<?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" id="definitions" name="Document delivery" targetNamespace="http://bpmn.io/schema/bpmn" exporter="tok" exporterVersion="1.0">
  <bpmn:message id="Message_Scan_request" name="Scan request" />
  <bpmn:message id="Message_Scan" name="Scan" />
  <bpmn:message id="Message_Refusal" name="Refusal" />
  <bpmn:collaboration id="collaboration">
    <bpmn:participant id="reader" name="Reader" processRef="reader-process" />
    <bpmn:participant id="library" name="University library" processRef="library-process" />
    <bpmn:messageFlow id="m-request-received" name="Scan request" sourceRef="request" targetRef="received" messageRef="Message_Scan_request" />
    <bpmn:messageFlow id="m-deliver-scan" name="Scan" sourceRef="deliver" targetRef="scan" messageRef="Message_Scan" />
    <bpmn:messageFlow id="m-refused-refusal" name="Refusal" sourceRef="refused" targetRef="refusal" messageRef="Message_Refusal" />
  </bpmn:collaboration>
  <bpmn:process id="reader-process" name="Reader" isExecutable="false">
    <bpmn:startEvent id="need" name="Article needed" />
    <bpmn:sendTask id="request" name="Request a scan" messageRef="Message_Scan_request" />
    <bpmn:eventBasedGateway id="reply" name="What comes back?" />
    <bpmn:intermediateCatchEvent id="scan" name="Scan received">
      <bpmn:messageEventDefinition id="scan-def" messageRef="Message_Scan" />
    </bpmn:intermediateCatchEvent>
    <bpmn:intermediateCatchEvent id="refusal" name="Refusal received">
      <bpmn:messageEventDefinition id="refusal-def" messageRef="Message_Refusal" />
    </bpmn:intermediateCatchEvent>
    <bpmn:manualTask id="read" name="Read the article" />
    <bpmn:endEvent id="done" name="Article read" />
    <bpmn:endEvent id="gave-up" name="Article not obtained" />
    <bpmn:sequenceFlow id="f-need-request" sourceRef="need" targetRef="request" />
    <bpmn:sequenceFlow id="f-request-reply" sourceRef="request" targetRef="reply" />
    <bpmn:sequenceFlow id="f-reply-scan" sourceRef="reply" targetRef="scan" />
    <bpmn:sequenceFlow id="f-reply-refusal" sourceRef="reply" targetRef="refusal" />
    <bpmn:sequenceFlow id="f-scan-read" sourceRef="scan" targetRef="read" />
    <bpmn:sequenceFlow id="f-read-done" sourceRef="read" targetRef="done" />
    <bpmn:sequenceFlow id="f-refusal-gave-up" sourceRef="refusal" targetRef="gave-up" />
  </bpmn:process>
  <bpmn:process id="library-process" name="University library" isExecutable="false">
    <bpmn:laneSet id="library-lanes">
      <bpmn:lane id="desk" name="Document delivery desk">
        <bpmn:flowNodeRef>received</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>check</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>allowed</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>deliver</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>delivered</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>refused</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="stacks" name="Stacks staff">
        <bpmn:flowNodeRef>fetch</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>digitise</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>
    <bpmn:startEvent id="received" name="Request received">
      <bpmn:messageEventDefinition id="received-def" messageRef="Message_Scan_request" />
    </bpmn:startEvent>
    <bpmn:userTask id="check" name="Check the copyright limits" />
    <bpmn:exclusiveGateway id="allowed" name="Is copying allowed?" />
    <bpmn:sendTask id="deliver" name="Send the scan" messageRef="Message_Scan" />
    <bpmn:endEvent id="delivered" name="Scan delivered" />
    <bpmn:endEvent id="refused" name="Request refused">
      <bpmn:messageEventDefinition id="refused-def" messageRef="Message_Refusal" />
    </bpmn:endEvent>
    <bpmn:userTask id="fetch" name="Fetch the volume" />
    <bpmn:userTask id="digitise" name="Scan the pages" />
    <bpmn:sequenceFlow id="f-received-check" sourceRef="received" targetRef="check" />
    <bpmn:sequenceFlow id="f-check-allowed" sourceRef="check" targetRef="allowed" />
    <bpmn:sequenceFlow id="f-allowed-fetch" name="yes" sourceRef="allowed" targetRef="fetch" />
    <bpmn:sequenceFlow id="f-allowed-refused" name="no" sourceRef="allowed" targetRef="refused" />
    <bpmn:sequenceFlow id="f-fetch-digitise" sourceRef="fetch" targetRef="digitise" />
    <bpmn:sequenceFlow id="f-digitise-deliver" sourceRef="digitise" targetRef="deliver" />
    <bpmn:sequenceFlow id="f-deliver-delivered" sourceRef="deliver" targetRef="delivered" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="collaboration">
      <bpmndi:BPMNShape id="reader_di" bpmnElement="reader" isHorizontal="true">
        <dc:Bounds x="0" y="0" width="950" height="230" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="library_di" bpmnElement="library" isHorizontal="true">
        <dc:Bounds x="0" y="270" width="950" height="280" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="desk_di" bpmnElement="desk" isHorizontal="true">
        <dc:Bounds x="30" y="270" width="920" height="140" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="stacks_di" bpmnElement="stacks" isHorizontal="true">
        <dc:Bounds x="30" y="410" width="920" height="140" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="need_di" bpmnElement="need">
        <dc:Bounds x="60" y="52" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="38" y="93" width="80" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="request_di" bpmnElement="request">
        <dc:Bounds x="146" y="30" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="reply_di" bpmnElement="reply">
        <dc:Bounds x="296" y="45" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="326" y="32" width="90" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="scan_di" bpmnElement="scan">
        <dc:Bounds x="396" y="52" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="419" y="91" width="46" height="23" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="refusal_di" bpmnElement="refusal">
        <dc:Bounds x="396" y="160" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="369" y="146" width="90" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="read_di" bpmnElement="read">
        <dc:Bounds x="482" y="30" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="done_di" bpmnElement="done">
        <dc:Bounds x="632" y="52" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="616" y="93" width="68" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="gave-up_di" bpmnElement="gave-up">
        <dc:Bounds x="514" y="160" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="501" y="201" width="62" height="23" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="received_di" bpmnElement="received">
        <dc:Bounds x="90" y="322" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="63" y="363" width="90" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="check_di" bpmnElement="check">
        <dc:Bounds x="176" y="300" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="allowed_di" bpmnElement="allowed" isMarkerVisible="true">
        <dc:Bounds x="326" y="315" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="355" y="302" width="108" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="deliver_di" bpmnElement="deliver">
        <dc:Bounds x="726" y="300" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="delivered_di" bpmnElement="delivered">
        <dc:Bounds x="876" y="322" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="854" y="363" width="80" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="refused_di" bpmnElement="refused">
        <dc:Bounds x="458" y="322" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="434" y="363" width="84" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="fetch_di" bpmnElement="fetch">
        <dc:Bounds x="426" y="440" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="digitise_di" bpmnElement="digitise">
        <dc:Bounds x="576" y="440" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="m-request-received_di" bpmnElement="m-request-received">
        <di:waypoint x="196" y="110" />
        <di:waypoint x="196" y="244" />
        <di:waypoint x="108" y="244" />
        <di:waypoint x="108" y="322" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="123" y="116" width="68" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="m-deliver-scan_di" bpmnElement="m-deliver-scan">
        <di:waypoint x="776" y="300" />
        <di:waypoint x="776" y="115" />
        <di:waypoint x="414" y="115" />
        <di:waypoint x="414" y="88" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="747" y="121" width="24" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="m-refused-refusal_di" bpmnElement="m-refused-refusal">
        <di:waypoint x="476" y="322" />
        <di:waypoint x="476" y="250" />
        <di:waypoint x="414" y="250" />
        <di:waypoint x="414" y="196" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="450" y="238" width="40" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-need-request_di" bpmnElement="f-need-request">
        <di:waypoint x="96" y="70" />
        <di:waypoint x="146" y="70" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-request-reply_di" bpmnElement="f-request-reply">
        <di:waypoint x="246" y="70" />
        <di:waypoint x="296" y="70" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-reply-scan_di" bpmnElement="f-reply-scan">
        <di:waypoint x="346" y="70" />
        <di:waypoint x="396" y="70" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-reply-refusal_di" bpmnElement="f-reply-refusal">
        <di:waypoint x="321" y="95" />
        <di:waypoint x="321" y="178" />
        <di:waypoint x="396" y="178" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-scan-read_di" bpmnElement="f-scan-read">
        <di:waypoint x="432" y="70" />
        <di:waypoint x="482" y="70" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-read-done_di" bpmnElement="f-read-done">
        <di:waypoint x="582" y="70" />
        <di:waypoint x="632" y="70" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-refusal-gave-up_di" bpmnElement="f-refusal-gave-up">
        <di:waypoint x="432" y="178" />
        <di:waypoint x="514" y="178" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-received-check_di" bpmnElement="f-received-check">
        <di:waypoint x="126" y="340" />
        <di:waypoint x="176" y="340" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-check-allowed_di" bpmnElement="f-check-allowed">
        <di:waypoint x="276" y="340" />
        <di:waypoint x="326" y="340" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-allowed-fetch_di" bpmnElement="f-allowed-fetch">
        <di:waypoint x="351" y="365" />
        <di:waypoint x="351" y="480" />
        <di:waypoint x="426" y="480" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="358" y="465" width="18" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-allowed-refused_di" bpmnElement="f-allowed-refused">
        <di:waypoint x="376" y="340" />
        <di:waypoint x="458" y="340" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="384" y="325" width="12" height="11" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-fetch-digitise_di" bpmnElement="f-fetch-digitise">
        <di:waypoint x="526" y="480" />
        <di:waypoint x="576" y="480" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-digitise-deliver_di" bpmnElement="f-digitise-deliver">
        <di:waypoint x="676" y="480" />
        <di:waypoint x="776" y="480" />
        <di:waypoint x="776" y="380" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f-deliver-delivered_di" bpmnElement="f-deliver-delivered">
        <di:waypoint x="826" y="340" />
        <di:waypoint x="876" y="340" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
