组任务及三种分配方式:
1:在taskProcess.bpmn中直接写candidate-users=“小A,小B,小C,小D"
2:在taskProcess.bpmn中写candidate-users =“#{userIDs}”,变量的值要是String的。
使用流程变量指定办理人
Map<String, Object>variables = new HashMap<String, Object>();
variables.put("userIDs", "大大,小小,中中");
3,使用TaskListener接口,使用类实现该接口,在类中定义:
//添加组任务的用户
delegateTask.addCandidateUser(userId1);
delegateTask.addCandidateUser(userId2);
组任务分配给个人任务(认领任务):
processEngine.getTaskService().claim(taskId, userId);
个人任务分配给组任务:
processEngine.getTaskService(). setAssignee(taskId,null);
向组任务添加人员:
processEngine.getTaskService().addCandidateUser(taskId, userId);
向组任务删除人员:
processEngine.getTaskService().deleteCandidateUser(taskId, userId);
个人任务和组任务存放办理人对应的表:
act_ru_identitylink表存放任务的办理人,包括个人任务和组任务,表示正在执行的任务
act_hi_identitylink表存放任务的办理人,包括个人任务和组任务,表示历史任务
区别在于:如果是个人任务TYPE的类型表示participant(参与者)
如果是组任务TYPE的类型表示candidate(候选者)和participant(参与者)