<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="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:fleans="https://fleans.io/schema/bpmn/1.0"
             id="Definitions_message_catch"
             targetNamespace="http://bpmn.io/schema/bpmn">
  <message id="msg1" name="approvalReceived">
    <extensionElements>
      <fleans:subscription correlationKey="= requestId" />
    </extensionElements>
  </message>
  <process id="message-catch-test" isExecutable="true">
    <startEvent id="start" />
    <scriptTask id="setCorrelation" scriptFormat="csharp">
      <script>_context.requestId = "req-456"</script>
    </scriptTask>
    <intermediateCatchEvent id="waitApproval">
      <messageEventDefinition messageRef="msg1" />
    </intermediateCatchEvent>
    <scriptTask id="afterApproval" scriptFormat="csharp">
      <script>_context.approved = true</script>
    </scriptTask>
    <endEvent id="end" />
    <sequenceFlow id="f1" sourceRef="start" targetRef="setCorrelation" />
    <sequenceFlow id="f2" sourceRef="setCorrelation" targetRef="waitApproval" />
    <sequenceFlow id="f3" sourceRef="waitApproval" targetRef="afterApproval" />
    <sequenceFlow id="f4" sourceRef="afterApproval" targetRef="end" />
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="message-catch-test">
      <bpmndi:BPMNShape id="start_di" bpmnElement="start">
        <dc:Bounds x="152" y="102" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="setCorrelation_di" bpmnElement="setCorrelation">
        <dc:Bounds x="240" y="80" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="waitApproval_di" bpmnElement="waitApproval">
        <dc:Bounds x="392" y="102" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="afterApproval_di" bpmnElement="afterApproval">
        <dc:Bounds x="480" y="80" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="end_di" bpmnElement="end">
        <dc:Bounds x="632" y="102" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="f1_di" bpmnElement="f1">
        <di:waypoint x="188" y="120" />
        <di:waypoint x="240" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f2_di" bpmnElement="f2">
        <di:waypoint x="340" y="120" />
        <di:waypoint x="392" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f3_di" bpmnElement="f3">
        <di:waypoint x="428" y="120" />
        <di:waypoint x="480" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="f4_di" bpmnElement="f4">
        <di:waypoint x="580" y="120" />
        <di:waypoint x="632" y="120" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
