Commit 642e72ae7abda7264e430cba9593c9e06aee3c28

Authored by lizhixian
1 parent 29a902f3

review: 代码审查

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 { @@ -808,6 +808,7 @@ public class BpmnModelUtils {
808 // 查找满足条件的 SequenceFlow 路径 808 // 查找满足条件的 SequenceFlow 路径
809 Gateway gateway = (Gateway) currentElement; 809 Gateway gateway = (Gateway) currentElement;
810 Collection<SequenceFlow> matchSequenceFlows; 810 Collection<SequenceFlow> matchSequenceFlows;
  811 + // 流程首次发起时,variables值一定为空,会导致条件表达式解析错误导致预测节点缺失
811 if (null == variables){ 812 if (null == variables){
812 matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(), 813 matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
813 flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId())); 814 flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId()));
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 { @@ -809,6 +809,7 @@ public class SimpleModelUtils {
809 if (nodeType == BpmSimpleModelNodeTypeEnum.CONDITION_BRANCH_NODE) { 809 if (nodeType == BpmSimpleModelNodeTypeEnum.CONDITION_BRANCH_NODE) {
810 // 查找满足条件的 BpmSimpleModelNodeVO 节点 810 // 查找满足条件的 BpmSimpleModelNodeVO 节点
811 BpmSimpleModelNodeVO matchConditionNode; 811 BpmSimpleModelNodeVO matchConditionNode;
  812 + // 流程首次发起时,variables值一定为空,会导致条件表达式解析错误导致预测节点缺失
812 if(null == variables) { 813 if(null == variables) {
813 matchConditionNode = CollUtil.findOne(currentNode.getConditionNodes(), 814 matchConditionNode = CollUtil.findOne(currentNode.getConditionNodes(),
814 conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow())); 815 conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));
@@ -830,6 +831,7 @@ public class SimpleModelUtils { @@ -830,6 +831,7 @@ public class SimpleModelUtils {
830 if (nodeType == BpmSimpleModelNodeTypeEnum.INCLUSIVE_BRANCH_NODE) { 831 if (nodeType == BpmSimpleModelNodeTypeEnum.INCLUSIVE_BRANCH_NODE) {
831 // 查找满足条件的 BpmSimpleModelNodeVO 节点 832 // 查找满足条件的 BpmSimpleModelNodeVO 节点
832 Collection<BpmSimpleModelNodeVO> matchConditionNodes; 833 Collection<BpmSimpleModelNodeVO> matchConditionNodes;
  834 + // 流程首次发起时,variables值一定为空,会导致条件表达式解析错误导致预测节点缺失
833 if (null == variables) { 835 if (null == variables) {
834 matchConditionNodes = CollUtil.filterNew(currentNode.getConditionNodes(), 836 matchConditionNodes = CollUtil.filterNew(currentNode.getConditionNodes(),
835 conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow())); 837 conditionNode -> !BooleanUtil.isTrue(conditionNode.getConditionSetting().getDefaultFlow()));