<?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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Bestellung-verbuchen_Definition" targetNamespace="http://bpmn.io/schema/bpmn" exporter="5Minds Studio" exporterVersion="1">
  <bpmn:collaboration id="Collaboration_1cidyxu" name="">
    <bpmn:participant id="Participant_0px403d" name="Bestellung-verbuchen" processRef="Bestellung-verbuchen_Process" />
    <bpmn:participant id="Participant_1trshgl" name="Material-Bestellung" />
    <bpmn:messageFlow id="Flow_16kioo9" name="Bestellungs-informationen" sourceRef="Participant_1trshgl" targetRef="StartEvent_1" />
    <bpmn:messageFlow id="Flow_1a0hus8" sourceRef="Participant_1trshgl" targetRef="Event_1xqu1nu" />
  </bpmn:collaboration>
  <bpmn:process id="Bestellung-verbuchen_Process" name="Bestellung-verbuchen" isExecutable="true">
    <bpmn:laneSet>
      <bpmn:lane id="Lane_1xzf0d3" name="Bestell-System">
        <bpmn:flowNodeRef>StartEvent_1</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Event_0vn3u70</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Gateway_0i642gb</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Gateway_1yzo3kj</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Event_1xqu1nu</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>
    <bpmn:sequenceFlow id="Flow_0wxqx2p" sourceRef="StartEvent_1" targetRef="Gateway_0i642gb" />
    <bpmn:sequenceFlow id="Flow_1a5ei06" sourceRef="Gateway_0i642gb" targetRef="Gateway_1yzo3kj" />
    <bpmn:sequenceFlow id="Flow_0nyrmwx" name="Ja" sourceRef="Gateway_1yzo3kj" targetRef="Event_0vn3u70">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">dataObjects.gebuchteBestellungen.bestellungen.length &gt;= 2;
