<?xml version="1.0"?>
<cps-workflow workflow_id="waeup_student_wf"
              title="CPS Workflow Definition"
              state_variable="review_state"
              meta_type="CPS Workflow">
 <permission>Modify portal content</permission>
 <permission>View</permission>
 <state state_id="admission_applied" title="">
  <exit-transition transition_id="pume_fail"/>
  <exit-transition transition_id="pume_pass"/>
 </state>
 <state state_id="admission_rejected" title="">
  <exit-transition transition_id="finally_reject"/>
 </state>
 <state state_id="admitted" title="">
  <exit-transition transition_id="enter_clearance_pin"/>
 </state>
 <state state_id="application_pin_entered" title="">
  <exit-transition transition_id="apply_for_admission"/>
  <permission-map name="Modify portal content"
                  acquired="True">
   <permission-role>Anonymous</permission-role>
  </permission-map>
  <permission-map name="View" acquired="True">
  </permission-map>
 </state>
 <state state_id="clearance_pin_entered" title="">
  <exit-transition transition_id="request_clearence"/>
 </state>
 <state state_id="cleared_and_validated" title="">
 </state>
 <state state_id="clearence_requested" title="">
  <exit-transition transition_id="clear_and_validate"/>
  <exit-transition transition_id="reject_clearance"/>
 </state>
 <state state_id="closed" title="">
  <exit-transition transition_id="open"/>
 </state>
 <state state_id="created" title="">
  <exit-transition transition_id="create_content"/>
  <exit-transition transition_id="enter_application_pin"/>
  <exit-transition transition_id="open"/>
  <permission-map name="Modify portal content"
                  acquired="False">
   <permission-role>Owner</permission-role>
   <permission-role>Manager</permission-role>
   <permission-role>SectionManager</permission-role>
  </permission-map>
  <permission-map name="View" acquired="True">
  </permission-map>
 </state>
 <state state_id="finally_rejected" title="">
 </state>
 <state state_id="opened" title="">
  <exit-transition transition_id="close"/>
  <permission-map name="Modify portal content"
                  acquired="True">
   <permission-role>Owner</permission-role>
  </permission-map>
  <permission-map name="View" acquired="True">
  </permission-map>
 </state>
 <state state_id="pume_failed" title="">
  <exit-transition transition_id="finally_reject"/>
 </state>
 <state state_id="pume_passed" title="">
  <exit-transition transition_id="admit"/>
  <exit-transition transition_id="reject_admission"/>
 </state>
 <transition transition_id="admit" title=""
             new_state="admitted" trigger="USER"
             before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
   <guard-role>AdmissionOfficer</guard-role>
  </guard>
 </transition>
 <transition transition_id="apply_for_admission" title=""
             new_state="admission_applied" trigger="USER"
             before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
   <guard-role>Owner</guard-role>
  </guard>
 </transition>
 <transition transition_id="clear_and_validate" title=""
             new_state="cleared_and_validated"
             trigger="USER" before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
   <guard-role>ClearanceOfficer</guard-role>
  </guard>
 </transition>
 <transition transition_id="close" title=""
             new_state="closed" trigger="USER"
             before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
  </guard>
 </transition>
 <transition transition_id="create" title=""
             new_state="created" trigger="USER"
             before_script="" after_script="">
  
  <guard>
  </guard>
  <transition-behavior behavior_id="allow-sub-create"/>
  <transition-behavior behavior_id="initial-create"/>
 </transition>
 <transition transition_id="create_content" title=""
             new_state="" trigger="USER" before_script=""
             after_script="">
  
  <guard>
  </guard>
  <transition-behavior behavior_id="allow-sub-create"/>
  <transition-behavior behavior_id="allow-sub-delete"/>
 </transition>
 <transition transition_id="enter_application_pin" title=""
             new_state="application_pin_entered"
             trigger="USER" before_script="" after_script="">
  
  <guard>
   <guard-permission>Modify portal content</guard-permission>
   <guard-permission></guard-permission>
  </guard>
 </transition>
 <transition transition_id="enter_clearance_pin" title=""
             new_state="clearance_pin_entered"
             trigger="USER" before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
   <guard-role>Owner</guard-role>
  </guard>
 </transition>
 <transition transition_id="finally_reject" title=""
             new_state="finally_rejected" trigger="USER"
             before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
   <guard-role>ClearanceOfficer</guard-role>
  </guard>
 </transition>
 <transition transition_id="open" title=""
             new_state="opened" trigger="USER"
             before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
  </guard>
 </transition>
 <transition transition_id="pume_fail" title=""
             new_state="pume_failed" trigger="USER"
             before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
   <guard-role>AdmissionOfficer</guard-role>
  </guard>
 </transition>
 <transition transition_id="pume_pass" title=""
             new_state="pume_passed" trigger="USER"
             before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
   <guard-role>AdmissionOfficer</guard-role>
  </guard>
 </transition>
 <transition transition_id="reject_admission" title=""
             new_state="admission_rejected" trigger="USER"
             before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
   <guard-role>AdmissionOfficer</guard-role>
  </guard>
 </transition>
 <transition transition_id="reject_clearance" title=""
             new_state="clearance_pin_entered"
             trigger="USER" before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
   <guard-role>ClearanceOfficer</guard-role>
  </guard>
 </transition>
 <transition transition_id="request_clearence" title=""
             new_state="clearence_requested" trigger="USER"
             before_script="" after_script="">
  
  <guard>
   <guard-role>Manager</guard-role>
   <guard-role>SectionManager</guard-role>
   <guard-role>Owner</guard-role>
  </guard>
 </transition>
 <script script_id="open_application_personal"
         type="Script (Python)"
         filename="workflows/waeup_student_wf/scripts/open_application_personal.py"/>
</cps-workflow>
