Commit c9690e144c05a753c258fe84bb5b507f605d9f7a
1 parent
575e7a38
fix: 解决审批节点表单无可编辑字段时,variables流程变量值为空,流程节点流转异常问题
Showing
1 changed file
with
6 additions
and
0 deletions
yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/BpmnModelUtils.java
| ... | ... | @@ -21,6 +21,7 @@ import org.flowable.bpmn.converter.BpmnXMLConverter; |
| 21 | 21 | import org.flowable.bpmn.model.Process; |
| 22 | 22 | import org.flowable.bpmn.model.*; |
| 23 | 23 | import org.flowable.common.engine.api.FlowableException; |
| 24 | +import org.flowable.common.engine.impl.javax.el.PropertyNotFoundException; | |
| 24 | 25 | import org.flowable.common.engine.impl.util.io.BytesStreamSource; |
| 25 | 26 | import org.flowable.engine.impl.el.FixedValue; |
| 26 | 27 | |
| ... | ... | @@ -1006,6 +1007,11 @@ public class BpmnModelUtils { |
| 1006 | 1007 | Object result = FlowableUtils.getExpressionValue(variables, expression); |
| 1007 | 1008 | return Boolean.TRUE.equals(result); |
| 1008 | 1009 | } catch (FlowableException ex) { |
| 1010 | + // TODO @芋艿 临时方案解决流程变量中不包含条件表达式时报错问题,如果expression 的计算,可能不依赖于 variables,getExpressionValue方法应该需要重构 | |
| 1011 | + if (ex.getCause() instanceof PropertyNotFoundException){ | |
| 1012 | + log.error("[evalConditionExpress][条件表达式({}) 变量({}) 解析报错]", expression, variables, ex); | |
| 1013 | + return Boolean.FALSE; | |
| 1014 | + } | |
| 1009 | 1015 | // 为什么使用 info 日志?原因是,expression 如果从 variables 取不到值,会报错。实际这种情况下,可以忽略 |
| 1010 | 1016 | log.info("[evalConditionExpress][条件表达式({}) 变量({}) 解析报错]", expression, variables, ex); |
| 1011 | 1017 | return Boolean.FALSE; | ... | ... |