<?xml version="1.0" encoding="utf-8"?>
<dc-workflow xmlns:i18n="http://xml.zope.org/namespaces/i18n"
             description="Workflow for Adaptive Case Management"
             initial_state="new"
             manager_bypass="True"
             state_variable="review_state"
             title="Case Workflow"
             workflow_id="case_workflow"
             i18n:attributes="title; description"
             i18n:domain="ploneintranet"
>

  <!-- NOTE TO INTEGRATORS AND DEVELOPERS

       To provide a custom case workflow in your own project, you can
       either override this case_workflow in your own policy product,
       and/or add additional workflows for ploneintranet.workspace.case,
       see workflows.xml.

       Cases bypass most of the normal ploneintranet.workspace security machinery.
       Instead they're completely configured via the workflow.
       Any permissions NOT managed here with 'acquired="False"' will be
       acquired, which is NOT what you want since it opens up the case
       for non-members.

       Basic rule of thumb for creating a secure case workflow:
       - for every workflow state the case can have:
       - explicitly manage ALL permissions listed below
       - always set acquired="False"
       - use the special local roles TeamMember and TeamManager
         provided automatically by our collective.workspace backend

       For clarity's sake roles that are not granted a specific permission
       in a specific state are commented out, to make the policy most
       explicit and readable, and a sane base for customization.

       The example workflow below is configured as follows:
       - TeamMember is not allowed to change workflow state, except
         from 'prepare' to 'complete'
       - TeamMember cannot add or modify content during the 'complete', 'audit',
         'propose' sequence (to protect quality control before decision)
       - The 'archive' and 'rejected' states are readonly

       The 'reject' transition is not supported in the frontend yet,
       but already included here for future compatibility.

       Please keep the variables at the end, they're used by the GUI.
       Make sure to update the metromap_transitions structure if you
       change any states or transitions below.
  -->

  <permission>ploneintranet.workspace: Manage workspace</permission>
  <permission>Access contents information</permission>
  <permission>View</permission>
  <permission>Modify portal content</permission>
  <permission>Delete objects</permission>
  <permission>Add portal content</permission>
  <permission>Plone Social: Add Microblog Status Update</permission>
  <permission>Plone Social: View Microblog Status Update</permission>
  <permission>Plone Social: Modify Microblog Status Update</permission>
  <permission>Plone Social: Delete Microblog Status Update</permission>
  <!--
      Modify Own Status Update and Delete Own Status Update are acquired
      unchanged from sitewide configuration.
  -->

  <state state_id="new"
         title="New"
         i18n:attributes="title"
  >
    <description i18n:translate="">Basic data is being gathered and added to the case.</description>
    <exit-transition transition_id="assign" />
    <exit-transition transition_id="freeze" />
    <exit-transition transition_id="reject" />
    <permission-map acquired="False"
                    name="ploneintranet.workspace: Manage workspace"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!--<permission-role>TeamMember</permission-role>-->
    </permission-map>
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Delete objects"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Add portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Add Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: View Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Modify Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Delete Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
  </state>

  <state state_id="prepare"
         title="Prepare"
         i18n:attributes="title"
  >
    <description i18n:translate="">Supporting documentation is being added to the case.</description>
    <exit-transition transition_id="reset" />
    <exit-transition transition_id="finalise" />
    <exit-transition transition_id="reject" />
    <exit-transition transition_id="freeze" />
    <permission-map acquired="False"
                    name="ploneintranet.workspace: Manage workspace"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Delete objects"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Add portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Add Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: View Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Modify Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Delete Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
  </state>

  <state state_id="complete"
         title="Complete"
         i18n:attributes="title"
  >
    <description i18n:translate="">All data is complete, the case is ready for consideration.</description>
    <exit-transition transition_id="re_assign" />
    <exit-transition transition_id="request" />
    <exit-transition transition_id="reject" />
    <exit-transition transition_id="freeze" />
    <permission-map acquired="False"
                    name="ploneintranet.workspace: Manage workspace"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Delete objects"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Add portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Add Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: View Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Modify Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Delete Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
  </state>

  <state state_id="audit"
         title="Audit"
         i18n:attributes="title"
  >
    <description i18n:translate="">Impact analysis and completeness checks.</description>
    <exit-transition transition_id="re_finalise" />
    <exit-transition transition_id="submit" />
    <exit-transition transition_id="reject" />
    <exit-transition transition_id="freeze" />
    <permission-map acquired="False"
                    name="ploneintranet.workspace: Manage workspace"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Delete objects"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Add portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Add Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: View Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Modify Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Delete Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
  </state>

  <state state_id="propose"
         title="Propose"
         i18n:attributes="title"
  >
    <description i18n:translate="">The case can be scheduled for a decision.</description>
    <exit-transition transition_id="re_request" />
    <exit-transition transition_id="decide" />
    <exit-transition transition_id="reject" />
    <exit-transition transition_id="freeze" />
    <permission-map acquired="False"
                    name="ploneintranet.workspace: Manage workspace"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Delete objects"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Add portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Add Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: View Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Modify Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Delete Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
  </state>

  <state state_id="decided"
         title="Decided"
         i18n:attributes="title"
  >
    <description i18n:translate="">A decision has been reached, and needs to be implemented.</description>
    <exit-transition transition_id="re_submit" />
    <exit-transition transition_id="close" />
    <exit-transition transition_id="freeze" />
    <permission-map acquired="False"
                    name="ploneintranet.workspace: Manage workspace"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Delete objects"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Add portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Add Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: View Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Modify Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Delete Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
  </state>

  <state state_id="closed"
         title="Closed"
         i18n:attributes="title"
  >
    <description i18n:translate="">The case is no longer active, and being prepared for archival.</description>
    <exit-transition transition_id="re_decide" />
    <exit-transition transition_id="archive" />
    <exit-transition transition_id="freeze" />
    <permission-map acquired="False"
                    name="ploneintranet.workspace: Manage workspace"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Delete objects"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Add portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Add Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: View Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Modify Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Delete Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <!--permission-role>TeamMember</permission-role-->
      <permission-role>TeamManager</permission-role>
    </permission-map>
  </state>

  <state state_id="archived"
         title="Archived"
         i18n:attributes="title"
  >
    <description i18n:translate="">The case has been archived in read-only mode.</description>
    <exit-transition transition_id="re_close" />
    <exit-transition transition_id="freeze" />
    <permission-map acquired="False"
                    name="ploneintranet.workspace: Manage workspace"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <!-- <permission-role>Manager</permission-role> -->
      <!-- <permission-role>Site Administrator</permission-role> -->
      <!-- <permission-role>TeamManager</permission-role> -->
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Delete objects"
    >
      <!-- <permission-role>Manager</permission-role> -->
      <!-- <permission-role>Site Administrator</permission-role> -->
      <!-- <permission-role>TeamManager</permission-role> -->
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Add portal content"
    >
      <!-- <permission-role>Manager</permission-role> -->
      <!-- <permission-role>Site Administrator</permission-role> -->
      <!-- <permission-role>TeamManager</permission-role> -->
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Add Microblog Status Update"
    >
      <!-- <permission-role>Manager</permission-role> -->
      <!-- <permission-role>Site Administrator</permission-role> -->
      <!-- <permission-role>TeamManager</permission-role> -->
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: View Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Modify Microblog Status Update"
    >
      <!-- permission-role>Manager</permission-role -->
      <!-- permission-role>Site Administrator</permission-role -->
      <!-- permission-role>TeamMember</permission-role -->
      <!-- permission-role>TeamManager</permission-role -->
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Delete Microblog Status Update"
    >
      <!-- permission-role>Manager</permission-role -->
      <!-- permission-role>Site Administrator</permission-role -->
      <!--permission-role>TeamMember</permission-role-->
      <!-- permission-role>TeamManager</permission-role -->
    </permission-map>
  </state>

  <state state_id="frozen"
         title="Frozen"
         i18n:attributes="title"
  >
    <description i18n:translate="">The case has been put on hold.</description>
    <exit-transition transition_id="re_assign" />
    <exit-transition transition_id="re_close" />
    <exit-transition transition_id="re_decide" />
    <exit-transition transition_id="re_finalise" />
    <exit-transition transition_id="re_reject" />
    <exit-transition transition_id="re_request" />
    <exit-transition transition_id="re_reset" />
    <exit-transition transition_id="re_submit" />
    <permission-map acquired="False"
                    name="ploneintranet.workspace: Manage workspace"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Delete objects"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Add portal content"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Add Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: View Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
  </state>

  <state state_id="rejected"
         title="Rejected"
         i18n:attributes="title"
  >
    <description i18n:translate="">The case has been rejected before a decision was reached.</description>
    <exit-transition transition_id="reset" />
    <exit-transition transition_id="freeze" />
    <permission-map acquired="False"
                    name="ploneintranet.workspace: Manage workspace"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Access contents information"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="View"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
      <permission-role>TeamGuest</permission-role>
    </permission-map>
    <permission-map acquired="False"
                    name="Modify portal content"
    >
      <!-- <permission-role>Manager</permission-role> -->
      <!-- <permission-role>Site Administrator</permission-role> -->
      <!-- <permission-role>TeamManager</permission-role> -->
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Delete objects"
    >
      <!-- <permission-role>Manager</permission-role> -->
      <!-- <permission-role>Site Administrator</permission-role> -->
      <!-- <permission-role>TeamManager</permission-role> -->
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Add portal content"
    >
      <!-- <permission-role>Manager</permission-role> -->
      <!-- <permission-role>Site Administrator</permission-role> -->
      <!-- <permission-role>TeamManager</permission-role> -->
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: Add Microblog Status Update"
    >
      <!-- <permission-role>Manager</permission-role> -->
      <!-- <permission-role>Site Administrator</permission-role> -->
      <!-- <permission-role>TeamManager</permission-role> -->
      <!-- <permission-role>TeamMember</permission-role> -->
    </permission-map>
    <permission-map acquired="False"
                    name="Plone Social: View Microblog Status Update"
    >
      <permission-role>Manager</permission-role>
      <permission-role>Site Administrator</permission-role>
      <permission-role>TeamManager</permission-role>
      <permission-role>TeamMember</permission-role>
    </permission-map>
  </state>



  <transition after_script=""
              before_script=""
              new_state="new"
              title="Reset"
              transition_id="reset"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Reset the case to 'new'.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=reset"
            i18n:translate=""
    >Reset</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="prepare"
              title="Assign"
              transition_id="assign"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Assign the case to the responsible department.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=assign"
            i18n:translate=""
    >Assign</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
      <guard-expression>here/case_workflow_guard</guard-expression>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="prepare"
              title="Assign"
              transition_id="re_assign"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Re-Assign the case to the responsible department.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=assign"
            i18n:translate=""
    >Assign</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="complete"
              title="Finalise"
              transition_id="finalise"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Verify that the case is complete.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=finalise"
            i18n:translate=""
    >Finalise</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
      <guard-expression>here/case_workflow_guard</guard-expression>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="complete"
              title="Finalise"
              transition_id="re_finalise"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Re-Verify that the case is complete.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=finalise"
            i18n:translate=""
    >Finalise</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="audit"
              title="Request"
              transition_id="request"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Finish handling by the department, mark as ready for audit.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=request"
            i18n:translate=""
    >Request</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
      <guard-expression>here/case_workflow_guard</guard-expression>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="audit"
              title="Request"
              transition_id="re_request"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Re-Finish handling by the department, mark as ready for audit.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=request"
            i18n:translate=""
    >Request</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="propose"
              title="Submit"
              transition_id="submit"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Submit the case for decision by the council.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=submit"
            i18n:translate=""
    >Submit</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
      <guard-expression>here/case_workflow_guard</guard-expression>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="propose"
              title="Submit"
              transition_id="re_submit"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Re-Submit the case for decision by the council.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=submit"
            i18n:translate=""
    >Submit</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="decided"
              title="Decide"
              transition_id="decide"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Accept or deny the case.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=decide"
            i18n:translate=""
    >Decide</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
      <guard-expression>here/case_workflow_guard</guard-expression>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="decided"
              title="Decide"
              transition_id="re_decide"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Re-Accept or deny the case.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=decide"
            i18n:translate=""
    >Decide</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="closed"
              title="Close the Case"
              transition_id="close"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Close the case.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=close"
            i18n:translate=""
    >Close the Case</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
      <guard-expression>here/case_workflow_guard</guard-expression>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="closed"
              title="Close the Case"
              transition_id="re_close"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Re-Close the case.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=close"
            i18n:translate=""
    >Close the Case</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="archived"
              title="Archive"
              transition_id="archive"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Mark the case as done and file away.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=archive"
            i18n:translate=""
    >Archive</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
      <guard-expression>here/case_workflow_guard</guard-expression>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="rejected"
              title="Reject"
              transition_id="reject"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Reject the case.</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=reject"
            i18n:translate=""
    >Reject</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
    </guard>
  </transition>

  <transition after_script=""
              before_script=""
              new_state="frozen"
              title="Freeze"
              transition_id="freeze"
              trigger="USER"
              i18n:attributes="title"
  >
    <description i18n:translate="">Put the Case on hold</description>
    <action category="workflow"
            icon=""
            url="%(content_url)s/content_status_modify?workflow_action=freeze"
            i18n:translate=""
    >Freeze</action>
    <guard>
      <guard-permission>ploneintranet.workspace: Manage workspace</guard-permission>
    </guard>
  </transition>


  <variable for_catalog="False"
            for_status="True"
            update_always="True"
            variable_id="action"
  >
    <description i18n:translate="">Previous transition</description>
    <default>
      <expression>transition/getId|nothing</expression>
    </default>
    <guard>
