<?xml version="1.0"?>
<dc-workflow xmlns:i18n="http://xml.zope.org/namespaces/i18n"
             i18n:domain="collective.addons"
             workflow_id="addon_linked_release_workflow"
             title="Add-on Linked Release Publication Workflow"
             description=" - A simple workflow for linked Add-on Release objects."
             state_variable="review_state"
             initial_state="pre-release"
             manager_bypass="False">

    <permission>Access contents information</permission>
    <permission>Change portal events</permission>
    <permission>Modify portal content</permission>
    <permission>View</permission>

    <state state_id="alpha" title="Alpha Release" i18n:attributes="title">
        <description i18n:translate="">The first stage of a linked add-on release</description>
        <exit-transition transition_id="re-release"/>
        <exit-transition transition_id="release-beta"/>
        <exit-transition transition_id="release-candidate"/>
        <exit-transition transition_id="release-final"/>
        <exit-transition transition_id="retract"/>
        <exit-transition transition_id="hide"/>
        <permission-map name="Access contents information"
                        acquired="True">
        </permission-map>
        <permission-map name="Modify portal content"
                        acquired="True">
        </permission-map>
        <permission-map name="View"
                        acquired="True">
        </permission-map>
    </state>

    <state state_id="beta" title="Beta Release" i18n:attributes="title">
        <description i18n:translate="">The second stage of a linked add-on release</description>
        <exit-transition transition_id="re-release" />
        <exit-transition transition_id="release-candidate" />
        <exit-transition transition_id="release-final" />
        <exit-transition transition_id="retract" />
        <exit-transition transition_id="hide" />
        <permission-map name="Access contents information"
                        acquired="True">
        </permission-map>
        <permission-map name="Modify portal content"
                        acquired="True">
        </permission-map>
        <permission-map name="View"
                        acquired="True">
        </permission-map>
    </state>

    <state state_id="final" title="Final Release" i18n:attributes="title">
        <description i18n:translate="">The final stage of a linked add-on release</description>
        <exit-transition transition_id="re-release" />
        <exit-transition transition_id="retract" />
        <exit-transition transition_id="hide" />
        <permission-map name="Access contents information"
                        acquired="True">
        </permission-map>
        <permission-map name="Modify portal content"
                        acquired="True">
        </permission-map>
        <permission-map name="View"
                        acquired="True">
        </permission-map>
    </state>

    <state state_id="hidden" title="Hidden" i18n:attributes="title">
        <description i18n:translate="">Hidden linked add-on release</description>
        <exit-transition transition_id="unhide" />
        <permission-map name="Access contents information"
                  acquired="False">
        <permission-role>Owner</permission-role>
        <permission-role>Manager</permission-role>
        <permission-role>Reader</permission-role>
        </permission-map>
        <permission-map name="Modify portal content"
                  acquired="True">
        </permission-map>
        <permission-map name="View" acquired="False">
        <permission-role>Owner</permission-role>
        <permission-role>Manager</permission-role>
        <permission-role>Reader</permission-role>
        </permission-map>
    </state>

    <state state_id="pre-release" title="Unreleased" i18n:attributes="title">
        <description i18n:translate="">Unreleased</description>
        <exit-transition transition_id="release-alpha"/>
        <exit-transition transition_id="release-beta"/>
        <exit-transition transition_id="release-candidate"/>
        <exit-transition transition_id="release-final"/>
        <exit-transition transition_id="hide"/>
        <permission-map name="Access contents information"
                  acquired="True">
        </permission-map>
        <permission-map name="Modify portal content"
                  acquired="True">
        </permission-map>
        <permission-map name="View"
                  acquired="True">
        </permission-map>
    </state>

    <state state_id="release-candidate" title="Release Candidate" i18n:attributes="title">
        <description i18n:translate="">Release Candidate</description>
        <exit-transition transition_id="re-release" />
        <exit-transition transition_id="release-final" />
        <exit-transition transition_id="retract" />
        <exit-transition transition_id="hide" />
          <permission-map name="Access contents information"
                        acquired="True">
        </permission-map>
        <permission-map name="Modify portal content"
                        acquired="True">
        </permission-map>
        <permission-map name="View"
                        acquired="True">
        </permission-map>
    </state>


    <transition transition_id="hide"
                title="Hide"
                new_state="hidden" trigger="USER" before_script=""
                after_script=""
                i18n:attributes="title">
        <description i18n:translate="">Hide this release</description>
        <action url="" category="workflow"
                i18n:translate="">Hide release</action>
        <guard>
            <guard-permission>Modify portal content</guard-permission>
        </guard>
    </transition>

    <transition transition_id="re-release"
                title="Re-release"
                new_state="" trigger="USER" before_script=""
                after_script=""
                i18n:attributes="title">
        <description i18n:translate="">re-release</description>
        <action url="" category="workflow"
                i18n:translate="">Re-Release</action>
        <guard>
            <guard-permission>Modify portal content</guard-permission>
        </guard>
    </transition>


    <transition transition_id="release-alpha"
             title="Release alpha"
             new_state="alpha" trigger="USER" before_script=""
             after_script=""
             i18n:attributes="title">
        <description i18n:translate="">Change the release stage to 'Release alpha'</description>
        <action url="" category="workflow"
             i18n:translate="">Release alpha</action>
        <guard>
             <guard-permission>Modify portal content</guard-permission>
        </guard>
    </transition>

    <transition transition_id="release-beta"
                title="Release beta"
                new_state="beta" trigger="USER" before_script=""
                after_script=""
                i18n:attributes="title">
        <description i18n:translate="">Change the release stage to 'Release beta'</description>
        <action url="" category="workflow"
                i18n:translate="">Release beta</action>
        <guard>
            <guard-permission>Modify portal content</guard-permission>
        </guard>
    </transition>

    <transition transition_id="release-candidate"
                title="Release-Candidate"
                new_state="release-candidate" trigger="USER" before_script=""
                after_script=""
                i18n:attributes="title">
        <description i18n:translate="">Release candidate</description>
        <action url="" category="workflow"
                i18n:translate="">Release candidate</action>
        <guard>
            <guard-permission>Modify portal content</guard-permission>
        </guard>
    </transition>

    <transition transition_id="release-final"
                title="Final Release"
                new_state="final" trigger="USER" before_script=""
                after_script=""
                i18n:attributes="title">
        <description i18n:translate="">Final release</description>
        <action url="" category="workflow"
                i18n:translate="">Final Release</action>
        <guard>
            <guard-permission>Modify portal content</guard-permission>
        </guard>
    </transition>

    <transition transition_id="retract" title="Retract"
                new_state="pre-release" trigger="USER"
                before_script=""
                after_script=""
                i18n:attributes="title">
        <description i18n:translate="">Retract release</description>
        <action url="" category="workflow"
                i18n:translate="">Retract release</action>
        <guard>
            <guard-permission>Modify portal content</guard-permission>
        </guard>
    </transition>

    <transition transition_id="unhide" title="Unhide"
                new_state="pre-release" trigger="USER"
                before_script=""
                after_script=""
                i18n:attributes="title">
        <description i18n:translate="">Unhide release project</description>
        <action url="" category="workflow"
                i18n:translate="">Unhide release</action>
        <guard>
            <guard-permission>Modify portal content</guard-permission>
        </guard>
    </transition>



</dc-workflow>
