[Bug-14378][Master] Trigger task execution in workflow instance page cause workflow instance keep running status (#14389)

This commit is contained in:
Aaron Wang 2023-06-24 22:10:14 +08:00 committed by GitHub
parent 5cbe170e43
commit 64e5741063
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2208,14 +2208,14 @@ public class WorkflowExecuteRunnable implements Callable<WorkflowSubmitStatus> {
// remove task instance from taskInstanceMap, completeTaskSet, validTaskMap, errorTaskMap
// completeTaskSet remove dependency taskInstanceMap, so the sort can't change
completeTaskSet.removeIf(set -> {
Optional<TaskInstance> existTaskInstanceOptional = getTaskInstance(set);
completeTaskSet.removeIf(taskCode -> {
Optional<TaskInstance> existTaskInstanceOptional = getTaskInstance(taskCode);
return existTaskInstanceOptional
.filter(taskInstance -> dag.containsNode(Integer.toString(taskInstance.getId()))).isPresent();
.filter(taskInstance -> dag.containsNode(Long.toString(taskInstance.getTaskCode()))).isPresent();
});
taskInstanceMap.entrySet().removeIf(map -> dag.containsNode(Long.toString(map.getValue().getTaskCode())));
validTaskMap.entrySet().removeIf(map -> dag.containsNode(Long.toString(map.getKey())));
errorTaskMap.entrySet().removeIf(map -> dag.containsNode(Long.toString(map.getKey())));
taskInstanceMap.entrySet().removeIf(entry -> dag.containsNode(Long.toString(entry.getValue().getTaskCode())));
validTaskMap.entrySet().removeIf(entry -> dag.containsNode(Long.toString(entry.getKey())));
errorTaskMap.entrySet().removeIf(entry -> dag.containsNode(Long.toString(entry.getKey())));
}
private void saveCacheTaskInstance(TaskInstance taskInstance) {