|
@@ -778,16 +778,9 @@ public class BpmnModelUtils {
|
|
|
if (currentElement instanceof ExclusiveGateway) {
|
|
|
// 查找满足条件的 SequenceFlow 路径
|
|
|
Gateway gateway = (Gateway) currentElement;
|
|
|
- SequenceFlow matchSequenceFlow;
|
|
|
- // 流程首次发起时,variables值一定为空,会导致条件表达式解析错误导致预测节点缺失
|
|
|
- if (null == variables) {
|
|
|
- matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
|
|
- flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId()));
|
|
|
- } else {
|
|
|
- matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
|
|
+ SequenceFlow matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
|
|
flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId())
|
|
|
&& (evalConditionExpress(variables, flow.getConditionExpression())));
|
|
|
- }
|
|
|
if (matchSequenceFlow == null) {
|
|
|
matchSequenceFlow = CollUtil.findOne(gateway.getOutgoingFlows(),
|
|
|
flow -> ObjUtil.equal(gateway.getDefaultFlow(), flow.getId()));
|
|
@@ -807,16 +800,9 @@ public class BpmnModelUtils {
|
|
|
if (currentElement instanceof InclusiveGateway) {
|
|
|
// 查找满足条件的 SequenceFlow 路径
|
|
|
Gateway gateway = (Gateway) currentElement;
|
|
|
- Collection<SequenceFlow> matchSequenceFlows;
|
|
|
- // 流程首次发起时,variables值一定为空,会导致条件表达式解析错误导致预测节点缺失
|
|
|
- if (null == variables){
|
|
|
- matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
|
|
|
- flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId()));
|
|
|
- }else {
|
|
|
- matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
|
|
|
+ Collection<SequenceFlow> matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
|
|
|
flow -> ObjUtil.notEqual(gateway.getDefaultFlow(), flow.getId())
|
|
|
&& evalConditionExpress(variables, flow.getConditionExpression()));
|
|
|
- }
|
|
|
if (CollUtil.isEmpty(matchSequenceFlows)) {
|
|
|
matchSequenceFlows = CollUtil.filterNew(gateway.getOutgoingFlows(),
|
|
|
flow -> ObjUtil.equal(gateway.getDefaultFlow(), flow.getId()));
|
|
@@ -851,6 +837,9 @@ public class BpmnModelUtils {
|
|
|
if (express == null) {
|
|
|
return Boolean.FALSE;
|
|
|
}
|
|
|
+ if (variables == null) {
|
|
|
+ return Boolean.FALSE;
|
|
|
+ }
|
|
|
try {
|
|
|
Object result = FlowableUtils.getExpressionValue(variables, express);
|
|
|
return Boolean.TRUE.equals(result);
|