Skip to content

Instantly share code, notes, and snippets.

@ederign
Created January 12, 2021 21:43
Show Gist options
  • Save ederign/481d9ac555573b63695031afd1005e10 to your computer and use it in GitHub Desktop.
Save ederign/481d9ac555573b63695031afd1005e10 to your computer and use it in GitHub Desktop.
sample.bpmn
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:bpsim="http://www.bpsim.org/schemas/1.0" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:drools="http://www.jboss.org/drools" id="_G8L7QDdNEDmAdvHSljkKzw" exporter="jBPM Process Modeler" exporterVersion="2.0" targetNamespace="http://www.omg.org/bpmn20">
<bpmn2:itemDefinition id="_travellerItem" structureRef="org.acme.travel.Traveller"/>
<bpmn2:itemDefinition id="__0E0784C3-1BEC-4A51-A5E6-D7E5DA3A4402_eventInputXItem" structureRef="org.acme.travel.Traveller"/>
<bpmn2:itemDefinition id="processedtravellersType" structureRef="org.acme.travel.Traveller"/>
<bpmn2:itemDefinition id="__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_namespaceInputXItem" structureRef="java.lang.String"/>
<bpmn2:itemDefinition id="__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_modelInputXItem" structureRef="java.lang.String"/>
<bpmn2:itemDefinition id="__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_decisionInputXItem" structureRef="java.lang.String"/>
<bpmn2:itemDefinition id="__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerInputXItem" structureRef="org.acme.travel.Traveller"/>
<bpmn2:itemDefinition id="__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerOutputXItem" structureRef="org.acme.travel.Traveller"/>
<bpmn2:itemDefinition id="__8BEA9396-93DE-4D44-8CE2-4A146464264E_eventOutputXItem" structureRef="org.acme.travel.Traveller"/>
<bpmn2:itemDefinition id="travellersType" structureRef="org.acme.travel.Traveller"/>
<bpmn2:message id="_G8NJYDdNEDmAdvHSljkKzw" itemRef="processedtravellersType" name="processedtravellers"/>
<bpmn2:message id="_G8NJYTdNEDmAdvHSljkKzw" itemRef="travellersType" name="travellers"/>
<bpmn2:process id="Travelers" drools:packageName="org.kie.kogito.test" drools:version="1.0" drools:adHoc="false" name="Process travelers" isExecutable="true" processType="Public">
<bpmn2:property id="traveller" itemSubjectRef="_travellerItem" name="traveller"/>
<bpmn2:sequenceFlow id="_D15CD483-D31D-42F8-A93A-AAAF44292D84" sourceRef="_8BEA9396-93DE-4D44-8CE2-4A146464264E" targetRef="_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8">
<bpmn2:extensionElements>
<drools:metaData name="isAutoConnection.source">
<drools:metaValue><![CDATA[true]]></drools:metaValue>
</drools:metaData>
<drools:metaData name="isAutoConnection.target">
<drools:metaValue><![CDATA[true]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="_C5756B00-2541-4948-A7F5-4494A10E3A31" name="Yes" sourceRef="_58FF9DA5-06C6-4D71-91CD-6EAE4E999CF9" targetRef="_B7417363-C542-4A4A-A314-2AF370DE2515">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[Yes]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="http://www.java.com/java"><![CDATA[return traveller.isProcessed();]]></bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="_EDFD7D46-79EC-4C49-B6D8-5873E9301AC7" name="No" sourceRef="_58FF9DA5-06C6-4D71-91CD-6EAE4E999CF9" targetRef="_0C615323-1520-40BF-8A41-46C2BBC6819C">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[No]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="http://www.java.com/java"><![CDATA[return !traveller.isProcessed();]]></bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="_96F8E118-C58C-4369-89DC-2C881614FF73" sourceRef="_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8" targetRef="_58FF9DA5-06C6-4D71-91CD-6EAE4E999CF9"/>
<bpmn2:sequenceFlow id="_5CC19845-48FB-4E72-BD04-E392C0241209" sourceRef="_0C615323-1520-40BF-8A41-46C2BBC6819C" targetRef="_F368D316-78E0-4D1C-A59A-79BC75A0A62B">
<bpmn2:extensionElements>
<drools:metaData name="isAutoConnection.source">
<drools:metaValue><![CDATA[true]]></drools:metaValue>
</drools:metaData>
<drools:metaData name="isAutoConnection.target">
<drools:metaValue><![CDATA[true]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="_6ED9B3DA-9FD9-49F3-A70E-A6AB6712A628" sourceRef="_B7417363-C542-4A4A-A314-2AF370DE2515" targetRef="_0E0784C3-1BEC-4A51-A5E6-D7E5DA3A4402">
<bpmn2:extensionElements>
<drools:metaData name="isAutoConnection.source">
<drools:metaValue><![CDATA[true]]></drools:metaValue>
</drools:metaData>
<drools:metaData name="isAutoConnection.target">
<drools:metaValue><![CDATA[true]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
</bpmn2:sequenceFlow>
<bpmn2:scriptTask id="_0C615323-1520-40BF-8A41-46C2BBC6819C" name="Skip Traveler" scriptFormat="http://www.java.com/java">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[Skip Traveler]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:incoming>_EDFD7D46-79EC-4C49-B6D8-5873E9301AC7</bpmn2:incoming>
<bpmn2:outgoing>_5CC19845-48FB-4E72-BD04-E392C0241209</bpmn2:outgoing>
<bpmn2:script>System.out.println("Skipping traveller " + traveller);</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:scriptTask id="_B7417363-C542-4A4A-A314-2AF370DE2515" name="Log Traveler" scriptFormat="http://www.java.com/java">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[Log Traveler]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:incoming>_C5756B00-2541-4948-A7F5-4494A10E3A31</bpmn2:incoming>
<bpmn2:outgoing>_6ED9B3DA-9FD9-49F3-A70E-A6AB6712A628</bpmn2:outgoing>
<bpmn2:script>System.out.println("Processing traveller " + traveller);</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:startEvent id="_8BEA9396-93DE-4D44-8CE2-4A146464264E" name="travelers">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[travelers]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:outgoing>_D15CD483-D31D-42F8-A93A-AAAF44292D84</bpmn2:outgoing>
<bpmn2:dataOutput id="_8BEA9396-93DE-4D44-8CE2-4A146464264E_eventOutputX" drools:dtype="org.acme.travel.Traveller" itemSubjectRef="__8BEA9396-93DE-4D44-8CE2-4A146464264E_eventOutputXItem" name="event"/>
<bpmn2:dataOutputAssociation>
<bpmn2:sourceRef>_8BEA9396-93DE-4D44-8CE2-4A146464264E_eventOutputX</bpmn2:sourceRef>
<bpmn2:targetRef>traveller</bpmn2:targetRef>
</bpmn2:dataOutputAssociation>
<bpmn2:outputSet>
<bpmn2:dataOutputRefs>_8BEA9396-93DE-4D44-8CE2-4A146464264E_eventOutputX</bpmn2:dataOutputRefs>
</bpmn2:outputSet>
<bpmn2:messageEventDefinition drools:msgref="travellers" messageRef="_G8NJYTdNEDmAdvHSljkKzw"/>
</bpmn2:startEvent>
<bpmn2:businessRuleTask id="_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8" drools:ruleFlowGroup="travellers" name="Process Traveler" implementation="http://www.jboss.org/drools/rule">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[Process Traveler]]></drools:metaValue>
</drools:metaData>
<drools:metaData name="customAsync">
<drools:metaValue><![CDATA[true]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:incoming>_D15CD483-D31D-42F8-A93A-AAAF44292D84</bpmn2:incoming>
<bpmn2:outgoing>_96F8E118-C58C-4369-89DC-2C881614FF73</bpmn2:outgoing>
<bpmn2:ioSpecification>
<bpmn2:dataInput id="_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerInputX" drools:dtype="org.acme.travel.Traveller" itemSubjectRef="__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerInputXItem" name="traveller"/>
<bpmn2:dataOutput id="_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerOutputX" drools:dtype="org.acme.travel.Traveller" itemSubjectRef="__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerOutputXItem" name="traveller"/>
<bpmn2:inputSet>
<bpmn2:dataInputRefs>_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerInputX</bpmn2:dataInputRefs>
</bpmn2:inputSet>
<bpmn2:outputSet>
<bpmn2:dataOutputRefs>_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerOutputX</bpmn2:dataOutputRefs>
</bpmn2:outputSet>
</bpmn2:ioSpecification>
<bpmn2:dataInputAssociation>
<bpmn2:sourceRef>traveller</bpmn2:sourceRef>
<bpmn2:targetRef>_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerInputX</bpmn2:targetRef>
</bpmn2:dataInputAssociation>
<bpmn2:dataOutputAssociation>
<bpmn2:sourceRef>_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_travellerOutputX</bpmn2:sourceRef>
<bpmn2:targetRef>traveller</bpmn2:targetRef>
</bpmn2:dataOutputAssociation>
</bpmn2:businessRuleTask>
<bpmn2:exclusiveGateway id="_58FF9DA5-06C6-4D71-91CD-6EAE4E999CF9" name="Processed Traveler?" gatewayDirection="Diverging">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[Processed Traveler?]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:incoming>_96F8E118-C58C-4369-89DC-2C881614FF73</bpmn2:incoming>
<bpmn2:outgoing>_EDFD7D46-79EC-4C49-B6D8-5873E9301AC7</bpmn2:outgoing>
<bpmn2:outgoing>_C5756B00-2541-4948-A7F5-4494A10E3A31</bpmn2:outgoing>
</bpmn2:exclusiveGateway>
<bpmn2:endEvent id="_F368D316-78E0-4D1C-A59A-79BC75A0A62B" name="skipTraveler">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[skipTraveler]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:incoming>_5CC19845-48FB-4E72-BD04-E392C0241209</bpmn2:incoming>
<bpmn2:terminateEventDefinition/>
</bpmn2:endEvent>
<bpmn2:endEvent id="_0E0784C3-1BEC-4A51-A5E6-D7E5DA3A4402" name="processedtraveler">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[processedtraveler]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:incoming>_6ED9B3DA-9FD9-49F3-A70E-A6AB6712A628</bpmn2:incoming>
<bpmn2:dataInput id="_0E0784C3-1BEC-4A51-A5E6-D7E5DA3A4402_eventInputX" drools:dtype="org.acme.travel.Traveller" itemSubjectRef="__0E0784C3-1BEC-4A51-A5E6-D7E5DA3A4402_eventInputXItem" name="event"/>
<bpmn2:dataInputAssociation>
<bpmn2:sourceRef>traveller</bpmn2:sourceRef>
<bpmn2:targetRef>_0E0784C3-1BEC-4A51-A5E6-D7E5DA3A4402_eventInputX</bpmn2:targetRef>
</bpmn2:dataInputAssociation>
<bpmn2:inputSet>
<bpmn2:dataInputRefs>_0E0784C3-1BEC-4A51-A5E6-D7E5DA3A4402_eventInputX</bpmn2:dataInputRefs>
</bpmn2:inputSet>
<bpmn2:messageEventDefinition drools:msgref="processedtravellers" messageRef="_G8NJYDdNEDmAdvHSljkKzw"/>
</bpmn2:endEvent>
</bpmn2:process>
<bpmndi:BPMNDiagram>
<bpmndi:BPMNPlane bpmnElement="Travelers">
<bpmndi:BPMNShape id="shape__0E0784C3-1BEC-4A51-A5E6-D7E5DA3A4402" bpmnElement="_0E0784C3-1BEC-4A51-A5E6-D7E5DA3A4402">
<dc:Bounds height="56" width="56" x="822" y="66"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="shape__F368D316-78E0-4D1C-A59A-79BC75A0A62B" bpmnElement="_F368D316-78E0-4D1C-A59A-79BC75A0A62B">
<dc:Bounds height="56" width="56" x="822" y="257"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="shape__58FF9DA5-06C6-4D71-91CD-6EAE4E999CF9" bpmnElement="_58FF9DA5-06C6-4D71-91CD-6EAE4E999CF9">
<dc:Bounds height="56" width="56" x="452" y="66"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="shape__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8" bpmnElement="_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8">
<dc:Bounds height="102" width="154" x="218" y="43"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="shape__8BEA9396-93DE-4D44-8CE2-4A146464264E" bpmnElement="_8BEA9396-93DE-4D44-8CE2-4A146464264E">
<dc:Bounds height="56" width="56" x="90" y="66"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="shape__B7417363-C542-4A4A-A314-2AF370DE2515" bpmnElement="_B7417363-C542-4A4A-A314-2AF370DE2515">
<dc:Bounds height="102" width="154" x="588" y="43"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="shape__0C615323-1520-40BF-8A41-46C2BBC6819C" bpmnElement="_0C615323-1520-40BF-8A41-46C2BBC6819C">
<dc:Bounds height="102" width="154" x="588" y="234"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="edge_shape__B7417363-C542-4A4A-A314-2AF370DE2515_to_shape__0E0784C3-1BEC-4A51-A5E6-D7E5DA3A4402" bpmnElement="_6ED9B3DA-9FD9-49F3-A70E-A6AB6712A628">
<di:waypoint x="742" y="94"/>
<di:waypoint x="822" y="94"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="edge_shape__0C615323-1520-40BF-8A41-46C2BBC6819C_to_shape__F368D316-78E0-4D1C-A59A-79BC75A0A62B" bpmnElement="_5CC19845-48FB-4E72-BD04-E392C0241209">
<di:waypoint x="742" y="285"/>
<di:waypoint x="822" y="285"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="edge_shape__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8_to_shape__58FF9DA5-06C6-4D71-91CD-6EAE4E999CF9" bpmnElement="_96F8E118-C58C-4369-89DC-2C881614FF73">
<di:waypoint x="372" y="94"/>
<di:waypoint x="452" y="94"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="edge_shape__58FF9DA5-06C6-4D71-91CD-6EAE4E999CF9_to_shape__0C615323-1520-40BF-8A41-46C2BBC6819C" bpmnElement="_EDFD7D46-79EC-4C49-B6D8-5873E9301AC7">
<di:waypoint x="480" y="122"/>
<di:waypoint x="480" y="285"/>
<di:waypoint x="588" y="285"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="edge_shape__58FF9DA5-06C6-4D71-91CD-6EAE4E999CF9_to_shape__B7417363-C542-4A4A-A314-2AF370DE2515" bpmnElement="_C5756B00-2541-4948-A7F5-4494A10E3A31">
<di:waypoint x="508" y="94"/>
<di:waypoint x="588" y="94"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="edge_shape__8BEA9396-93DE-4D44-8CE2-4A146464264E_to_shape__60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8" bpmnElement="_D15CD483-D31D-42F8-A93A-AAAF44292D84">
<di:waypoint x="146" y="94"/>
<di:waypoint x="218" y="94"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
<bpmn2:relationship type="BPSimData">
<bpmn2:extensionElements>
<bpsim:BPSimData>
<bpsim:Scenario id="default" name="Simulationscenario">
<bpsim:ScenarioParameters/>
<bpsim:ElementParameters elementRef="_60FA6326-76DC-4DB2-AB06-DB8AC8EE8DC8">
<bpsim:TimeParameters>
<bpsim:ProcessingTime>
<bpsim:NormalDistribution mean="0" standardDeviation="0"/>
</bpsim:ProcessingTime>
</bpsim:TimeParameters>
<bpsim:ResourceParameters>
<bpsim:Availability>
<bpsim:FloatingParameter value="0"/>
</bpsim:Availability>
<bpsim:Quantity>
<bpsim:FloatingParameter value="0"/>
</bpsim:Quantity>
</bpsim:ResourceParameters>
<bpsim:CostParameters>
<bpsim:UnitCost>
<bpsim:FloatingParameter value="0"/>
</bpsim:UnitCost>
</bpsim:CostParameters>
</bpsim:ElementParameters>
<bpsim:ElementParameters elementRef="_B7417363-C542-4A4A-A314-2AF370DE2515">
<bpsim:TimeParameters>
<bpsim:ProcessingTime>
<bpsim:NormalDistribution mean="0" standardDeviation="0"/>
</bpsim:ProcessingTime>
</bpsim:TimeParameters>
<bpsim:ResourceParameters>
<bpsim:Availability>
<bpsim:FloatingParameter value="0"/>
</bpsim:Availability>
<bpsim:Quantity>
<bpsim:FloatingParameter value="0"/>
</bpsim:Quantity>
</bpsim:ResourceParameters>
<bpsim:CostParameters>
<bpsim:UnitCost>
<bpsim:FloatingParameter value="0"/>
</bpsim:UnitCost>
</bpsim:CostParameters>
</bpsim:ElementParameters>
<bpsim:ElementParameters elementRef="_0C615323-1520-40BF-8A41-46C2BBC6819C">
<bpsim:TimeParameters>
<bpsim:ProcessingTime>
<bpsim:NormalDistribution mean="0" standardDeviation="0"/>
</bpsim:ProcessingTime>
</bpsim:TimeParameters>
<bpsim:ResourceParameters>
<bpsim:Availability>
<bpsim:FloatingParameter value="0"/>
</bpsim:Availability>
<bpsim:Quantity>
<bpsim:FloatingParameter value="0"/>
</bpsim:Quantity>
</bpsim:ResourceParameters>
<bpsim:CostParameters>
<bpsim:UnitCost>
<bpsim:FloatingParameter value="0"/>
</bpsim:UnitCost>
</bpsim:CostParameters>
</bpsim:ElementParameters>
</bpsim:Scenario>
</bpsim:BPSimData>
</bpmn2:extensionElements>
<bpmn2:source>_G8L7QDdNEDmAdvHSljkKzw</bpmn2:source>
<bpmn2:target>_G8L7QDdNEDmAdvHSljkKzw</bpmn2:target>
</bpmn2:relationship>
</bpmn2:definitions>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment