<?xml version="1.0" encoding="UTF-8"?> 
<definitions id="Definition"
             typeLanguage="http://www.java.com/javaTypes"
             expressionLanguage="http://www.mvel.org/2.0"
             xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
             xmlns:g="http://www.jboss.org/drools/flow/gpd"
             xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
             xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
             xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
             xmlns:tns="http://www.jboss.org/drools"
             targetNamespace="">

  <itemDefinition id="_userIdItem" structureRef="String" />
  <itemDefinition id="_descriptionItem" structureRef="String" />
  <itemDefinition id="_dateItem" structureRef="String" />
  <itemDefinition id="_resultItem" structureRef="String" />
  <itemDefinition id="_commentItem" structureRef="String" />
  <itemDefinition id="_resultUserItem" structureRef="String" />
  <itemDefinition id="_resultManagerItem" structureRef="String" />

  <process processType="Private" isExecutable="true" id="com.sample.humantask" name="HumanTask" tns:packageName="defaultPackage" >

    <!-- process variables -->
    <property id="userId" itemSubjectRef="_userIdItem"/>
    <property id="description" itemSubjectRef="_descriptionItem"/>
    <property id="date" itemSubjectRef="_dateItem"/>
    <property id="result" itemSubjectRef="_resultItem"/>
    <property id="comment" itemSubjectRef="_commentItem"/>
    <property id="resultUser" itemSubjectRef="_resultUserItem"/>
    <property id="resultManager" itemSubjectRef="_resultManagerItem"/>

    <laneSet>
      <lane name="sales-rep" >
        <flowNodeRef>_2</flowNodeRef>
        <flowNodeRef>_5</flowNodeRef>
        <flowNodeRef>_11</flowNodeRef>
      </lane>
    </laneSet>

    <!-- nodes -->
    <startEvent id="_1" name="Start" />
    <userTask id="_2" name="Review" >
      <ioSpecification>
        <dataInput id="_2_descriptionInput" name="description" />
        <dataInput id="_2_userIdInput" name="userId" />
        <dataInput id="_2_dateInput" name="date" />
        <dataInput id="_2_TaskNameInput" name="TaskName" />
        <dataInput id="_2_GroupIdInput" name="GroupId" />
        <dataOutput id="_2_commentOutput" name="comment" />
        <dataOutput id="_2_outcomeOutput" name="outcome" />
        <inputSet>
          <dataInputRefs>_2_descriptionInput</dataInputRefs>
          <dataInputRefs>_2_userIdInput</dataInputRefs>
          <dataInputRefs>_2_dateInput</dataInputRefs>
          <dataInputRefs>_2_TaskNameInput</dataInputRefs>
          <dataInputRefs>_2_GroupIdInput</dataInputRefs>
        </inputSet>
        <outputSet>
          <dataOutputRefs>_2_commentOutput</dataOutputRefs>
          <dataOutputRefs>_2_outcomeOutput</dataOutputRefs>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <sourceRef>description</sourceRef>
        <targetRef>_2_descriptionInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>userId</sourceRef>
        <targetRef>_2_userIdInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>date</sourceRef>
        <targetRef>_2_dateInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_2_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Request Review</from>
          <to xsi:type="tFormalExpression">_2_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_2_GroupIdInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">sales</from>
          <to xsi:type="tFormalExpression">_2_GroupIdInput</to>
        </assignment>
      </dataInputAssociation>
      <dataOutputAssociation>
        <sourceRef>_2_commentOutput</sourceRef>
        <targetRef>comment</targetRef>
      </dataOutputAssociation>
      <dataOutputAssociation>
        <sourceRef>_2_outcomeOutput</sourceRef>
        <targetRef>result</targetRef>
      </dataOutputAssociation>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression></formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
    </userTask>
    <intermediateCatchEvent id="_4" name="Timer" >
      <timerEventDefinition>
        <timeCycle xsi:type="tFormalExpression">1m###1m</timeCycle>
      </timerEventDefinition>
    </intermediateCatchEvent>
    <userTask id="_5" name="Reminder" >
      <ioSpecification>
        <dataInput id="_5_resultInput" name="result" />
        <dataInput id="_5_descriptionInput" name="description" />
        <dataInput id="_5_userIdInput" name="userId" />
        <dataInput id="_5_commentInput" name="comment" />
        <dataInput id="_5_dateInput" name="date" />
        <dataInput id="_5_TaskNameInput" name="TaskName" />
        <inputSet>
          <dataInputRefs>_5_resultInput</dataInputRefs>
          <dataInputRefs>_5_descriptionInput</dataInputRefs>
          <dataInputRefs>_5_userIdInput</dataInputRefs>
          <dataInputRefs>_5_commentInput</dataInputRefs>
          <dataInputRefs>_5_dateInput</dataInputRefs>
          <dataInputRefs>_5_TaskNameInput</dataInputRefs>
        </inputSet>
        <outputSet>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <sourceRef>result</sourceRef>
        <targetRef>_5_resultInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>description</sourceRef>
        <targetRef>_5_descriptionInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>userId</sourceRef>
        <targetRef>_5_userIdInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>comment</sourceRef>
        <targetRef>_5_commentInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>date</sourceRef>
        <targetRef>_5_dateInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_5_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Request Reminder</from>
          <to xsi:type="tFormalExpression">_5_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
    </userTask>
    <endEvent id="_6" name="End" />
    <parallelGateway id="_8" name="Gateway" gatewayDirection="Converging" />
    <userTask id="_9" name="Manager Approval" >
      <ioSpecification>
        <dataInput id="_9_resultInput" name="result" />
        <dataInput id="_9_descriptionInput" name="description" />
        <dataInput id="_9_userIdInput" name="userId" />
        <dataInput id="_9_commentInput" name="comment" />
        <dataInput id="_9_dateInput" name="date" />
        <dataInput id="_9_TaskNameInput" name="TaskName" />
        <dataInput id="_9_GroupIdInput" name="GroupId" />
        <dataOutput id="_9_outcomeOutput" name="outcome" />
        <inputSet>
          <dataInputRefs>_9_resultInput</dataInputRefs>
          <dataInputRefs>_9_descriptionInput</dataInputRefs>
          <dataInputRefs>_9_userIdInput</dataInputRefs>
          <dataInputRefs>_9_commentInput</dataInputRefs>
          <dataInputRefs>_9_dateInput</dataInputRefs>
          <dataInputRefs>_9_TaskNameInput</dataInputRefs>
          <dataInputRefs>_9_GroupIdInput</dataInputRefs>
        </inputSet>
        <outputSet>
          <dataOutputRefs>_9_outcomeOutput</dataOutputRefs>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <sourceRef>result</sourceRef>
        <targetRef>_9_resultInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>description</sourceRef>
        <targetRef>_9_descriptionInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>userId</sourceRef>
        <targetRef>_9_userIdInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>comment</sourceRef>
        <targetRef>_9_commentInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>date</sourceRef>
        <targetRef>_9_dateInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_9_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Request Approval</from>
          <to xsi:type="tFormalExpression">_9_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_9_GroupIdInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">PM</from>
          <to xsi:type="tFormalExpression">_9_GroupIdInput</to>
        </assignment>
      </dataInputAssociation>
      <dataOutputAssociation>
        <sourceRef>_9_outcomeOutput</sourceRef>
        <targetRef>resultManager</targetRef>
      </dataOutputAssociation>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression></formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
    </userTask>
    <parallelGateway id="_10" name="Gateway" gatewayDirection="Diverging" />
    <userTask id="_11" name="Notification" >
      <ioSpecification>
        <dataInput id="_11_resultInput" name="result" />
        <dataInput id="_11_resultUserInput" name="resultUser" />
        <dataInput id="_11_resultManagerInput" name="resultManager" />
        <dataInput id="_11_descriptionInput" name="description" />
        <dataInput id="_11_userIdInput" name="userId" />
        <dataInput id="_11_commentInput" name="comment" />
        <dataInput id="_11_dateInput" name="date" />
        <dataInput id="_11_TaskNameInput" name="TaskName" />
        <inputSet>
          <dataInputRefs>_11_resultInput</dataInputRefs>
          <dataInputRefs>_11_resultUserInput</dataInputRefs>
          <dataInputRefs>_11_resultManagerInput</dataInputRefs>
          <dataInputRefs>_11_descriptionInput</dataInputRefs>
          <dataInputRefs>_11_userIdInput</dataInputRefs>
          <dataInputRefs>_11_commentInput</dataInputRefs>
          <dataInputRefs>_11_dateInput</dataInputRefs>
          <dataInputRefs>_11_TaskNameInput</dataInputRefs>
        </inputSet>
        <outputSet>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <sourceRef>result</sourceRef>
        <targetRef>_11_resultInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>resultUser</sourceRef>
        <targetRef>_11_resultUserInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>resultManager</sourceRef>
        <targetRef>_11_resultManagerInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>description</sourceRef>
        <targetRef>_11_descriptionInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>userId</sourceRef>
        <targetRef>_11_userIdInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>comment</sourceRef>
        <targetRef>_11_commentInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>date</sourceRef>
        <targetRef>_11_dateInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_11_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Request Notification</from>
          <to xsi:type="tFormalExpression">_11_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
    </userTask>
    <endEvent id="_12" name="End" >
        <terminateEventDefinition/>
    </endEvent>
    <userTask id="_13" name="User Approval" >
      <ioSpecification>
        <dataInput id="_13_resultInput" name="result" />
        <dataInput id="_13_descriptionInput" name="description" />
        <dataInput id="_13_userIdInput" name="userId" />
        <dataInput id="_13_commentInput" name="comment" />
        <dataInput id="_13_dateInput" name="date" />
        <dataInput id="_13_TaskNameInput" name="TaskName" />
        <dataOutput id="_13_outcomeOutput" name="outcome" />
        <inputSet>
          <dataInputRefs>_13_resultInput</dataInputRefs>
          <dataInputRefs>_13_descriptionInput</dataInputRefs>
          <dataInputRefs>_13_userIdInput</dataInputRefs>
          <dataInputRefs>_13_commentInput</dataInputRefs>
          <dataInputRefs>_13_dateInput</dataInputRefs>
          <dataInputRefs>_13_TaskNameInput</dataInputRefs>
        </inputSet>
        <outputSet>
          <dataOutputRefs>_13_outcomeOutput</dataOutputRefs>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <sourceRef>result</sourceRef>
        <targetRef>_13_resultInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>description</sourceRef>
        <targetRef>_13_descriptionInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>userId</sourceRef>
        <targetRef>_13_userIdInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>comment</sourceRef>
        <targetRef>_13_commentInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <sourceRef>date</sourceRef>
        <targetRef>_13_dateInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_13_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Request Approval</from>
          <to xsi:type="tFormalExpression">_13_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataOutputAssociation>
        <sourceRef>_13_outcomeOutput</sourceRef>
        <targetRef>resultUser</targetRef>
      </dataOutputAssociation>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>#{userId}</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
    </userTask>
    <scriptTask id="_14" name="Time" >
      <script>kcontext.setVariable("date", new java.util.Date());</script>
    </scriptTask>

    <!-- connections -->
    <sequenceFlow id="_14-_2" sourceRef="_14" targetRef="_2" />
    <sequenceFlow id="_10-_4" sourceRef="_10" targetRef="_4" />
    <sequenceFlow id="_4-_5" sourceRef="_4" targetRef="_5" />
    <sequenceFlow id="_5-_6" sourceRef="_5" targetRef="_6" />
    <sequenceFlow id="_9-_8" sourceRef="_9" targetRef="_8" />
    <sequenceFlow id="_13-_8" sourceRef="_13" targetRef="_8" />
    <sequenceFlow id="_10-_9" sourceRef="_10" targetRef="_9" />
    <sequenceFlow id="_2-_10" sourceRef="_2" targetRef="_10" />
    <sequenceFlow id="_8-_11" sourceRef="_8" targetRef="_11" />
    <sequenceFlow id="_11-_12" sourceRef="_11" targetRef="_12" />
    <sequenceFlow id="_10-_13" sourceRef="_10" targetRef="_13" />
    <sequenceFlow id="_1-_14" sourceRef="_1" targetRef="_14" />

  </process>

  <bpmndi:BPMNDiagram>
    <bpmndi:BPMNPlane bpmnElement="com.sample.humantask" >
      <bpmndi:BPMNShape bpmnElement="_1" >
        <dc:Bounds x="7" y="87" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2" >
        <dc:Bounds x="170" y="86" width="79" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_4" >
        <dc:Bounds x="310" y="260" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_5" >
        <dc:Bounds x="390" y="261" width="100" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_6" >
        <dc:Bounds x="519" y="260" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_8" >
        <dc:Bounds x="583" y="83" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_9" >
        <dc:Bounds x="358" y="125" width="182" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_10" >
        <dc:Bounds x="265" y="85" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_11" >
        <dc:Bounds x="662" y="83" width="118" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_12" >
        <dc:Bounds x="805" y="82" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_13" >
        <dc:Bounds x="375" y="32" width="146" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_14" >
        <dc:Bounds x="76" y="86" width="69" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="_14-_2" >
        <di:waypoint x="110" y="110" />
        <di:waypoint x="209" y="110" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_10-_4" >
        <di:waypoint x="289" y="109" />
        <di:waypoint x="289" y="284" />
        <di:waypoint x="334" y="284" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_4-_5" >
        <di:waypoint x="334" y="284" />
        <di:waypoint x="440" y="285" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_5-_6" >
        <di:waypoint x="440" y="285" />
        <di:waypoint x="543" y="284" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_9-_8" >
        <di:waypoint x="449" y="149" />
        <di:waypoint x="607" y="149" />
        <di:waypoint x="607" y="107" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_13-_8" >
        <di:waypoint x="448" y="56" />
        <di:waypoint x="607" y="56" />
        <di:waypoint x="607" y="107" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_10-_9" >
        <di:waypoint x="289" y="109" />
        <di:waypoint x="289" y="148" />
        <di:waypoint x="449" y="149" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-_10" >
        <di:waypoint x="209" y="110" />
        <di:waypoint x="289" y="109" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_8-_11" >
        <di:waypoint x="607" y="107" />
        <di:waypoint x="721" y="107" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_11-_12" >
        <di:waypoint x="721" y="107" />
        <di:waypoint x="829" y="106" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_10-_13" >
        <di:waypoint x="289" y="109" />
        <di:waypoint x="289" y="55" />
        <di:waypoint x="448" y="56" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_1-_14" >
        <di:waypoint x="31" y="111" />
        <di:waypoint x="110" y="110" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>

</definitions>