From c9690e144c05a753c258fe84bb5b507f605d9f7a Mon Sep 17 00:00:00 2001 From: lizhixian <18210040298@163.com> Date: Thu, 13 Mar 2025 16:05:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E8=A1=A8=E5=8D=95=E6=97=A0=E5=8F=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=AD=97=E6=AE=B5=E6=97=B6=EF=BC=8Cvariables=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=8F=98=E9=87=8F=E5=80=BC=E4=B8=BA=E7=A9=BA=EF=BC=8C?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E8=8A=82=E7=82=B9=E6=B5=81=E8=BD=AC=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bpm/framework/flowable/core/util/BpmnModelUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/BpmnModelUtils.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/BpmnModelUtils.java index 1cccf18f04..fdfb724442 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/util/BpmnModelUtils.java +++ b/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; import org.flowable.bpmn.model.Process; import org.flowable.bpmn.model.*; import org.flowable.common.engine.api.FlowableException; +import org.flowable.common.engine.impl.javax.el.PropertyNotFoundException; import org.flowable.common.engine.impl.util.io.BytesStreamSource; import org.flowable.engine.impl.el.FixedValue; @@ -1006,6 +1007,11 @@ public class BpmnModelUtils { Object result = FlowableUtils.getExpressionValue(variables, expression); return Boolean.TRUE.equals(result); } catch (FlowableException ex) { + // TODO @芋艿 临时方案解决流程变量中不包含条件表达式时报错问题,如果expression 的计算,可能不依赖于 variables,getExpressionValue方法应该需要重构 + if (ex.getCause() instanceof PropertyNotFoundException){ + log.error("[evalConditionExpress][条件表达式({}) 变量({}) 解析报错]", expression, variables, ex); + return Boolean.FALSE; + } // 为什么使用 info 日志?原因是,expression 如果从 variables 取不到值,会报错。实际这种情况下,可以忽略 log.info("[evalConditionExpress][条件表达式({}) 变量({}) 解析报错]", expression, variables, ex); return Boolean.FALSE;