</guard>
  </variable>

  <variable for_catalog="False"
            for_status="True"
            update_always="True"
            variable_id="actor"
  >
    <description i18n:translate="">The ID of the user who performed the previous transition</description>
    <default>
      <expression>user/getId</expression>
    </default>
    <guard>
</guard>
  </variable>

  <variable for_catalog="False"
            for_status="True"
            update_always="True"
            variable_id="comments"
  >
    <description i18n:translate="">Comment about the last transition</description>
    <default>
      <expression>python:state_change.kwargs.get('comment', '')</expression>
    </default>
    <guard>
</guard>
  </variable>

  <variable for_catalog="False"
            for_status="False"
            update_always="False"
            variable_id="review_history"
  >
    <description i18n:translate="">Provides access to workflow history</description>
    <default>
      <expression>state_change/getHistory</expression>
    </default>
    <guard>
      <guard-permission>Request review</guard-permission>
      <guard-permission>Review portal content</guard-permission>
    </guard>
  </variable>

  <variable for_catalog="False"
            for_status="True"
            update_always="True"
            variable_id="time"
  >
    <description i18n:translate="">When the previous transition was performed</description>
    <default>
      <expression>state_change/getDateTime</expression>
    </default>
    <guard>
</guard>
  </variable>

  <variable for_catalog="False"
            for_status="True"
            update_always="True"
            variable_id="metromap_transitions"
  >
    <description i18n:translate="">A list of dicts which order the workflow states along with the next transition in the sequence, used for the metromap</description>
    <default>
      <expression>python:[
      {'state': 'new', 'next_transition': 'assign', 'reopen_transition': 'reset'},
      {'state': 'prepare', 'next_transition':'finalise', 'reopen_transition': 're_assign'},
      {'state': 'complete', 'next_transition': 'request', 'reopen_transition': 're_finalise'},
      {'state': 'audit', 'next_transition': 'submit', 'reopen_transition': 're_request'},
      {'state': 'propose', 'next_transition': 'decide', 'reopen_transition': 're_submit'},
      {'state': 'decided', 'next_transition': 'close', 'reopen_transition': 're_decide'},
      {'state': 'closed', 'next_transition': 'archive', 'reopen_transition': 're_close'},
      {'state': 'archived'}
        ]</expression>
    </default>
    <guard>
</guard>
  </variable>
  <variable for_catalog="False"
            for_status="True"
            update_always="True"
            variable_id="frozen_state"
  >
    <description i18n:translate="">Which workflow state is used for the frozen state</description>
    <default>
      <expression>string:frozen</expression>
    </default>
    <guard>
</guard>
  </variable>
  <variable for_catalog="False"
            for_status="False"
            update_always="True"
            variable_id="transition_icons"
  >
    <description i18n:translate="">Each transition can have its own icon.</description>
    <default>
      <expression>python:{
      'assign': 'icon-right-hand',
      'finalise': 'icon-pin',
      'request': 'icon-right-circle',
      'submit': 'icon-right-circle',
      'decide': 'icon-hammer',
      'close': 'icon-cancel-circle',
      'archive': 'icon-archive',
        }</expression>
    </default>
    <guard>
</guard>
  </variable>
</dc-workflow>
