diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java index 57e6d7538a..4ca6aa6b6c 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java @@ -604,13 +604,15 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro if (processDefinition.equals(processDefinitionDeepCopy) && saveTaskResult == Constants.EXIT_CODE_SUCCESS) { List processTaskRelationLogList = processTaskRelationLogMapper.queryByProcessCodeAndVersion(processDefinition.getCode(), processDefinition.getVersion()); if (taskRelationList.size() == processTaskRelationLogList.size()) { - Map taskRelationLogMap = - taskRelationList.stream().collect(Collectors.toMap(ProcessTaskRelationLog::getPostTaskCode, processTaskRelationLog -> processTaskRelationLog)); - for (ProcessTaskRelationLog processTaskRelationLog : taskRelationList) { - if (!processTaskRelationLog.equals(taskRelationLogMap.get(processTaskRelationLog.getPostTaskCode()))) { + Set taskRelationSet = taskRelationList.stream().collect(Collectors.toSet()); + Set processTaskRelationLogSet = processTaskRelationLogList.stream().collect(Collectors.toSet()); + if (taskRelationSet.size() == processTaskRelationLogSet.size()) { + taskRelationSet.removeAll(processTaskRelationLogSet); + if (!taskRelationSet.isEmpty()) { isChange = true; - break; } + } else { + isChange = true; } } else { isChange = true;