|
|
|
|
@ -35,7 +35,7 @@ public class ProcessEndListener implements ExecutionListener { |
|
|
|
|
Map<String, Object> variablesMap = new HashMap<>(); |
|
|
|
|
variablesMap.putAll(variables); |
|
|
|
|
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
|
|
|
|
HttpServletResponse response = servletRequestAttributes.getResponse(); |
|
|
|
|
// HttpServletResponse response = servletRequestAttributes.getResponse();
|
|
|
|
|
switch (event) { |
|
|
|
|
case "start": |
|
|
|
|
System.out.println("ProcessEndListener-start event-------------------"); |
|
|
|
|
@ -43,15 +43,15 @@ public class ProcessEndListener implements ExecutionListener { |
|
|
|
|
if(variablesMap.containsKey("wf_process_terminate")) return; |
|
|
|
|
|
|
|
|
|
IAutoStartModelService autoStartModelService = (IAutoStartModelService) SpringContextHolder.getBean(AutoStartModelServiceImpl.class); |
|
|
|
|
//判断工作流的的重复模式1
|
|
|
|
|
//判断工作流的的重复模式,重复的任务生成工单、保存任务信息,计算下次任务开始时间
|
|
|
|
|
if (Func.isNotEmpty(variablesMap.get("chongfumoshi")) && !StringUtils.equals(RepeatEnum.不重复.getCode(), variablesMap.get("chongfumoshi").toString())) { |
|
|
|
|
String s = autoStartModelService.saveStartProcess(processInstanceId, variablesMap); |
|
|
|
|
try { |
|
|
|
|
response.sendError(200,s); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
e.printStackTrace(); |
|
|
|
|
} |
|
|
|
|
} else {//不重复任务
|
|
|
|
|
// try {
|
|
|
|
|
// response.sendError(200,s);
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
} else {//不重复任务,生成工单
|
|
|
|
|
autoStartModelService.newWorkOrder(processInstanceId, variablesMap); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
|