新增模型结束节点判断处理逻辑

This commit is contained in:
hubin 2024-12-13 22:38:04 +08:00
parent 6d0ca7cb67
commit fc303167d5
4 changed files with 13 additions and 2 deletions

View File

@ -84,7 +84,7 @@ public class ModelHelper {
// 获取路由分支子节点
nextNodes.addAll(getNextChildNodes(flowLongContext, execution, rootNodeModel, childNode.getChildNode()));
}
} else {
} else if (!TaskType.end.eq(childNode.getType())) {
// 普通节点
nextNodes.add(childNode);
}

View File

@ -438,6 +438,9 @@ public class NodeModel implements ModelInstance, Serializable {
if (null == nextNode) {
// 如果当前节点完成并且该节点为条件节点找到主干执行节点继续执行
nextNode = ModelHelper.findNextNode(this, currentTask);
} else if(TaskType.end.eq(nextNode.getType())) {
// 执行到结束节点
nextNode = null;
}
return Optional.ofNullable(nextNode);
}

View File

@ -51,6 +51,9 @@ public class TestNextChildNodes extends TestModel {
}});
assertEquals("flk1733658019276", "flk1733658095760", processModel);
// 结束
assertConsumer("flk1733658019276", processModel, null, nodeModels -> Assertions.assertTrue(nodeModels.isEmpty()));
}
private void assertEquals(String nextNodeKey, String nodeKey, ProcessModel processModel) {

View File

@ -367,7 +367,12 @@
"allowAppendNode": false,
"allowRollback": false,
"rejectStrategy": 2,
"rejectStart": 1
"rejectStart": 1,
"childNode": {
"nodeName": "结束",
"nodeKey": "flk1733380933011",
"type": -1
}
}
}
}