Browse Source

[Bug][API] fix ProcessDefinition update error #8334 (#8338)

* [bug] fix task definition delete

* [bug] fix ProcessDefinition update error #8334

* [bug] fix ProcessDefinition update error #8334

Co-authored-by: edward-yang <yangjianh210@gmail.com>
3.0.0/version-upgrade
EdwardYang 3 years ago committed by GitHub
parent
commit
13d9031b68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java

12
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) { if (processDefinition.equals(processDefinitionDeepCopy) && saveTaskResult == Constants.EXIT_CODE_SUCCESS) {
List<ProcessTaskRelationLog> processTaskRelationLogList = processTaskRelationLogMapper.queryByProcessCodeAndVersion(processDefinition.getCode(), processDefinition.getVersion()); List<ProcessTaskRelationLog> processTaskRelationLogList = processTaskRelationLogMapper.queryByProcessCodeAndVersion(processDefinition.getCode(), processDefinition.getVersion());
if (taskRelationList.size() == processTaskRelationLogList.size()) { if (taskRelationList.size() == processTaskRelationLogList.size()) {
Map<Long, ProcessTaskRelationLog> taskRelationLogMap = Set<ProcessTaskRelationLog> taskRelationSet = taskRelationList.stream().collect(Collectors.toSet());
taskRelationList.stream().collect(Collectors.toMap(ProcessTaskRelationLog::getPostTaskCode, processTaskRelationLog -> processTaskRelationLog)); Set<ProcessTaskRelationLog> processTaskRelationLogSet = processTaskRelationLogList.stream().collect(Collectors.toSet());
for (ProcessTaskRelationLog processTaskRelationLog : taskRelationList) { if (taskRelationSet.size() == processTaskRelationLogSet.size()) {
if (!processTaskRelationLog.equals(taskRelationLogMap.get(processTaskRelationLog.getPostTaskCode()))) { taskRelationSet.removeAll(processTaskRelationLogSet);
if (!taskRelationSet.isEmpty()) {
isChange = true; isChange = true;
break;
} }
} else {
isChange = true;
} }
} else { } else {
isChange = true; isChange = true;

Loading…
Cancel
Save