dengzedong
4 天以前 730d1944e3a13c517c77df2b0712df05645a38dd
提交 | 用户 | 时间
e7c126 1 package com.iailab.module.bpm.framework.flowable.core.behavior;
H 2
3 import com.iailab.module.bpm.framework.flowable.core.candidate.BpmTaskCandidateInvoker;
4 import lombok.Setter;
5 import org.flowable.bpmn.model.Activity;
6 import org.flowable.bpmn.model.UserTask;
7 import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior;
8 import org.flowable.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior;
9 import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior;
10 import org.flowable.engine.impl.bpmn.behavior.UserTaskActivityBehavior;
11 import org.flowable.engine.impl.bpmn.parser.factory.DefaultActivityBehaviorFactory;
12
13 /**
14  * 自定义的 ActivityBehaviorFactory 实现类,目的如下:
15  * 1. 自定义 {@link #createUserTaskActivityBehavior(UserTask)}:实现自定义的流程任务的 assignee 负责人的分配
16  *
17  * @author iailab
18  */
19 @Setter
20 public class BpmActivityBehaviorFactory extends DefaultActivityBehaviorFactory {
21
22     private BpmTaskCandidateInvoker taskCandidateInvoker;
23
24     @Override
25     public UserTaskActivityBehavior createUserTaskActivityBehavior(UserTask userTask) {
26         return new BpmUserTaskActivityBehavior(userTask)
27                 .setTaskCandidateInvoker(taskCandidateInvoker);
28     }
29
30     @Override
31     public ParallelMultiInstanceBehavior createParallelMultiInstanceBehavior(Activity activity,
32                                                                              AbstractBpmnActivityBehavior behavior) {
33         return new BpmParallelMultiInstanceBehavior(activity, behavior)
34                 .setTaskCandidateInvoker(taskCandidateInvoker);
35     }
36
37     @Override
38     public SequentialMultiInstanceBehavior createSequentialMultiInstanceBehavior(Activity activity,
39                                                                                  AbstractBpmnActivityBehavior behavior) {
40         return new BpmSequentialMultiInstanceBehavior(activity, behavior)
41                 .setTaskCandidateInvoker(taskCandidateInvoker);
42     }
43
44 }