<?xml version="1.0" encoding="UTF-8"?>
<wf-config>
    <workflow-map>
        <name-map collection="default" workflow="default"/>
        <!--<name-map collection="123456789/4" workflow="selectSingleReviewer"/>-->
        <!--<name-map collection="123456789/5" workflow="scoreReview"/>-->
    </workflow-map>

    <!--Standard workflow step-->
    <workflow start="reviewstep" id="default">

        <roles>
            <role id="reviewer" name="Reviewer" description="The people responsible for this step are able to edit the metadata of incoming submissions, and then accept or reject them." />
            <role id="editor" name="Editor" description="The people responsible for this step are able to edit the metadata of incoming submissions, and then accept or reject them."/>
            <role id="finaleditor" name="Final Editor" description="The people responsible for this step are able to edit the metadata of incoming submissions, but will not be able to reject them."/>
        </roles>

        <step id="reviewstep" role="reviewer" userSelectionMethod="claimaction">
            <outcomes>
                <step status="0">editstep</step>
            </outcomes>
            <actions>
                <action id="reviewaction"/>
            </actions>
        </step>
        <step id="editstep" role="editor" userSelectionMethod="claimaction">
            <outcomes>
                <step status="0">finaleditstep</step>
            </outcomes>
            <actions>
                <action id="editaction"/>
            </actions>
        </step>
        <step id="finaleditstep" role="finaleditor" userSelectionMethod="claimaction">
            <actions>
                <action id="finaleditaction"/>
            </actions>
        </step>
    </workflow>

    <!--Workflow where a reviewManager can select a single review who will then either accept/reject the item-->
    <workflow id="selectSingleReviewer" start="selectReviewerStep">
        <roles>
            <role id="reviewer" name="Reviewer" scope="item" />
            <role id="reviewmanagers" name="ReviewManagers" scope="repository"/>
        </roles>


        <step id="selectReviewerStep" role="reviewmanagers" userSelectionMethod="claimaction">
            <outcomes>
                <step status="0">singleUserReviewStep</step>
            </outcomes>
            <actions>
                <action id="selectrevieweraction"/>
            </actions>
        </step>

        <step id="singleUserReviewStep" role="reviewer" userSelectionMethod="autoassignAction">
            <outcomes>
                <step status="1">selectReviewerStep</step>
            </outcomes>
            <actions>
                <action id="singleuserreviewaction"/>
            </actions>
        </step>

    </workflow>

    <!--Workflow where a number of users will perform reviews on an item and depending on the scores the item will be archived/rejected-->
    <workflow id="scoreReview" start="scoreReviewStep">
        <roles>
            <role id="scoreReviewers" name="ScoreReviewers" scope="collection" description="The people responsible to select a single reviewer for the submission"/>
        </roles>

        <step id="scoreReviewStep" role="scoreReviewers" userSelectionMethod="claimaction" requiredUsers="2">
            <outcomes>
                <step status="0">evaluationStep</step>
            </outcomes>
            <actions>
                <action id="scorereviewaction"/>
            </actions>
        </step>
        <step id="evaluationStep" userSelectionMethod="noUserSelectionAction">
            <actions>
                <action id="evaluationaction"/>
            </actions>
        </step>
    </workflow>
</wf-config>
