AssignmentHandler实现动态用户分配
JPDL如下:
<?xml version="1.0" encoding="UTF-8"?>
<process name="yjwdgl" xmlns="http://jbpm.org/4.3/jpdl">
<start g="12,36,92,52" name="start">
<transition g="-48,-24" name="应急文件录入" to="应急文档签署"/>
</start>
<task form="yjwdqs" g="180,36,121,49" name="应急文档签署">
<description>应急文档管理</description>
<transition g="-38,-17" name="应急文档归档" to="应急文档归档"/>
<assignment-handler g="420,36,121,49" name="应急文档归档">
<description>应急文档管理</description>
<transition g="-12,-16" name="结束" to="end"/>
<assignment-handler name="end"/>
</process>
实现类:
public class TestBean implements AssignmentHandler {
private static final long serialVersionUID = 1L;
public void assign(Assignable assignable, OpenExecution execution) throws Exception {
assignable.addCandidateUser("user");
assignable.addCandidateUser("manager");
}
}