<?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_1ffimfn">
    <bpmn2:participant id="Participant_12ilyg2" processRef="Process_1" />
  </bpmn2:collaboration>
  <bpmn2:process id="Process_1" isExecutable="false">
    <bpmn2:sequenceFlow id="SequenceFlow_0lo0xqi" sourceRef="Task_0xh2iwa" targetRef="EndEvent_07q3k5v" />
    <bpmn2:sequenceFlow id="SequenceFlow_1q1veva" sourceRef="Activity_00ticbc" targetRef="Task_0xh2iwa" />
    <bpmn2:sequenceFlow id="SequenceFlow_0cr3d6e" sourceRef="StartEvent_1" targetRef="Task_1gpov6r" />
    <bpmn2:sequenceFlow id="Flow_0xs04ww" sourceRef="Task_1gpov6r" targetRef="Activity_00ticbc" />
    <bpmn2:endEvent id="EndEvent_07q3k5v">
      <bpmn2:incoming>SequenceFlow_0lo0xqi</bpmn2:incoming>
    </bpmn2:endEvent>
    <bpmn2:serviceTask id="Task_0xh2iwa" name="service1" implementation="service1" camunda:delegateExpression="service1">
      <bpmn2:extensionElements>
        <camunda:inputOutput>
          <camunda:inputParameter name="repeat">100</camunda:inputParameter>
          <camunda:inputParameter name="inputVar2">
            <camunda:script scriptFormat="JavaScript">data.result</camunda:script>
          </camunda:inputParameter>
          <camunda:outputParameter name="sequence">$output.seq</camunda:outputParameter>
          <camunda:outputParameter name="returnText">$('out text:'+output.text)</camunda:outputParameter>
        </camunda:inputOutput>
        <camunda:executionListener event="end">
          <camunda:script scriptFormat="JavaScript">console.log(' service1 end:', data);</camunda:script>
        </camunda:executionListener>
      </bpmn2:extensionElements>
      <bpmn2:incoming>SequenceFlow_1q1veva</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_0lo0xqi</bpmn2:outgoing>
    </bpmn2:serviceTask>
    <bpmn2:serviceTask id="Activity_00ticbc" name="Add 2 Using scripts" implementation="add" camunda:delegateExpression="add">
      <bpmn2:extensionElements>
        <camunda:executionListener event="start">
          <camunda:script scriptFormat="JavaScript">input.v1=33;
            input.v2=25;</camunda:script>
        </camunda:executionListener>
        <camunda:executionListener event="end">
          <camunda:script scriptFormat="JavaScript">data.result2=output+100;</camunda:script>
        </camunda:executionListener>
      </bpmn2:extensionElements>
      <bpmn2:incoming>Flow_0xs04ww</bpmn2:incoming>
      <bpmn2:outgoing>SequenceFlow_1q1veva</bpmn2:outgoing>
    </bpmn2:serviceTask>
    <bpmn2:serviceTask id="Task_1gpov6r" name="add" implementation="add" camunda:delegateExpression="add">
      <bpmn2:extensionElements>
        <camunda:inputOutput>
          <camunda:inputParameter name="v1">5</camunda:inputParameter>
          <camunda:inputParameter name="v2">3</camunda:inputParameter>
          <camunda:outputParameter name="result" />
        </camunda:inputOutput>
        <camunda:executionListener event="start">
          <camunda:script scriptFormat="JavaScript">console.log(' add service start:', data);</camunda:script>
        </camunda:executionListener>
      </bpmn2:extensionElements>
      <bpmn2:incoming>SequenceFlow_0cr3d6e</bpmn2:incoming>
      <bpmn2:outgoing>Flow_0xs04ww</bpmn2:outgoing>
    </bpmn2:serviceTask>
    <bpmn2:startEvent id="StartEvent_1">
      <bpmn2:extensionElements />
      <bpmn2:outgoing>SequenceFlow_0cr3d6e</bpmn2:outgoing>
    </bpmn2:startEvent>
  </bpmn2:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1ffimfn">
      <bpmndi:BPMNShape id="Participant_12ilyg2_di" bpmnElement="Participant_12ilyg2" isHorizontal="true">
        <dc:Bounds x="133" y="23" width="587" height="247" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_0xs04ww_di" bpmnElement="Flow_0xs04ww">
        <di:waypoint x="360" y="147" />
        <di:waypoint x="390" y="147" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="SequenceFlow_0cr3d6e_di" bpmnElement="SequenceFlow_0cr3d6e">
        <di:waypoint x="218" y="140" />
        <di:waypoint x="260" y="140" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="187.5" y="73" width="90" height="12" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="SequenceFlow_1q1veva_di" bpmnElement="SequenceFlow_1q1veva">
        <di:waypoint x="490" y="147" />
        <di:waypoint x="520" y="147" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="372.5" y="73" width="0" height="12" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="SequenceFlow_0lo0xqi_di" bpmnElement="SequenceFlow_0lo0xqi">
        <di:waypoint x="620" y="147" />
        <di:waypoint x="652" y="147" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="467" y="73" width="90" height="12" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="EndEvent_07q3k5v_di" bpmnElement="EndEvent_07q3k5v">
        <dc:Bounds x="652" y="129" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="501" y="116" width="90" height="12" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="ServiceTask_11kwtae_di" bpmnElement="Task_0xh2iwa">
        <dc:Bounds x="520" y="107" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1pvusvx_di" bpmnElement="Activity_00ticbc">
        <dc:Bounds x="390" y="107" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="ServiceTask_0xah4d4_di" bpmnElement="Task_1gpov6r">
        <dc:Bounds x="260" y="107" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="182" y="122" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="153" y="112" width="90" height="20" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn2:definitions>
