<?xml version="1.0" encoding="UTF-8"?>

<!--  Nominated invitation -->

<process-definition xmlns="urn:jbpm.org:jpdl-3.1" 
   name="inwf:invitation-nominated">

   <swimlane name="initiator"/>
   
   <start-state name="start">
   
      <task name="inwf:inviteToSiteTask" swimlane="initiator" />

      <transition name="sendInvite" to="invitePending">
         <action class="org.alfresco.repo.invitation.site.SendInviteAction" />
      </transition>
   </start-state>

   <swimlane name="assignee">
      <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
         <actor>#{bpm_assignee.properties['cm:userName']}</actor>
      </assignment>
   </swimlane>

   <task-node name="invitePending">
      <task name="inwf:invitePendingTask" swimlane="assignee" />
      <transition name="accept" to="inviteAccepted">
         <action class="org.alfresco.repo.invitation.site.AcceptInviteAction"/>
      </transition>
      <transition name="reject" to="inviteRejected">
         <action class="org.alfresco.repo.invitation.site.RejectInviteAction"/>
      </transition>
      <transition name="cancel" to="end">
         <action class="org.alfresco.repo.invitation.site.CancelInviteAction"/>
      </transition>
   </task-node>

   <task-node name="inviteAccepted">
      <task name="inwf:acceptInviteTask" swimlane="initiator" />
      <transition name="end" to="end"/>
   </task-node>

   <task-node name="inviteRejected">
      <task name="inwf:rejectInviteTask" swimlane="initiator" />
      <transition name="end" to="end"/>
   </task-node>

   <end-state name="end" />

</process-definition>
