4.4. User Task
To define the task assignee, select one of the process roles in the Process role property of the User task node. When a process reaches the User task, process actors with the given role will be found among all the process actors, and the task will be assigned to them.
Process role from a task:
<userTask id="managerApproval" name="Manager approval">
<extensionElements>
<cuba:procRole>manager</cuba:procRole>
</extensionElements>
</process>
If you want the task to be assigned to multiple users, then set Parallel
or Sequential
value to the Multi-instance type property of the User task node.
There is also an ability to specify the task assignee in the assignee property of the User Task node. The property value may contain a string with an identifier of CUBA user: da8159cc-757f-7f59-6579-7f629ac02f72
, a variable that contains a string with a user id: ${varialbeName}
, or an expression that invokes the service that returns a user id: ${someService.getSomeUserId()}
. Keep in mind, that the procRole property still must be defined. When the process reaches such User Task, a ProcActor
instance for the specified user and process role is searched. If it doesn’t exist, a new ProcActor
object is created. To specify the assignee in the model designer, select the User Task, click the Show advanced properties link and click into the Assignments property editor. A new dialog will appear, fill the Assignee property there.
Set the Claim allowed property if you don’t want the task to be immediately assigned to the particular user, but to appear in the list of available tasks for the group of users. Then, one of the candidates will be able to claim the task. Task candidates are defined amongst process actors with the corresponding Process role property.
A task without an explicit executor:
<userTask id="managerApproval" name="Manager approval">
<extensionElements>
<cuba:claimAllowed>true</cuba:claimAllowed>
</extensionElements>
</process>