Commit 37cb20d964d3d733e072d219635be1e8303bbb1f

Authored by Lesan
1 parent fcbf1d07

fix: 检查所有route->router

yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmSimpleModelNodeType.java
... ... @@ -33,7 +33,7 @@ public enum BpmSimpleModelNodeType implements IntArrayValuable {
33 33 CONDITION_BRANCH_NODE(51, "条件分支", "exclusiveGateway"),
34 34 PARALLEL_BRANCH_NODE(52, "并行分支", "parallelGateway"),
35 35 INCLUSIVE_BRANCH_NODE(53, "包容分支", "inclusiveGateway"),
36   - ROUTE_BRANCH_NODE(54, "路由分支", "exclusiveGateway")
  36 + ROUTER_BRANCH_NODE(54, "路由分支", "exclusiveGateway")
37 37 ;
38 38  
39 39 public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmSimpleModelNodeType::getType).toArray();
... ... @@ -51,7 +51,7 @@ public enum BpmSimpleModelNodeType implements IntArrayValuable {
51 51 return Objects.equals(CONDITION_BRANCH_NODE.getType(), type)
52 52 || Objects.equals(PARALLEL_BRANCH_NODE.getType(), type)
53 53 || Objects.equals(INCLUSIVE_BRANCH_NODE.getType(), type)
54   - || Objects.equals(ROUTE_BRANCH_NODE.getType(), type);
  54 + || Objects.equals(ROUTER_BRANCH_NODE.getType(), type);
55 55 }
56 56  
57 57 public static BpmSimpleModelNodeType valueOf(Integer type) {
... ...
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/definition/vo/model/simple/BpmSimpleModelNodeVO.java
... ... @@ -117,10 +117,10 @@ public class BpmSimpleModelNodeVO {
117 117 private ConditionGroups conditionGroups; // 仅用于条件节点 BpmSimpleModelNodeType.CONDITION_NODE
118 118  
119 119 @Schema(description = "路由分支组", example = "[]")
120   - private List<RouteCondition> routerGroups;
  120 + private List<RouterCondition> routerGroups;
121 121  
122 122 @Schema(description = "默认分支 ID", example = "Flow_xxx")
123   - private String defaultFlowId; // 仅用于路由分支节点 BpmSimpleModelNodeType.ROUTE_BRANCH_NODE
  123 + private String defaultFlowId; // 仅用于路由分支节点 BpmSimpleModelNodeType.ROUTER_BRANCH_NODE
124 124  
125 125 @Schema(description = "任务监听器")
126 126 @Valid
... ... @@ -293,7 +293,7 @@ public class BpmSimpleModelNodeVO {
293 293 @Schema(description = "路由分支")
294 294 @Data
295 295 @Valid
296   - public static class RouteCondition {
  296 + public static class RouterCondition {
297 297  
298 298 @Schema(description = "节点 Id", example = "Activity_xxx") // 跳转到该节点
299 299 @NotEmpty(message = "节点 Id 不能为空")
... ...
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java
... ... @@ -188,7 +188,7 @@ public class SimpleModelUtils {
188 188 // 分支终点节点 ID
189 189 String branchEndNodeId = null;
190 190 if (nodeType == BpmSimpleModelNodeType.CONDITION_BRANCH_NODE
191   - || nodeType == BpmSimpleModelNodeType.ROUTE_BRANCH_NODE) { // 条件分支或路由分支
  191 + || nodeType == BpmSimpleModelNodeType.ROUTER_BRANCH_NODE) { // 条件分支或路由分支
192 192 // 分两种情况 1. 分支节点有孩子节点为孩子节点 Id 2. 分支节点孩子为无效节点时 (分支嵌套且为分支最后一个节点) 为分支终点节点 ID
193 193 branchEndNodeId = isValidNode(childNode) ? childNode.getId() : targetNodeId;
194 194 } else if (nodeType == BpmSimpleModelNodeType.PARALLEL_BRANCH_NODE
... ... @@ -199,10 +199,10 @@ public class SimpleModelUtils {
199 199 Assert.notEmpty(branchEndNodeId, "分支终点节点 Id 不能为空");
200 200  
201 201 // 3. 遍历分支节点
202   - if (nodeType == BpmSimpleModelNodeType.ROUTE_BRANCH_NODE) {
  202 + if (nodeType == BpmSimpleModelNodeType.ROUTER_BRANCH_NODE) {
203 203 // 路由分支遍历
204   - for (BpmSimpleModelNodeVO.RouteCondition route : node.getRouterGroups()) {
205   - SequenceFlow sequenceFlow = RouteBranchNodeConvert.buildSequenceFlow(node.getId(), route);
  204 + for (BpmSimpleModelNodeVO.RouterCondition router : node.getRouterGroups()) {
  205 + SequenceFlow sequenceFlow = RouteBranchNodeConvert.buildSequenceFlow(node.getId(), router);
206 206 process.addFlowElement(sequenceFlow);
207 207 }
208 208 } else {
... ... @@ -233,7 +233,7 @@ public class SimpleModelUtils {
233 233 SequenceFlow sequenceFlow = buildBpmnSequenceFlow(branchEndNodeId, nextNodeId);
234 234 process.addFlowElement(sequenceFlow);
235 235 // 4.2 如果是路由分支,需要连接后续节点为默认路由
236   - } else if (nodeType == BpmSimpleModelNodeType.ROUTE_BRANCH_NODE) {
  236 + } else if (nodeType == BpmSimpleModelNodeType.ROUTER_BRANCH_NODE) {
237 237 SequenceFlow sequenceFlow = buildBpmnSequenceFlow(node.getId(), branchEndNodeId, node.getDefaultFlowId(),
238 238 null, null);
239 239 process.addFlowElement(sequenceFlow);
... ... @@ -646,9 +646,9 @@ public class SimpleModelUtils {
646 646 node.getConditionGroups());
647 647 }
648 648  
649   - public static String buildConditionExpression(BpmSimpleModelNodeVO.RouteCondition route) {
650   - return buildConditionExpression(route.getConditionType(), route.getConditionExpression(),
651   - route.getConditionGroups());
  649 + public static String buildConditionExpression(BpmSimpleModelNodeVO.RouterCondition router) {
  650 + return buildConditionExpression(router.getConditionType(), router.getConditionExpression(),
  651 + router.getConditionGroups());
652 652 }
653 653  
654 654 public static String buildConditionExpression(Integer conditionType, String conditionExpression,
... ... @@ -735,12 +735,12 @@ public class SimpleModelUtils {
735 735  
736 736 @Override
737 737 public BpmSimpleModelNodeType getType() {
738   - return BpmSimpleModelNodeType.ROUTE_BRANCH_NODE;
  738 + return BpmSimpleModelNodeType.ROUTER_BRANCH_NODE;
739 739 }
740 740  
741   - public static SequenceFlow buildSequenceFlow(String nodeId, BpmSimpleModelNodeVO.RouteCondition route) {
742   - String conditionExpression = ConditionNodeConvert.buildConditionExpression(route);
743   - return buildBpmnSequenceFlow(nodeId, route.getNodeId(), null, null, conditionExpression);
  741 + public static SequenceFlow buildSequenceFlow(String nodeId, BpmSimpleModelNodeVO.RouterCondition router) {
  742 + String conditionExpression = ConditionNodeConvert.buildConditionExpression(router);
  743 + return buildBpmnSequenceFlow(nodeId, router.getNodeId(), null, null, conditionExpression);
744 744 }
745 745  
746 746 }
... ...