Studio Developer Manual / Version 2304
Table Of ContentsWhich user can accept which workflow task depends on several conditions. First of all there is an access rights system in place where groups are granted certain rights (that is read, write, accept, complete, cancel) on a task. In addition, for publication workflows there exist performer policies that determine which users have the required access rights on the workflow's contents. For more details on these fundamental mechanisms, see the Workflow Manual.
The special case of assignees is covered because it also requires a Studio client configuration. If a task is an assignment task, the user of the predecessor task can specify assignees for the task. Assignees can be multiple users and groups. Only assigned users or members of assigned groups can then carry out the task. Currently, assignees are only supported for publication workflows out of the box.
The following example shows how the Approve
and Publish
tasks of the
Studio-Two-Step-Publication
process definition are defined as assignment tasks.
<Workflow> <Process name="..." startTask="..."> <!-- ... --> <UserTask name="Approve" description="studio-three-step-publication-approve-task" successor="PublishOrCompose" reexecutable="true"> <Performers policyClass="com.coremedia.cap.workflow.plugin.AssignableResourcePermissionsPerformersPolicy" assignedUsersVariable="assignedUsers_Approve" assignedGroupsVariable="assignedGroups_Approve" rights="approve, publish"/> <Rights> <Grant group="administratoren" rights="read, accept, cancel, delegate, reject"/> <Grant group="approver-role" rights="read, accept, cancel, delegate, reject"/> </Rights> <Assignment> <Reads variable="assignedUsers_Approve"/> <Reads variable="assignedGroups_Approve"/> <Writes variable="assignedUsers_Publish"/> <Writes variable="assignedGroups_Publish"/> <!-- ... --> </Assignment> <!-- ... --> </UserTask> <UserTask name="Approve" description="studio-three-step-publication-approve-task" successor="ApproveOrDoPublish" reexecutable="true"> <Performers policyClass="com.coremedia.cap.workflow.plugin.AssignableResourcePermissionsPerformersPolicy" assignedUsersVariable="assignedUsers_Publish" assignedGroupsVariable="assignedGroups_Publish" rights="publish"/> <Rights> <Grant group="administratoren" rights="read, accept, cancel, delegate, reject"/> <Grant group="publisher-role" rights="read, accept, cancel, delegate, reject"/> </Rights> <Assignment> <Reads variable="assignedUsers_Publish"/> <Reads variable="assignedGroups_Publish"/> <!-- ... --> </Assignment> <!-- ... --> </UserTask> </Process> </Workflow>
Example 9.105. Defining assignable performers policy for tasks
In order to make a task an assignment task, the AssignableResourcePermissionsPerformersPolicy
has to be set
as the performers policy of the task. In addition, this policy needs to be configured with the two parameters
assignedUsersVariable
and assignedGroupsVariable
. The values for both parameters need
to be process variables and they need to follow the exact naming pattern of
assignedUsers_{$taskName}
and assignedGroups_{$taskName}
. In the example, one can
also see that the Approve
task reads the assignedUsers_Approve
and assignedGroups_Approve
variables and writes the assignedUsers_Publish
and assignedGroups_Publish
variables.
For the Studio client, configuring a workflow step as an assignment task is very easy as
shown in Example 9.104, “Workflow steps configuration for the built-in 2-step publication workflow
”: In the WorkflowTransition
definition for the Compose
task, the WorkflowStep
definition for Approve
has the parameter isAssignmentTask
set.
To conclude, the WorkflowTransition#isAssignmentTask
configurations for the Studio client
must match the AssignableResourcePermissionsPerformersPolicy
configurations of the process definition on the
workflow server.