jbpm的例子之六 使用swimlane

使用swimlane可以让process的task的assignment更加清晰。
如下所示:task0和task1都是引用了swimlane admin。可以看成一种task assigment的连续性,task0和task1是相关的,因为它们的assignment都是同一个swimlane。

<process-definition name='testSwimlane'>

<swimlane name='admin'>
<assignment class='test.swimlane.Admin' />
</swimlane>

<start-state>
<transition to='t' />
</start-state>

<task-node name='t'>

<task name='task0' swimlane='admin' />
<task name='task1' swimlane='admin' />
<task name='task2' />
<transition to='end' />

</task-node>

<end-state name='end' />

</process-definition>

assignment需要实现AssignmentHandler接口。

public class Admin implements AssignmentHandler {

private static final long serialVersionUID = 1L;

@Override
public void assign(Assignable assignable, ExecutionContext executionContext)
throws Exception {
assignable.setActorId("SuperAdminUser");
}

}

你可能感兴趣的:(jbpm)