浏览代码

review: 代码审查

lizhixian 6 月之前
父节点
当前提交
642e72ae7a

+ 1 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/BpmnModelUtils.java

@@ -808,6 +808,7 @@ public class BpmnModelUtils {
             // 查找满足条件的 SequenceFlow 路径
             // 查找满足条件的 SequenceFlow 路径
             Gateway gateway = (Gateway) currentElement;
             Gateway gateway = (Gateway) currentElement;
             Collection<SequenceFlow> matchSequenceFlows;
             Collection<SequenceFlow> matchSequenceFlows;
+            // 流程首次发起时,variables值一定为空,会导致条件表达式解析错误导致预测节点缺失
             if (null == variables){
             if (null == variables){
                 matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
                 matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
                         flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId()));
                         flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId()));

+ 2 - 0
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/SimpleModelUtils.java

@@ -809,6 +809,7 @@ public class SimpleModelUtils {
         if (nodeType == BpmSimpleModelNodeTypeEnum.CONDITION_BRANCH_NODE) {
         if (nodeType == BpmSimpleModelNodeTypeEnum.CONDITION_BRANCH_NODE) {
             // 查找满足条件的 BpmSimpleModelNodeVO 节点
             // 查找满足条件的 BpmSimpleModelNodeVO 节点
             BpmSimpleModelNodeVO matchConditionNode;
             BpmSimpleModelNodeVO matchConditionNode;
+            // 流程首次发起时,variables值一定为空,会导致条件表达式解析错误导致预测节点缺失
             if(null == variables) {
             if(null == variables) {
                 matchConditionNode = CollUtil.findOne(currentNode.getConditionNodes(),
                 matchConditionNode = CollUtil.findOne(currentNode.getConditionNodes(),
                         conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));
                         conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));
@@ -830,6 +831,7 @@ public class SimpleModelUtils {
         if (nodeType == BpmSimpleModelNodeTypeEnum.INCLUSIVE_BRANCH_NODE) {
         if (nodeType == BpmSimpleModelNodeTypeEnum.INCLUSIVE_BRANCH_NODE) {
             // 查找满足条件的 BpmSimpleModelNodeVO 节点
             // 查找满足条件的 BpmSimpleModelNodeVO 节点
             Collection<BpmSimpleModelNodeVO> matchConditionNodes;
             Collection<BpmSimpleModelNodeVO> matchConditionNodes;
+            // 流程首次发起时,variables值一定为空,会导致条件表达式解析错误导致预测节点缺失
             if (null == variables) {
             if (null == variables) {
                 matchConditionNodes = CollUtil.filterNew(currentNode.getConditionNodes(),
                 matchConditionNodes = CollUtil.filterNew(currentNode.getConditionNodes(),
                         conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));
                         conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));