提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.module.bpm.framework.flowable.core.candidate.expression; |
H |
2 |
|
|
3 |
import com.iailab.framework.common.util.collection.SetUtils; |
|
4 |
import com.iailab.framework.common.util.number.NumberUtils; |
|
5 |
import com.iailab.module.bpm.service.task.BpmProcessInstanceService; |
|
6 |
import org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl; |
|
7 |
import org.flowable.engine.runtime.ProcessInstance; |
|
8 |
import org.springframework.stereotype.Component; |
|
9 |
|
|
10 |
import javax.annotation.Resource; |
|
11 |
import java.util.Set; |
|
12 |
|
|
13 |
/** |
|
14 |
* 分配给发起人审批的 Expression 流程表达式 |
|
15 |
* |
|
16 |
* @author iailab |
|
17 |
*/ |
|
18 |
@Component |
|
19 |
public class BpmTaskAssignStartUserExpression { |
|
20 |
|
|
21 |
@Resource |
|
22 |
private BpmProcessInstanceService processInstanceService; |
|
23 |
|
|
24 |
/** |
|
25 |
* 计算审批的候选人 |
|
26 |
* |
|
27 |
* @param execution 流程执行实体 |
|
28 |
* @return 发起人 |
|
29 |
*/ |
|
30 |
public Set<Long> calculateUsers(ExecutionEntityImpl execution) { |
|
31 |
ProcessInstance processInstance = processInstanceService.getProcessInstance(execution.getProcessInstanceId()); |
|
32 |
Long startUserId = NumberUtils.parseLong(processInstance.getStartUserId()); |
|
33 |
return SetUtils.asSet(startUserId); |
|
34 |
} |
|
35 |
|
|
36 |
} |