Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: update config docs

...

Info

As of DSpace 7, the workflow.xml configuration file has been migrated to use Spring Bean syntax (instead of a custom XML format).  The structure of this XML has changed. If you need help migrating your old workflow.xml file (which started with a <wf-config> tag) to the new format (using <bean> tags), an XSLT script is available: workflow-migration.xsl

The workflow main configuration can be found in the workflow.xml file, located in [dspace]/config/spring/api/workflow.xml . An example of this workflow configuration file can be found bellowbelow.

Code Block
languagehtml/xml
<wf-config><beans>
     <workflow-map> <bean class="org.dspace.xmlworkflow.XmlWorkflowFactoryImpl">
        <!-- collection to workflow mapping -->
<property name="workflowMapping">
             <name-map collection="default" workflow="{workflow.id}"/>
<util:map>
           <name-map collection="123456789/0" workflow="{workflow.id2}     <entry key="defaultWorkflow" value-ref="defaultWorkflow"/>
<!--     </workflow-map>

       <workflow<entry startkey="{start.step.id}123456789/4" idvalue-ref="{workflow.id}">
selectSingleReviewer"/>-->
<!--        <roles>
    <entry key="123456789/5" value-ref="scoreReview"/>-->
      <!-- Roles used in the workflow --> </util:map>
        </roles>property>

    </bean>     
    
    <!--Standard StepsDSpace come hereworkflow-->
    <bean name="defaultWorkflow" class="org.dspace.xmlworkflow.state.Workflow">
      <step id="ExampleStep1" nextStep  <property name="ExampleStep2firstStep" userSelectionMethodref="{UserSelectionActionId}reviewstep"/>
        <property name="steps">
     <!-- Step1 config-->
     <util:list>
       </step>
        <step id="ExampleStep2" userSelectionMethod<ref bean="{UserSelectionActionId}reviewstep"/>

        </step>
    </workflow>
    <workflow<ref startbean="{start.step.id2}" id="{workflow.id}"editstep"/>
                <ref bean="finaleditstep"/>
     <!-- Another workflow configuration-->
       </util:list>
        </workflow>property>
    </wf-config>

workflow-map

bean> 

    <workflow start="{start.step.id}" id="{workflow.id}">
        <roles>
         <!-- Roles used in the workflow -->
        </roles>

            <!-- Steps come here-->
            <step id="ExampleStep1" nextStep="ExampleStep2" userSelectionMethod="{UserSelectionActionId}">
            <!-- Step1 config-->
            </step>
        <step id="ExampleStep2" userSelectionMethod="{UserSelectionActionId}">

        </step>
    </workflow>
    <workflow start="{start.step.id2}" id="{workflow.id}">
     <!-- Another workflow configuration-->
    </workflow>
</wf-config>

workflowMapping bean (org.dspace.xmlworkflow.XmlWorkflowFactoryImpl)

The workflow The workflow map contains a mapping between collections in DSpace and a workflow configuration. Similar to the configuration of the submission process, the mapping can be done based on the handle of the collection. The mapping with "defaultdefaultWorkflow" as the value for the collection mapping, will be used for the collections not occurring in other mapping tags. Each mapping is defined by a "name-mapentry" tag with two attributes:

  • collectionkey: can either be a collection handle or "defaultdefaultWorkflow"
  • workflowvalue-ref: the value of this attribute points to one of the workflow configurations defined by the "workflowWorkflow" tagsbeans

workflow beans (org.dspace.xmlworkflow.state.Workflow)

The workflow element bean is a repeatable XML element and the configuration between two "workflow" tags represents one workflow process. It requires the following 2 attributes::

  • "name" attributeid: a unique identifier name used for the identification of the workflow and used in the workflow to collection mapping
  • start"firstStep" property: the identifier of the first step of the workflow, this will be the entry point of this workflow-process. When a new item has been committed to a collection that uses this workflow, the step configured in the "start" attribute will he the first step the item will go through.

...

  • "steps" property: a list of all steps within this workflow (in the order they will be processed).

role beans (org.dspace.xmlworkflow.Role)