</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="Flow_1tjfd6f" name="Nein" sourceRef="Gateway_1yzo3kj" targetRef="Event_1xqu1nu" />
    <bpmn:sequenceFlow id="Flow_056mypw" sourceRef="Event_1xqu1nu" targetRef="Gateway_0i642gb" />
    <bpmn:startEvent id="StartEvent_1" name="Bestellung übermittelt">
      <bpmn:outgoing>Flow_0wxqx2p</bpmn:outgoing>
      <bpmn:dataOutputAssociation id="DataOutputAssociation_1ai2kvw">
        <bpmn:extensionElements>
          <camunda:properties>
            <camunda:property name="dataSource" value="return {&#10;  bestellungen: [&#10;    {&#10;      produkt: token.current.produkt,&#10;      menge: token.current.menge,&#10;    },&#10;  ],&#10;};" />
          </camunda:properties>
        </bpmn:extensionElements>
        <bpmn:targetRef>gebuchteBestellungen</bpmn:targetRef>
      </bpmn:dataOutputAssociation>
      <bpmn:messageEventDefinition id="MessageEventDefinition_1j1extw" messageRef="Message_5fen6rEW" />
    </bpmn:startEvent>
    <bpmn:endEvent id="Event_0vn3u70" name="Bestellung verbucht">
      <bpmn:incoming>Flow_0nyrmwx</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:exclusiveGateway id="Gateway_0i642gb">
      <bpmn:incoming>Flow_0wxqx2p</bpmn:incoming>
      <bpmn:incoming>Flow_056mypw</bpmn:incoming>
      <bpmn:outgoing>Flow_1a5ei06</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:exclusiveGateway id="Gateway_1yzo3kj" name="Mindestanzahl erreicht?" default="Flow_1tjfd6f">
      <bpmn:incoming>Flow_1a5ei06</bpmn:incoming>
      <bpmn:outgoing>Flow_0nyrmwx</bpmn:outgoing>
      <bpmn:outgoing>Flow_1tjfd6f</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:intermediateCatchEvent id="Event_1xqu1nu" name="Bestellung übermittelt">
      <bpmn:extensionElements>
        <camunda:properties>
          <camunda:property name="engine.setTriggerValueInToken" value="${token.current.produkt}" />
          <camunda:property name="engine.setTriggerValueInEventPayload" value="${eventPayload.produkt}" />
        </camunda:properties>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_1tjfd6f</bpmn:incoming>
      <bpmn:outgoing>Flow_056mypw</bpmn:outgoing>
      <bpmn:dataOutputAssociation id="DataOutputAssociation_1uiaez2">
        <bpmn:extensionElements>
          <camunda:properties>
            <camunda:property name="dataSource" value="return {&#10;  bestellungen: [&#10;    ...dataObjects.gebuchteBestellungen.bestellungen,&#10;    {&#10;      produkt: token.current.produkt,&#10;      menge: token.current.menge,&#10;    },&#10;  ],&#10;};" />
          </camunda:properties>
        </bpmn:extensionElements>
        <bpmn:targetRef>gebuchteBestellungen</bpmn:targetRef>
      </bpmn:dataOutputAssociation>
      <bpmn:messageEventDefinition id="MessageEventDefinition_0j4cdyz" messageRef="Message_eBRAfgKq" />
    </bpmn:intermediateCatchEvent>
    <bpmn:dataObjectReference id="gebuchteBestellungen" name="Gebuchte Bestellungen" dataObjectRef="DataObject_1hwe8c7" />
    <bpmn:dataObject id="DataObject_1hwe8c7" />
  </bpmn:process>
  <bpmn:message id="Message_5fen6rEW" name="bestellung_verbuchen" />
  <bpmn:message id="Message_mg0gIhAQ" name="bestellung_verbuchen" />
  <bpmn:message id="Message_eBRAfgKq" name="bestellung_verbuchen" />
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1cidyxu">
      <bpmndi:BPMNShape id="Participant_0px403d_di" bpmnElement="Participant_0px403d" isHorizontal="true">
        <dc:Bounds x="5" y="4" width="885" height="406" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_1xzf0d3_di" bpmnElement="Lane_1xzf0d3" isHorizontal="true">
        <dc:Bounds x="35" y="4" width="855" height="406" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_16p33kc_di" bpmnElement="StartEvent_1">
        <dc:Bounds x="92" y="212" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="84" y="255" width="52" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0vn3u70_di" bpmnElement="Event_0vn3u70">
        <dc:Bounds x="492" y="212" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="484" y="255" width="52" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Gateway_0i642gb_di" bpmnElement="Gateway_0i642gb" isMarkerVisible="true">
        <dc:Bounds x="205" y="205" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Gateway_1yzo3kj_di" bpmnElement="Gateway_1yzo3kj" isMarkerVisible="true">
        <dc:Bounds x="345" y="205" width="50" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="334" y="265" width="71" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1a2mmha_di" bpmnElement="Event_1xqu1nu">
        <dc:Bounds x="352" y="102" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="394" y="106" width="52" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="DataObjectReference_04hhnd5_di" bpmnElement="gebuchteBestellungen">
        <dc:Bounds x="212" y="25" width="36" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="258" y="16" width="64" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_0wxqx2p_di" bpmnElement="Flow_0wxqx2p">
        <di:waypoint x="128" y="230" />
        <di:waypoint x="205" y="230" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1a5ei06_di" bpmnElement="Flow_1a5ei06">
        <di:waypoint x="255" y="230" />
        <di:waypoint x="345" y="230" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0nyrmwx_di" bpmnElement="Flow_0nyrmwx">
        <di:waypoint x="395" y="230" />
        <di:waypoint x="492" y="230" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="414" y="212" width="12" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1tjfd6f_di" bpmnElement="Flow_1tjfd6f">
        <di:waypoint x="370" y="205" />
        <di:waypoint x="370" y="138" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="374" y="169" width="23" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_056mypw_di" bpmnElement="Flow_056mypw">
        <di:waypoint x="352" y="120" />
        <di:waypoint x="230" y="120" />
        <di:waypoint x="230" y="205" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Participant_0wr8l9x_di" bpmnElement="Participant_1trshgl" isHorizontal="true">
        <dc:Bounds x="5" y="-120" width="885" height="60" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_16kioo9_di" bpmnElement="Flow_16kioo9">
        <di:waypoint x="110" y="-60" />
        <di:waypoint x="110" y="212" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="116" y="-36" width="67" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="DataOutputAssociation_1uiaez2_di" bpmnElement="DataOutputAssociation_1uiaez2">
        <di:waypoint x="354" y="113" />
        <di:waypoint x="248" y="64" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="DataOutputAssociation_1ai2kvw_di" bpmnElement="DataOutputAssociation_1ai2kvw">
        <di:waypoint x="120" y="215" />
        <di:waypoint x="218" y="75" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1a0hus8_di" bpmnElement="Flow_1a0hus8">
        <di:waypoint x="370" y="-60" />
        <di:waypoint x="370" y="102" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
