潘志宝
2024-12-03 51c1c2c9fa28fb1765dd6e81c70b78566792aebe
提交 | 用户 | 时间
e7c126 1 package com.iailab.module.bpm.framework.flowable.core.candidate.strategy;
H 2
3 import cn.hutool.core.convert.Convert;
4 import com.iailab.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateStrategy;
5 import com.iailab.module.bpm.framework.flowable.core.enums.BpmTaskCandidateStrategyEnum;
6 import com.iailab.module.bpm.framework.flowable.core.util.FlowableUtils;
7 import org.flowable.engine.delegate.DelegateExecution;
8 import org.springframework.stereotype.Component;
9
10 import java.util.Set;
11
12 /**
13  * 流程表达式 {@link BpmTaskCandidateStrategy} 实现类
14  *
15  * @author iailab
16  */
17 @Component
18 public class BpmTaskCandidateExpressionStrategy implements BpmTaskCandidateStrategy {
19
20     @Override
21     public BpmTaskCandidateStrategyEnum getStrategy() {
22         return BpmTaskCandidateStrategyEnum.EXPRESSION;
23     }
24
25     @Override
26     public void validateParam(String param) {
27         // do nothing 因为它基本做不了校验
28     }
29
30     @Override
31     public Set<Long> calculateUsers(DelegateExecution execution, String param) {
32         Object result = FlowableUtils.getExpressionValue(execution, param);
33         return Convert.toSet(Long.class, result);
34     }
35
36 }