Tasks run one after another for every seeded item. Each task becomes an external service task.
workflow<Order>("billing-pipeline") {
input(orders)
task("validate") { it.attempts = 0 }
task("charge") { charge(it) }
task("receipt") { sendReceipt(it) }
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="definitions_1ea6fa3d-3551-427e-8588-f15c8775bedc" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="billing-pipeline" isExecutable="true" name="billing-pipeline">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_d54ef220-22d6-4de0-876e-b06fde90b5de</outgoing>
</startEvent>
<serviceTask camunda:topic="validate" camunda:type="external" id="ext_validate_t1" name="validate">
<incoming>sequenceFlow_d54ef220-22d6-4de0-876e-b06fde90b5de</incoming>
<outgoing>sequenceFlow_3312baa0-fa0c-4436-b798-22e43ae4e932</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_d54ef220-22d6-4de0-876e-b06fde90b5de" sourceRef="start" targetRef="ext_validate_t1"/>
<serviceTask camunda:topic="charge" camunda:type="external" id="ext_charge_t2" name="charge">
<incoming>sequenceFlow_3312baa0-fa0c-4436-b798-22e43ae4e932</incoming>
<outgoing>sequenceFlow_b57f916b-dcd3-410b-a613-f9c24636be85</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_3312baa0-fa0c-4436-b798-22e43ae4e932" sourceRef="ext_validate_t1" targetRef="ext_charge_t2"/>
<serviceTask camunda:topic="receipt" camunda:type="external" id="ext_receipt_t3" name="receipt">
<incoming>sequenceFlow_b57f916b-dcd3-410b-a613-f9c24636be85</incoming>
<outgoing>sequenceFlow_52b05ec1-02e1-4003-8247-f1f838ee9c1d</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_b57f916b-dcd3-410b-a613-f9c24636be85" sourceRef="ext_charge_t2" targetRef="ext_receipt_t3"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_52b05ec1-02e1-4003-8247-f1f838ee9c1d</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_52b05ec1-02e1-4003-8247-f1f838ee9c1d" sourceRef="ext_receipt_t3" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_313c9f01-2471-4d3c-8afc-a6f181046e84">
<bpmndi:BPMNPlane bpmnElement="billing-pipeline" id="BPMNPlane_0e91bba1-1937-492c-aecc-67dce73dc817">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_2a8f29db-09e8-4c5a-b929-4a6bccedf26f">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ext_validate_t1" id="BPMNShape_d15358b4-ea8e-48db-9072-0541f50dc218">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_d54ef220-22d6-4de0-876e-b06fde90b5de" id="BPMNEdge_129400b5-7736-4dc4-8a05-ed47ce7c72ba">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_charge_t2" id="BPMNShape_65793ab3-87cd-4a05-9162-1cef5ce7fd9c">
<dc:Bounds height="80.0" width="100.0" x="368.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_3312baa0-fa0c-4436-b798-22e43ae4e932" id="BPMNEdge_edc1191b-864c-4a90-b93a-b0d493f1b726">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="368.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_receipt_t3" id="BPMNShape_e77b8763-e12a-4312-9dab-67064309e858">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_b57f916b-dcd3-410b-a613-f9c24636be85" id="BPMNEdge_cbf675a6-0928-427b-aa90-2c58d5ab5495">
<di:waypoint x="468.0" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_e84c95aa-b873-41ed-9215-a1d877560e20">
<dc:Bounds height="36.0" width="36.0" x="740.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_52b05ec1-02e1-4003-8247-f1f838ee9c1d" id="BPMNEdge_f865f848-ecf7-4eed-9a97-f8c973e62ef0">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="740.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ns0="http://camunda.org/schema/zeebe/1.0" id="definitions_995bf060-a51c-4cea-8e80-52f44ccd106c" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="billing-pipeline" isExecutable="true" name="billing-pipeline">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_2f18a1b5-850d-45d5-b081-d275fd00e98e</outgoing>
</startEvent>
<serviceTask id="ext_validate_t1" name="validate">
<extensionElements>
<ns0:taskDefinition type="validate"/>
</extensionElements>
<incoming>sequenceFlow_2f18a1b5-850d-45d5-b081-d275fd00e98e</incoming>
<outgoing>sequenceFlow_f0cd0605-7265-4da3-b6cc-be41dc95f020</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_2f18a1b5-850d-45d5-b081-d275fd00e98e" sourceRef="start" targetRef="ext_validate_t1"/>
<serviceTask id="ext_charge_t2" name="charge">
<extensionElements>
<ns0:taskDefinition type="charge"/>
</extensionElements>
<incoming>sequenceFlow_f0cd0605-7265-4da3-b6cc-be41dc95f020</incoming>
<outgoing>sequenceFlow_18cd3844-5e0b-41bf-a019-f6d72f45a4a3</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_f0cd0605-7265-4da3-b6cc-be41dc95f020" sourceRef="ext_validate_t1" targetRef="ext_charge_t2"/>
<serviceTask id="ext_receipt_t3" name="receipt">
<extensionElements>
<ns0:taskDefinition type="receipt"/>
</extensionElements>
<incoming>sequenceFlow_18cd3844-5e0b-41bf-a019-f6d72f45a4a3</incoming>
<outgoing>sequenceFlow_dccd106e-a62e-48b3-b386-7f69aa341016</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_18cd3844-5e0b-41bf-a019-f6d72f45a4a3" sourceRef="ext_charge_t2" targetRef="ext_receipt_t3"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_dccd106e-a62e-48b3-b386-7f69aa341016</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_dccd106e-a62e-48b3-b386-7f69aa341016" sourceRef="ext_receipt_t3" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_37f8c372-710a-457a-b4c7-4074a6c499ba">
<bpmndi:BPMNPlane bpmnElement="billing-pipeline" id="BPMNPlane_bc6fb329-d4b3-4504-bc9d-3eebb65c6a70">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_0015941c-3a8c-427d-a822-22a3cffd8477">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ext_validate_t1" id="BPMNShape_b3257601-4084-4e92-9101-1de91e3e7bed">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_2f18a1b5-850d-45d5-b081-d275fd00e98e" id="BPMNEdge_d10eee16-396b-49d8-bc57-f843e9827244">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_charge_t2" id="BPMNShape_8f740d4f-def3-4e83-93cf-aa6c9c98bbd5">
<dc:Bounds height="80.0" width="100.0" x="368.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_f0cd0605-7265-4da3-b6cc-be41dc95f020" id="BPMNEdge_377ec61b-a5e5-4511-b039-a8eea385d934">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="368.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_receipt_t3" id="BPMNShape_47bf2bee-649a-4f49-8a43-f420a1d5130c">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_18cd3844-5e0b-41bf-a019-f6d72f45a4a3" id="BPMNEdge_692d5ad7-2dff-4078-baaa-f9015d4d995a">
<di:waypoint x="468.0" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_b07d12c0-8f48-4f5a-b348-0f3b45c2c5cd">
<dc:Bounds height="36.0" width="36.0" x="740.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_dccd106e-a62e-48b3-b386-7f69aa341016" id="BPMNEdge_a0dd6449-6e73-4a7a-b047-93fa6150c163">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="740.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
condition/otherwise compiles to a decision service task plus an exclusive gateway pair.
workflow<Order>("order-triage") {
input(orders)
condition({ it.total > 100 }) {
task("manual-review") { review(it) }
} otherwise {
task("auto-approve") { approve(it) }
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="definitions_2e77f1c9-d613-453c-b6b0-ea78b535891a" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="order-triage" isExecutable="true" name="order-triage">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_2ca20f5d-2828-44eb-9933-96780e8ed515</outgoing>
</startEvent>
<serviceTask camunda:topic="decision_c1" camunda:type="external" id="decision_c1" name="evaluate condition">
<incoming>sequenceFlow_2ca20f5d-2828-44eb-9933-96780e8ed515</incoming>
<outgoing>sequenceFlow_2f776baa-f1e9-4d5e-aa67-62699ed6b5d4</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_2ca20f5d-2828-44eb-9933-96780e8ed515" sourceRef="start" targetRef="decision_c1"/>
<exclusiveGateway id="gw1" name="">
<incoming>sequenceFlow_2f776baa-f1e9-4d5e-aa67-62699ed6b5d4</incoming>
<outgoing>sequenceFlow_949ec03a-f7bf-40bc-bb27-c826ea08b88d</outgoing>
<outgoing>sequenceFlow_ec182eee-0b1f-44c3-9345-731b15f0e914</outgoing>
</exclusiveGateway>
<sequenceFlow id="sequenceFlow_2f776baa-f1e9-4d5e-aa67-62699ed6b5d4" sourceRef="decision_c1" targetRef="gw1"/>
<sequenceFlow id="sequenceFlow_949ec03a-f7bf-40bc-bb27-c826ea08b88d" name="yes" sourceRef="gw1" targetRef="ext_manual-review_t3">
<conditionExpression id="conditionExpression_5b21e66d-d591-4e91-a844-3d12ca2baa61">${c1_result}</conditionExpression>
</sequenceFlow>
<serviceTask camunda:topic="manual-review" camunda:type="external" id="ext_manual-review_t3" name="manual-review">
<incoming>sequenceFlow_949ec03a-f7bf-40bc-bb27-c826ea08b88d</incoming>
<outgoing>sequenceFlow_ecacc823-b72b-44d3-904b-c39ffc8e59a6</outgoing>
</serviceTask>
<exclusiveGateway id="gw2" name="">
<incoming>sequenceFlow_ecacc823-b72b-44d3-904b-c39ffc8e59a6</incoming>
<incoming>sequenceFlow_97cee64c-8cab-4f6f-a1e3-ad10c48e0edd</incoming>
<outgoing>sequenceFlow_854a745e-b60d-403f-8864-2ad8cb824f81</outgoing>
</exclusiveGateway>
<sequenceFlow id="sequenceFlow_ecacc823-b72b-44d3-904b-c39ffc8e59a6" sourceRef="ext_manual-review_t3" targetRef="gw2"/>
<sequenceFlow id="sequenceFlow_ec182eee-0b1f-44c3-9345-731b15f0e914" name="no" sourceRef="gw1" targetRef="ext_auto-approve_t4">
<conditionExpression id="conditionExpression_1fccef3c-3861-4d51-bbf2-f22e5d179c50">${!(c1_result)}</conditionExpression>
</sequenceFlow>
<serviceTask camunda:topic="auto-approve" camunda:type="external" id="ext_auto-approve_t4" name="auto-approve">
<incoming>sequenceFlow_ec182eee-0b1f-44c3-9345-731b15f0e914</incoming>
<outgoing>sequenceFlow_97cee64c-8cab-4f6f-a1e3-ad10c48e0edd</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_97cee64c-8cab-4f6f-a1e3-ad10c48e0edd" sourceRef="ext_auto-approve_t4" targetRef="gw2"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_854a745e-b60d-403f-8864-2ad8cb824f81</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_854a745e-b60d-403f-8864-2ad8cb824f81" sourceRef="gw2" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_79195a38-0762-4f5c-833c-db980badf84d">
<bpmndi:BPMNPlane bpmnElement="order-triage" id="BPMNPlane_0601ed13-58a3-4ae0-93fc-9779b1f3d4ce">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_d03a1d24-f384-43bd-a6d4-12ff96c7de8e">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decision_c1" id="BPMNShape_62a89e22-a3b7-4dd2-bffe-8b62b921c01a">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="115.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_2ca20f5d-2828-44eb-9933-96780e8ed515" id="BPMNEdge_b400f6e5-6a6d-41c4-8d5a-4799c19d280b">
<di:waypoint x="96.0" y="155.0"/>
<di:waypoint x="198.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw1" id="BPMNShape_ede21803-5327-484b-885f-53df0dbc5cf7" isMarkerVisible="true">
<dc:Bounds height="50.0" width="50.0" x="393.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_2f776baa-f1e9-4d5e-aa67-62699ed6b5d4" id="BPMNEdge_a1c405ff-012c-4588-bc44-36cf87a23207">
<di:waypoint x="298.0" y="155.0"/>
<di:waypoint x="393.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_manual-review_t3" id="BPMNShape_db25cc0a-e28d-4812-af2d-cb8e50586bad">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_949ec03a-f7bf-40bc-bb27-c826ea08b88d" id="BPMNEdge_08411d35-3570-4460-956c-6b79d4451471">
<di:waypoint x="443.0" y="155.0"/>
<di:waypoint x="490.5" y="155.0"/>
<di:waypoint x="490.5" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw2" id="BPMNShape_70c9d696-a42a-4e03-9388-41719d06c17b" isMarkerVisible="true">
<dc:Bounds height="50.0" width="50.0" x="733.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_ecacc823-b72b-44d3-904b-c39ffc8e59a6" id="BPMNEdge_059d5355-ca46-4bc6-bac0-9ebcf0c52edf">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="685.5" y="100.0"/>
<di:waypoint x="685.5" y="155.0"/>
<di:waypoint x="733.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_auto-approve_t4" id="BPMNShape_0c9f4777-ce3c-4f9c-8140-35c68b226649">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="170.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_ec182eee-0b1f-44c3-9345-731b15f0e914" id="BPMNEdge_49ae7b2c-1ce8-43ac-a743-9165822aadac">
<di:waypoint x="443.0" y="155.0"/>
<di:waypoint x="490.5" y="155.0"/>
<di:waypoint x="490.5" y="210.0"/>
<di:waypoint x="538.0" y="210.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_97cee64c-8cab-4f6f-a1e3-ad10c48e0edd" id="BPMNEdge_d62f5e49-d3ae-40bf-b2e5-4009697bd78c">
<di:waypoint x="638.0" y="210.0"/>
<di:waypoint x="685.5" y="210.0"/>
<di:waypoint x="685.5" y="155.0"/>
<di:waypoint x="733.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_2e119f1d-111d-480c-9b6d-6970b55d935c">
<dc:Bounds height="36.0" width="36.0" x="910.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_854a745e-b60d-403f-8864-2ad8cb824f81" id="BPMNEdge_ae4d1ec9-8495-4558-a2f6-6dd037af872d">
<di:waypoint x="783.0" y="155.0"/>
<di:waypoint x="910.0" y="155.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ns0="http://camunda.org/schema/zeebe/1.0" id="definitions_d7516e98-6884-469c-be3c-240b614b43b9" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="order-triage" isExecutable="true" name="order-triage">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_050b05bf-24d7-4a3e-9838-137498ab4c13</outgoing>
</startEvent>
<serviceTask id="decision_c1" name="evaluate condition">
<extensionElements>
<ns0:taskDefinition type="decision_c1"/>
</extensionElements>
<incoming>sequenceFlow_050b05bf-24d7-4a3e-9838-137498ab4c13</incoming>
<outgoing>sequenceFlow_572bddff-769f-466f-9fd9-e1fbc9dfff6b</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_050b05bf-24d7-4a3e-9838-137498ab4c13" sourceRef="start" targetRef="decision_c1"/>
<exclusiveGateway id="gw1" name="">
<incoming>sequenceFlow_572bddff-769f-466f-9fd9-e1fbc9dfff6b</incoming>
<outgoing>sequenceFlow_38b63a44-b80a-4e78-b36f-24114b243e1b</outgoing>
<outgoing>sequenceFlow_bee17879-dd2f-40d2-8f42-82ce41f8b4a9</outgoing>
</exclusiveGateway>
<sequenceFlow id="sequenceFlow_572bddff-769f-466f-9fd9-e1fbc9dfff6b" sourceRef="decision_c1" targetRef="gw1"/>
<sequenceFlow id="sequenceFlow_38b63a44-b80a-4e78-b36f-24114b243e1b" name="yes" sourceRef="gw1" targetRef="ext_manual-review_t3">
<conditionExpression id="conditionExpression_d1b06c03-be47-4706-a2bc-e9fa1637823f">=c1_result</conditionExpression>
</sequenceFlow>
<serviceTask id="ext_manual-review_t3" name="manual-review">
<extensionElements>
<ns0:taskDefinition type="manual-review"/>
</extensionElements>
<incoming>sequenceFlow_38b63a44-b80a-4e78-b36f-24114b243e1b</incoming>
<outgoing>sequenceFlow_d80d4c4f-87de-4bac-9c7e-ee232f806719</outgoing>
</serviceTask>
<exclusiveGateway id="gw2" name="">
<incoming>sequenceFlow_d80d4c4f-87de-4bac-9c7e-ee232f806719</incoming>
<incoming>sequenceFlow_c43919ce-c92f-4d0e-9c5b-4bc6222529ef</incoming>
<outgoing>sequenceFlow_6efbbf92-214e-4394-9067-8cfb0d11e7b5</outgoing>
</exclusiveGateway>
<sequenceFlow id="sequenceFlow_d80d4c4f-87de-4bac-9c7e-ee232f806719" sourceRef="ext_manual-review_t3" targetRef="gw2"/>
<sequenceFlow id="sequenceFlow_bee17879-dd2f-40d2-8f42-82ce41f8b4a9" name="no" sourceRef="gw1" targetRef="ext_auto-approve_t4">
<conditionExpression id="conditionExpression_4cd9a0c8-db29-49ea-91c3-5757d9174c17">=not(c1_result)</conditionExpression>
</sequenceFlow>
<serviceTask id="ext_auto-approve_t4" name="auto-approve">
<extensionElements>
<ns0:taskDefinition type="auto-approve"/>
</extensionElements>
<incoming>sequenceFlow_bee17879-dd2f-40d2-8f42-82ce41f8b4a9</incoming>
<outgoing>sequenceFlow_c43919ce-c92f-4d0e-9c5b-4bc6222529ef</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_c43919ce-c92f-4d0e-9c5b-4bc6222529ef" sourceRef="ext_auto-approve_t4" targetRef="gw2"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_6efbbf92-214e-4394-9067-8cfb0d11e7b5</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_6efbbf92-214e-4394-9067-8cfb0d11e7b5" sourceRef="gw2" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_85e79641-b54c-4cdb-99e0-5d14d2cca44c">
<bpmndi:BPMNPlane bpmnElement="order-triage" id="BPMNPlane_6091b945-6bc7-412e-8282-e5f1adbf4069">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_ebaffe7f-c399-498d-80ed-e5557f413226">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decision_c1" id="BPMNShape_10ee4058-9e23-4086-8dba-ebc9cfa8624d">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="115.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_050b05bf-24d7-4a3e-9838-137498ab4c13" id="BPMNEdge_6d900b43-0a08-402c-aa8f-d3e475a23764">
<di:waypoint x="96.0" y="155.0"/>
<di:waypoint x="198.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw1" id="BPMNShape_b13cb2a8-8cf1-43f9-9351-bd2b37f784cf" isMarkerVisible="true">
<dc:Bounds height="50.0" width="50.0" x="393.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_572bddff-769f-466f-9fd9-e1fbc9dfff6b" id="BPMNEdge_84b9e06e-b89a-429d-9062-2958eedc4f41">
<di:waypoint x="298.0" y="155.0"/>
<di:waypoint x="393.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_manual-review_t3" id="BPMNShape_d06ecc61-0379-4996-b235-26e52024d54c">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_38b63a44-b80a-4e78-b36f-24114b243e1b" id="BPMNEdge_06a3df8f-d135-4d80-940d-7ad17a9c823d">
<di:waypoint x="443.0" y="155.0"/>
<di:waypoint x="490.5" y="155.0"/>
<di:waypoint x="490.5" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw2" id="BPMNShape_016239d9-6ae6-4627-a005-1beb188b295e" isMarkerVisible="true">
<dc:Bounds height="50.0" width="50.0" x="733.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_d80d4c4f-87de-4bac-9c7e-ee232f806719" id="BPMNEdge_af1150a9-9705-42fd-a85a-35e155a9097d">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="685.5" y="100.0"/>
<di:waypoint x="685.5" y="155.0"/>
<di:waypoint x="733.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_auto-approve_t4" id="BPMNShape_eb132041-2d42-42ce-a940-1f005a6b6d69">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="170.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_bee17879-dd2f-40d2-8f42-82ce41f8b4a9" id="BPMNEdge_13de0b99-fa4f-44e2-a677-a414f21062a5">
<di:waypoint x="443.0" y="155.0"/>
<di:waypoint x="490.5" y="155.0"/>
<di:waypoint x="490.5" y="210.0"/>
<di:waypoint x="538.0" y="210.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_c43919ce-c92f-4d0e-9c5b-4bc6222529ef" id="BPMNEdge_37c91f10-f365-4991-8dcd-26bd20f6f207">
<di:waypoint x="638.0" y="210.0"/>
<di:waypoint x="685.5" y="210.0"/>
<di:waypoint x="685.5" y="155.0"/>
<di:waypoint x="733.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_3ca47668-382e-4c33-b029-9e2079052fc9">
<dc:Bounds height="36.0" width="36.0" x="910.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_6efbbf92-214e-4394-9067-8cfb0d11e7b5" id="BPMNEdge_2980df8d-971e-491c-a8d3-e3253e7a6595">
<di:waypoint x="783.0" y="155.0"/>
<di:waypoint x="910.0" y="155.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
loop compiles to a decision service task with a gateway looping back while the predicate holds.
workflow<Order>("retry-charge") {
input(orders)
loop({ it.attempts < 3 }) {
task("try-charge") { it.attempts = it.attempts + 1 }
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="definitions_62f31ae2-cb64-46ad-bf7f-a45412dad930" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="retry-charge" isExecutable="true" name="retry-charge">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_dd71f50d-2c3b-44ef-bc67-c3a4a09dfba7</outgoing>
</startEvent>
<serviceTask camunda:topic="decision_l1" camunda:type="external" id="decision_l1" name="loop guard">
<incoming>sequenceFlow_dd71f50d-2c3b-44ef-bc67-c3a4a09dfba7</incoming>
<incoming>sequenceFlow_28248cac-e4dc-4bc9-8b16-d5c1154aae39</incoming>
<outgoing>sequenceFlow_49f50404-0e0e-4504-bc3b-43506192a7b1</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_dd71f50d-2c3b-44ef-bc67-c3a4a09dfba7" sourceRef="start" targetRef="decision_l1"/>
<exclusiveGateway id="gw1" name="">
<incoming>sequenceFlow_49f50404-0e0e-4504-bc3b-43506192a7b1</incoming>
<outgoing>sequenceFlow_576223f3-6d0f-4c56-99bd-97737e739c32</outgoing>
<outgoing>sequenceFlow_6d23cdcb-5edb-4d3e-ad72-8af13a023a55</outgoing>
</exclusiveGateway>
<sequenceFlow id="sequenceFlow_49f50404-0e0e-4504-bc3b-43506192a7b1" sourceRef="decision_l1" targetRef="gw1"/>
<sequenceFlow id="sequenceFlow_576223f3-6d0f-4c56-99bd-97737e739c32" name="repeat" sourceRef="gw1" targetRef="ext_try-charge_t2">
<conditionExpression id="conditionExpression_9a97597d-e94d-46f2-8c6e-c097b62d3b1e">${l1_result}</conditionExpression>
</sequenceFlow>
<serviceTask camunda:topic="try-charge" camunda:type="external" id="ext_try-charge_t2" name="try-charge">
<incoming>sequenceFlow_576223f3-6d0f-4c56-99bd-97737e739c32</incoming>
<outgoing>sequenceFlow_28248cac-e4dc-4bc9-8b16-d5c1154aae39</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_28248cac-e4dc-4bc9-8b16-d5c1154aae39" sourceRef="ext_try-charge_t2" targetRef="decision_l1"/>
<sequenceFlow id="sequenceFlow_6d23cdcb-5edb-4d3e-ad72-8af13a023a55" name="done" sourceRef="gw1" targetRef="end">
<conditionExpression id="conditionExpression_6b40dd5e-d163-46e8-b062-13e2a47ea295">${!(l1_result)}</conditionExpression>
</sequenceFlow>
<endEvent id="end" name="End">
<incoming>sequenceFlow_6d23cdcb-5edb-4d3e-ad72-8af13a023a55</incoming>
</endEvent>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_c7dc8993-4453-46aa-af0a-3eee56e4e1be">
<bpmndi:BPMNPlane bpmnElement="retry-charge" id="BPMNPlane_b3f9c8ff-e36a-46bb-86a1-857c93cb0e60">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_ea9ffef9-3a4a-4df6-9d96-87641728e0bf">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decision_l1" id="BPMNShape_986ab0ca-f1a1-4654-a16e-a7809fd9a6e8">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_dd71f50d-2c3b-44ef-bc67-c3a4a09dfba7" id="BPMNEdge_e4687824-eaf3-40e1-80d5-406f09ac13b5">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw1" id="BPMNShape_722217f9-d382-4549-9e98-dd4e26b54059" isMarkerVisible="true">
<dc:Bounds height="50.0" width="50.0" x="393.0" y="75.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_49f50404-0e0e-4504-bc3b-43506192a7b1" id="BPMNEdge_5f345361-e29f-44d6-a362-aa8e27d12663">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="393.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_try-charge_t2" id="BPMNShape_ccf4a520-36ba-41cc-972d-67cf3f179148">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="170.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_576223f3-6d0f-4c56-99bd-97737e739c32" id="BPMNEdge_4857d695-bd39-4e13-8e9b-e8d12a0b0383">
<di:waypoint x="443.0" y="100.0"/>
<di:waypoint x="490.5" y="100.0"/>
<di:waypoint x="490.5" y="210.0"/>
<di:waypoint x="538.0" y="210.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_28248cac-e4dc-4bc9-8b16-d5c1154aae39" id="BPMNEdge_4072cc40-3349-4231-9ffa-ef86c208ed2c">
<di:waypoint x="588.0" y="250.0"/>
<di:waypoint x="588.0" y="295.0"/>
<di:waypoint x="248.0" y="295.0"/>
<di:waypoint x="248.0" y="140.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_e5d29418-2a5e-4116-aacc-ccf620fbf824">
<dc:Bounds height="36.0" width="36.0" x="570.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_6d23cdcb-5edb-4d3e-ad72-8af13a023a55" id="BPMNEdge_2ff2e823-d83a-4eab-b384-e75c0e3be191">
<di:waypoint x="443.0" y="100.0"/>
<di:waypoint x="570.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ns0="http://camunda.org/schema/zeebe/1.0" id="definitions_ac20f9f9-324b-47ab-a951-e861d922e055" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="retry-charge" isExecutable="true" name="retry-charge">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_d15eb3f2-c221-4ce5-b2ad-0ca85f24dca1</outgoing>
</startEvent>
<serviceTask id="decision_l1" name="loop guard">
<extensionElements>
<ns0:taskDefinition type="decision_l1"/>
</extensionElements>
<incoming>sequenceFlow_d15eb3f2-c221-4ce5-b2ad-0ca85f24dca1</incoming>
<incoming>sequenceFlow_07b35e4e-f4d3-4175-a27d-7c98cf1c1e88</incoming>
<outgoing>sequenceFlow_f93772cc-7e84-4240-8de3-4ae3c4047e85</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_d15eb3f2-c221-4ce5-b2ad-0ca85f24dca1" sourceRef="start" targetRef="decision_l1"/>
<exclusiveGateway id="gw1" name="">
<incoming>sequenceFlow_f93772cc-7e84-4240-8de3-4ae3c4047e85</incoming>
<outgoing>sequenceFlow_ae9a36f3-5768-4709-ad5f-da278e121670</outgoing>
<outgoing>sequenceFlow_89ab733c-91ad-4d29-8c72-adddc54ad754</outgoing>
</exclusiveGateway>
<sequenceFlow id="sequenceFlow_f93772cc-7e84-4240-8de3-4ae3c4047e85" sourceRef="decision_l1" targetRef="gw1"/>
<sequenceFlow id="sequenceFlow_ae9a36f3-5768-4709-ad5f-da278e121670" name="repeat" sourceRef="gw1" targetRef="ext_try-charge_t2">
<conditionExpression id="conditionExpression_c95a7e59-8ba8-487c-aef8-f4a7a6a17f81">=l1_result</conditionExpression>
</sequenceFlow>
<serviceTask id="ext_try-charge_t2" name="try-charge">
<extensionElements>
<ns0:taskDefinition type="try-charge"/>
</extensionElements>
<incoming>sequenceFlow_ae9a36f3-5768-4709-ad5f-da278e121670</incoming>
<outgoing>sequenceFlow_07b35e4e-f4d3-4175-a27d-7c98cf1c1e88</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_07b35e4e-f4d3-4175-a27d-7c98cf1c1e88" sourceRef="ext_try-charge_t2" targetRef="decision_l1"/>
<sequenceFlow id="sequenceFlow_89ab733c-91ad-4d29-8c72-adddc54ad754" name="done" sourceRef="gw1" targetRef="end">
<conditionExpression id="conditionExpression_b958c628-7050-4eba-a59a-101aac4541e6">=not(l1_result)</conditionExpression>
</sequenceFlow>
<endEvent id="end" name="End">
<incoming>sequenceFlow_89ab733c-91ad-4d29-8c72-adddc54ad754</incoming>
</endEvent>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_c11c8ca7-efeb-4e87-a9e5-5a8f068e4100">
<bpmndi:BPMNPlane bpmnElement="retry-charge" id="BPMNPlane_a8b4dbbc-4330-4a2e-a80f-db47c2e6cce4">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_22f115dd-d030-4c68-b36d-9514b54b4714">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decision_l1" id="BPMNShape_13caf902-c9cd-486e-86f9-f665bf5ebb45">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_d15eb3f2-c221-4ce5-b2ad-0ca85f24dca1" id="BPMNEdge_c167ee34-dd00-4fa4-aa92-3d18272e789a">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw1" id="BPMNShape_4bf4d242-ae22-4626-acdc-e60dda2acd57" isMarkerVisible="true">
<dc:Bounds height="50.0" width="50.0" x="393.0" y="75.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_f93772cc-7e84-4240-8de3-4ae3c4047e85" id="BPMNEdge_bf374f2d-7ebd-43c6-ad2d-19677fedc004">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="393.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_try-charge_t2" id="BPMNShape_f6d94be2-c3ee-4b29-85a4-52e197378423">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="170.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_ae9a36f3-5768-4709-ad5f-da278e121670" id="BPMNEdge_878c2012-a62d-4ed5-9ab6-0452de7f9e7f">
<di:waypoint x="443.0" y="100.0"/>
<di:waypoint x="490.5" y="100.0"/>
<di:waypoint x="490.5" y="210.0"/>
<di:waypoint x="538.0" y="210.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_07b35e4e-f4d3-4175-a27d-7c98cf1c1e88" id="BPMNEdge_01fafaa1-3ee2-4340-bc50-676559267a02">
<di:waypoint x="588.0" y="250.0"/>
<di:waypoint x="588.0" y="295.0"/>
<di:waypoint x="248.0" y="295.0"/>
<di:waypoint x="248.0" y="140.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_f7925ddb-2c38-49f5-a7b8-379d66f70257">
<dc:Bounds height="36.0" width="36.0" x="570.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_89ab733c-91ad-4d29-8c72-adddc54ad754" id="BPMNEdge_c96cd0c8-2e8a-4b01-9b80-b1e445f67fa1">
<di:waypoint x="443.0" y="100.0"/>
<di:waypoint x="570.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
parallel branches compile to a parallel gateway fork/join.
workflow<Order>("fulfilment") {
input(orders)
parallel {
branch { task("reserve-stock") { reserve(it) } }
branch { task("notify-customer") { notify(it) } }
}
task("dispatch") { dispatch(it) }
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="definitions_23ab4a8c-6b3a-435e-b720-251bb1a7cb0b" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="fulfilment" isExecutable="true" name="fulfilment">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_0609bd99-4e2d-4a67-8a5f-cefdd6fb027b</outgoing>
</startEvent>
<parallelGateway id="gw1" name="">
<incoming>sequenceFlow_0609bd99-4e2d-4a67-8a5f-cefdd6fb027b</incoming>
<outgoing>sequenceFlow_6e85b5c5-94db-4877-96e4-b1f203348edd</outgoing>
<outgoing>sequenceFlow_ed59610e-8cd0-41d5-84c1-826646a88236</outgoing>
</parallelGateway>
<sequenceFlow id="sequenceFlow_0609bd99-4e2d-4a67-8a5f-cefdd6fb027b" sourceRef="start" targetRef="gw1"/>
<serviceTask camunda:topic="reserve-stock" camunda:type="external" id="ext_reserve-stock_t3" name="reserve-stock">
<incoming>sequenceFlow_6e85b5c5-94db-4877-96e4-b1f203348edd</incoming>
<outgoing>sequenceFlow_304d42d0-aca7-4fd4-8491-3d58f8c7415f</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_6e85b5c5-94db-4877-96e4-b1f203348edd" sourceRef="gw1" targetRef="ext_reserve-stock_t3"/>
<parallelGateway id="gw2" name="">
<incoming>sequenceFlow_304d42d0-aca7-4fd4-8491-3d58f8c7415f</incoming>
<incoming>sequenceFlow_e5f045e7-483a-49cd-ab85-fdbe9b9c3c50</incoming>
<outgoing>sequenceFlow_77e7965a-2303-44c7-ba14-687a53564e91</outgoing>
</parallelGateway>
<sequenceFlow id="sequenceFlow_304d42d0-aca7-4fd4-8491-3d58f8c7415f" sourceRef="ext_reserve-stock_t3" targetRef="gw2"/>
<serviceTask camunda:topic="notify-customer" camunda:type="external" id="ext_notify-customer_t4" name="notify-customer">
<incoming>sequenceFlow_ed59610e-8cd0-41d5-84c1-826646a88236</incoming>
<outgoing>sequenceFlow_e5f045e7-483a-49cd-ab85-fdbe9b9c3c50</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_ed59610e-8cd0-41d5-84c1-826646a88236" sourceRef="gw1" targetRef="ext_notify-customer_t4"/>
<sequenceFlow id="sequenceFlow_e5f045e7-483a-49cd-ab85-fdbe9b9c3c50" sourceRef="ext_notify-customer_t4" targetRef="gw2"/>
<serviceTask camunda:topic="dispatch" camunda:type="external" id="ext_dispatch_t5" name="dispatch">
<incoming>sequenceFlow_77e7965a-2303-44c7-ba14-687a53564e91</incoming>
<outgoing>sequenceFlow_1b02f176-d876-4bce-a605-b72548755dd4</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_77e7965a-2303-44c7-ba14-687a53564e91" sourceRef="gw2" targetRef="ext_dispatch_t5"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_1b02f176-d876-4bce-a605-b72548755dd4</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_1b02f176-d876-4bce-a605-b72548755dd4" sourceRef="ext_dispatch_t5" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_9ddf1e93-300a-4658-8ec6-1a0a6b834991">
<bpmndi:BPMNPlane bpmnElement="fulfilment" id="BPMNPlane_c89a328b-5fc8-4a36-85dd-4097a9351702">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_d11f998e-6501-4bbd-9e90-05b880a16295">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="gw1" id="BPMNShape_77e8ebe4-2db5-407c-be1f-4e02882e50ce">
<dc:Bounds height="50.0" width="50.0" x="223.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_0609bd99-4e2d-4a67-8a5f-cefdd6fb027b" id="BPMNEdge_70f150fb-87c3-4d4e-b4c0-b98af3a7e56e">
<di:waypoint x="96.0" y="155.0"/>
<di:waypoint x="223.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_reserve-stock_t3" id="BPMNShape_6a616d2b-e311-47ee-bc8a-819a3d5e7df4">
<dc:Bounds height="80.0" width="100.0" x="368.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_6e85b5c5-94db-4877-96e4-b1f203348edd" id="BPMNEdge_075cad14-88e7-4c18-a693-c6450180643d">
<di:waypoint x="273.0" y="155.0"/>
<di:waypoint x="320.5" y="155.0"/>
<di:waypoint x="320.5" y="100.0"/>
<di:waypoint x="368.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw2" id="BPMNShape_8318bf3e-d494-467e-9644-f121f1e9f661">
<dc:Bounds height="50.0" width="50.0" x="563.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_304d42d0-aca7-4fd4-8491-3d58f8c7415f" id="BPMNEdge_e1b73823-9e69-44f5-bf32-d9ce49ba98a8">
<di:waypoint x="468.0" y="100.0"/>
<di:waypoint x="515.5" y="100.0"/>
<di:waypoint x="515.5" y="155.0"/>
<di:waypoint x="563.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_notify-customer_t4" id="BPMNShape_ebc9a0c0-8f23-4bfd-88c1-814d5df5e180">
<dc:Bounds height="80.0" width="100.0" x="368.0" y="170.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_ed59610e-8cd0-41d5-84c1-826646a88236" id="BPMNEdge_9fb8deff-5d3e-4751-9692-7bd48027e2f8">
<di:waypoint x="273.0" y="155.0"/>
<di:waypoint x="320.5" y="155.0"/>
<di:waypoint x="320.5" y="210.0"/>
<di:waypoint x="368.0" y="210.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_e5f045e7-483a-49cd-ab85-fdbe9b9c3c50" id="BPMNEdge_676a1fce-411c-4294-853e-4a63ff277642">
<di:waypoint x="468.0" y="210.0"/>
<di:waypoint x="515.5" y="210.0"/>
<di:waypoint x="515.5" y="155.0"/>
<di:waypoint x="563.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_dispatch_t5" id="BPMNShape_6961c963-0742-4169-8c07-e3c826bdbc05">
<dc:Bounds height="80.0" width="100.0" x="708.0" y="115.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_77e7965a-2303-44c7-ba14-687a53564e91" id="BPMNEdge_a6366950-5b73-459c-ae68-d769c404ceed">
<di:waypoint x="613.0" y="155.0"/>
<di:waypoint x="708.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_30ef4005-c463-4dc4-b6b1-1c84399e2b32">
<dc:Bounds height="36.0" width="36.0" x="910.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_1b02f176-d876-4bce-a605-b72548755dd4" id="BPMNEdge_9cd6e0a3-14b2-44c6-bc1a-c3f2f0210489">
<di:waypoint x="808.0" y="155.0"/>
<di:waypoint x="910.0" y="155.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ns0="http://camunda.org/schema/zeebe/1.0" id="definitions_eeb3f5a6-1edd-4871-a561-7c496519ffb3" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="fulfilment" isExecutable="true" name="fulfilment">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_f4486b3f-a483-4614-8068-b2ee18cbef2b</outgoing>
</startEvent>
<parallelGateway id="gw1" name="">
<incoming>sequenceFlow_f4486b3f-a483-4614-8068-b2ee18cbef2b</incoming>
<outgoing>sequenceFlow_1e8946b9-5df5-4fe4-b1d1-34a05902e135</outgoing>
<outgoing>sequenceFlow_dcda2482-da9c-493d-ac31-c1e49e38f038</outgoing>
</parallelGateway>
<sequenceFlow id="sequenceFlow_f4486b3f-a483-4614-8068-b2ee18cbef2b" sourceRef="start" targetRef="gw1"/>
<serviceTask id="ext_reserve-stock_t3" name="reserve-stock">
<extensionElements>
<ns0:taskDefinition type="reserve-stock"/>
</extensionElements>
<incoming>sequenceFlow_1e8946b9-5df5-4fe4-b1d1-34a05902e135</incoming>
<outgoing>sequenceFlow_c88906b1-a7ec-4b55-9f07-633a1ace0b01</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_1e8946b9-5df5-4fe4-b1d1-34a05902e135" sourceRef="gw1" targetRef="ext_reserve-stock_t3"/>
<parallelGateway id="gw2" name="">
<incoming>sequenceFlow_c88906b1-a7ec-4b55-9f07-633a1ace0b01</incoming>
<incoming>sequenceFlow_8f241b9d-fc8a-4702-a740-332520f2c5cb</incoming>
<outgoing>sequenceFlow_fabd4032-3c3d-4726-af56-61f32a767b3b</outgoing>
</parallelGateway>
<sequenceFlow id="sequenceFlow_c88906b1-a7ec-4b55-9f07-633a1ace0b01" sourceRef="ext_reserve-stock_t3" targetRef="gw2"/>
<serviceTask id="ext_notify-customer_t4" name="notify-customer">
<extensionElements>
<ns0:taskDefinition type="notify-customer"/>
</extensionElements>
<incoming>sequenceFlow_dcda2482-da9c-493d-ac31-c1e49e38f038</incoming>
<outgoing>sequenceFlow_8f241b9d-fc8a-4702-a740-332520f2c5cb</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_dcda2482-da9c-493d-ac31-c1e49e38f038" sourceRef="gw1" targetRef="ext_notify-customer_t4"/>
<sequenceFlow id="sequenceFlow_8f241b9d-fc8a-4702-a740-332520f2c5cb" sourceRef="ext_notify-customer_t4" targetRef="gw2"/>
<serviceTask id="ext_dispatch_t5" name="dispatch">
<extensionElements>
<ns0:taskDefinition type="dispatch"/>
</extensionElements>
<incoming>sequenceFlow_fabd4032-3c3d-4726-af56-61f32a767b3b</incoming>
<outgoing>sequenceFlow_8cd63c28-c38d-44da-826f-e3b75454829d</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_fabd4032-3c3d-4726-af56-61f32a767b3b" sourceRef="gw2" targetRef="ext_dispatch_t5"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_8cd63c28-c38d-44da-826f-e3b75454829d</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_8cd63c28-c38d-44da-826f-e3b75454829d" sourceRef="ext_dispatch_t5" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_c736d818-504b-4a18-b8c3-d9c59c46f9d3">
<bpmndi:BPMNPlane bpmnElement="fulfilment" id="BPMNPlane_a47c5e1a-c004-42de-bc01-ad063bf19058">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_1aa04eca-be0c-4458-8ded-bc37cd62dcb2">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="gw1" id="BPMNShape_ee29e2ca-1756-4f33-a487-eee4850ac871">
<dc:Bounds height="50.0" width="50.0" x="223.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_f4486b3f-a483-4614-8068-b2ee18cbef2b" id="BPMNEdge_07c66cb1-ecc9-48f5-a3ac-6fbc6cb5e969">
<di:waypoint x="96.0" y="155.0"/>
<di:waypoint x="223.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_reserve-stock_t3" id="BPMNShape_3e547980-37cc-43b4-bc91-1618ef61c499">
<dc:Bounds height="80.0" width="100.0" x="368.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_1e8946b9-5df5-4fe4-b1d1-34a05902e135" id="BPMNEdge_f42229c7-bc19-4046-af7b-e38ffaac8e7b">
<di:waypoint x="273.0" y="155.0"/>
<di:waypoint x="320.5" y="155.0"/>
<di:waypoint x="320.5" y="100.0"/>
<di:waypoint x="368.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw2" id="BPMNShape_25448bf3-4777-4590-85d4-be6a3e4de837">
<dc:Bounds height="50.0" width="50.0" x="563.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_c88906b1-a7ec-4b55-9f07-633a1ace0b01" id="BPMNEdge_e3e9c47f-e9c8-410e-801b-47c29ade1688">
<di:waypoint x="468.0" y="100.0"/>
<di:waypoint x="515.5" y="100.0"/>
<di:waypoint x="515.5" y="155.0"/>
<di:waypoint x="563.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_notify-customer_t4" id="BPMNShape_f87abad0-bbf8-45a3-ae58-2a30e08840b9">
<dc:Bounds height="80.0" width="100.0" x="368.0" y="170.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_dcda2482-da9c-493d-ac31-c1e49e38f038" id="BPMNEdge_e2fec81e-0245-4b42-bd89-b47be6f48de7">
<di:waypoint x="273.0" y="155.0"/>
<di:waypoint x="320.5" y="155.0"/>
<di:waypoint x="320.5" y="210.0"/>
<di:waypoint x="368.0" y="210.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_8f241b9d-fc8a-4702-a740-332520f2c5cb" id="BPMNEdge_5cb0d0a1-1034-49da-8a1c-dffb2ab2ce48">
<di:waypoint x="468.0" y="210.0"/>
<di:waypoint x="515.5" y="210.0"/>
<di:waypoint x="515.5" y="155.0"/>
<di:waypoint x="563.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_dispatch_t5" id="BPMNShape_9980c417-283b-401c-b36e-0ccec2d0ded6">
<dc:Bounds height="80.0" width="100.0" x="708.0" y="115.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_fabd4032-3c3d-4726-af56-61f32a767b3b" id="BPMNEdge_fef41019-dfca-4cfe-a0be-9a7026146110">
<di:waypoint x="613.0" y="155.0"/>
<di:waypoint x="708.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_07b2d604-4d50-40d5-815c-0e86f0330577">
<dc:Bounds height="36.0" width="36.0" x="910.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_8cd63c28-c38d-44da-826f-e3b75454829d" id="BPMNEdge_39cf778b-f64d-4ae7-b7ec-ebc7b61ea6f9">
<di:waypoint x="808.0" y="155.0"/>
<di:waypoint x="910.0" y="155.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
fanOut expands every item into children. It compiles to an expand service task plus a parallel multi-instance call activity invoking a child process.
workflow<Order>("order-lines") {
input(orders)
task("load") { load(it) }
fanOut(expand = { fetchLines(it.id) }, concurrency = 4) {
condition({ it.qty > 10 }) {
task("bulk-price") { bulk(it) }
} otherwise {
task("unit-price") { unit(it) }
}
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="definitions_29f3b8ab-79b9-4569-ba77-66caaf30a6e2" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="order-lines" isExecutable="true" name="order-lines">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_f020f7d5-2392-4914-9efe-73cc02d48bbf</outgoing>
</startEvent>
<serviceTask camunda:topic="load" camunda:type="external" id="ext_load_t1" name="load">
<incoming>sequenceFlow_f020f7d5-2392-4914-9efe-73cc02d48bbf</incoming>
<outgoing>sequenceFlow_215e5115-b0a2-499f-a5c5-22d152194650</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_f020f7d5-2392-4914-9efe-73cc02d48bbf" sourceRef="start" targetRef="ext_load_t1"/>
<serviceTask camunda:topic="expand_f1" camunda:type="external" id="expand_f1" name="expand children">
<incoming>sequenceFlow_215e5115-b0a2-499f-a5c5-22d152194650</incoming>
<outgoing>sequenceFlow_0364235c-816f-4c8f-852b-79abb33118b2</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_215e5115-b0a2-499f-a5c5-22d152194650" sourceRef="ext_load_t1" targetRef="expand_f1"/>
<callActivity calledElement="order-lines_f1" id="call_f1" name="for each child">
<extensionElements>
<camunda:in source="f1_item" target="f1_item"/>
</extensionElements>
<incoming>sequenceFlow_0364235c-816f-4c8f-852b-79abb33118b2</incoming>
<outgoing>sequenceFlow_491b3153-f3f7-44aa-a363-5ef7b51e36b6</outgoing>
<multiInstanceLoopCharacteristics camunda:collection="${f1_items.elements()}" camunda:elementVariable="f1_item" id="multiInstanceLoopCharacteristics_817289af-a2e6-4287-ac0e-51e38d0f53da" isSequential="false"/>
</callActivity>
<sequenceFlow id="sequenceFlow_0364235c-816f-4c8f-852b-79abb33118b2" sourceRef="expand_f1" targetRef="call_f1"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_491b3153-f3f7-44aa-a363-5ef7b51e36b6</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_491b3153-f3f7-44aa-a363-5ef7b51e36b6" sourceRef="call_f1" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_9b2cf301-fbfe-43ef-a5ce-9b2b785c4148">
<bpmndi:BPMNPlane bpmnElement="order-lines" id="BPMNPlane_1b442f55-46a2-4f95-9280-ee31c881f97b">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_6b5b1572-3390-408c-b768-385ab8f96a8a">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ext_load_t1" id="BPMNShape_1a06a927-66b0-458b-8b0f-1c56fbbd0faa">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_f020f7d5-2392-4914-9efe-73cc02d48bbf" id="BPMNEdge_c8f96b60-ab3a-49e4-a171-db7981c418be">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="expand_f1" id="BPMNShape_78edd3cd-6f12-4e3d-8382-2a6bb18ad76d">
<dc:Bounds height="80.0" width="100.0" x="368.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_215e5115-b0a2-499f-a5c5-22d152194650" id="BPMNEdge_aaefb865-ca33-4f2e-919f-3eb29c272479">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="368.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="call_f1" id="BPMNShape_adbaf81b-3370-43ea-af49-93e34d488b53">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_0364235c-816f-4c8f-852b-79abb33118b2" id="BPMNEdge_a97b1fc6-7c23-442a-ab51-510c1da15d8a">
<di:waypoint x="468.0" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_5ab7dc35-43e7-4885-a335-02c2e9e406ca">
<dc:Bounds height="36.0" width="36.0" x="740.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_491b3153-f3f7-44aa-a363-5ef7b51e36b6" id="BPMNEdge_7903c831-6b42-48e0-9af9-cf0d9a85e433">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="740.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="definitions_4cdef21d-c9ff-4c9c-9d71-26c35f5f542d" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="order-lines_f1" isExecutable="true" name="order-lines_f1">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_bfe26fdb-7d97-4c76-b3f6-da595b157c5d</outgoing>
</startEvent>
<serviceTask camunda:topic="decision_c1" camunda:type="external" id="decision_c1" name="evaluate condition">
<incoming>sequenceFlow_bfe26fdb-7d97-4c76-b3f6-da595b157c5d</incoming>
<outgoing>sequenceFlow_ea483609-158b-4384-8069-15ef3f59d7e0</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_bfe26fdb-7d97-4c76-b3f6-da595b157c5d" sourceRef="start" targetRef="decision_c1"/>
<exclusiveGateway id="gw1" name="">
<incoming>sequenceFlow_ea483609-158b-4384-8069-15ef3f59d7e0</incoming>
<outgoing>sequenceFlow_216220a4-1159-4586-a2ff-1b1db358a13d</outgoing>
<outgoing>sequenceFlow_5928b38f-9aea-4b51-8c67-46c484b4160b</outgoing>
</exclusiveGateway>
<sequenceFlow id="sequenceFlow_ea483609-158b-4384-8069-15ef3f59d7e0" sourceRef="decision_c1" targetRef="gw1"/>
<sequenceFlow id="sequenceFlow_216220a4-1159-4586-a2ff-1b1db358a13d" name="yes" sourceRef="gw1" targetRef="ext_bulk-price_t3">
<conditionExpression id="conditionExpression_34cd842f-b34a-4170-83ca-57c2d93f4539">${c1_result}</conditionExpression>
</sequenceFlow>
<serviceTask camunda:topic="bulk-price" camunda:type="external" id="ext_bulk-price_t3" name="bulk-price">
<incoming>sequenceFlow_216220a4-1159-4586-a2ff-1b1db358a13d</incoming>
<outgoing>sequenceFlow_eb52a217-542a-4856-80fc-71382c4dcad8</outgoing>
</serviceTask>
<exclusiveGateway id="gw2" name="">
<incoming>sequenceFlow_eb52a217-542a-4856-80fc-71382c4dcad8</incoming>
<incoming>sequenceFlow_8c7468a8-d758-4350-b58f-45f8a7526a90</incoming>
<outgoing>sequenceFlow_9e22b224-d0a3-4320-b0d3-124d6091848e</outgoing>
</exclusiveGateway>
<sequenceFlow id="sequenceFlow_eb52a217-542a-4856-80fc-71382c4dcad8" sourceRef="ext_bulk-price_t3" targetRef="gw2"/>
<sequenceFlow id="sequenceFlow_5928b38f-9aea-4b51-8c67-46c484b4160b" name="no" sourceRef="gw1" targetRef="ext_unit-price_t4">
<conditionExpression id="conditionExpression_d0371154-8fb1-4666-a1ff-eaf3aee457b6">${!(c1_result)}</conditionExpression>
</sequenceFlow>
<serviceTask camunda:topic="unit-price" camunda:type="external" id="ext_unit-price_t4" name="unit-price">
<incoming>sequenceFlow_5928b38f-9aea-4b51-8c67-46c484b4160b</incoming>
<outgoing>sequenceFlow_8c7468a8-d758-4350-b58f-45f8a7526a90</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_8c7468a8-d758-4350-b58f-45f8a7526a90" sourceRef="ext_unit-price_t4" targetRef="gw2"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_9e22b224-d0a3-4320-b0d3-124d6091848e</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_9e22b224-d0a3-4320-b0d3-124d6091848e" sourceRef="gw2" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_9a4819d9-1762-477c-ad0a-5bab798eed1e">
<bpmndi:BPMNPlane bpmnElement="order-lines_f1" id="BPMNPlane_0cd74597-a308-4ccf-99a3-7433934e03e0">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_1bf5a902-ca16-4f72-9dea-73e707e00383">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decision_c1" id="BPMNShape_a3a4738f-8cd3-4e05-92fb-102116dfae12">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="115.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_bfe26fdb-7d97-4c76-b3f6-da595b157c5d" id="BPMNEdge_e3a9bd2a-25c2-49d2-9af2-43582c7f5f28">
<di:waypoint x="96.0" y="155.0"/>
<di:waypoint x="198.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw1" id="BPMNShape_adc610b7-fc02-430c-bb6b-e547c0f7546f" isMarkerVisible="true">
<dc:Bounds height="50.0" width="50.0" x="393.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_ea483609-158b-4384-8069-15ef3f59d7e0" id="BPMNEdge_2d8ac105-48ea-44e2-8b41-e4a2ae47041a">
<di:waypoint x="298.0" y="155.0"/>
<di:waypoint x="393.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_bulk-price_t3" id="BPMNShape_5d11a47a-98a1-4687-8467-8afd2d08547f">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_216220a4-1159-4586-a2ff-1b1db358a13d" id="BPMNEdge_4ad091c0-494f-4133-bde3-863ce629c97b">
<di:waypoint x="443.0" y="155.0"/>
<di:waypoint x="490.5" y="155.0"/>
<di:waypoint x="490.5" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw2" id="BPMNShape_513459da-2c1f-47d9-b37f-39e4566c1f2f" isMarkerVisible="true">
<dc:Bounds height="50.0" width="50.0" x="733.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_eb52a217-542a-4856-80fc-71382c4dcad8" id="BPMNEdge_caf46919-4cbf-4c6e-987b-0f4ef93f7a57">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="685.5" y="100.0"/>
<di:waypoint x="685.5" y="155.0"/>
<di:waypoint x="733.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_unit-price_t4" id="BPMNShape_cb7a1288-5219-4ac5-817d-22ef3014b607">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="170.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_5928b38f-9aea-4b51-8c67-46c484b4160b" id="BPMNEdge_35bd75d8-4586-47ff-ae32-ccda8e0bd937">
<di:waypoint x="443.0" y="155.0"/>
<di:waypoint x="490.5" y="155.0"/>
<di:waypoint x="490.5" y="210.0"/>
<di:waypoint x="538.0" y="210.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_8c7468a8-d758-4350-b58f-45f8a7526a90" id="BPMNEdge_6aa907e9-9df3-4c60-ba3b-a61de4fe0c8d">
<di:waypoint x="638.0" y="210.0"/>
<di:waypoint x="685.5" y="210.0"/>
<di:waypoint x="685.5" y="155.0"/>
<di:waypoint x="733.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_82a39f90-034f-43a8-9dfb-ec9526a97387">
<dc:Bounds height="36.0" width="36.0" x="910.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_9e22b224-d0a3-4320-b0d3-124d6091848e" id="BPMNEdge_dc895bd3-a71a-4b2c-933d-310ba8ab0107">
<di:waypoint x="783.0" y="155.0"/>
<di:waypoint x="910.0" y="155.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ns0="http://camunda.org/schema/zeebe/1.0" id="definitions_16bfffa6-5833-4704-ae2d-05243ab76e01" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="order-lines" isExecutable="true" name="order-lines">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_4ad02e41-825e-49af-b517-19df8154bc27</outgoing>
</startEvent>
<serviceTask id="ext_load_t1" name="load">
<extensionElements>
<ns0:taskDefinition type="load"/>
</extensionElements>
<incoming>sequenceFlow_4ad02e41-825e-49af-b517-19df8154bc27</incoming>
<outgoing>sequenceFlow_070c3465-1648-4308-85fc-d95ec877ad49</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_4ad02e41-825e-49af-b517-19df8154bc27" sourceRef="start" targetRef="ext_load_t1"/>
<serviceTask id="expand_f1" name="expand children">
<extensionElements>
<ns0:taskDefinition type="expand_f1"/>
</extensionElements>
<incoming>sequenceFlow_070c3465-1648-4308-85fc-d95ec877ad49</incoming>
<outgoing>sequenceFlow_16a4f017-f81f-427f-b245-582dc5016235</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_070c3465-1648-4308-85fc-d95ec877ad49" sourceRef="ext_load_t1" targetRef="expand_f1"/>
<callActivity calledElement="order-lines_f1" id="call_f1" name="for each child">
<extensionElements>
<ns0:calledElement processId="order-lines_f1" propagateAllChildVariables="false"/>
</extensionElements>
<incoming>sequenceFlow_16a4f017-f81f-427f-b245-582dc5016235</incoming>
<outgoing>sequenceFlow_14691048-65f6-47e3-9372-7e03acbd1562</outgoing>
<multiInstanceLoopCharacteristics id="multiInstanceLoopCharacteristics_ee5f778e-079d-4016-85da-1f8959ce613d" isSequential="false">
<extensionElements>
<ns0:loopCharacteristics inputCollection="=f1_items" inputElement="f1_item"/>
</extensionElements>
</multiInstanceLoopCharacteristics>
</callActivity>
<sequenceFlow id="sequenceFlow_16a4f017-f81f-427f-b245-582dc5016235" sourceRef="expand_f1" targetRef="call_f1"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_14691048-65f6-47e3-9372-7e03acbd1562</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_14691048-65f6-47e3-9372-7e03acbd1562" sourceRef="call_f1" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_da980906-4ba3-4243-860f-82a6144277c3">
<bpmndi:BPMNPlane bpmnElement="order-lines" id="BPMNPlane_6b5f61af-6d28-458d-bff5-134931026e26">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_4661ef99-77fa-4433-ba48-24fe9e6cf9fb">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ext_load_t1" id="BPMNShape_221253c9-eadc-43f6-b734-55a4dbc24fdb">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_4ad02e41-825e-49af-b517-19df8154bc27" id="BPMNEdge_29d9e75b-663e-42d8-b9c1-ad49c0e2b5f3">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="expand_f1" id="BPMNShape_d7385144-dea7-4be1-83dc-3f55e9e8c385">
<dc:Bounds height="80.0" width="100.0" x="368.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_070c3465-1648-4308-85fc-d95ec877ad49" id="BPMNEdge_7da4e4ab-8089-4dee-9b24-da8ea613172a">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="368.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="call_f1" id="BPMNShape_57d32ffa-d5e7-4ce6-8b0c-9e9d07a560c1">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_16a4f017-f81f-427f-b245-582dc5016235" id="BPMNEdge_abe3e84d-6f41-444f-b844-c8758aa44e7f">
<di:waypoint x="468.0" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_9b57d601-571e-4040-af67-e6a2b3a7477b">
<dc:Bounds height="36.0" width="36.0" x="740.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_14691048-65f6-47e3-9372-7e03acbd1562" id="BPMNEdge_1a5b38cf-dad5-4670-aefe-fadad35dda46">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="740.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ns0="http://camunda.org/schema/zeebe/1.0" id="definitions_48f6ebe1-18bd-4f22-9b22-a716633d0a18" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="order-lines_f1" isExecutable="true" name="order-lines_f1">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_76ed3e22-e1a0-4fdc-a45b-e2812114c381</outgoing>
</startEvent>
<serviceTask id="decision_c1" name="evaluate condition">
<extensionElements>
<ns0:taskDefinition type="decision_c1"/>
</extensionElements>
<incoming>sequenceFlow_76ed3e22-e1a0-4fdc-a45b-e2812114c381</incoming>
<outgoing>sequenceFlow_356cfc03-0471-4530-8a7d-2f867ffd57fc</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_76ed3e22-e1a0-4fdc-a45b-e2812114c381" sourceRef="start" targetRef="decision_c1"/>
<exclusiveGateway id="gw1" name="">
<incoming>sequenceFlow_356cfc03-0471-4530-8a7d-2f867ffd57fc</incoming>
<outgoing>sequenceFlow_985c4761-5429-42e4-9541-c3f437be8872</outgoing>
<outgoing>sequenceFlow_75a10b1f-c60f-42f3-9a51-d8c8d4f4ffba</outgoing>
</exclusiveGateway>
<sequenceFlow id="sequenceFlow_356cfc03-0471-4530-8a7d-2f867ffd57fc" sourceRef="decision_c1" targetRef="gw1"/>
<sequenceFlow id="sequenceFlow_985c4761-5429-42e4-9541-c3f437be8872" name="yes" sourceRef="gw1" targetRef="ext_bulk-price_t3">
<conditionExpression id="conditionExpression_1ad781a7-6e85-4dd5-9d97-42b03ab781d1">=c1_result</conditionExpression>
</sequenceFlow>
<serviceTask id="ext_bulk-price_t3" name="bulk-price">
<extensionElements>
<ns0:taskDefinition type="bulk-price"/>
</extensionElements>
<incoming>sequenceFlow_985c4761-5429-42e4-9541-c3f437be8872</incoming>
<outgoing>sequenceFlow_2418aa5e-cd7e-4805-90e9-06b55319745d</outgoing>
</serviceTask>
<exclusiveGateway id="gw2" name="">
<incoming>sequenceFlow_2418aa5e-cd7e-4805-90e9-06b55319745d</incoming>
<incoming>sequenceFlow_f14d9943-20fe-4dd5-af37-11f70a6b2d17</incoming>
<outgoing>sequenceFlow_0d2f09b6-f302-4da0-8c7a-eb13e3f6ffcb</outgoing>
</exclusiveGateway>
<sequenceFlow id="sequenceFlow_2418aa5e-cd7e-4805-90e9-06b55319745d" sourceRef="ext_bulk-price_t3" targetRef="gw2"/>
<sequenceFlow id="sequenceFlow_75a10b1f-c60f-42f3-9a51-d8c8d4f4ffba" name="no" sourceRef="gw1" targetRef="ext_unit-price_t4">
<conditionExpression id="conditionExpression_fb102aef-f6f0-4446-bc66-7359152c108e">=not(c1_result)</conditionExpression>
</sequenceFlow>
<serviceTask id="ext_unit-price_t4" name="unit-price">
<extensionElements>
<ns0:taskDefinition type="unit-price"/>
</extensionElements>
<incoming>sequenceFlow_75a10b1f-c60f-42f3-9a51-d8c8d4f4ffba</incoming>
<outgoing>sequenceFlow_f14d9943-20fe-4dd5-af37-11f70a6b2d17</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_f14d9943-20fe-4dd5-af37-11f70a6b2d17" sourceRef="ext_unit-price_t4" targetRef="gw2"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_0d2f09b6-f302-4da0-8c7a-eb13e3f6ffcb</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_0d2f09b6-f302-4da0-8c7a-eb13e3f6ffcb" sourceRef="gw2" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_45b4860f-516d-4b9d-b363-228b393c12f1">
<bpmndi:BPMNPlane bpmnElement="order-lines_f1" id="BPMNPlane_7e7f9f14-77a7-4d0c-af55-2550503d1707">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_23065873-1c10-4a14-91e9-aa51883e8f81">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decision_c1" id="BPMNShape_39779cf6-b4bf-4258-a883-285370f4fd8b">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="115.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_76ed3e22-e1a0-4fdc-a45b-e2812114c381" id="BPMNEdge_3503bba8-2425-49de-88fd-ed595dcc012f">
<di:waypoint x="96.0" y="155.0"/>
<di:waypoint x="198.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw1" id="BPMNShape_6dd6ef19-fe15-450a-ad77-66626e041502" isMarkerVisible="true">
<dc:Bounds height="50.0" width="50.0" x="393.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_356cfc03-0471-4530-8a7d-2f867ffd57fc" id="BPMNEdge_30dad0e5-b670-4c3a-aa1f-99b0d0aa2e02">
<di:waypoint x="298.0" y="155.0"/>
<di:waypoint x="393.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_bulk-price_t3" id="BPMNShape_a4ada632-ba9e-4b09-a333-1e3f9f107ce5">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_985c4761-5429-42e4-9541-c3f437be8872" id="BPMNEdge_3975d7e4-e62d-4c15-840e-7a570cf0c491">
<di:waypoint x="443.0" y="155.0"/>
<di:waypoint x="490.5" y="155.0"/>
<di:waypoint x="490.5" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="gw2" id="BPMNShape_2558d5a0-11eb-4733-bb00-e27938ecba98" isMarkerVisible="true">
<dc:Bounds height="50.0" width="50.0" x="733.0" y="130.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_2418aa5e-cd7e-4805-90e9-06b55319745d" id="BPMNEdge_b82de195-ce39-47bf-a6b0-ed6fbcd6f56e">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="685.5" y="100.0"/>
<di:waypoint x="685.5" y="155.0"/>
<di:waypoint x="733.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_unit-price_t4" id="BPMNShape_67500936-6f97-40d5-9681-defeb556c0ca">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="170.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_75a10b1f-c60f-42f3-9a51-d8c8d4f4ffba" id="BPMNEdge_6e6af7c8-2577-4aa0-8576-58fa69a32638">
<di:waypoint x="443.0" y="155.0"/>
<di:waypoint x="490.5" y="155.0"/>
<di:waypoint x="490.5" y="210.0"/>
<di:waypoint x="538.0" y="210.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_f14d9943-20fe-4dd5-af37-11f70a6b2d17" id="BPMNEdge_9c2e5fe3-73fb-4317-b5a5-615c8a58807c">
<di:waypoint x="638.0" y="210.0"/>
<di:waypoint x="685.5" y="210.0"/>
<di:waypoint x="685.5" y="155.0"/>
<di:waypoint x="733.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_be96856e-b011-4a8d-8e5c-905c5d445c9a">
<dc:Bounds height="36.0" width="36.0" x="910.0" y="137.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_0d2f09b6-f302-4da0-8c7a-eb13e3f6ffcb" id="BPMNEdge_7b68dca1-5716-49a4-bbc0-397881d75e99">
<di:waypoint x="783.0" y="155.0"/>
<di:waypoint x="910.0" y="155.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
reduce folds the expanded children into one value and runs onComplete on the parent. It compiles to the fan-out plus a reduce service task after the multi-instance join.
workflow<Order>("order-totals") {
input(orders)
fanOut(expand = { fetchLines(it.id) }, concurrency = 4) {
task("price") { price(it) }
}.reduce(0, combine = { sum, line -> sum + line.qty }) { order, units ->
order.total = units
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="definitions_d019ffbe-3d6c-48fc-923d-e505f36504f9" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="order-totals" isExecutable="true" name="order-totals">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_e2382182-b1ac-4621-9b86-5d6e6082addb</outgoing>
</startEvent>
<serviceTask camunda:topic="expand_f1" camunda:type="external" id="expand_f1" name="expand children">
<incoming>sequenceFlow_e2382182-b1ac-4621-9b86-5d6e6082addb</incoming>
<outgoing>sequenceFlow_ac7e5d49-fbff-4ac8-93ec-9823b48e84e0</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_e2382182-b1ac-4621-9b86-5d6e6082addb" sourceRef="start" targetRef="expand_f1"/>
<callActivity calledElement="order-totals_f1" id="call_f1" name="for each child">
<extensionElements>
<camunda:in source="f1_item" target="f1_item"/>
</extensionElements>
<incoming>sequenceFlow_ac7e5d49-fbff-4ac8-93ec-9823b48e84e0</incoming>
<outgoing>sequenceFlow_6a57597c-f9e2-4041-ac7b-7c5dc5795bbf</outgoing>
<multiInstanceLoopCharacteristics camunda:collection="${f1_items.elements()}" camunda:elementVariable="f1_item" id="multiInstanceLoopCharacteristics_668ec15a-d22c-4a55-acd5-c647e9019790" isSequential="false"/>
</callActivity>
<sequenceFlow id="sequenceFlow_ac7e5d49-fbff-4ac8-93ec-9823b48e84e0" sourceRef="expand_f1" targetRef="call_f1"/>
<serviceTask camunda:topic="reduce_f1" camunda:type="external" id="reduce_f1" name="reduce children">
<incoming>sequenceFlow_6a57597c-f9e2-4041-ac7b-7c5dc5795bbf</incoming>
<outgoing>sequenceFlow_59bb303a-4023-47c0-b2b1-48176b3706da</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_6a57597c-f9e2-4041-ac7b-7c5dc5795bbf" sourceRef="call_f1" targetRef="reduce_f1"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_59bb303a-4023-47c0-b2b1-48176b3706da</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_59bb303a-4023-47c0-b2b1-48176b3706da" sourceRef="reduce_f1" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_6cf41f32-f1a0-4f91-b4a4-6b3e2b71a81a">
<bpmndi:BPMNPlane bpmnElement="order-totals" id="BPMNPlane_db40a143-6c9d-4a06-a344-4f799947ae05">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_b9074749-c8d0-4d19-87c1-b0f5c5d6cd79">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="expand_f1" id="BPMNShape_b4f15c29-d18d-45fc-9c69-23dbca35c2da">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_e2382182-b1ac-4621-9b86-5d6e6082addb" id="BPMNEdge_3cc234eb-8c6c-4ff5-9f08-f293fa19f813">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="call_f1" id="BPMNShape_9f60d0d0-b680-429b-87d6-7d544e464b84">
<dc:Bounds height="80.0" width="100.0" x="368.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_ac7e5d49-fbff-4ac8-93ec-9823b48e84e0" id="BPMNEdge_6eb05f5c-c4b3-463b-95f7-ec7ee2f7ec06">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="368.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="reduce_f1" id="BPMNShape_74518e0a-38c0-4905-a509-9315769de6cb">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_6a57597c-f9e2-4041-ac7b-7c5dc5795bbf" id="BPMNEdge_4cecc5cc-fb0e-4f02-a7f4-41b9b89301fb">
<di:waypoint x="468.0" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_b8e64c3d-b899-4e54-bbfe-e364d1654989">
<dc:Bounds height="36.0" width="36.0" x="740.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_59bb303a-4023-47c0-b2b1-48176b3706da" id="BPMNEdge_cc8632e2-4fe1-4746-8319-1266ed3313ce">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="740.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="definitions_acfbfb8d-72bd-42c5-bd52-54a7978b10a5" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="order-totals_f1" isExecutable="true" name="order-totals_f1">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_46db7f91-8a99-4157-8d79-691cdb0a48a6</outgoing>
</startEvent>
<serviceTask camunda:topic="price" camunda:type="external" id="ext_price_t1" name="price">
<incoming>sequenceFlow_46db7f91-8a99-4157-8d79-691cdb0a48a6</incoming>
<outgoing>sequenceFlow_f732fc00-c50a-4cca-9521-85a32a9c5d56</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_46db7f91-8a99-4157-8d79-691cdb0a48a6" sourceRef="start" targetRef="ext_price_t1"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_f732fc00-c50a-4cca-9521-85a32a9c5d56</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_f732fc00-c50a-4cca-9521-85a32a9c5d56" sourceRef="ext_price_t1" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_0ee3c009-e72e-45dc-86ee-7eda49aa8003">
<bpmndi:BPMNPlane bpmnElement="order-totals_f1" id="BPMNPlane_3d7b42fb-eb76-42c0-a975-7fa4681b7b92">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_66c57449-6fb8-440c-a815-5071c6a354bc">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ext_price_t1" id="BPMNShape_45c8dc79-a680-4c9c-9484-ff9a6f3896cb">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_46db7f91-8a99-4157-8d79-691cdb0a48a6" id="BPMNEdge_226b7d8d-340d-44eb-86a4-9f7e49d55df3">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_c8cb465e-60cb-4285-8d0e-db34139278ea">
<dc:Bounds height="36.0" width="36.0" x="400.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_f732fc00-c50a-4cca-9521-85a32a9c5d56" id="BPMNEdge_94e18cea-f416-4ff4-b000-9c3d342049f1">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="400.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ns0="http://camunda.org/schema/zeebe/1.0" id="definitions_8e1678b6-3780-4a0a-9c8e-51e590f96c72" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="order-totals" isExecutable="true" name="order-totals">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_bf3480c0-fd2f-4978-863b-789221e008cc</outgoing>
</startEvent>
<serviceTask id="expand_f1" name="expand children">
<extensionElements>
<ns0:taskDefinition type="expand_f1"/>
</extensionElements>
<incoming>sequenceFlow_bf3480c0-fd2f-4978-863b-789221e008cc</incoming>
<outgoing>sequenceFlow_8cb8ac8f-0f64-4ecc-91fd-5344545dfb9b</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_bf3480c0-fd2f-4978-863b-789221e008cc" sourceRef="start" targetRef="expand_f1"/>
<callActivity calledElement="order-totals_f1" id="call_f1" name="for each child">
<extensionElements>
<ns0:calledElement processId="order-totals_f1" propagateAllChildVariables="false"/>
</extensionElements>
<incoming>sequenceFlow_8cb8ac8f-0f64-4ecc-91fd-5344545dfb9b</incoming>
<outgoing>sequenceFlow_c1be7628-05a9-4cdb-9f55-5c1a05a1a45b</outgoing>
<multiInstanceLoopCharacteristics id="multiInstanceLoopCharacteristics_f338f167-f0d3-4b25-8747-15c312a4a8f5" isSequential="false">
<extensionElements>
<ns0:loopCharacteristics inputCollection="=f1_items" inputElement="f1_item"/>
</extensionElements>
</multiInstanceLoopCharacteristics>
</callActivity>
<sequenceFlow id="sequenceFlow_8cb8ac8f-0f64-4ecc-91fd-5344545dfb9b" sourceRef="expand_f1" targetRef="call_f1"/>
<serviceTask id="reduce_f1" name="reduce children">
<extensionElements>
<ns0:taskDefinition type="reduce_f1"/>
</extensionElements>
<incoming>sequenceFlow_c1be7628-05a9-4cdb-9f55-5c1a05a1a45b</incoming>
<outgoing>sequenceFlow_479baab7-f917-4f0a-be02-87b70b31bb4e</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_c1be7628-05a9-4cdb-9f55-5c1a05a1a45b" sourceRef="call_f1" targetRef="reduce_f1"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_479baab7-f917-4f0a-be02-87b70b31bb4e</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_479baab7-f917-4f0a-be02-87b70b31bb4e" sourceRef="reduce_f1" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_c6c85248-6412-4bea-bdfe-637f6267493f">
<bpmndi:BPMNPlane bpmnElement="order-totals" id="BPMNPlane_e4c7dab3-1f4e-4509-b394-ff7f7d83f006">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_987f2a61-b554-4654-a2cf-09645f3e9848">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="expand_f1" id="BPMNShape_c1d1d777-d1b8-4036-86d4-ad023ae036af">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_bf3480c0-fd2f-4978-863b-789221e008cc" id="BPMNEdge_e15ce231-8cd3-4f5c-b0a0-df8b38077698">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="call_f1" id="BPMNShape_c1fbc918-62fb-4880-91b1-c2158b00abd5">
<dc:Bounds height="80.0" width="100.0" x="368.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_8cb8ac8f-0f64-4ecc-91fd-5344545dfb9b" id="BPMNEdge_7def1a58-da53-4322-87fd-a7449cfa3704">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="368.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="reduce_f1" id="BPMNShape_5076c566-7ff2-4bb1-9e8b-bbaf7c90761c">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_c1be7628-05a9-4cdb-9f55-5c1a05a1a45b" id="BPMNEdge_73fda5f8-45f8-4eab-b18b-df38335b0e5c">
<di:waypoint x="468.0" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_d7d409f1-6760-43ad-b6d6-d85d11520eb5">
<dc:Bounds height="36.0" width="36.0" x="740.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_479baab7-f917-4f0a-be02-87b70b31bb4e" id="BPMNEdge_095f680e-c782-4dd1-a6e8-ece562604b83">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="740.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ns0="http://camunda.org/schema/zeebe/1.0" id="definitions_5f99e8d7-d420-455e-84db-2c0f228866ad" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="order-totals_f1" isExecutable="true" name="order-totals_f1">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_40ed5f04-2a91-4014-8aaa-e75b5a0a0525</outgoing>
</startEvent>
<serviceTask id="ext_price_t1" name="price">
<extensionElements>
<ns0:taskDefinition type="price"/>
</extensionElements>
<incoming>sequenceFlow_40ed5f04-2a91-4014-8aaa-e75b5a0a0525</incoming>
<outgoing>sequenceFlow_ac725a8e-f5f1-4a17-aeb4-f85bbb55075b</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_40ed5f04-2a91-4014-8aaa-e75b5a0a0525" sourceRef="start" targetRef="ext_price_t1"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_ac725a8e-f5f1-4a17-aeb4-f85bbb55075b</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_ac725a8e-f5f1-4a17-aeb4-f85bbb55075b" sourceRef="ext_price_t1" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_104f90e1-1da1-45ec-8ca1-15fc34f064b4">
<bpmndi:BPMNPlane bpmnElement="order-totals_f1" id="BPMNPlane_3cf736ca-b721-4ae4-8e69-3b0858ff0c07">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_f4e283d6-91e8-4a14-b6b1-87c5febed708">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ext_price_t1" id="BPMNShape_12f30611-6ff1-4f54-8f2d-8fe664a77c5a">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_40ed5f04-2a91-4014-8aaa-e75b5a0a0525" id="BPMNEdge_50f85e98-8d32-478a-823d-284d4a9d1c72">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_85242026-6f53-4640-94ce-08ec0bc0d05f">
<dc:Bounds height="36.0" width="36.0" x="400.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_ac725a8e-f5f1-4a17-aeb4-f85bbb55075b" id="BPMNEdge_5181dcea-0bd2-448f-bc53-e9f0cd0f2859">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="400.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
wait pauses the flow for a fixed duration. It compiles to an intermediate timer catch event the engine schedules natively.
workflow<Order>("retry-later") {
input(orders)
task("attempt") { charge(it) }
wait(15.minutes)
task("settle") { settle(it) }
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="definitions_c8a91944-3462-45ff-b503-e8b3949ab64b" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="retry-later" isExecutable="true" name="retry-later">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_81f09c6a-1d7d-412b-9f6b-e3ead30c9c0c</outgoing>
</startEvent>
<serviceTask camunda:topic="attempt" camunda:type="external" id="ext_attempt_t1" name="attempt">
<incoming>sequenceFlow_81f09c6a-1d7d-412b-9f6b-e3ead30c9c0c</incoming>
<outgoing>sequenceFlow_07a86c7e-b8a7-456f-8c4d-7590fb7de34e</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_81f09c6a-1d7d-412b-9f6b-e3ead30c9c0c" sourceRef="start" targetRef="ext_attempt_t1"/>
<intermediateCatchEvent id="timer_w1" name="wait 15m">
<incoming>sequenceFlow_07a86c7e-b8a7-456f-8c4d-7590fb7de34e</incoming>
<outgoing>sequenceFlow_e72ae26b-c64c-46f7-9093-0a84e393b327</outgoing>
<timerEventDefinition id="timerEventDefinition_103f6894-6ff1-4608-b800-523e75a54c81">
<timeDuration id="timeDuration_8078321e-3f2e-46c6-9263-76a5a07a4527">PT15M</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<sequenceFlow id="sequenceFlow_07a86c7e-b8a7-456f-8c4d-7590fb7de34e" sourceRef="ext_attempt_t1" targetRef="timer_w1"/>
<serviceTask camunda:topic="settle" camunda:type="external" id="ext_settle_t2" name="settle">
<incoming>sequenceFlow_e72ae26b-c64c-46f7-9093-0a84e393b327</incoming>
<outgoing>sequenceFlow_e35f9569-9737-40a8-8176-d50ac2791b2b</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_e72ae26b-c64c-46f7-9093-0a84e393b327" sourceRef="timer_w1" targetRef="ext_settle_t2"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_e35f9569-9737-40a8-8176-d50ac2791b2b</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_e35f9569-9737-40a8-8176-d50ac2791b2b" sourceRef="ext_settle_t2" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_bbfbba25-82c0-4f63-8865-b631e26812ce">
<bpmndi:BPMNPlane bpmnElement="retry-later" id="BPMNPlane_53e1d292-7b7b-4fbd-802b-d95d9a31926d">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_0d05ead4-5f1d-4eec-b828-c68c96c06c21">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ext_attempt_t1" id="BPMNShape_cdb8c1d1-6413-4ff7-9ef7-08ee1cc9e27c">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_81f09c6a-1d7d-412b-9f6b-e3ead30c9c0c" id="BPMNEdge_47699628-f771-45fa-9776-ee09c035b785">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="timer_w1" id="BPMNShape_1e815430-fd7d-4bc2-8c03-32cbf89cffff">
<dc:Bounds height="36.0" width="36.0" x="400.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_07a86c7e-b8a7-456f-8c4d-7590fb7de34e" id="BPMNEdge_bb4c1230-b133-421e-921f-060c3e63c584">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="400.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_settle_t2" id="BPMNShape_aba0d860-3c5a-4a7d-88e7-99716e4f1014">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_e72ae26b-c64c-46f7-9093-0a84e393b327" id="BPMNEdge_93c0335c-f302-44fb-a8b2-d839d51cd225">
<di:waypoint x="436.0" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_cd96aba6-a6d1-4b07-a976-1a85164ab47e">
<dc:Bounds height="36.0" width="36.0" x="740.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_e35f9569-9737-40a8-8176-d50ac2791b2b" id="BPMNEdge_44bfb00b-ae70-4ada-9183-a047a75373ef">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="740.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ns0="http://camunda.org/schema/zeebe/1.0" id="definitions_b63a103b-3702-42e1-9d43-17901cd01fb4" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="retry-later" isExecutable="true" name="retry-later">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_c8fb9c62-18b5-4ceb-8ef8-8e60b31a67e6</outgoing>
</startEvent>
<serviceTask id="ext_attempt_t1" name="attempt">
<extensionElements>
<ns0:taskDefinition type="attempt"/>
</extensionElements>
<incoming>sequenceFlow_c8fb9c62-18b5-4ceb-8ef8-8e60b31a67e6</incoming>
<outgoing>sequenceFlow_28d14d9e-8319-4e1c-9ebb-766377491d52</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_c8fb9c62-18b5-4ceb-8ef8-8e60b31a67e6" sourceRef="start" targetRef="ext_attempt_t1"/>
<intermediateCatchEvent id="timer_w1" name="wait 15m">
<incoming>sequenceFlow_28d14d9e-8319-4e1c-9ebb-766377491d52</incoming>
<outgoing>sequenceFlow_ad6cba8a-78d2-4cd7-8558-d9d76b22cd45</outgoing>
<timerEventDefinition id="timerEventDefinition_8a0f6d9a-c928-4b35-9e4e-784c3566989c">
<timeDuration id="timeDuration_441ecfcc-33af-40da-8af6-d8205622dd2f">PT15M</timeDuration>
</timerEventDefinition>
</intermediateCatchEvent>
<sequenceFlow id="sequenceFlow_28d14d9e-8319-4e1c-9ebb-766377491d52" sourceRef="ext_attempt_t1" targetRef="timer_w1"/>
<serviceTask id="ext_settle_t2" name="settle">
<extensionElements>
<ns0:taskDefinition type="settle"/>
</extensionElements>
<incoming>sequenceFlow_ad6cba8a-78d2-4cd7-8558-d9d76b22cd45</incoming>
<outgoing>sequenceFlow_86b32d38-f44e-4bd1-958e-243a781314df</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_ad6cba8a-78d2-4cd7-8558-d9d76b22cd45" sourceRef="timer_w1" targetRef="ext_settle_t2"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_86b32d38-f44e-4bd1-958e-243a781314df</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_86b32d38-f44e-4bd1-958e-243a781314df" sourceRef="ext_settle_t2" targetRef="end"/>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_2775ae17-9d23-4bf2-9cd5-6dba182783eb">
<bpmndi:BPMNPlane bpmnElement="retry-later" id="BPMNPlane_90985593-ec62-4d44-bc32-b02bc061fe6d">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_083fe9e9-2f46-410b-a279-1ce0675bfbce">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ext_attempt_t1" id="BPMNShape_4d6c9cf2-78ba-4490-b66a-ea78c2913d6e">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_c8fb9c62-18b5-4ceb-8ef8-8e60b31a67e6" id="BPMNEdge_5ec9962e-3a0c-422a-9a99-4551663a93a1">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="timer_w1" id="BPMNShape_b56f181c-cfd9-431f-8291-7444ffc9857f">
<dc:Bounds height="36.0" width="36.0" x="400.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_28d14d9e-8319-4e1c-9ebb-766377491d52" id="BPMNEdge_0ce99522-7e2d-4a9e-9d99-e38f24229e38">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="400.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_settle_t2" id="BPMNShape_3a21beaa-359a-4982-836a-e5882ffda11f">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_ad6cba8a-78d2-4cd7-8558-d9d76b22cd45" id="BPMNEdge_c48306cb-879f-4bc8-99d8-8167d805f17a">
<di:waypoint x="436.0" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_4ee7d7aa-c202-4c7c-b58d-78fad24a5ed9">
<dc:Bounds height="36.0" width="36.0" x="740.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_86b32d38-f44e-4bd1-958e-243a781314df" id="BPMNEdge_c4164be4-a436-43d8-b8d5-17cef0c1eb89">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="740.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
awaitMessage parks the flow until an external event arrives. It compiles to an intermediate message catch event the engine correlates by key.
workflow<Order>("await-payment") {
input(orders)
task("invoice") { invoice(it) }
awaitMessage("payment-confirmed")
task("fulfil") { fulfil(it) }
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="definitions_04ecbe04-7134-495b-9590-8b6fad931a10" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="await-payment" isExecutable="true" name="await-payment">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_43409b79-e7af-46b7-a1e4-0735a9a52d6b</outgoing>
</startEvent>
<serviceTask camunda:topic="invoice" camunda:type="external" id="ext_invoice_t1" name="invoice">
<incoming>sequenceFlow_43409b79-e7af-46b7-a1e4-0735a9a52d6b</incoming>
<outgoing>sequenceFlow_139684da-038d-4d58-82df-4b5e6d4adff9</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_43409b79-e7af-46b7-a1e4-0735a9a52d6b" sourceRef="start" targetRef="ext_invoice_t1"/>
<intermediateCatchEvent id="msg_msg1" name="payment-confirmed">
<incoming>sequenceFlow_139684da-038d-4d58-82df-4b5e6d4adff9</incoming>
<outgoing>sequenceFlow_4fc48ef6-65a3-476e-825f-2dc9cff0a939</outgoing>
<messageEventDefinition id="messageEventDefinition_7bddb8bc-6b97-48d5-b652-ced1ee70488a" messageRef="message_1c7a72f4-c595-4231-9a5b-cb09b9d29515"/>
</intermediateCatchEvent>
<sequenceFlow id="sequenceFlow_139684da-038d-4d58-82df-4b5e6d4adff9" sourceRef="ext_invoice_t1" targetRef="msg_msg1"/>
<serviceTask camunda:topic="fulfil" camunda:type="external" id="ext_fulfil_t2" name="fulfil">
<incoming>sequenceFlow_4fc48ef6-65a3-476e-825f-2dc9cff0a939</incoming>
<outgoing>sequenceFlow_a274e593-3ffa-4ec4-a2af-e2c275b97173</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_4fc48ef6-65a3-476e-825f-2dc9cff0a939" sourceRef="msg_msg1" targetRef="ext_fulfil_t2"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_a274e593-3ffa-4ec4-a2af-e2c275b97173</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_a274e593-3ffa-4ec4-a2af-e2c275b97173" sourceRef="ext_fulfil_t2" targetRef="end"/>
</process>
<message id="message_1c7a72f4-c595-4231-9a5b-cb09b9d29515" name="payment-confirmed"/>
<bpmndi:BPMNDiagram id="BPMNDiagram_41b1a8b0-aa4b-488f-bbac-c279d81ab7f5">
<bpmndi:BPMNPlane bpmnElement="await-payment" id="BPMNPlane_4a9c585e-e700-4602-a88b-fd730f34c899">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_08729031-6c15-42a7-9dfb-b507463be580">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ext_invoice_t1" id="BPMNShape_0704d408-3b19-49c0-8908-89a372f68b5e">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_43409b79-e7af-46b7-a1e4-0735a9a52d6b" id="BPMNEdge_74186ab9-db74-40ec-9019-238c9ea96fff">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="msg_msg1" id="BPMNShape_d0cc15a6-0541-4288-b0ba-a0cd7440ea38">
<dc:Bounds height="36.0" width="36.0" x="400.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_139684da-038d-4d58-82df-4b5e6d4adff9" id="BPMNEdge_689abdde-dc24-4634-b2c6-77a826aa220f">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="400.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_fulfil_t2" id="BPMNShape_1dc8d087-403c-4078-8e40-1d6fbf760ec8">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_4fc48ef6-65a3-476e-825f-2dc9cff0a939" id="BPMNEdge_d84a8ece-bc66-4e7e-86c8-b76587e008dc">
<di:waypoint x="436.0" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_1e07285e-55d8-4c66-9f03-a41f813166de">
<dc:Bounds height="36.0" width="36.0" x="740.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_a274e593-3ffa-4ec4-a2af-e2c275b97173" id="BPMNEdge_aefa1c45-c1b0-4796-91ec-c064fea9e1fc">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="740.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ns0="http://camunda.org/schema/zeebe/1.0" id="definitions_0f6867f8-b8ff-486a-bf78-39179563ebf1" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL">
<process camunda:historyTimeToLive="P180D" id="await-payment" isExecutable="true" name="await-payment">
<startEvent id="start" name="Start">
<outgoing>sequenceFlow_aba21378-31be-465a-8720-4fc2dcfdc9e7</outgoing>
</startEvent>
<serviceTask id="ext_invoice_t1" name="invoice">
<extensionElements>
<ns0:taskDefinition type="invoice"/>
</extensionElements>
<incoming>sequenceFlow_aba21378-31be-465a-8720-4fc2dcfdc9e7</incoming>
<outgoing>sequenceFlow_42246efb-d1c1-4713-b1ee-e867d2b9f1d2</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_aba21378-31be-465a-8720-4fc2dcfdc9e7" sourceRef="start" targetRef="ext_invoice_t1"/>
<intermediateCatchEvent id="msg_msg1" name="payment-confirmed">
<incoming>sequenceFlow_42246efb-d1c1-4713-b1ee-e867d2b9f1d2</incoming>
<outgoing>sequenceFlow_ffa886da-268c-4f3f-b05b-8b5b876e6906</outgoing>
<messageEventDefinition id="messageEventDefinition_c9376bf8-fde9-46fe-a671-61cfdc143533" messageRef="message_e7074ebc-f64c-4bd5-bf1f-6434423d74c0"/>
</intermediateCatchEvent>
<sequenceFlow id="sequenceFlow_42246efb-d1c1-4713-b1ee-e867d2b9f1d2" sourceRef="ext_invoice_t1" targetRef="msg_msg1"/>
<serviceTask id="ext_fulfil_t2" name="fulfil">
<extensionElements>
<ns0:taskDefinition type="fulfil"/>
</extensionElements>
<incoming>sequenceFlow_ffa886da-268c-4f3f-b05b-8b5b876e6906</incoming>
<outgoing>sequenceFlow_9e6d5be8-a7a7-4336-a5bc-31e0e83b0e44</outgoing>
</serviceTask>
<sequenceFlow id="sequenceFlow_ffa886da-268c-4f3f-b05b-8b5b876e6906" sourceRef="msg_msg1" targetRef="ext_fulfil_t2"/>
<endEvent id="end" name="End">
<incoming>sequenceFlow_9e6d5be8-a7a7-4336-a5bc-31e0e83b0e44</incoming>
</endEvent>
<sequenceFlow id="sequenceFlow_9e6d5be8-a7a7-4336-a5bc-31e0e83b0e44" sourceRef="ext_fulfil_t2" targetRef="end"/>
</process>
<message id="message_e7074ebc-f64c-4bd5-bf1f-6434423d74c0" name="payment-confirmed"/>
<bpmndi:BPMNDiagram id="BPMNDiagram_d5284478-030e-4800-ae23-ba16983111eb">
<bpmndi:BPMNPlane bpmnElement="await-payment" id="BPMNPlane_d598160a-a86d-434c-be2b-b3f02081f8e1">
<bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_9f998755-ef7f-4cbd-a308-eb1a8de10512">
<dc:Bounds height="36.0" width="36.0" x="60.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ext_invoice_t1" id="BPMNShape_c6126d36-c8b2-4239-a199-0a2fbb727cbd">
<dc:Bounds height="80.0" width="100.0" x="198.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_aba21378-31be-465a-8720-4fc2dcfdc9e7" id="BPMNEdge_5de59d1c-66c0-4b58-86fc-5f7ec69ee48f">
<di:waypoint x="96.0" y="100.0"/>
<di:waypoint x="198.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="msg_msg1" id="BPMNShape_ebbf4e2c-11fe-4baa-90aa-e751f1c20ea9">
<dc:Bounds height="36.0" width="36.0" x="400.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_42246efb-d1c1-4713-b1ee-e867d2b9f1d2" id="BPMNEdge_940de7dd-c008-44b8-8257-c3501817e94e">
<di:waypoint x="298.0" y="100.0"/>
<di:waypoint x="400.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="ext_fulfil_t2" id="BPMNShape_088aeab0-b894-49f8-a06e-c87176812215">
<dc:Bounds height="80.0" width="100.0" x="538.0" y="60.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_ffa886da-268c-4f3f-b05b-8b5b876e6906" id="BPMNEdge_51415a27-3835-45c8-84cb-a0e62829d1db">
<di:waypoint x="436.0" y="100.0"/>
<di:waypoint x="538.0" y="100.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_1edcf31a-5e1f-4587-a107-9bf79dc23353">
<dc:Bounds height="36.0" width="36.0" x="740.0" y="82.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sequenceFlow_9e6d5be8-a7a7-4336-a5bc-31e0e83b0e44" id="BPMNEdge_26563fdf-c266-4691-8503-52a7635fd09d">
<di:waypoint x="638.0" y="100.0"/>
<di:waypoint x="740.0" y="100.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>