<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/processdef">
  <process id="ArborSyncCancelOrder" name="ArborSyncCancelOrder" isExecutable="true">
    <documentation>ArborSyncCancelOrder</documentation>
    <startEvent id="sid-38203C2B-DA77-43BE-AD89-CF407427D27B" flowable:formFieldValidation="true"></startEvent>
    <sequenceFlow id="sid-9644021F-C133-4ACA-AE98-6FFB74A129C4" sourceRef="sid-38203C2B-DA77-43BE-AD89-CF407427D27B" targetRef="sid-18FEBC62-1525-4F19-BA08-18D64E6ACF8E"></sequenceFlow>
    <serviceTask id="sid-E5A47F8E-A59C-4477-AB9C-ED0C5C13F28F" name="Sync cancel order with ARBOR" flowable:class="com.mobinets.nep.client.workflow.soap.SoapDelegate">
      <extensionElements>
        <flowable:field name="service">
          <flowable:string><![CDATA[OMAPIServicesService]]></flowable:string>
        </flowable:field>
        <flowable:field name="operation">
          <flowable:string><![CDATA[cancelOrder]]></flowable:string>
        </flowable:field>
        <flowable:field name="request.chgWho">
          <flowable:expression><![CDATA[${chgWho}]]></flowable:expression>
        </flowable:field>
        <flowable:field name="request.orderId">
          <flowable:expression><![CDATA[${arborId}]]></flowable:expression>
        </flowable:field>
        <flowable:field name="request.itemId">
          <flowable:expression><![CDATA[${woNo}]]></flowable:expression>
        </flowable:field>
        <flowable:field name="oteaiheader.msgFormat">
          <flowable:string><![CDATA[CancelOrder.Req]]></flowable:string>
        </flowable:field>
        <flowable:field name="oteaiheader.msgVersion">
          <flowable:string><![CDATA[0000]]></flowable:string>
        </flowable:field>
        <flowable:field name="oteaiheader.requestorId">
          <flowable:string><![CDATA[ARBOR]]></flowable:string>
        </flowable:field>
        <flowable:field name="oteaiheader.requestorChannelId">
          <flowable:string><![CDATA[WS]]></flowable:string>
        </flowable:field>
        <flowable:field name="oteaiheader.requestorUserId">
          <flowable:string><![CDATA[ARBOR]]></flowable:string>
        </flowable:field>
        <flowable:field name="oteaiheader.requestorLanguage">
          <flowable:string><![CDATA[E]]></flowable:string>
        </flowable:field>
        <flowable:field name="oteaiheader.requestorSecurityInfo">
          <flowable:string><![CDATA[Eai]]></flowable:string>
        </flowable:field>
        <flowable:field name="oteaiheader.eaiReference">
          <flowable:string><![CDATA[0]]></flowable:string>
        </flowable:field>
        <flowable:field name="oteaiheader.returnCode">
          <flowable:string><![CDATA[0000]]></flowable:string>
        </flowable:field>
        <flowable:field name="request.referenceNo">
          <flowable:expression><![CDATA[${ArboRefNo}]]></flowable:expression>
        </flowable:field>
      </extensionElements>
    </serviceTask>
    <endEvent id="sid-A3D9E60B-D58D-44AA-9024-DDD257A931EF"></endEvent>
    <sequenceFlow id="sid-3ED8FFB9-8D2E-4846-B8C6-4A004466A2CE" sourceRef="sid-BB096FC7-4F23-4DD4-91DF-209F087FCC83" targetRef="sid-D1C70F91-A3D9-4CFF-84B7-9BCCC021C1BB"></sequenceFlow>
    <boundaryEvent id="sid-BB096FC7-4F23-4DD4-91DF-209F087FCC83" attachedToRef="sid-E5A47F8E-A59C-4477-AB9C-ED0C5C13F28F">
      <errorEventDefinition></errorEventDefinition>
    </boundaryEvent>
    <sequenceFlow id="sid-8D61834B-AF0F-44E2-9063-9E341FD96728" sourceRef="sid-E5A47F8E-A59C-4477-AB9C-ED0C5C13F28F" targetRef="sid-A3D9E60B-D58D-44AA-9024-DDD257A931EF"></sequenceFlow>
    <scriptTask id="sid-18FEBC62-1525-4F19-BA08-18D64E6ACF8E" name="Set variables" scriptFormat="groovy" flowable:autoStoreVariables="false">
      <script><![CDATA[execution.setVariable("woNo", "");
if(execution.getVariable("fWOID")!=null){
execution.setVariable("woNo", fWOID);
if(execution.getVariable("fWOID").startsWith("I") || execution.getVariable("fWOID").startsWith("T"))
execution.setVariable("woNo",execution.getVariable("fWOID").substring(1));
else if(fWOID.toUpperCase().endsWith('A') || fWOID.toUpperCase().endsWith('D'))
execution.setVariable("woNo",fWOID.substring(0, fWOID.length() - 1));
}




execution.setVariable("arborId","")
if(execution.getVariable("arbor_Order_Id")!=null){
execution.setVariable("arborId",execution.getVariable("arbor_Order_Id"));
if(arbor_Order_Id.toUpperCase().endsWith('A') || arbor_Order_Id.toUpperCase().endsWith('D'))
execution.setVariable("arborId",arbor_Order_Id.substring(0, arbor_Order_Id.length() - 1));
}]]></script>
    </scriptTask>
    <sequenceFlow id="sid-708A1307-04F9-4B89-AEBC-190C8A42C1F6" sourceRef="sid-18FEBC62-1525-4F19-BA08-18D64E6ACF8E" targetRef="sid-69DA487E-2D0B-4D38-B763-C4F4322AA6A1"></sequenceFlow>
    <callActivity id="sid-69DA487E-2D0B-4D38-B763-C4F4322AA6A1" name="arbor_refno_generator" calledElement="arbor_refno_generator" flowable:calledElementType="key" flowable:fallbackToDefaultTenant="false">
      <extensionElements>
        <flowable:out sourceExpression="${ArboRefNo}" target="ArboRefNo"></flowable:out>
      </extensionElements>
    </callActivity>
    <sequenceFlow id="sid-0E765FA5-E4A4-4040-9655-2B492B6CEEEC" sourceRef="sid-69DA487E-2D0B-4D38-B763-C4F4322AA6A1" targetRef="sid-E5A47F8E-A59C-4477-AB9C-ED0C5C13F28F"></sequenceFlow>
    <callActivity id="sid-D1C70F91-A3D9-4CFF-84B7-9BCCC021C1BB" name="InterruptWO" calledElement="Interrupt_WO" flowable:calledElementType="key" flowable:fallbackToDefaultTenant="false">
      <extensionElements>
        <flowable:in sourceExpression="${fWOID}" target="fWOID"></flowable:in>
        <flowable:in sourceExpression="Sync with Arbor failed" target="errorRemarks"></flowable:in>
        <flowable:in sourceExpression="Cancelled" target="status"></flowable:in>
      </extensionElements>
    </callActivity>
    <exclusiveGateway id="sid-A34B14D0-3BEB-4524-8DE4-9D6FEA8576B5"></exclusiveGateway>
    <sequenceFlow id="sid-E0FE08B1-1BDF-4A6A-91F8-1A88E0E77416" sourceRef="sid-D1C70F91-A3D9-4CFF-84B7-9BCCC021C1BB" targetRef="sid-A34B14D0-3BEB-4524-8DE4-9D6FEA8576B5"></sequenceFlow>
    <sequenceFlow id="sid-A0C90AB4-5412-4D1F-898E-C80A42D26F65" name="continue" sourceRef="sid-A34B14D0-3BEB-4524-8DE4-9D6FEA8576B5" targetRef="sid-A3D9E60B-D58D-44AA-9024-DDD257A931EF">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${actionToDo=='continue'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="sid-1360C738-35A4-472C-B931-E914CE9908E6" name="retry" sourceRef="sid-A34B14D0-3BEB-4524-8DE4-9D6FEA8576B5" targetRef="sid-69DA487E-2D0B-4D38-B763-C4F4322AA6A1">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${actionToDo=='retry'}]]></conditionExpression>
    </sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_ArborSyncCancelOrder">
    <bpmndi:BPMNPlane bpmnElement="ArborSyncCancelOrder" id="BPMNPlane_ArborSyncCancelOrder">
      <bpmndi:BPMNShape bpmnElement="sid-38203C2B-DA77-43BE-AD89-CF407427D27B" id="BPMNShape_sid-38203C2B-DA77-43BE-AD89-CF407427D27B">
        <omgdc:Bounds height="30.0" width="30.0" x="75.0" y="160.00000000000003"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-E5A47F8E-A59C-4477-AB9C-ED0C5C13F28F" id="BPMNShape_sid-E5A47F8E-A59C-4477-AB9C-ED0C5C13F28F">
        <omgdc:Bounds height="80.0" width="100.0" x="552.2799982513827" y="135.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-A3D9E60B-D58D-44AA-9024-DDD257A931EF" id="BPMNShape_sid-A3D9E60B-D58D-44AA-9024-DDD257A931EF">
        <omgdc:Bounds height="28.0" width="28.0" x="735.0" y="161.00000000000003"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-BB096FC7-4F23-4DD4-91DF-209F087FCC83" id="BPMNShape_sid-BB096FC7-4F23-4DD4-91DF-209F087FCC83">
        <omgdc:Bounds height="30.0" width="30.0" x="584.205208303141" y="200.99719930988846"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-18FEBC62-1525-4F19-BA08-18D64E6ACF8E" id="BPMNShape_sid-18FEBC62-1525-4F19-BA08-18D64E6ACF8E">
        <omgdc:Bounds height="80.0" width="99.99999999999997" x="165.00000000000003" y="135.00000000000006"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-69DA487E-2D0B-4D38-B763-C4F4322AA6A1" id="BPMNShape_sid-69DA487E-2D0B-4D38-B763-C4F4322AA6A1">
        <omgdc:Bounds height="80.0" width="100.0" x="315.0" y="135.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-D1C70F91-A3D9-4CFF-84B7-9BCCC021C1BB" id="BPMNShape_sid-D1C70F91-A3D9-4CFF-84B7-9BCCC021C1BB">
        <omgdc:Bounds height="80.0" width="100.0" x="555.0" y="285.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-A34B14D0-3BEB-4524-8DE4-9D6FEA8576B5" id="BPMNShape_sid-A34B14D0-3BEB-4524-8DE4-9D6FEA8576B5">
        <omgdc:Bounds height="40.0" width="40.0" x="585.0" y="420.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sid-9644021F-C133-4ACA-AE98-6FFB74A129C4" id="BPMNEdge_sid-9644021F-C133-4ACA-AE98-6FFB74A129C4">
        <omgdi:waypoint x="104.94999883055105" y="175.00000000000006"></omgdi:waypoint>
        <omgdi:waypoint x="164.9999999999863" y="175.00000000000006"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-708A1307-04F9-4B89-AEBC-190C8A42C1F6" id="BPMNEdge_sid-708A1307-04F9-4B89-AEBC-190C8A42C1F6">
        <omgdi:waypoint x="264.9499999999855" y="175.00000000000003"></omgdi:waypoint>
        <omgdi:waypoint x="315.0" y="175.00000000000003"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-1360C738-35A4-472C-B931-E914CE9908E6" id="BPMNEdge_sid-1360C738-35A4-472C-B931-E914CE9908E6">
        <omgdi:waypoint x="585.5" y="440.5"></omgdi:waypoint>
        <omgdi:waypoint x="365.0" y="440.5"></omgdi:waypoint>
        <omgdi:waypoint x="365.0" y="214.95000000000002"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-8D61834B-AF0F-44E2-9063-9E341FD96728" id="BPMNEdge_sid-8D61834B-AF0F-44E2-9063-9E341FD96728">
        <omgdi:waypoint x="652.2299982512839" y="175.00000000000003"></omgdi:waypoint>
        <omgdi:waypoint x="735.0" y="175.00000000000003"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-0E765FA5-E4A4-4040-9655-2B492B6CEEEC" id="BPMNEdge_sid-0E765FA5-E4A4-4040-9655-2B492B6CEEEC">
        <omgdi:waypoint x="414.9499999999157" y="175.0"></omgdi:waypoint>
        <omgdi:waypoint x="552.2799982513782" y="175.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-E0FE08B1-1BDF-4A6A-91F8-1A88E0E77416" id="BPMNEdge_sid-E0FE08B1-1BDF-4A6A-91F8-1A88E0E77416">
        <omgdi:waypoint x="605.1729437229437" y="364.95000000000005"></omgdi:waypoint>
        <omgdi:waypoint x="605.4130434782609" y="420.4130434782609"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-A0C90AB4-5412-4D1F-898E-C80A42D26F65" id="BPMNEdge_sid-A0C90AB4-5412-4D1F-898E-C80A42D26F65">
        <omgdi:waypoint x="624.4434018104646" y="440.5"></omgdi:waypoint>
        <omgdi:waypoint x="749.0" y="440.5"></omgdi:waypoint>
        <omgdi:waypoint x="749.0" y="188.9499212386947"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-3ED8FFB9-8D2E-4846-B8C6-4A004466A2CE" id="BPMNEdge_sid-3ED8FFB9-8D2E-4846-B8C6-4A004466A2CE">
        <omgdi:waypoint x="599.205208303141" y="230.9471965936822"></omgdi:waypoint>
        <omgdi:waypoint x="599.205208303141" y="285.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>