<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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:g="http://www.jboss.org/drools/flow/gpd" xmlns:tns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" id="Definition" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
  <itemDefinition id="_ParameterItem" structureRef="org.switchyard.quickstarts.bpm.service.data.Order"/>
  <itemDefinition id="_ResultItem" structureRef="Boolean"/>
  <itemDefinition id="_messageIdItem" structureRef="String"/>
  <itemDefinition id="_userNameItem" structureRef="String"/>
  <process id="ProcessOrder" tns:packageName="org.switchyard.demo.openshift" name="ProcessOrder" isExecutable="true" processType="Private">
    <property id="Parameter" itemSubjectRef="_ParameterItem"/>
    <property id="Result" itemSubjectRef="_ResultItem"/>
    <property id="messageId" itemSubjectRef="_messageIdItem"/>
    <property id="userName" itemSubjectRef="_userNameItem"/>
    <startEvent id="_1" name="Start">
      <outgoing>_1-_8</outgoing>
    </startEvent>
    <endEvent id="_7" name="End">
      <incoming>_9-_7</incoming>
      <terminateEventDefinition id="TerminateEventDefinition_1"/>
    </endEvent>
    <task id="_8" tns:taskName="SwitchYard Service Task" name="Inventory">
      <extensionElements>
        <tns:onEntry-script tns:scriptFormat="http://www.java.com/java">
          <tns:script>System.out.println(&quot;********** Inventory user: &quot; + userName + &quot; / incoming messageId: &quot; + messageId + &quot; **********&quot;);</tns:script>
        </tns:onEntry-script>
      </extensionElements>
      <incoming>_1-_8</incoming>
      <outgoing>_8-_11</outgoing>
      <ioSpecification id="InputOutputSpecification_1">
        <dataInput id="_8_ParameterInput" name="Parameter"/>
        <dataInput id="_8_messageIdInput" name="messageId"/>
        <dataInput id="_8_userNameInput" name="userName"/>
        <dataInput id="_8_ServiceNameInput" name="ServiceName"/>
        <dataInput id="_8_ResultNameInput" name="ResultName"/>
        <dataInput id="_8_OperationNameInput" name="OperationName"/>
        <dataInput id="_8_OutputMessageVariableInput" name="OutputMessageVariable"/>
        <dataInput id="_8_ParameterNameInput" name="ParameterName"/>
        <dataOutput id="_8_ResultOutput" name="Result"/>
        <inputSet id="InputSet_1">
          <dataInputRefs>_8_ParameterInput</dataInputRefs>
          <dataInputRefs>_8_messageIdInput</dataInputRefs>
          <dataInputRefs>_8_userNameInput</dataInputRefs>
          <dataInputRefs>_8_ServiceNameInput</dataInputRefs>
          <dataInputRefs>_8_ResultNameInput</dataInputRefs>
          <dataInputRefs>_8_OperationNameInput</dataInputRefs>
          <dataInputRefs>_8_OutputMessageVariableInput</dataInputRefs>
          <dataInputRefs>_8_ParameterNameInput</dataInputRefs>
        </inputSet>
        <outputSet id="OutputSet_1">
          <dataOutputRefs>_8_ResultOutput</dataOutputRefs>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation id="DataInputAssociation_1">
        <sourceRef>Parameter</sourceRef>
        <targetRef>_8_ParameterInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_2">
        <sourceRef>messageId</sourceRef>
        <targetRef>_8_messageIdInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_3">
        <sourceRef>userName</sourceRef>
        <targetRef>_8_userNameInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_4">
        <targetRef>_8_ServiceNameInput</targetRef>
        <assignment id="Assignment_1">
          <from xsi:type="tFormalExpression" id="FormalExpression_1">Inventory</from>
          <to xsi:type="tFormalExpression" id="FormalExpression_2">_8_ServiceNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_5">
        <targetRef>_8_ResultNameInput</targetRef>
        <assignment id="Assignment_2">
          <from xsi:type="tFormalExpression" id="FormalExpression_3"/>
          <to xsi:type="tFormalExpression" id="FormalExpression_4">_8_ResultNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_6">
        <targetRef>_8_OperationNameInput</targetRef>
        <assignment id="Assignment_3">
          <from xsi:type="tFormalExpression" id="FormalExpression_5">checkAvailability</from>
          <to xsi:type="tFormalExpression" id="FormalExpression_6">_8_OperationNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_7">
        <targetRef>_8_OutputMessageVariableInput</targetRef>
        <assignment id="Assignment_4">
          <from xsi:type="tFormalExpression" id="FormalExpression_7">item-available</from>
          <to xsi:type="tFormalExpression" id="FormalExpression_8">_8_OutputMessageVariableInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_8">
        <targetRef>_8_ParameterNameInput</targetRef>
        <assignment id="Assignment_5">
          <from xsi:type="tFormalExpression" id="FormalExpression_9"/>
          <to xsi:type="tFormalExpression" id="FormalExpression_10">_8_ParameterNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataOutputAssociation id="DataOutputAssociation_1">
        <sourceRef>_8_ResultOutput</sourceRef>
        <targetRef>Result</targetRef>
      </dataOutputAssociation>
    </task>
    <task id="_9" tns:taskName="SwitchYard Service Task" name="Shipping">
      <incoming>_11-_9</incoming>
      <outgoing>_9-_7</outgoing>
      <ioSpecification id="InputOutputSpecification_2">
        <dataInput id="_9_ParameterInput" name="Parameter"/>
        <dataInput id="_9_ServiceNameInput" name="ServiceName"/>
        <dataInput id="_9_ResultNameInput" name="ResultName"/>
        <dataInput id="_9_OperationNameInput" name="OperationName"/>
        <dataInput id="_9_ParameterNameInput" name="ParameterName"/>
        <dataOutput id="_9_ResultOutput" name="Result"/>
        <inputSet id="InputSet_2">
          <dataInputRefs>_9_ParameterInput</dataInputRefs>
          <dataInputRefs>_9_ServiceNameInput</dataInputRefs>
          <dataInputRefs>_9_ResultNameInput</dataInputRefs>
          <dataInputRefs>_9_OperationNameInput</dataInputRefs>
          <dataInputRefs>_9_ParameterNameInput</dataInputRefs>
        </inputSet>
        <outputSet id="OutputSet_2">
          <dataOutputRefs>_9_ResultOutput</dataOutputRefs>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation id="DataInputAssociation_9">
        <sourceRef>Parameter</sourceRef>
        <targetRef>_9_ParameterInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_10">
        <targetRef>_9_ServiceNameInput</targetRef>
        <assignment id="Assignment_6">
          <from xsi:type="tFormalExpression" id="FormalExpression_11">Shipping</from>
          <to xsi:type="tFormalExpression" id="FormalExpression_12">_9_ServiceNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_11">
        <targetRef>_9_ResultNameInput</targetRef>
        <assignment id="Assignment_7">
          <from xsi:type="tFormalExpression" id="FormalExpression_13"/>
          <to xsi:type="tFormalExpression" id="FormalExpression_14">_9_ResultNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_12">
        <targetRef>_9_OperationNameInput</targetRef>
        <assignment id="Assignment_8">
          <from xsi:type="tFormalExpression" id="FormalExpression_15">ship</from>
          <to xsi:type="tFormalExpression" id="FormalExpression_16">_9_OperationNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_13">
        <targetRef>_9_ParameterNameInput</targetRef>
        <assignment id="Assignment_9">
          <from xsi:type="tFormalExpression" id="FormalExpression_17"/>
          <to xsi:type="tFormalExpression" id="FormalExpression_18">_9_ParameterNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataOutputAssociation id="DataOutputAssociation_2">
        <sourceRef>_9_ResultOutput</sourceRef>
        <targetRef>Result</targetRef>
      </dataOutputAssociation>
    </task>
    <task id="_10" tns:taskName="SwitchYard Service Task" name="BackOrder">
      <incoming>_11-_10</incoming>
      <outgoing>_10-_12</outgoing>
      <ioSpecification id="InputOutputSpecification_3">
        <dataInput id="_10_ParameterInput" name="Parameter"/>
        <dataInput id="_10_ServiceNameInput" name="ServiceName"/>
        <dataInput id="_10_ResultNameInput" name="ResultName"/>
        <dataInput id="_10_OperationNameInput" name="OperationName"/>
        <dataInput id="_10_ParameterNameInput" name="ParameterName"/>
        <dataOutput id="_10_ResultOutput" name="Result"/>
        <inputSet id="InputSet_3">
          <dataInputRefs>_10_ParameterInput</dataInputRefs>
          <dataInputRefs>_10_ServiceNameInput</dataInputRefs>
          <dataInputRefs>_10_ResultNameInput</dataInputRefs>
          <dataInputRefs>_10_OperationNameInput</dataInputRefs>
          <dataInputRefs>_10_ParameterNameInput</dataInputRefs>
        </inputSet>
        <outputSet id="OutputSet_3">
          <dataOutputRefs>_10_ResultOutput</dataOutputRefs>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation id="DataInputAssociation_14">
        <sourceRef>Parameter</sourceRef>
        <targetRef>_10_ParameterInput</targetRef>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_15">
        <targetRef>_10_ServiceNameInput</targetRef>
        <assignment id="Assignment_10">
          <from xsi:type="tFormalExpression" id="FormalExpression_19">BackOrder</from>
          <to xsi:type="tFormalExpression" id="FormalExpression_20">_10_ServiceNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_16">
        <targetRef>_10_ResultNameInput</targetRef>
        <assignment id="Assignment_11">
          <from xsi:type="tFormalExpression" id="FormalExpression_21"/>
          <to xsi:type="tFormalExpression" id="FormalExpression_22">_10_ResultNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_17">
        <targetRef>_10_OperationNameInput</targetRef>
        <assignment id="Assignment_12">
          <from xsi:type="tFormalExpression" id="FormalExpression_23">hold</from>
          <to xsi:type="tFormalExpression" id="FormalExpression_24">_10_OperationNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation id="DataInputAssociation_18">
        <targetRef>_10_ParameterNameInput</targetRef>
        <assignment id="Assignment_13">
          <from xsi:type="tFormalExpression" id="FormalExpression_25"/>
          <to xsi:type="tFormalExpression" id="FormalExpression_26">_10_ParameterNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataOutputAssociation id="DataOutputAssociation_3">
        <sourceRef>_10_ResultOutput</sourceRef>
        <targetRef>Result</targetRef>
      </dataOutputAssociation>
    </task>
    <exclusiveGateway id="_11" name="Gateway" gatewayDirection="Diverging">
      <incoming>_8-_11</incoming>
      <outgoing>_11-_9</outgoing>
      <outgoing>_11-_10</outgoing>
    </exclusiveGateway>
    <endEvent id="_12" name="End">
      <incoming>_10-_12</incoming>
      <terminateEventDefinition id="TerminateEventDefinition_2"/>
    </endEvent>
    <sequenceFlow id="_9-_7" sourceRef="_9" targetRef="_7"/>
    <sequenceFlow id="_1-_8" sourceRef="_1" targetRef="_8"/>
    <sequenceFlow id="_11-_9" tns:priority="1" name="ship" sourceRef="_11" targetRef="_9">
      <conditionExpression xsi:type="tFormalExpression" id="FormalExpression_27" language="http://www.java.com/java">return ((Boolean)Result).booleanValue();</conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_11-_10" tns:priority="1" name="hold" sourceRef="_11" targetRef="_10">
      <conditionExpression xsi:type="tFormalExpression" id="FormalExpression_28" language="http://www.java.com/java">return !((Boolean)Result).booleanValue();</conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_8-_11" sourceRef="_8" targetRef="_11"/>
    <sequenceFlow id="_10-_12" sourceRef="_10" targetRef="_12"/>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_Process_1" bpmnElement="ProcessOrder">
      <bpmndi:BPMNShape id="BPMNShape_StartEvent_1" bpmnElement="_1">
        <dc:Bounds height="48.0" width="48.0" x="178.0" y="30.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_EndEvent_1" bpmnElement="_7">
        <dc:Bounds height="48.0" width="48.0" x="95.0" y="446.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Task_1" bpmnElement="_8">
        <dc:Bounds height="48.0" width="100.0" x="151.0" y="136.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Task_2" bpmnElement="_9">
        <dc:Bounds height="48.0" width="100.0" x="68.0" y="354.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_Task_3" bpmnElement="_10">
        <dc:Bounds height="48.0" width="100.0" x="229.0" y="359.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_ExclusiveGateway_1" bpmnElement="_11" isMarkerVisible="true">
        <dc:Bounds height="48.0" width="48.0" x="175.0" y="242.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="BPMNShape_EndEvent_2" bpmnElement="_12">
        <dc:Bounds height="48.0" width="48.0" x="254.0" y="447.0"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="_9-_7" sourceElement="BPMNShape_Task_2" targetElement="BPMNShape_EndEvent_1">
        <di:waypoint xsi:type="dc:Point" x="118.0" y="402.0"/>
        <di:waypoint xsi:type="dc:Point" x="119.0" y="446.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="_1-_8" sourceElement="BPMNShape_StartEvent_1" targetElement="BPMNShape_Task_1">
        <di:waypoint xsi:type="dc:Point" x="202.0" y="78.0"/>
        <di:waypoint xsi:type="dc:Point" x="201.0" y="136.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_3" bpmnElement="_11-_9" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_Task_2">
        <di:waypoint xsi:type="dc:Point" x="199.0" y="291.0"/>
        <di:waypoint xsi:type="dc:Point" x="118.0" y="354.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_4" bpmnElement="_11-_10" sourceElement="BPMNShape_ExclusiveGateway_1" targetElement="BPMNShape_Task_3">
        <di:waypoint xsi:type="dc:Point" x="199.0" y="291.0"/>
        <di:waypoint xsi:type="dc:Point" x="279.0" y="359.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="_8-_11" sourceElement="BPMNShape_Task_1" targetElement="BPMNShape_ExclusiveGateway_1">
        <di:waypoint xsi:type="dc:Point" x="201.0" y="184.0"/>
        <di:waypoint xsi:type="dc:Point" x="199.0" y="242.0"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="_10-_12" sourceElement="BPMNShape_Task_3" targetElement="BPMNShape_EndEvent_2">
        <di:waypoint xsi:type="dc:Point" x="279.0" y="407.0"/>
        <di:waypoint xsi:type="dc:Point" x="278.0" y="447.0"/>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
