<?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>Gateway_0i642gb</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Gateway_1yzo3kj</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Gateway_0lftvsm</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Event_1xqu1nu</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Event_0kgxjcu</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Event_0vn3u70</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>Gateway_1rtul3d</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="Gateway_1rtul3d">
      <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="Gateway_0lftvsm" />
    <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: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:sequenceFlow id="Flow_0p11i0z" sourceRef="Gateway_0lftvsm" targetRef="Event_1xqu1nu" />
    <bpmn:eventBasedGateway id="Gateway_0lftvsm">
      <bpmn:incoming>Flow_1tjfd6f</bpmn:incoming>
      <bpmn:outgoing>Flow_0p11i0z</bpmn:outgoing>
      <bpmn:outgoing>Flow_1vl1n5d</bpmn:outgoing>
    </bpmn:eventBasedGateway>
    <bpmn:sequenceFlow id="Flow_1vl1n5d" sourceRef="Gateway_0lftvsm" targetRef="Event_0kgxjcu" />
    <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_0p11i0z</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:intermediateCatchEvent id="Event_0kgxjcu" name="Wartezeit abgelaufen">
      <bpmn:incoming>Flow_1vl1n5d</bpmn:incoming>
      <bpmn:outgoing>Flow_0n3hxec</bpmn:outgoing>
      <bpmn:timerEventDefinition id="TimerEventDefinition_05xd6vl">
        <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT5S</bpmn:timeDuration>
      </bpmn:timerEventDefinition>
    </bpmn:intermediateCatchEvent>
    <bpmn:endEvent id="Event_0vn3u70" name="Bestellung verbucht">
      <bpmn:incoming>Flow_0kizmtc</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_0kizmtc" sourceRef="Gateway_1rtul3d" targetRef="Event_0vn3u70" />
    <bpmn:sequenceFlow id="Flow_0n3hxec" sourceRef="Event_0kgxjcu" targetRef="Gateway_1rtul3d" />
    <bpmn:exclusiveGateway id="Gateway_1rtul3d">
      <bpmn:incoming>Flow_0nyrmwx</bpmn:incoming>
      <bpmn:incoming>Flow_0n3hxec</bpmn:incoming>
      <bpmn:outgoing>Flow_0kizmtc</bpmn:outgoing>
    </bpmn:exclusiveGateway>
  </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="-10" width="885" height="450" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Lane_1xzf0d3_di" bpmnElement="Lane_1xzf0d3" isHorizontal="true">
        <dc:Bounds x="35" y="-10" width="855" height="450" />
        <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="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="333.5" y="176" width="71" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Gateway_0pcjge1_di" bpmnElement="Gateway_0lftvsm">
        <dc:Bounds x="475" y="205" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1a2mmha_di" bpmnElement="Event_1xqu1nu">
        <dc:Bounds x="592" y="132" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="585" y="176" width="52" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="DataObjectReference_04hhnd5_di" bpmnElement="gebuchteBestellungen">
        <dc:Bounds x="212" y="5" width="36" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="258" y="46" width="64" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0kgxjcu_di" bpmnElement="Event_0kgxjcu">
        <dc:Bounds x="592" y="292" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="583" y="266" width="55" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0vn3u70_di" bpmnElement="Event_0vn3u70">
        <dc:Bounds x="802" y="362" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="794" y="405" width="52" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Gateway_1rtul3d_di" bpmnElement="Gateway_1rtul3d" isMarkerVisible="true">
        <dc:Bounds x="665" y="355" width="50" height="50" />
      </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="370" y="255" />
        <di:waypoint x="370" y="380" />
        <di:waypoint x="665" y="380" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="384" y="278" width="12" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1tjfd6f_di" bpmnElement="Flow_1tjfd6f">
        <di:waypoint x="395" y="230" />
        <di:waypoint x="475" y="230" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="408" y="239" width="23" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_056mypw_di" bpmnElement="Flow_056mypw">
        <di:waypoint x="610" y="132" />
        <di:waypoint x="610" y="90" />
        <di:waypoint x="230" y="90" />
        <di:waypoint x="230" y="205" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0p11i0z_di" bpmnElement="Flow_0p11i0z">
        <di:waypoint x="500" y="205" />
        <di:waypoint x="500" y="150" />
        <di:waypoint x="592" y="150" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1vl1n5d_di" bpmnElement="Flow_1vl1n5d">
        <di:waypoint x="500" y="255" />
        <di:waypoint x="500" y="310" />
        <di:waypoint x="592" y="310" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0kizmtc_di" bpmnElement="Flow_0kizmtc">
        <di:waypoint x="715" y="380" />
        <di:waypoint x="802" y="380" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0n3hxec_di" bpmnElement="Flow_0n3hxec">
        <di:waypoint x="628" y="310" />
        <di:waypoint x="690" y="310" />
        <di:waypoint x="690" y="355" />
      </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="DataOutputAssociation_1ai2kvw_di" bpmnElement="DataOutputAssociation_1ai2kvw">
        <di:waypoint x="120" y="215" />
        <di:waypoint x="220" y="55" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="DataOutputAssociation_1uiaez2_di" bpmnElement="DataOutputAssociation_1uiaez2">
        <di:waypoint x="605" y="133" />
        <di:waypoint x="580" y="36" />
        <di:waypoint x="248" y="36" />
      </bpmndi:BPMNEdge>
      <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="-44" width="67" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1a0hus8_di" bpmnElement="Flow_1a0hus8">
        <di:waypoint x="610" y="-60" />
        <di:waypoint x="610" y="132" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
