Studio Developer Manual / Version 2107
Table Of ContentsThis section covers publication-specific workflow customizations in addition to the previously described general guidelines for additional workflow fields and validation customization.
The running example for this section is adding a 3-step publication workflow to Studio on top of the built-in workflows for direct publication and 2-step publication. From the Studio user perspective, the new 3-step workflow has the following steps.
- Start/Compose
Compose the change set to publish upon workflow start. The next step is Approve, for which you can select assignees (users, groups).
- Approve
Review the workflow change set. The next step is either handing the workflow back to Compose or pushing it on to Publish. In the second case, you can select assignees.
- Publish
Confirm the review of the previous step. The next step is either to finalize the publication or to hand back to Approve. In the second case, you can select assignees.
The complete definition of the 3-step publication workflow is given in the Example 7.92, “Workflow definition of a new StudioThreeStepPublication workflow ”.
<?xml version="1.0" encoding="iso-8859-1"?> <!-- CoreMedia Three Step Publication Workflow for Studio --> <Workflow> <Process name="StudioThreeStepPublication" description="studio-three-step-publication" startTask="AssignUser"> <Rights> <Grant group="administratoren" rights="read, write, create, start, suspend, resume, abort"/> <Grant group="composer-role" rights="read, write, create, start, suspend, resume, abort"/> <Grant group="approver-role" rights="read, write"/> <Grant group="publisher-role" rights="read, write"/> </Rights> <Variable name="subject" type="String"/> <Variable name="comment" type="String"/> <AggregationVariable name="assignedUsers_Approve" type="User"/> <AggregationVariable name="assignedGroups_Approve" type="Group"/> <AggregationVariable name="assignedUsers_Publish" type="User"/> <AggregationVariable name="assignedGroups_Publish" type="Group"/> <AggregationVariable name="changeSet" type="Resource"/> <AggregationVariable name="comments" type="String"/> <Variable name="changeSetLockedInStudio" type="Boolean"> <Boolean value="true"/> </Variable> <Variable name="contentNotLockedForPerformerOfTasks" type="String"> <String value="Compose,Approve,Publish"/> </Variable> <Variable name="nextSelectedTask" type="String"> </Variable> <Variable name="publicationSuccessful" type="Boolean"> <Boolean value="false"/> </Variable> <AggregationVariable name="publicationResultResources" type="Resource"/> <AggregationVariable name="publicationResultCodes" type="Integer"/> <AggregationVariable name="publicationResultVersions" type="Integer"/> <AggregationVariable name="publicationResultParams" type="String"/> <InitialAssignment> <Writes variable="subject"/> <Writes variable="comment"/> <Writes variable="changeSet"/> <Writes variable="comments"/> <Writes variable="assignedUsers_Approve"/> <Writes variable="assignedGroups_Approve"/> <Writes variable="assignedUsers_Publish"/> <Writes variable="assignedGroups_Publish"/> </InitialAssignment> <Assignment> <Reads variable="subject"/> <Reads variable="comment"/> <Reads variable="changeSet"/> <Reads variable="comments"/> <Reads variable="assignedUsers_Approve"/> <Reads variable="assignedGroups_Approve"/> <Reads variable="assignedUsers_Publish"/> <Reads variable="assignedGroups_Publish"/> </Assignment> <AutomatedTask name="AssignUser" description="assignuser-task" successor="CheckEmptyChangeSet"> <Action class="ExcludeUser" task="Approve" userVariable="OWNER_"/> <Action class="ExcludeUser" task="Publish" userVariable="OWNER_"/> <Action class="RegisterPendingProcess" userVariable="OWNER_"/> </AutomatedTask> <If name="CheckEmptyChangeSet"> <Condition> <IsEmpty variable="changeSet"/> </Condition> <Then successor="Finish"/> <Else successor="Approve"/> </If> <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"/> <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"/> <Reads variable="subject"/> <Writes variable="comment"/> <Reads description="approve-changeSet" variable="changeSet" contentEditable="false"/> <Writes variable="comments"/> <Reads variable="publicationResultCodes"/> <Writes variable="nextSelectedTask"/> </Assignment> <ExitAction class="ExcludePerformer" task="Compose"/> <ExitAction class="ExcludePerformer" task="Publish"/> <ExitAction class="RegisterPendingProcess"/> </UserTask> <If name="PublishOrCompose"> <Condition> <Equal> <String value="Compose"/> <Get variable="nextSelectedTask"/> </Equal> </Condition> <Then successor="Compose"/> <Else successor="Publish"/> </If> <UserTask name="Publish" 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"/> <Reads variable="subject"/> <Writes variable="comment"/> <Reads description="approve-changeSet" variable="changeSet" contentEditable="false"/> <Writes variable="comments"/> <Reads variable="publicationResultCodes"/> <Writes variable="nextSelectedTask"/> </Assignment> <EntryAction class="ApproveResource" gui="true" resourceVariable="changeSet" successVariable="publicationSuccessful" ignoreErrors="true" timeout="180" userVariable="PERFORMER_"> </EntryAction> <ExitAction class="ExcludePerformer" task="Compose"/> <ExitAction class="ExcludePerformer" task="Approve"/> <ExitAction class="ForceUser" task="DoPublish"/> <ExitAction class="RegisterPendingProcess"/> </UserTask> <If name="ApproveOrDoPublish"> <Condition> <Equal> <String value="Approve"/> <Get variable="nextSelectedTask"/> </Equal> </Condition> <Then successor="Approve"/> <Else successor="DoPublish"/> </If> <UserTask name="DoPublish" description="studio-three-step-publication-publish-task" successor="CheckPublication" reexecutable="true" autoAccepted="true" autoCompleted="true"> <Rights> <Grant group="administratoren" rights="read, accept, cancel, delegate, reject"/> <Grant group="publisher-role" rights="read, accept, cancel, delegate, reject"/> </Rights> <Assignment> <Reads variable="subject"/> <Reads variable="comment"/> <Reads description="publish-changeSet" variable="changeSet" contentEditable="false"/> <Reads variable="comments"/> </Assignment> <EntryAction class="PublishResources" gui="true" resourceVariable="changeSet" resultVariable="publicationResultResources" versionVariable="publicationResultVersions" codeVariable="publicationResultCodes" parameterVariable="publicationResultParams" successVariable="publicationSuccessful" ignoreErrors="false" ignorePublicationErrors="true" timeout="600" userVariable="PERFORMER_"/> </UserTask> <If name="CheckPublication"> <Condition> <Get variable="publicationSuccessful"/> </Condition> <Then successor="Finish"/> <Else successor="Compose"/> </If> <UserTask name="Compose" description="studio-three-step-publication-compose-task" successor="CheckEmptyChangeSet" reexecutable="true"> <Performers policyClass="com.coremedia.cap.workflow.plugin.ResourcePermissionsPerformersPolicy" rights="write"/> <Rights> <Grant group="administratoren" rights="read, accept, skip"/> <Grant group="composer-role" rights="read, accept"/> <Grant group="approver-role" rights="read, skip"/> </Rights> <Assignment> <Writes variable="subject"/> <Writes variable="comment"/> <Writes variable="changeSet" contentEditable="true"/> <Writes variable="comments"/> <Writes variable="assignedUsers_Approve"/> <Writes variable="assignedGroups_Approve"/> <Reads variable="publicationResultCodes"/> </Assignment> <ExitAction class="ExcludePerformer" task="Approve"/> <ExitAction class="ExcludePerformer" task="Publish"/> <ExitAction class="RegisterPendingProcess"/> </UserTask> <Variable name="finishTaskRetryTimer" type="Timer"/> <TimerHandler class="RetryTaskTimerHandler" task="Finish" timerName="finishTaskRetryTimer"/> <AutomatedTask name="Finish" final="true"> <Action class="AssignVariable" resultVariable="changeSetLockedInStudio"> <Boolean value="false"/> </Action> <Action class="AssignVariable" resultVariable="finishTaskRetryTimer"> <Timer value="30"/> </Action> <Action class="EnableTimer" timerVariable="finishTaskRetryTimer"/> <Action class="ArchiveProcess" maxProcessesPerUser="100"/> </AutomatedTask> </Process> </Workflow>
Example 7.92. Workflow definition of a new StudioThreeStepPublication workflow
For details on how to define workflows along consult the Workflow Manual. It also describes the pre-defined actions in the context of publication workflows. This section focuses on two special aspects to make publication workflows work hand in hand with Studio.
Performers Policy
The
AssignableResourcePermissionsPerformersPolicy
is the only performers policy that is currently supported for custom publication workflows.Assignees
The
Approve
andPublish
tasks can have assignees. You need to name the associated process variables according to the patternassignedUsers_{$taskName}
andassignedGroups_{$taskName}
. In addition, you need to pass these variables as parameters to theAssignableResourcePermissionsPerformersPolicy
(asassignedUsersVariable
andassignedGroupsVariable
respectively). The default workflow forms of the Studio Client app take care of setting these process variables accordingly when selecting assignees in the user interface.Next Selected Task
The process must have the variable
nextSelectedTask
that determines the next step at points where the user decides which the next step is. For the example 3-step publication workflow, this happens for the tasksApprove
andPublish
. Both tasks are followed by anIf
task where thenextSelectedTask
variable decides about whether pushing the worflow further or whether to hand it back to the previous task. The default workflow forms of the Studio Client app take care of setting this process variable accordingly when selecting the next workflow step in the user interface.