是否可以定义 candidateGroups 或 candidateUsers 在Activiti中动态执行? 我想这样做:
candidateGroups
candidateUsers
<userTask id="approve" name="approve" activiti:candidateUsers="${myWorkflowService.getCandidateUsers()}"></userTask>
然后在Java类中, MyWorkflowService ,我将定义方法 getCandidateUsers() 返回用户/组列表。
MyWorkflowService
getCandidateUsers()
我设法解决了如下问题:
我添加了一个 executionListener 到该用户任务之前的转换:
executionListener
<activiti:executionListener event="start" expression="${myWorkflowService.getCandidateUsers(execution)}"></activiti:executionListener>
在我的课堂上,我定义了这个方法:
public void getCandidateUsers(DelegateExecution execution) { execution.setVariable("approver", "foo"); }