|
|
@ -158,10 +158,9 @@ public class DependentExecute { |
|
|
|
if (dependentItem.getDepTaskCode() == Constants.DEPENDENT_WORKFLOW_CODE) { |
|
|
|
if (dependentItem.getDepTaskCode() == Constants.DEPENDENT_WORKFLOW_CODE) { |
|
|
|
result = dependResultByProcessInstance(processInstance); |
|
|
|
result = dependResultByProcessInstance(processInstance); |
|
|
|
} else if (dependentItem.getDepTaskCode() == Constants.DEPENDENT_ALL_TASK_CODE) { |
|
|
|
} else if (dependentItem.getDepTaskCode() == Constants.DEPENDENT_ALL_TASK_CODE) { |
|
|
|
result = dependResultByAllTaskOfProcessInstance(processInstance, dateInterval, testFlag); |
|
|
|
result = dependResultByAllTaskOfProcessInstance(processInstance, testFlag); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
result = dependResultBySingleTaskInstance(processInstance, dependentItem.getDepTaskCode(), dateInterval, |
|
|
|
result = dependResultBySingleTaskInstance(processInstance, dependentItem.getDepTaskCode(), testFlag); |
|
|
|
testFlag); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (result != DependResult.SUCCESS) { |
|
|
|
if (result != DependResult.SUCCESS) { |
|
|
|
break; |
|
|
|
break; |
|
|
@ -194,8 +193,7 @@ public class DependentExecute { |
|
|
|
* |
|
|
|
* |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private DependResult dependResultByAllTaskOfProcessInstance(ProcessInstance processInstance, |
|
|
|
private DependResult dependResultByAllTaskOfProcessInstance(ProcessInstance processInstance, int testFlag) { |
|
|
|
DateInterval dateInterval, int testFlag) { |
|
|
|
|
|
|
|
if (!processInstance.getState().isFinished()) { |
|
|
|
if (!processInstance.getState().isFinished()) { |
|
|
|
log.info("Wait for the dependent workflow to complete, processCode: {}, processInstanceId: {}.", |
|
|
|
log.info("Wait for the dependent workflow to complete, processCode: {}, processInstanceId: {}.", |
|
|
|
processInstance.getProcessDefinitionCode(), processInstance.getId()); |
|
|
|
processInstance.getProcessDefinitionCode(), processInstance.getId()); |
|
|
@ -212,8 +210,8 @@ public class DependentExecute { |
|
|
|
.collect(Collectors.toMap(TaskDefinitionLog::getCode, TaskDefinitionLog::getName)); |
|
|
|
.collect(Collectors.toMap(TaskDefinitionLog::getCode, TaskDefinitionLog::getName)); |
|
|
|
|
|
|
|
|
|
|
|
List<TaskInstance> taskInstanceList = |
|
|
|
List<TaskInstance> taskInstanceList = |
|
|
|
taskInstanceDao.queryLastTaskInstanceListIntervalByTaskCodes(taskDefinitionCodeMap.keySet(), |
|
|
|
taskInstanceDao.queryLastTaskInstanceListIntervalInProcessInstance(processInstance.getId(), |
|
|
|
dateInterval, testFlag); |
|
|
|
taskDefinitionCodeMap.keySet(), testFlag); |
|
|
|
Map<Long, TaskExecutionStatus> taskExecutionStatusMap = |
|
|
|
Map<Long, TaskExecutionStatus> taskExecutionStatusMap = |
|
|
|
taskInstanceList.stream() |
|
|
|
taskInstanceList.stream() |
|
|
|
.filter(taskInstance -> taskInstance.getTaskExecuteType() != TaskExecuteType.STREAM) |
|
|
|
.filter(taskInstance -> taskInstance.getTaskExecuteType() != TaskExecuteType.STREAM) |
|
|
@ -245,14 +243,14 @@ public class DependentExecute { |
|
|
|
* |
|
|
|
* |
|
|
|
* @param processInstance last process instance in the date interval |
|
|
|
* @param processInstance last process instance in the date interval |
|
|
|
* @param depTaskCode the dependent task code |
|
|
|
* @param depTaskCode the dependent task code |
|
|
|
* @param dateInterval date interval |
|
|
|
|
|
|
|
* @param testFlag test flag |
|
|
|
* @param testFlag test flag |
|
|
|
* @return depend result |
|
|
|
* @return depend result |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private DependResult dependResultBySingleTaskInstance(ProcessInstance processInstance, long depTaskCode, |
|
|
|
private DependResult dependResultBySingleTaskInstance(ProcessInstance processInstance, long depTaskCode, |
|
|
|
DateInterval dateInterval, int testFlag) { |
|
|
|
int testFlag) { |
|
|
|
TaskInstance taskInstance = |
|
|
|
TaskInstance taskInstance = |
|
|
|
taskInstanceDao.queryLastTaskInstanceIntervalByTaskCode(depTaskCode, dateInterval, testFlag); |
|
|
|
taskInstanceDao.queryLastTaskInstanceIntervalInProcessInstance(processInstance.getId(), |
|
|
|
|
|
|
|
depTaskCode, testFlag); |
|
|
|
|
|
|
|
|
|
|
|
if (taskInstance == null) { |
|
|
|
if (taskInstance == null) { |
|
|
|
TaskDefinition taskDefinition = taskDefinitionDao.queryByCode(depTaskCode); |
|
|
|
TaskDefinition taskDefinition = taskDefinitionDao.queryByCode(depTaskCode); |
|
|
|