Unverified Commit 794cfd11 authored by lgcareer's avatar lgcareer Committed by GitHub
Browse files

Merge pull request #87 from lgcareer/branch-1.0.0

fix graphHasCycle
parents 222c7ca4 de27d9db
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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;
                    }
                }
            }
        }