|
|
@ -325,7 +325,7 @@ public class ProcessServiceImpl implements ProcessService { |
|
|
|
|
|
|
|
|
|
|
|
protected void saveSerialProcess(ProcessInstance processInstance, ProcessDefinition processDefinition) { |
|
|
|
protected void saveSerialProcess(ProcessInstance processInstance, ProcessDefinition processDefinition) { |
|
|
|
processInstance.setStateWithDesc(WorkflowExecutionStatus.SERIAL_WAIT, "wait by serial_wait strategy"); |
|
|
|
processInstance.setStateWithDesc(WorkflowExecutionStatus.SERIAL_WAIT, "wait by serial_wait strategy"); |
|
|
|
processInstanceDao.upsertProcessInstance(processInstance); |
|
|
|
processInstanceDao.performTransactionalUpsert(processInstance); |
|
|
|
// serial wait
|
|
|
|
// serial wait
|
|
|
|
// when we get the running instance(or waiting instance) only get the priority instance(by id)
|
|
|
|
// when we get the running instance(or waiting instance) only get the priority instance(by id)
|
|
|
|
if (processDefinition.getExecutionType().typeIsSerialWait()) { |
|
|
|
if (processDefinition.getExecutionType().typeIsSerialWait()) { |
|
|
@ -338,7 +338,7 @@ public class ProcessServiceImpl implements ProcessService { |
|
|
|
if (CollectionUtils.isEmpty(runningProcessInstances)) { |
|
|
|
if (CollectionUtils.isEmpty(runningProcessInstances)) { |
|
|
|
processInstance.setStateWithDesc(WorkflowExecutionStatus.RUNNING_EXECUTION, |
|
|
|
processInstance.setStateWithDesc(WorkflowExecutionStatus.RUNNING_EXECUTION, |
|
|
|
"submit from serial_wait strategy"); |
|
|
|
"submit from serial_wait strategy"); |
|
|
|
processInstanceDao.upsertProcessInstance(processInstance); |
|
|
|
processInstanceDao.performTransactionalUpsert(processInstance); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (processDefinition.getExecutionType().typeIsSerialDiscard()) { |
|
|
|
} else if (processDefinition.getExecutionType().typeIsSerialDiscard()) { |
|
|
|
List<ProcessInstance> runningProcessInstances = |
|
|
|
List<ProcessInstance> runningProcessInstances = |
|
|
@ -349,12 +349,12 @@ public class ProcessServiceImpl implements ProcessService { |
|
|
|
processInstance.getId()); |
|
|
|
processInstance.getId()); |
|
|
|
if (CollectionUtils.isNotEmpty(runningProcessInstances)) { |
|
|
|
if (CollectionUtils.isNotEmpty(runningProcessInstances)) { |
|
|
|
processInstance.setStateWithDesc(WorkflowExecutionStatus.STOP, "stop by serial_discard strategy"); |
|
|
|
processInstance.setStateWithDesc(WorkflowExecutionStatus.STOP, "stop by serial_discard strategy"); |
|
|
|
processInstanceDao.upsertProcessInstance(processInstance); |
|
|
|
processInstanceDao.performTransactionalUpsert(processInstance); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
processInstance.setStateWithDesc(WorkflowExecutionStatus.RUNNING_EXECUTION, |
|
|
|
processInstance.setStateWithDesc(WorkflowExecutionStatus.RUNNING_EXECUTION, |
|
|
|
"submit from serial_discard strategy"); |
|
|
|
"submit from serial_discard strategy"); |
|
|
|
processInstanceDao.upsertProcessInstance(processInstance); |
|
|
|
processInstanceDao.performTransactionalUpsert(processInstance); |
|
|
|
} else if (processDefinition.getExecutionType().typeIsSerialPriority()) { |
|
|
|
} else if (processDefinition.getExecutionType().typeIsSerialPriority()) { |
|
|
|
List<ProcessInstance> runningProcessInstances = |
|
|
|
List<ProcessInstance> runningProcessInstances = |
|
|
|
this.processInstanceMapper.queryByProcessDefineCodeAndProcessDefinitionVersionAndStatusAndNextId( |
|
|
|
this.processInstanceMapper.queryByProcessDefineCodeAndProcessDefinitionVersionAndStatusAndNextId( |
|
|
@ -384,7 +384,7 @@ public class ProcessServiceImpl implements ProcessService { |
|
|
|
} |
|
|
|
} |
|
|
|
processInstance.setStateWithDesc(WorkflowExecutionStatus.RUNNING_EXECUTION, |
|
|
|
processInstance.setStateWithDesc(WorkflowExecutionStatus.RUNNING_EXECUTION, |
|
|
|
"submit by serial_priority strategy"); |
|
|
|
"submit by serial_priority strategy"); |
|
|
|
processInstanceDao.upsertProcessInstance(processInstance); |
|
|
|
processInstanceDao.performTransactionalUpsert(processInstance); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|