<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="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:camunda="http://camunda.org/schema/1.0/bpmn" id="sample-diagram" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
  <bpmn2:collaboration id="Collaboration_0836vd2">
    <bpmn2:participant id="Participant_1ta8xo0" processRef="Process_1" />
  </bpmn2:collaboration>
  <bpmn2:process id="Process_1" isExecutable="false">
    <bpmn2:startEvent id="StartEvent_1" name="msg1">
      <bpmn2:outgoing>Flow_05fc7p8</bpmn2:outgoing>
      <bpmn2:messageEventDefinition id="MessageEventDefinition_0ovk0o2" messageRef="Message_1xjp44w" />
    </bpmn2:startEvent>
    <bpmn2:sequenceFlow id="Flow_05fc7p8" sourceRef="StartEvent_1" targetRef="Event_1jxticj" />
    <bpmn2:sequenceFlow id="Flow_0deaukg" sourceRef="Event_1jxticj" targetRef="Event_1d1ctka" />
    <bpmn2:sequenceFlow id="Flow_0d04skv" sourceRef="Event_0m0xe67" targetRef="Event_1o4h7vy" />
    <bpmn2:sequenceFlow id="Flow_1itzdhz" sourceRef="Event_1o4h7vy" targetRef="Event_0rb320g" />
    <bpmn2:intermediateCatchEvent id="Event_1jxticj">
      <bpmn2:incoming>Flow_05fc7p8</bpmn2:incoming>
      <bpmn2:outgoing>Flow_0deaukg</bpmn2:outgoing>
      <bpmn2:timerEventDefinition id="TimerEventDefinition_1hvjjon">
        <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression">PT2S</bpmn2:timeDuration>
      </bpmn2:timerEventDefinition>
    </bpmn2:intermediateCatchEvent>
    <bpmn2:endEvent id="Event_0rb320g" name="confirm2">
      <bpmn2:extensionElements>
        <camunda:executionListener event="start">
          <camunda:script scriptFormat="JavaScript">this.context.messageMatchingKey={'data.caseId': data.caseId };</camunda:script>
        </camunda:executionListener>
      </bpmn2:extensionElements>
      <bpmn2:incoming>Flow_1itzdhz</bpmn2:incoming>
      <bpmn2:messageEventDefinition id="MessageEventDefinition_00mpngw" messageRef="Message_1ywvuw8" />
    </bpmn2:endEvent>
    <bpmn2:sequenceFlow id="Flow_07tjqvd" sourceRef="Event_1d1ctka" targetRef="Event_0m0xe67" />
    <bpmn2:intermediateCatchEvent id="Event_0m0xe67" name="msg2">
      <bpmn2:extensionElements>
        <camunda:executionListener event="end">
          <camunda:script scriptFormat="JavaScript">console.log('msg2 end event');

item.vars=item.message;
console.log('start script- item.vars',
item.vars);</camunda:script>
        </camunda:executionListener>
      </bpmn2:extensionElements>
      <bpmn2:incoming>Flow_07tjqvd</bpmn2:incoming>
      <bpmn2:outgoing>Flow_0d04skv</bpmn2:outgoing>
      <bpmn2:messageEventDefinition id="MessageEventDefinition_1s6c3tp" messageRef="Message_06069yb" />
    </bpmn2:intermediateCatchEvent>
    <bpmn2:intermediateThrowEvent id="Event_1d1ctka" name="confirm1">
      <bpmn2:extensionElements>
        <camunda:executionListener event="start">
          <camunda:script scriptFormat="JavaScript">this.context.messageMatchingKey={'data.caseId': data.caseId };</camunda:script>
        </camunda:executionListener>
      </bpmn2:extensionElements>
      <bpmn2:incoming>Flow_0deaukg</bpmn2:incoming>
      <bpmn2:outgoing>Flow_07tjqvd</bpmn2:outgoing>
      <bpmn2:messageEventDefinition id="MessageEventDefinition_1bkxo8c" messageRef="Message_1ia8xed" />
    </bpmn2:intermediateThrowEvent>
    <bpmn2:intermediateCatchEvent id="Event_1o4h7vy">
      <bpmn2:incoming>Flow_0d04skv</bpmn2:incoming>
      <bpmn2:outgoing>Flow_1itzdhz</bpmn2:outgoing>
      <bpmn2:timerEventDefinition id="TimerEventDefinition_0vt46l3">
        <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression">PT2S</bpmn2:timeDuration>
      </bpmn2:timerEventDefinition>
    </bpmn2:intermediateCatchEvent>
  </bpmn2:process>
  <bpmn2:message id="Message_1xjp44w" name="msg1" />
  <bpmn2:message id="Message_1ia8xed" name="confirm1" />
  <bpmn2:message id="Message_06069yb" name="msg2" />
  <bpmn2:message id="Message_1ywvuw8" name="confirm2" />
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_0836vd2">
      <bpmndi:BPMNShape id="Participant_1ta8xo0_di" bpmnElement="Participant_1ta8xo0" isHorizontal="true">
        <dc:Bounds x="220" y="60" width="580" height="200" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_07tjqvd_di" bpmnElement="Flow_07tjqvd">
        <di:waypoint x="468" y="160" />
        <di:waypoint x="522" y="160" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1itzdhz_di" bpmnElement="Flow_1itzdhz">
        <di:waypoint x="648" y="160" />
        <di:waypoint x="732" y="160" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0d04skv_di" bpmnElement="Flow_0d04skv">
        <di:waypoint x="558" y="160" />
        <di:waypoint x="612" y="160" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0deaukg_di" bpmnElement="Flow_0deaukg">
        <di:waypoint x="388" y="160" />
        <di:waypoint x="432" y="160" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_05fc7p8_di" bpmnElement="Flow_05fc7p8">
        <di:waypoint x="298" y="160" />
        <di:waypoint x="352" y="160" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Event_0cxd8rv_di" bpmnElement="StartEvent_1">
        <dc:Bounds x="262" y="142" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="267" y="185" width="27" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1q8uv7a_di" bpmnElement="Event_1jxticj">
        <dc:Bounds x="352" y="142" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0kll4ko_di" bpmnElement="Event_0rb320g">
        <dc:Bounds x="732" y="142" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="728" y="118" width="43" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0bsnifo_di" bpmnElement="Event_0m0xe67">
        <dc:Bounds x="522" y="142" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="526" y="188" width="27" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1wunjtd_di" bpmnElement="Event_1d1ctka">
        <dc:Bounds x="432" y="142" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="428" y="118" width="43" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1usl9d2_di" bpmnElement="Event_1o4h7vy">
        <dc:Bounds x="612" y="142" width="36" height="36" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn2:definitions>
