I suggest you to use activiti:candidateGroups. Create a group and all the users to the group. When the task starts it goes to the pool. This particular process uses a "pooled assignment".
Suppose, for example, a Sales_Team group contains 3 people. You could iterate through the group and assign a task to each and every member of the group and then not consider the task complete until some or all group members have taken action. The other and easy to use alternative is pooled assignment which can be achieved using activiti:candidateGroups attribute of userTask
Using a pool, all members of a group are notified of the task, but as soon as 1 member takes "ownership" of the task, it is removed from everyone else's to do list. The owner can then complete the task or return it to the pool again.
If it is returned to the pool, all members of the group will see the task in their to do list until another person takes ownership or completes the task.
Here is an example from my project:
<serviceTask id="submitDocServiceTask1" name="Submit Document"
activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
<extensionElements>
<activiti:field name="script">
<activiti:string><![CDATA[execution.setVariable('cmsWorkflow_approveCount', 0);]]></activiti:string>
</activiti:field>
</extensionElements>
</serviceTask>
<userTask id="salesReviewUsertask1" name="Sales Team Review"
activiti:candidateGroups="GROUP_Sales_Team" activiti:formKey="cmsWorkflow:activitiSalesReview">
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
<![CDATA[
if(task.getVariableLocal('cmsWorkflow_approveRejectOutcome') == 'Approve') {
var finalApprovalCount = cmsWorkflow_approveCount + 1;
execution.setVariable('cmsWorkflow_approveCount', finalApprovalCount);
}
]]>
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
Notice this part: <userTask id="salesReviewUsertask1" name="Sales Team Review"
activiti:candidateGroups="GROUP_Sales_Team".....
Hi panchal,
Where to get this <listOfAssignees> ??
Regards,
Madhu
Hi Madhu,
You can get <<listOfAssignees>> in this task as well.
But i want to know from you that from where you get the list of assignees? Like you want to get specific group of users and want to assign tasks to this users.
Regards,
Vidhi
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.