<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
  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:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:getriebe="https://tokenjanitor.github.io/getriebe/bpmn/extensions/v1"
  targetNamespace="urn:getriebe:tutorial"
  expressionLanguage="https://tokenjanitor.github.io/getriebe/languages/expression/v1">
  <bpmn:itemDefinition id="BooleanValue" structureRef="xsd:boolean" />
  <bpmn:resource id="reviewer" name="Reviewer" />
  <bpmn:process id="documentReview" name="Document review" isExecutable="true">
    <bpmn:dataObject id="detailed" itemSubjectRef="BooleanValue" />
    <bpmn:startEvent id="start" name="Received" />
    <bpmn:exclusiveGateway id="choose" name="Detailed?" gatewayDirection="Diverging" default="summaryPath" />
    <bpmn:userTask id="reviewFull" name="Review full document">
      <bpmn:potentialOwner><bpmn:resourceRef>reviewer</bpmn:resourceRef></bpmn:potentialOwner>
    </bpmn:userTask>
    <bpmn:userTask id="reviewSummary" name="Review summary">
      <bpmn:potentialOwner><bpmn:resourceRef>reviewer</bpmn:resourceRef></bpmn:potentialOwner>
    </bpmn:userTask>
    <bpmn:exclusiveGateway id="merge" name="Merge" gatewayDirection="Converging" />
    <bpmn:parallelGateway id="split" name="Start both" gatewayDirection="Diverging" />
    <bpmn:userTask id="checkReferences" name="Check references">
      <bpmn:potentialOwner><bpmn:resourceRef>reviewer</bpmn:resourceRef></bpmn:potentialOwner>
    </bpmn:userTask>
    <bpmn:userTask id="fileDocument" name="File document">
      <bpmn:potentialOwner><bpmn:resourceRef>reviewer</bpmn:resourceRef></bpmn:potentialOwner>
    </bpmn:userTask>
    <bpmn:parallelGateway id="join" name="Both finished" gatewayDirection="Converging" />
    <bpmn:endEvent id="end" name="Finished" />
    <bpmn:sequenceFlow id="begin" sourceRef="start" targetRef="choose" />
    <bpmn:sequenceFlow id="detailedPath" sourceRef="choose" targetRef="reviewFull" name="Detailed">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">detailed</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="summaryPath" sourceRef="choose" targetRef="reviewSummary" name="Summary" />
    <bpmn:sequenceFlow id="fullReviewed" sourceRef="reviewFull" targetRef="merge" />
    <bpmn:sequenceFlow id="summaryReviewed" sourceRef="reviewSummary" targetRef="merge" />
    <bpmn:sequenceFlow id="startChecks" sourceRef="merge" targetRef="split" />
    <bpmn:sequenceFlow id="startReferences" sourceRef="split" targetRef="checkReferences" />
    <bpmn:sequenceFlow id="startFiling" sourceRef="split" targetRef="fileDocument" />
    <bpmn:sequenceFlow id="referencesChecked" sourceRef="checkReferences" targetRef="join" />
    <bpmn:sequenceFlow id="documentFiled" sourceRef="fileDocument" targetRef="join" />
    <bpmn:sequenceFlow id="finish" sourceRef="join" targetRef="end" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="reviewDiagram">
    <bpmndi:BPMNPlane id="reviewPlane" bpmnElement="documentReview">
      <bpmndi:BPMNShape id="startShape" bpmnElement="start">
        <dc:Bounds x="45" y="152" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="chooseShape" bpmnElement="choose">
        <dc:Bounds x="110" y="145" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="reviewFullShape" bpmnElement="reviewFull">
        <dc:Bounds x="228" y="65" width="126" height="68" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="reviewSummaryShape" bpmnElement="reviewSummary">
        <dc:Bounds x="228" y="208" width="126" height="68" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="mergeShape" bpmnElement="merge">
        <dc:Bounds x="420" y="145" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="splitShape" bpmnElement="split">
        <dc:Bounds x="525" y="145" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="checkReferencesShape" bpmnElement="checkReferences">
        <dc:Bounds x="645" y="65" width="126" height="68" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="fileDocumentShape" bpmnElement="fileDocument">
        <dc:Bounds x="645" y="208" width="126" height="68" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="joinShape" bpmnElement="join">
        <dc:Bounds x="842" y="145" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="endShape" bpmnElement="end">
        <dc:Bounds x="963" y="152" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="beginEdge" bpmnElement="begin">
        <di:waypoint x="81" y="170" />
        <di:waypoint x="110" y="170" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="detailedPathEdge" bpmnElement="detailedPath">
        <di:waypoint x="160" y="170" />
        <di:waypoint x="194" y="170" />
        <di:waypoint x="194" y="99" />
        <di:waypoint x="228" y="99" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="summaryPathEdge" bpmnElement="summaryPath">
        <di:waypoint x="160" y="170" />
        <di:waypoint x="194" y="170" />
        <di:waypoint x="194" y="242" />
        <di:waypoint x="228" y="242" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="fullReviewedEdge" bpmnElement="fullReviewed">
        <di:waypoint x="354" y="99" />
        <di:waypoint x="387" y="99" />
        <di:waypoint x="387" y="170" />
        <di:waypoint x="420" y="170" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="summaryReviewedEdge" bpmnElement="summaryReviewed">
        <di:waypoint x="354" y="242" />
        <di:waypoint x="387" y="242" />
        <di:waypoint x="387" y="170" />
        <di:waypoint x="420" y="170" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="startChecksEdge" bpmnElement="startChecks">
        <di:waypoint x="470" y="170" />
        <di:waypoint x="525" y="170" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="startReferencesEdge" bpmnElement="startReferences">
        <di:waypoint x="575" y="170" />
        <di:waypoint x="610" y="170" />
        <di:waypoint x="610" y="99" />
        <di:waypoint x="645" y="99" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="startFilingEdge" bpmnElement="startFiling">
        <di:waypoint x="575" y="170" />
        <di:waypoint x="610" y="170" />
        <di:waypoint x="610" y="242" />
        <di:waypoint x="645" y="242" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="referencesCheckedEdge" bpmnElement="referencesChecked">
        <di:waypoint x="771" y="99" />
        <di:waypoint x="806" y="99" />
        <di:waypoint x="806" y="170" />
        <di:waypoint x="842" y="170" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="documentFiledEdge" bpmnElement="documentFiled">
        <di:waypoint x="771" y="242" />
        <di:waypoint x="806" y="242" />
        <di:waypoint x="806" y="170" />
        <di:waypoint x="842" y="170" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="finishEdge" bpmnElement="finish">
        <di:waypoint x="892" y="170" />
        <di:waypoint x="963" y="170" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
