|
|
@ -258,8 +258,8 @@ public class ProcessService { |
|
|
|
* @return process instance |
|
|
|
* @return process instance |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private ProcessInstance setWaitingThreadProcess(Command command, ProcessInstance processInstance) { |
|
|
|
private ProcessInstance setWaitingThreadProcess(Command command, ProcessInstance processInstance) { |
|
|
|
processInstance.setState(ExecutionStatus.WAITTING_THREAD); |
|
|
|
processInstance.setState(ExecutionStatus.WAITING_THREAD); |
|
|
|
if (command.getCommandType() != CommandType.RECOVER_WAITTING_THREAD) { |
|
|
|
if (command.getCommandType() != CommandType.RECOVER_WAITING_THREAD) { |
|
|
|
processInstance.addHistoryCmd(command.getCommandType()); |
|
|
|
processInstance.addHistoryCmd(command.getCommandType()); |
|
|
|
} |
|
|
|
} |
|
|
|
saveProcessInstance(processInstance); |
|
|
|
saveProcessInstance(processInstance); |
|
|
@ -522,7 +522,7 @@ public class ProcessService { |
|
|
|
// process instance quit by "waiting thread" state
|
|
|
|
// process instance quit by "waiting thread" state
|
|
|
|
if (originCommand == null) { |
|
|
|
if (originCommand == null) { |
|
|
|
Command command = new Command( |
|
|
|
Command command = new Command( |
|
|
|
CommandType.RECOVER_WAITTING_THREAD, |
|
|
|
CommandType.RECOVER_WAITING_THREAD, |
|
|
|
processInstance.getTaskDependType(), |
|
|
|
processInstance.getTaskDependType(), |
|
|
|
processInstance.getFailureStrategy(), |
|
|
|
processInstance.getFailureStrategy(), |
|
|
|
processInstance.getExecutorId(), |
|
|
|
processInstance.getExecutorId(), |
|
|
@ -539,14 +539,14 @@ public class ProcessService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// update the command time if current command if recover from waiting
|
|
|
|
// update the command time if current command if recover from waiting
|
|
|
|
if (originCommand.getCommandType() == CommandType.RECOVER_WAITTING_THREAD) { |
|
|
|
if (originCommand.getCommandType() == CommandType.RECOVER_WAITING_THREAD) { |
|
|
|
originCommand.setUpdateTime(new Date()); |
|
|
|
originCommand.setUpdateTime(new Date()); |
|
|
|
saveCommand(originCommand); |
|
|
|
saveCommand(originCommand); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// delete old command and create new waiting thread command
|
|
|
|
// delete old command and create new waiting thread command
|
|
|
|
commandMapper.deleteById(originCommand.getId()); |
|
|
|
commandMapper.deleteById(originCommand.getId()); |
|
|
|
originCommand.setId(0); |
|
|
|
originCommand.setId(0); |
|
|
|
originCommand.setCommandType(CommandType.RECOVER_WAITTING_THREAD); |
|
|
|
originCommand.setCommandType(CommandType.RECOVER_WAITING_THREAD); |
|
|
|
originCommand.setUpdateTime(new Date()); |
|
|
|
originCommand.setUpdateTime(new Date()); |
|
|
|
originCommand.setCommandParam(JSONUtils.toJsonString(cmdParam)); |
|
|
|
originCommand.setCommandParam(JSONUtils.toJsonString(cmdParam)); |
|
|
|
originCommand.setProcessInstancePriority(processInstance.getProcessInstancePriority()); |
|
|
|
originCommand.setProcessInstancePriority(processInstance.getProcessInstancePriority()); |
|
|
@ -809,7 +809,7 @@ public class ProcessService { |
|
|
|
break; |
|
|
|
break; |
|
|
|
case START_CURRENT_TASK_PROCESS: |
|
|
|
case START_CURRENT_TASK_PROCESS: |
|
|
|
break; |
|
|
|
break; |
|
|
|
case RECOVER_WAITTING_THREAD: |
|
|
|
case RECOVER_WAITING_THREAD: |
|
|
|
break; |
|
|
|
break; |
|
|
|
case RECOVER_SUSPENDED_PROCESS: |
|
|
|
case RECOVER_SUSPENDED_PROCESS: |
|
|
|
// find pause tasks and init task's state
|
|
|
|
// find pause tasks and init task's state
|
|
|
|