|
|
@@ -8,6 +8,7 @@ import com.google.common.collect.Sets;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.flowable.bpmn.model.BpmnModel;
|
|
|
import org.flowable.common.engine.api.FlowableException;
|
|
|
+import org.flowable.common.engine.impl.javax.el.PropertyNotFoundException;
|
|
|
import org.flowable.engine.delegate.DelegateExecution;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@@ -48,10 +49,12 @@ public class BpmTaskCandidateExpressionStrategy implements BpmTaskCandidateStrat
|
|
|
Object result = FlowableUtils.getExpressionValue(variables, param);
|
|
|
return CollectionUtils.toLinkedHashSet(Long.class, result);
|
|
|
} catch (FlowableException ex) {
|
|
|
- // 预测未运行的节点时候,表达式如果包含 execution 或者不存在的流程变量会抛异常,
|
|
|
- log.warn("[calculateUsersByActivity][表达式({}) 变量({}) 解析报错", param, variables, ex);
|
|
|
- // 不能预测候选人,返回空列表, 避免流程无法进行
|
|
|
- return Sets.newHashSet();
|
|
|
+ // 预测未运行的节点时候,表达式如果包含 execution 或者不存在的流程变量会抛异常,此时忽略该异常!相当于说,不做流程预测!!!
|
|
|
+ if (ex.getCause() != null && ex.getCause() instanceof PropertyNotFoundException) {
|
|
|
+ return Sets.newHashSet();
|
|
|
+ }
|
|
|
+ log.error("[calculateUsersByActivity][表达式({}) 变量({}) 解析报错", param, variables, ex);
|
|
|
+ throw ex;
|
|
|
}
|
|
|
}
|
|
|
|