loading table of contents...

6.3. Studio Simple Publication Workflow Definition

In this chapter you find the complete workflow definition of the Studio Direct Publication workflow as described in Section 4.3, “Example of Workflow Definition”.

<?xml version="1.0" encoding="iso-8859-1"?>

<!--
          CoreMedia Simple Publication Workflow for Studio
-->

<Workflow>
  <Process name="StudioSimplePublication" description="studio-simple-publication"
           startTask="AssignUser">

    <Rights>
      <Grant group="administratoren" rights="read, create, start, suspend, resume, abort"/>
      <Grant group="composer-role" rights="read, create, start, suspend, resume, abort"/>
      <Grant group="approver-role" rights="read"/>
      <Grant group="publisher-role" rights="read"/>
    </Rights>

    <Variable name="subject" type="String"/>
    <Variable name="comment" type="String"/>
    <AggregationVariable name="changeSet" type="Resource"/>
    <AggregationVariable name="comments" type="String"/>

    <Variable name="changeSetLockedInStudio" type="Boolean">
      <Boolean value="true"/>
    </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"/>
    </InitialAssignment>

    <Assignment>
      <Reads variable="subject"/>
      <Reads variable="comment"/>
      <Reads variable="changeSet"/>
      <Reads variable="comments"/>
    </Assignment>

    <AutomatedTask name="AssignUser"
                   description="assignuser-task" successor="CheckEmptyChangeSet">
      <Action class="ForceUser" task="Publish" userVariable="OWNER_"/>
      <Action class="ForceUser" task="Compose" userVariable="OWNER_"/>
      <Action class="RegisterPendingProcess" userVariable="OWNER_"/>
    </AutomatedTask>

    <If name="CheckEmptyChangeSet">
      <Condition>
	<IsEmpty variable="changeSet"/>
      </Condition>
      <Then successor="Finish"/>
      <Else successor="Publish"/>
    </If>

    <UserTask name="Publish"
              description="studio-simple-publication-publish-task"
              successor="CheckPublication" reexecutable="true" autoAccepted="true" autoCompleted="true">
      <Rights>
        <Grant group="administratoren" rights="read, accept, retry"/>
        <Grant group="composer-role" rights="read, accept, retry"/>
      </Rights>

      <Assignment>
        <Reads variable="subject"/>
        <Reads variable="comment"/>
        <Reads description="publish-changeSet" variable="changeSet" contentEditable="false"/>
        <Reads variable="comments"/>
      </Assignment>

      <EntryAction class="ApproveResource" gui="true"
                   resourceVariable="changeSet"
		   successVariable="publicationSuccessful"
                   ignoreErrors="true"
                   timeout="180"
                   userVariable="PERFORMER_">
      </EntryAction>

      <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-simple-publication-compose-task"
              successor="CheckEmptyChangeSet" reexecutable="true" autoAccepted="true">
      <Rights>
        <Grant group="administratoren" rights="read, accept, delegate, skip"/>
        <Grant group="composer-role" rights="read, accept, delegate, skip"/>
      </Rights>

      <Assignment>
        <Writes variable="subject"/>
        <Writes variable="comment"/>
        <Writes variable="changeSet" contentEditable="true"/>
        <Writes variable="comments"/>
        <Reads variable="publicationResultCodes"/>
      </Assignment>
    </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 6.62. Listing of the direct publication workflow