Commit dc7763ef0b126dc561b2bdbf2d9f60c2b671f16f
1 parent
49c857c8
fix:【BPM 工作流】BpmTaskCandidateExpressionStrategy 在 PropertyNotFoundException 不存在时,频繁打 warn 日志
Showing
3 changed files
with
9 additions
and
4 deletions
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/candidate/expression/BpmTaskAssignLeaderExpression.java
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/candidate/expression/BpmTaskAssignStartUserExpression.java
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/candidate/strategy/other/BpmTaskCandidateExpressionStrategy.java
| ... | ... | @@ -8,6 +8,7 @@ import com.google.common.collect.Sets; |
| 8 | 8 | import lombok.extern.slf4j.Slf4j; |
| 9 | 9 | import org.flowable.bpmn.model.BpmnModel; |
| 10 | 10 | import org.flowable.common.engine.api.FlowableException; |
| 11 | +import org.flowable.common.engine.impl.javax.el.PropertyNotFoundException; | |
| 11 | 12 | import org.flowable.engine.delegate.DelegateExecution; |
| 12 | 13 | import org.springframework.stereotype.Component; |
| 13 | 14 | |
| ... | ... | @@ -48,10 +49,12 @@ public class BpmTaskCandidateExpressionStrategy implements BpmTaskCandidateStrat |
| 48 | 49 | Object result = FlowableUtils.getExpressionValue(variables, param); |
| 49 | 50 | return CollectionUtils.toLinkedHashSet(Long.class, result); |
| 50 | 51 | } catch (FlowableException ex) { |
| 51 | - // 预测未运行的节点时候,表达式如果包含 execution 或者不存在的流程变量会抛异常, | |
| 52 | - log.warn("[calculateUsersByActivity][表达式({}) 变量({}) 解析报错", param, variables, ex); | |
| 53 | - // 不能预测候选人,返回空列表, 避免流程无法进行 | |
| 54 | - return Sets.newHashSet(); | |
| 52 | + // 预测未运行的节点时候,表达式如果包含 execution 或者不存在的流程变量会抛异常,此时忽略该异常!相当于说,不做流程预测!!! | |
| 53 | + if (ex.getCause() != null && ex.getCause() instanceof PropertyNotFoundException) { | |
| 54 | + return Sets.newHashSet(); | |
| 55 | + } | |
| 56 | + log.error("[calculateUsersByActivity][表达式({}) 变量({}) 解析报错", param, variables, ex); | |
| 57 | + throw ex; | |
| 55 | 58 | } |
| 56 | 59 | } |
| 57 | 60 | ... | ... |