<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:bproc="http://schemas.haulmont.com/bproc/bpmn" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.flowable.org/processdef">
  <process id="quick-start-refund" name="Quick start refund" isExecutable="true" flowable:candidateStarterGroups="all-users" bproc:candidateStarterGroupsValue="all-users">
    <documentation>A sample refund process</documentation>
    <startEvent id="startEvent1">
      <extensionElements>
        <bproc:formData type="input-dialog" openMode="DIALOG" businessKey="requestNumber">
          <bproc:formFields>
            <bproc:formField id="requestNumber" caption="Request number" type="string" editable="true" required="true" />
            <bproc:formField id="expenseAmount" caption="Expense amount" type="double" editable="true" required="true" />
            <bproc:formField id="expenseDate" caption="Expense date" type="date" editable="true" required="true" />
            <bproc:formField id="document" caption="Document" type="file" editable="true" required="true" />
            <bproc:formField id="manager" caption="Manager" type="user" editable="true" required="true">
              <bproc:formFieldProperty name="uiComponent" value="lookupField" />
            </bproc:formField>
          </bproc:formFields>
        </bproc:formData>
      </extensionElements>
      <outgoing>SequenceFlow_1onellk</outgoing>
    </startEvent>
    <sequenceFlow id="SequenceFlow_1onellk" sourceRef="startEvent1" targetRef="approval" />
    <userTask id="approval" name="Approval" flowable:assignee="${manager.id}" bproc:assigneeSource="processVariable" bproc:assigneeValue="manager">
      <extensionElements>
        <bproc:formData type="input-dialog" openMode="DIALOG">
          <bproc:formFields>
            <bproc:formField id="requestNumber" caption="Request number" type="string" editable="false" required="false" />
            <bproc:formField id="expenseAmount" caption="Expense amount" type="double" editable="false" required="false" />
            <bproc:formField id="expenseDate" caption="Expense date" type="date" editable="false" required="false" />
            <bproc:formField id="document" caption="Document" type="file" editable="false" required="false" />
            <bproc:formField id="comment" caption="Comment" type="multilineString" editable="true" required="false" />
          </bproc:formFields>
          <bproc:formOutcomes>
            <bproc:formOutcome id="approve" caption="Approve" icon="font-icon:CHECK" />
            <bproc:formOutcome id="reject" caption="Reject" icon="font-icon:BAN" />
          </bproc:formOutcomes>
        </bproc:formData>
      </extensionElements>
      <incoming>SequenceFlow_1onellk</incoming>
      <outgoing>SequenceFlow_0v7tc15</outgoing>
    </userTask>
    <exclusiveGateway id="ExclusiveGateway_0fh8kfj">
      <incoming>SequenceFlow_0v7tc15</incoming>
      <outgoing>SequenceFlow_11r5pei</outgoing>
      <outgoing>SequenceFlow_1xbcvdo</outgoing>
    </exclusiveGateway>
    <sequenceFlow id="SequenceFlow_0v7tc15" sourceRef="approval" targetRef="ExclusiveGateway_0fh8kfj" />
    <endEvent id="EndEvent_04w1kx4">
      <incoming>SequenceFlow_11r5pei</incoming>
    </endEvent>
    <sequenceFlow id="SequenceFlow_11r5pei" name="rejected" sourceRef="ExclusiveGateway_0fh8kfj" targetRef="EndEvent_04w1kx4">
      <extensionElements>
        <bproc:conditionDetails conditionSource="userTaskOutcome" conditionType="anyoneCompleted" userTaskId="approval" userTaskOutcome="reject" />
      </extensionElements>
      <conditionExpression xsi:type="tFormalExpression">${execution.getVariable('approval_result') != null &amp;&amp; bproc_UserTaskResults.containsOutcome(execution.getVariable('approval_result'), 'reject')}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="SequenceFlow_1xbcvdo" name="approved" sourceRef="ExclusiveGateway_0fh8kfj" targetRef="Task_068h84v">
      <extensionElements>
        <bproc:conditionDetails conditionSource="userTaskOutcome" conditionType="anyoneCompleted" userTaskId="approval" userTaskOutcome="approve" />
      </extensionElements>
      <conditionExpression xsi:type="tFormalExpression">${execution.getVariable('approval_result') != null &amp;&amp; bproc_UserTaskResults.containsOutcome(execution.getVariable('approval_result'), 'approve')}</conditionExpression>
    </sequenceFlow>
    <userTask id="Task_068h84v" name="Payment" flowable:candidateGroups="accountants" bproc:assigneeSource="expression" bproc:candidateGroupsValue="accountants">
      <extensionElements>
        <bproc:formData type="input-dialog" openMode="DIALOG">
          <bproc:formFields>
            <bproc:formField id="requestNumber" caption="Request number" type="string" editable="false" required="false" />
            <bproc:formField id="expenseAmount" caption="Expense amount" type="double" editable="false" required="false" />
            <bproc:formField id="expenseDate" caption="Expense date" type="date" editable="false" required="false" />
            <bproc:formField id="document" caption="Document" type="file" editable="false" required="false" />
          </bproc:formFields>
        </bproc:formData>
      </extensionElements>
      <incoming>SequenceFlow_1xbcvdo</incoming>
      <outgoing>SequenceFlow_04a6bqm</outgoing>
    </userTask>
    <endEvent id="EndEvent_1v5drsw">
      <incoming>SequenceFlow_04a6bqm</incoming>
    </endEvent>
    <sequenceFlow id="SequenceFlow_04a6bqm" sourceRef="Task_068h84v" targetRef="EndEvent_1v5drsw" />
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_process">
    <bpmndi:BPMNPlane id="BPMNPlane_process" bpmnElement="quick-start-refund">
      <bpmndi:BPMNShape id="BPMNShape_startEvent1" bpmnElement="startEvent1">
        <omgdc:Bounds x="129" y="36" width="30" height="30" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="SequenceFlow_1onellk_di" bpmnElement="SequenceFlow_1onellk">
        <omgdi:waypoint x="159" y="51" />
        <omgdi:waypoint x="209" y="51" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="UserTask_08pzh6a_di" bpmnElement="approval">
        <omgdc:Bounds x="209" y="11" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="ExclusiveGateway_0fh8kfj_di" bpmnElement="ExclusiveGateway_0fh8kfj" isMarkerVisible="true">
        <omgdc:Bounds x="387" y="26" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="SequenceFlow_0v7tc15_di" bpmnElement="SequenceFlow_0v7tc15">
        <omgdi:waypoint x="309" y="51" />
        <omgdi:waypoint x="387" y="51" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="EndEvent_04w1kx4_di" bpmnElement="EndEvent_04w1kx4">
        <omgdc:Bounds x="394" y="149" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="SequenceFlow_11r5pei_di" bpmnElement="SequenceFlow_11r5pei">
        <omgdi:waypoint x="412" y="76" />
        <omgdi:waypoint x="412" y="149" />
        <bpmndi:BPMNLabel>
          <omgdc:Bounds x="415" y="108" width="40" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="SequenceFlow_1xbcvdo_di" bpmnElement="SequenceFlow_1xbcvdo">
        <omgdi:waypoint x="437" y="51" />
        <omgdi:waypoint x="533" y="51" />
        <bpmndi:BPMNLabel>
          <omgdc:Bounds x="463" y="33" width="46" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="UserTask_01wg9o3_di" bpmnElement="Task_068h84v">
        <omgdc:Bounds x="533" y="11" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="EndEvent_1v5drsw_di" bpmnElement="EndEvent_1v5drsw">
        <omgdc:Bounds x="743" y="33" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="SequenceFlow_04a6bqm_di" bpmnElement="SequenceFlow_04a6bqm">
        <omgdi:waypoint x="633" y="51" />
        <omgdi:waypoint x="743" y="51" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
