<?xml version="1.0" encoding="UTF-8"?>
<process name="AssignTask" xmlns="http://jbpm.org/4.4/jpdl">
<start name="start1" g="164,33,48,48">
<transition name="to 会计核算" to="会计核算" g="-67,-20"/>
</start>
<end name="end1" g="174,218,48,48"/>
<task name="会计核算" g="152,125,92,52" candidate-users="张三,李四,王五">
<transition name="to end1" to="end1" g="-45,-20"/>
</task>
</process>
String userId = "张三";
List<Task> tasks = processEngine.getTaskService().findGroupTasks(userId);
for(Task task : tasks) {
//张三拾取组任务,拾取之后就变成张三的个人任务了,只能由张三处理,其他人就看不到了
processEngine.getTaskService().takeTask(task.getId(), userId);
}
<?xml version="1.0" encoding="UTF-8"?>
<process name="AssignTask" xmlns="http://jbpm.org/4.4/jpdl">
<start name="start1" g="164,33,48,48">
<transition name="to 会计核算" to="会计核算" g="-67,-20"/>
</start>
<end name="end1" g="174,218,48,48"/>
<task name="会计核算" g="152,125,92,52" candidate-users="#{userIds}">
<transition name="to end1" to="end1" g="-45,-20"/>
</task>
</process>
String userIds = "张三,李四,王五";
Map<String,String> variables = new HashMap<String,String>();
variables.put("userIds", userIds);
processEngine.getExecutionService().startProcessInstanceByKey("AssignTask",variables);