<?xml version="1.0"?>
<dc-workflow workflow_id="todo_workflow" title="Todo Workflow" description="Workflow for Tasks / Todo items" state_variable="review_state"         initial_state="open" manager_bypass="True" >
  <permission>Modify portal content</permission>
  <state state_id="done" title="Done" >
    <exit-transition transition_id="set_to_open" />
    <exit-transition transition_id="set_to_planned" />
  </state>
  <state state_id="open" title="Open" >
    <exit-transition transition_id="finish" />
    <exit-transition transition_id="set_to_planned" />
  </state>
  <state state_id="planned" title="Planned" >
    <exit-transition transition_id="finish" />
    <exit-transition transition_id="set_to_open" />
  </state>
  <transition transition_id="finish" title="Finish" new_state="done" trigger="USER" before_script="" after_script="" >
    <action url="%(content_url)s/content_status_modify?workflow_action=finish" category="workflow" icon="">Finish</action>
    <guard >
    </guard>
  </transition>
  <transition transition_id="set_to_open" title="Set to Open" new_state="open" trigger="USER" before_script="" after_script="" >
    <action url="%(content_url)s/content_status_modify?workflow_action=set_to_open" category="workflow" icon="">Set to Open</action>
    <guard >
    </guard>
  </transition>
  <transition transition_id="set_to_planned" title="Set to Planned" new_state="planned" trigger="USER" before_script="" after_script="" >
    <action url="%(content_url)s/content_status_modify?workflow_action=set_to_planned" category="workflow" icon="">Set to Planned</action>
    <guard >
    </guard>
  </transition>
  <variable variable_id="action" for_catalog="False" for_status="True" update_always="True" >
    <description>Previous transition</description>
    <default>
      <expression>transition/getId|nothing</expression>
    </default>
    <guard >
    </guard>
  </variable>
  <variable variable_id="actor" for_catalog="False" for_status="True" update_always="True" >
    <description>The ID of the user who performed the previous transition</description>
    <default>
      <expression>user/getId</expression>
    </default>
    <guard >
    </guard>
  </variable>
  <variable variable_id="comments" for_catalog="False" for_status="True" update_always="True" >
    <description>Comment about the last transition</description>
    <default>
      <expression>python:state_change.kwargs.get('comment', '')</expression>
    </default>
    <guard >
    </guard>
  </variable>
  <variable variable_id="review_history" for_catalog="False" for_status="False" update_always="False" >
    <description>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 variable_id="time" for_catalog="False" for_status="True" update_always="True" >
    <description>When the previous transition was performed</description>
    <default>
      <expression>state_change/getDateTime</expression>
    </default>
    <guard >
    </guard>
  </variable>
</dc-workflow>