Each workflow process step has a number of roles defined between the "rolesrole" tagsproperty. A role represents one or more DSpace EPersons or Groups and can be used to assign them to one or more steps in the workflow process. One role is represented by one "role" tag bean and has the following attributes:

  • "id" attribute: a unique identifier (in one workflow process) for the role
  • "description" property: optional attribute to describe the role
  • "scope" property: optional attribute that is used to find our group and must have one of the following values:
    • collectionCOLLECTION: The collection value specifies that the group will be configured at the level of the collection. This type of groups is the same as the type that existed in the original workflow system.  In case no value is specified for the scope attribute, the workflow framework assumes the role is a collection role.
    • repositoryREPOSITORY: The repository scope uses groups that are defined at repository level in DSpace. The name attribute should exactly match the name of a group in DSpace.
    • itemITEM: The item scope assumes that a different action in the workflow will assign a number of EPersons or Groups to a specific workflow-item in order to perform a step. These assignees can be different for each workflow item.
  • "name" property: The name specified in the name attribute of a role will be used to lookup an eperson group in DSpace. The lookup will depend on the scope specified in the "scope" attribute:
    • collection: The workflow framework will look for a group containing the name specified in the name attribute and the ID of the collection for which this role is used.
    • repository: The workflow framework will look for a group with the same name as the name specified in the name attribute
    • item: in case the item scope is selected, the name of the role attribute is not required
    internal: optional attribute which isn't really used at the moment, false by default
Code Block
languagehtml/xml
<roles><bean id="reviewer" class="org.dspace.xmlworkflow.Role">
    <role id<property name="scope" value="{unique.role.id}" description="{role.description}" scope="{role.scope}" name="{role.name}" internal="true/false#{ T(org.dspace.xmlworkflow.Role.Scope).COLLECTION}"/>
    <property name="name" value="Reviewer"/>
    <property name="description" value="The people responsible for this step are able to edit the metadata of incoming submissions, and then accept or reject them."/>
</roles>
bean> 

step beans (org.dspace.xmlworkflow.state.Step)

The step element represents one step in the workflow process. A step represents a number of actions that must be executed by one specified role. In case no role attribute is specified, the workflow framework assumes that the DSpace system is responsible for the execution of the step and that no user interface will be available for each of the actions in this step. The step element has the following attributes in order to further configure it:

  • id"name" attribute: The id name attribute specifies a unique identifier for the step, this id will be used when configuring other steps in order to point to this step. This identifier can also be used when configuring the start step of the workflow item.nextStep: This attribute specifies the step that will follow once this step has been completed under normal circumstances. If this attribute is not set, the workflow framework will assume that this step is an endpoint of the workflow process and will archive the item in DSpace once the step has been completed.
  • "userSelectionMethod" property: This attribute defines the UserSelectionAction that will be used to determine how to attache users to this step for a workflow-item. The value of this attribute must refer to the identifier of an action bean in the workflow-actions.xml. Examples of the user attachment to a step are the currently used system of a task pool or as an alternative directly assigning a user to a task.
  • "role" property: optional attribute that must point to the id attribute of a role element specified for the workflow. This role will be used to define the epersons and groups used by the userSelectionMethod.
  • RequiredUsers
Code Block
languagehtml/xml
<step id="{step.id}" nextStep="{next.step.id}" userSelectionMethod="{user.selection.bean.id}" role="{role.id}" >
<!-- optional alternate outcomes, depending on the outcome of the actions you can alter the next step here -->
<alternativeOutcome>
     <step status="{integer}">{alternate.step.id}</step>
</alternativeOutcome>
<action id="{action.bean.id}"/>
<action id="{action.bean.id.1}"/>
</step>
<bean name="reviewstep" class="org.dspace.xmlworkflow.state.Step">
    <property name="userSelectionMethod" ref="claimaction"/>
    <property name="role" ref="reviewer"/>
    <property name="outcomes">
        <util:map>
            <entry key="#{ T(org.dspace.xmlworkflow.state.actions.ActionResult).OUTCOME_COMPLETE}"
                   value-ref="editstep"/>
        </util:map>
    </property>
    <property name="actions">
        <util:list>
            <ref bean="reviewaction"/>
        </util:list>
    </property>
</bean> 

Each step contains a number of actions that the workflow item will go through. In case the action has a user interface, the users responsible for the exectution of this step will have to execute these actions before the workflow item can proceed to the next action or the end of the step.

There is also an optional subsection that can be defined for a step part called "alternativeOutcomeoutcomes". This can be used to define outcomes for the step that differ from the one specified in the nextStep attribute. Each action returns an integer depending on the result of the action. The default value is "0" and will make the workflow item proceed to the next action or to the end of the step.
In case an action returns a different outcome than the default "0", the alternative outcomes will be used to lookup the next step. The alternativeOutcome "outcomes" element contains a number of steps, each having a status attribute. This status attribute defines the return value of an action. The value of the element will be used to lookup the next step the workflow item will go through in case an action returns that specified status.

...