Browse Source

Merge pull request #87 from lgcareer/branch-1.0.0

fix graphHasCycle
pull/2/head
lgcareer 6 years ago committed by GitHub
parent
commit
794cfd11bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java

8
escheduler-api/src/main/java/cn/escheduler/api/service/ProcessDefinitionService.java

@ -114,7 +114,7 @@ public class ProcessDefinitionService extends BaseDAGService {
ProcessData processData = JSONUtils.parseObject(processDefinitionJson, ProcessData.class);
Map<String, Object> checkProcessJson = checkProcessNodeList(processData, processDefinitionJson);
if (checkProcessJson.get(Constants.STATUS) != Status.SUCCESS) {
return result;
return checkProcessJson;
}
processDefine.setName(name);
@ -262,7 +262,7 @@ public class ProcessDefinitionService extends BaseDAGService {
ProcessData processData = JSONUtils.parseObject(processDefinitionJson, ProcessData.class);
Map<String, Object> checkProcessJson = checkProcessNodeList(processData, processDefinitionJson);
if ((checkProcessJson.get(Constants.STATUS) != Status.SUCCESS)) {
return result;
return checkProcessJson;
}
ProcessDefinition processDefinition = processDao.findProcessDefineById(id);
if (processDefinition == null) {
@ -717,7 +717,9 @@ public class ProcessDefinitionService extends BaseDAGService {
List<String> preTasks = JSONUtils.toList(taskNodeResponse.getPreTasks(),String.class);
if (CollectionUtils.isNotEmpty(preTasks)) {
for (String preTask : preTasks) {
graph.addEdge(preTask, taskNodeResponse.getName());
if (!graph.addEdge(preTask, taskNodeResponse.getName())) {
return true;
}
}
}
}

Loading…
Cancel
Save