<?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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_017gbh2" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.5.1">
  <bpmn:collaboration id="Collaboration_15ljak1">
    <bpmn:participant id="Participant_0fz1e0p" name="Smart Factory" processRef="production_process_new_light" />
  </bpmn:collaboration>
  <bpmn:process id="production_process_new_light" isExecutable="true">
    <bpmn:laneSet id="LaneSet_13ll9pr">
      <bpmn:lane id="Lane_19v0aoe" name="Production Manager">
        <bpmn:flowNodeRef>Event_127z07e</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Activity_0jehcum</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_19wcevr" name="VGR_1">
        <bpmn:flowNodeRef>Activity_107pam0</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Activity_0cwptph</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Event_06fuvj7</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_1bwmv95" name="HBW_1">
        <bpmn:flowNodeRef>Activity_1lx6ugd</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_1ca9sse" name="WT_1">
        <bpmn:flowNodeRef>Activity_075b7q0</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_0k67zxj" name="OV_1">
        <bpmn:flowNodeRef>Activity_1e6xoye</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_03naixx" name="MM_1">
        <bpmn:flowNodeRef>Activity_0kh9pn6</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="Lane_0qn6f7k" name="SM_1">
        <bpmn:flowNodeRef>Activity_147au71</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>
    <bpmn:sequenceFlow id="Flow_1ctylva" sourceRef="Activity_0jehcum" targetRef="Activity_1lx6ugd" />
    <bpmn:sequenceFlow id="Flow_1ql0eor" sourceRef="Activity_107pam0" targetRef="Activity_1e6xoye" />
    <bpmn:sequenceFlow id="Flow_1dz8a67" sourceRef="Activity_075b7q0" targetRef="Activity_0kh9pn6" />
    <bpmn:sequenceFlow id="Flow_1pq1ex5" sourceRef="Activity_0kh9pn6" targetRef="Activity_147au71" />
    <bpmn:startEvent id="Event_127z07e" name="Start Production">
      <bpmn:outgoing>Flow_1tuwaur</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:sequenceFlow id="Flow_1tuwaur" sourceRef="Event_127z07e" targetRef="Activity_0jehcum" />
    <bpmn:sequenceFlow id="Flow_08mwpzo" sourceRef="Activity_1lx6ugd" targetRef="Activity_107pam0" />
    <bpmn:sequenceFlow id="Flow_0c4u01a" sourceRef="Activity_0cwptph" targetRef="Event_06fuvj7" />
    <bpmn:userTask id="Activity_0jehcum" name="Enter Color" camunda:assignee="demo">
      <bpmn:extensionElements>
        <camunda:formData>
          <camunda:formField id="color" label="Color" type="string" />
        </camunda:formData>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_1tuwaur</bpmn:incoming>
      <bpmn:outgoing>Flow_1ctylva</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:sequenceFlow id="Flow_129drek" sourceRef="Activity_1e6xoye" targetRef="Activity_075b7q0" />
    <bpmn:sequenceFlow id="Flow_0878e3q" sourceRef="Activity_147au71" targetRef="Activity_0cwptph" />
    <bpmn:serviceTask id="Activity_1lx6ugd" name="Unload workpiece" camunda:asyncBefore="true" camunda:asyncAfter="true" camunda:exclusive="false">
      <bpmn:extensionElements>
        <camunda:connector>
          <camunda:inputOutput>
            <camunda:inputParameter name="url">
              <camunda:script scriptFormat="javascript">url = "http://127.0.0.1:5000/process/unload_from_hbw_container?color=" + execution.getVariable("color")</camunda:script>
            </camunda:inputParameter>
            <camunda:inputParameter name="method">GET</camunda:inputParameter>
          </camunda:inputOutput>
          <camunda:connectorId>http-connector</camunda:connectorId>
        </camunda:connector>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_1ctylva</bpmn:incoming>
      <bpmn:outgoing>Flow_08mwpzo</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="Activity_107pam0" name="Pickup from HBW and transport to OV" camunda:asyncBefore="true" camunda:asyncAfter="true" camunda:exclusive="false">
      <bpmn:extensionElements>
        <camunda:connector>
          <camunda:inputOutput>
            <camunda:inputParameter name="url">
              <camunda:script scriptFormat="javascript">url = "http://127.0.0.1:5000/vgr/pick_up_and_transport?machine=vgr_1&amp;start=high_bay_warehouse&amp;end=oven"</camunda:script>
            </camunda:inputParameter>
            <camunda:inputParameter name="method">GET</camunda:inputParameter>
          </camunda:inputOutput>
          <camunda:connectorId>http-connector</camunda:connectorId>
        </camunda:connector>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_08mwpzo</bpmn:incoming>
      <bpmn:outgoing>Flow_1ql0eor</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="Activity_1e6xoye" name="Burn" camunda:asyncBefore="true" camunda:asyncAfter="true" camunda:exclusive="false">
      <bpmn:extensionElements>
        <camunda:connector>
          <camunda:inputOutput>
            <camunda:inputParameter name="url">
              <camunda:script scriptFormat="javascript">url = "http://127.0.0.1:5000/ov/burn?machine=ov_1&amp;time=2"</camunda:script>
            </camunda:inputParameter>
            <camunda:inputParameter name="method">GET</camunda:inputParameter>
          </camunda:inputOutput>
          <camunda:connectorId>http-connector</camunda:connectorId>
        </camunda:connector>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_1ql0eor</bpmn:incoming>
      <bpmn:outgoing>Flow_129drek</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="Activity_075b7q0" name="Transport from Oven to Milling" camunda:asyncBefore="true" camunda:asyncAfter="true" camunda:exclusive="false">
      <bpmn:extensionElements>
        <camunda:connector>
          <camunda:inputOutput>
            <camunda:inputParameter name="url">
              <camunda:script scriptFormat="javascript">url = "http://127.0.0.1:5000/wt/pick_up_and_transport?machine=wt_1&amp;start=oven&amp;end=milling_machine"</camunda:script>
            </camunda:inputParameter>
            <camunda:inputParameter name="method">GET</camunda:inputParameter>
          </camunda:inputOutput>
          <camunda:connectorId>http-connector</camunda:connectorId>
        </camunda:connector>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_129drek</bpmn:incoming>
      <bpmn:outgoing>Flow_1dz8a67</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="Activity_0kh9pn6" name="Mill" camunda:asyncBefore="true" camunda:asyncAfter="true" camunda:exclusive="false">
      <bpmn:extensionElements>
        <camunda:connector>
          <camunda:inputOutput>
            <camunda:inputParameter name="url">
              <camunda:script scriptFormat="javascript">url = "http://127.0.0.1:5000/mm/mill?machine=mm_1&amp;start=initial&amp;end=ejection&amp;time=1"</camunda:script>
            </camunda:inputParameter>
            <camunda:inputParameter name="method">GET</camunda:inputParameter>
          </camunda:inputOutput>
          <camunda:connectorId>http-connector</camunda:connectorId>
        </camunda:connector>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_1dz8a67</bpmn:incoming>
      <bpmn:outgoing>Flow_1pq1ex5</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="Activity_0cwptph" name="Pickup from SM and transport to Delivery" camunda:asyncBefore="true" camunda:asyncAfter="true" camunda:exclusive="false">
      <bpmn:extensionElements>
        <camunda:connector>
          <camunda:inputOutput>
            <camunda:inputParameter name="url">
              <camunda:script scriptFormat="javascript">url = "http://127.0.0.1:5000/vgr/pick_up_and_transport?machine=vgr_1&amp;start=sink_" + execution.getVariable("sink") + "&amp;end=high_bay_warehouse_delivery_station"</camunda:script>
            </camunda:inputParameter>
            <camunda:inputParameter name="method">GET</camunda:inputParameter>
          </camunda:inputOutput>
          <camunda:connectorId>http-connector</camunda:connectorId>
        </camunda:connector>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0878e3q</bpmn:incoming>
      <bpmn:outgoing>Flow_0c4u01a</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="Event_06fuvj7" name="Production ended">
      <bpmn:incoming>Flow_0c4u01a</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:serviceTask id="Activity_147au71" name="Sort" camunda:asyncBefore="true" camunda:asyncAfter="true" camunda:exclusive="false">
      <bpmn:extensionElements>
        <camunda:connector>
          <camunda:inputOutput>
            <camunda:inputParameter name="url">
              <camunda:script scriptFormat="javascript">url = "http://127.0.0.1:5000/sm/sort?machine=sm_1&amp;start=initial&amp;use_nfc=false&amp;predefined_ejection_location=none"</camunda:script>
            </camunda:inputParameter>
            <camunda:inputParameter name="method">GET</camunda:inputParameter>
            <camunda:outputParameter name="sink">${JSON(response).jsonPath("$.attributes[0].sink").numberValue()}</camunda:outputParameter>
          </camunda:inputOutput>
          <camunda:connectorId>http-connector</camunda:connectorId>
        </camunda:connector>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_1pq1ex5</bpmn:incoming>
      <bpmn:outgoing>Flow_0878e3q</bpmn:outgoing>
    </bpmn:serviceTask>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_15ljak1">
      <bpmndi:BPMNShape id="Participant_0fz1e0p_di" bpmnElement="Participant_0fz1e0p" isHorizontal="true">
        <dc:Bounds x="129" y="80" width="1381" height="710" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_19v0aoe_di" bpmnElement="Lane_19v0aoe" isHorizontal="true">
        <dc:Bounds x="159" y="80" width="1351" height="100" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_19wcevr_di" bpmnElement="Lane_19wcevr" isHorizontal="true">
        <dc:Bounds x="159" y="180" width="1351" height="100" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_1bwmv95_di" bpmnElement="Lane_1bwmv95" isHorizontal="true">
        <dc:Bounds x="159" y="280" width="1351" height="100" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_1ca9sse_di" bpmnElement="Lane_1ca9sse" isHorizontal="true">
        <dc:Bounds x="159" y="380" width="1351" height="100" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_0k67zxj_di" bpmnElement="Lane_0k67zxj" isHorizontal="true">
        <dc:Bounds x="159" y="480" width="1351" height="100" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_03naixx_di" bpmnElement="Lane_03naixx" isHorizontal="true">
        <dc:Bounds x="159" y="580" width="1351" height="100" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_0qn6f7k_di" bpmnElement="Lane_0qn6f7k" isHorizontal="true">
        <dc:Bounds x="159" y="680" width="1351" height="110" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_127z07e_di" bpmnElement="Event_127z07e">
        <dc:Bounds x="212" y="110" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="191" y="153" width="79" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1kp3znw_di" bpmnElement="Activity_0jehcum">
        <dc:Bounds x="280" y="88" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1lx6ugd_di" bpmnElement="Activity_1lx6ugd">
        <dc:Bounds x="421" y="290" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_107pam0_di" bpmnElement="Activity_107pam0">
        <dc:Bounds x="570" y="190" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1e6xoye_di" bpmnElement="Activity_1e6xoye">
        <dc:Bounds x="714" y="490" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_075b7q0_di" bpmnElement="Activity_075b7q0">
        <dc:Bounds x="861" y="390" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0kh9pn6_di" bpmnElement="Activity_0kh9pn6">
        <dc:Bounds x="1016" y="590" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0cwptph_di" bpmnElement="Activity_0cwptph">
        <dc:Bounds x="1310" y="190" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_06fuvj7_di" bpmnElement="Event_06fuvj7">
        <dc:Bounds x="1442" y="212" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1417" y="255" width="87" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_147au71_di" bpmnElement="Activity_147au71">
        <dc:Bounds x="1160" y="696" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_1ctylva_di" bpmnElement="Flow_1ctylva">
        <di:waypoint x="380" y="128" />
        <di:waypoint x="400" y="128" />
        <di:waypoint x="400" y="330" />
        <di:waypoint x="421" y="330" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1ql0eor_di" bpmnElement="Flow_1ql0eor">
        <di:waypoint x="670" y="230" />
        <di:waypoint x="690" y="230" />
        <di:waypoint x="690" y="530" />
        <di:waypoint x="714" y="530" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1dz8a67_di" bpmnElement="Flow_1dz8a67">
        <di:waypoint x="961" y="430" />
        <di:waypoint x="980" y="430" />
        <di:waypoint x="980" y="630" />
        <di:waypoint x="1016" y="630" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1pq1ex5_di" bpmnElement="Flow_1pq1ex5">
        <di:waypoint x="1116" y="630" />
        <di:waypoint x="1140" y="630" />
        <di:waypoint x="1140" y="736" />
        <di:waypoint x="1160" y="736" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0878e3q_di" bpmnElement="Flow_0878e3q">
        <di:waypoint x="1260" y="736" />
        <di:waypoint x="1280" y="736" />
        <di:waypoint x="1280" y="230" />
        <di:waypoint x="1310" y="230" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1tuwaur_di" bpmnElement="Flow_1tuwaur">
        <di:waypoint x="248" y="128" />
        <di:waypoint x="280" y="128" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_08mwpzo_di" bpmnElement="Flow_08mwpzo">
        <di:waypoint x="521" y="330" />
        <di:waypoint x="550" y="330" />
        <di:waypoint x="550" y="230" />
        <di:waypoint x="570" y="230" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0c4u01a_di" bpmnElement="Flow_0c4u01a">
        <di:waypoint x="1410" y="230" />
        <di:waypoint x="1442" y="230" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_129drek_di" bpmnElement="Flow_129drek">
        <di:waypoint x="814" y="530" />
        <di:waypoint x="841" y="530" />
        <di:waypoint x="841" y="430" />
        <di:waypoint x="861" y="430" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
