Skip to content

Instantly share code, notes, and snippets.

@korthout
Created June 9, 2020 07:44
Show Gist options
  • Save korthout/b654e18a5482c3fddce3e0e2e1629858 to your computer and use it in GitHub Desktop.
Save korthout/b654e18a5482c3fddce3e0e2e1629858 to your computer and use it in GitHub Desktop.
Example Zeebe bpmn to show output mappings in container of multi-instance subprocess
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0np1c1o" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Zeebe Modeler" exporterVersion="0.9.1">
<bpmn:process id="Process_0ci0xjm" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_13659id</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:endEvent id="Event_0vubwhi">
<bpmn:incoming>Flow_0aks3ve</bpmn:incoming>
</bpmn:endEvent>
<bpmn:subProcess id="Activity_1t8ayez">
<bpmn:extensionElements>
<zeebe:ioMapping>
<zeebe:output source="=pages" target="Book.pages" />
</zeebe:ioMapping>
</bpmn:extensionElements>
<bpmn:incoming>Flow_13659id</bpmn:incoming>
<bpmn:outgoing>Flow_0aks3ve</bpmn:outgoing>
<bpmn:startEvent id="Event_02l511x">
<bpmn:outgoing>Flow_0jwqkkk</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:subProcess id="ReadPagesSubProcess" name="Read pages">
<bpmn:incoming>Flow_0jwqkkk</bpmn:incoming>
<bpmn:outgoing>Flow_03laeqb</bpmn:outgoing>
<bpmn:multiInstanceLoopCharacteristics>
<bpmn:extensionElements>
<zeebe:loopCharacteristics inputCollection="=Book.pages" inputElement="page" outputCollection="pages" outputElement="=paged" />
</bpmn:extensionElements>
</bpmn:multiInstanceLoopCharacteristics>
<bpmn:startEvent id="Event_0g684kt">
<bpmn:outgoing>Flow_04y1h2e</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:endEvent id="Event_17xlomo">
<bpmn:incoming>Flow_0u5f9vy</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_0u5f9vy" sourceRef="ReadPageTask" targetRef="Event_17xlomo" />
<bpmn:sequenceFlow id="Flow_04y1h2e" sourceRef="Event_0g684kt" targetRef="ReadPageTask" />
<bpmn:serviceTask id="ReadPageTask" name="Read page">
<bpmn:extensionElements>
<zeebe:taskDefinition type="read" />
<zeebe:ioMapping>
<zeebe:output source="={PageNumber:page.PageNumber,isRead:true}" target="paged" />
</zeebe:ioMapping>
</bpmn:extensionElements>
<bpmn:incoming>Flow_04y1h2e</bpmn:incoming>
<bpmn:outgoing>Flow_0u5f9vy</bpmn:outgoing>
</bpmn:serviceTask>
</bpmn:subProcess>
<bpmn:sequenceFlow id="Flow_0jwqkkk" sourceRef="Event_02l511x" targetRef="ReadPagesSubProcess" />
<bpmn:endEvent id="Event_0fhpkxy">
<bpmn:incoming>Flow_03laeqb</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_03laeqb" sourceRef="ReadPagesSubProcess" targetRef="Event_0fhpkxy" />
</bpmn:subProcess>
<bpmn:sequenceFlow id="Flow_13659id" sourceRef="StartEvent_1" targetRef="Activity_1t8ayez" />
<bpmn:sequenceFlow id="Flow_0aks3ve" sourceRef="Activity_1t8ayez" targetRef="Event_0vubwhi" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_0ci0xjm">
<bpmndi:BPMNEdge id="Flow_13659id_di" bpmnElement="Flow_13659id">
<di:waypoint x="208" y="205" />
<di:waypoint x="260" y="205" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0aks3ve_di" bpmnElement="Flow_0aks3ve">
<di:waypoint x="920" y="205" />
<di:waypoint x="972" y="205" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="172" y="187" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0vubwhi_di" bpmnElement="Event_0vubwhi">
<dc:Bounds x="972" y="187" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1t8ayez_di" bpmnElement="Activity_1t8ayez" isExpanded="true">
<dc:Bounds x="260" y="80" width="660" height="250" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_0jwqkkk_di" bpmnElement="Flow_0jwqkkk">
<di:waypoint x="328" y="205" />
<di:waypoint x="390" y="205" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_03laeqb_di" bpmnElement="Flow_03laeqb">
<di:waypoint x="770" y="205" />
<di:waypoint x="842" y="205" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Event_0fhpkxy_di" bpmnElement="Event_0fhpkxy">
<dc:Bounds x="842" y="187" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_02l511x_di" bpmnElement="Event_02l511x">
<dc:Bounds x="292" y="187" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0x5orj9_di" bpmnElement="ReadPagesSubProcess" isExpanded="true">
<dc:Bounds x="390" y="100" width="380" height="210" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_04y1h2e_di" bpmnElement="Flow_04y1h2e">
<di:waypoint x="466" y="200" />
<di:waypoint x="520" y="200" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0u5f9vy_di" bpmnElement="Flow_0u5f9vy">
<di:waypoint x="620" y="200" />
<di:waypoint x="662" y="200" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="Event_0g684kt_di" bpmnElement="Event_0g684kt">
<dc:Bounds x="430" y="182" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_17xlomo_di" bpmnElement="Event_17xlomo">
<dc:Bounds x="662" y="182" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_0kengxq_di" bpmnElement="ReadPageTask">
<dc:Bounds x="520" y="160" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment