Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Looping.bpmn #2051

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
299 changes: 203 additions & 96 deletions jbpm-examples/src/main/resources/looping/Looping.bpmn
Original file line number Diff line number Diff line change
@@ -1,113 +1,220 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
typeLanguage="http://www.java.com/javaTypes"
expressionLanguage="http://www.mvel.org/2.0"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
xmlns:g="http://www.jboss.org/drools/flow/gpd"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns="http://www.jboss.org/drools"
targetNamespace="">

<itemDefinition id="_countItem" structureRef="Integer" />
<itemDefinition id="_iItem" structureRef="Integer" />

<process processType="Private" isExecutable="true" id="com.sample.looping" name="Looping" tns:packageName="com.sample" >

<!-- process variables -->
<property id="count" itemSubjectRef="_countItem"/>
<property id="i" itemSubjectRef="_iItem"/>

<!-- nodes -->
<startEvent id="_1" name="Start" />
<exclusiveGateway id="_2" name="Gateway" gatewayDirection="Converging" />
<scriptTask id="_3" name="Loop" >
<script>System.out.println("i = " + i);
kcontext.setVariable("i", i+1);</script>
</scriptTask>
<exclusiveGateway id="_4" name="Gateway" gatewayDirection="Diverging" />
<scriptTask id="_5" name="Done" >
<script>System.out.println("Loop completed");</script>
</scriptTask>
<endEvent id="_6" name="End" >
<terminateEventDefinition/>
</endEvent>
<scriptTask id="_7" name="Init" >
<script>kcontext.setVariable("i", 0);</script>
</scriptTask>

<!-- connections -->
<sequenceFlow id="_4-_2" sourceRef="_4" targetRef="_2" name="i &lt; count" tns:priority="1" >
<conditionExpression xsi:type="tFormalExpression" language="http://www.java.com/java" >return i &lt; count;</conditionExpression>
</sequenceFlow>
<sequenceFlow id="_7-_2" sourceRef="_7" targetRef="_2" />
<sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />
<sequenceFlow id="_3-_4" sourceRef="_3" targetRef="_4" />
<sequenceFlow id="_4-_5" sourceRef="_4" targetRef="_5" name="else" tns:priority="2" >
<conditionExpression xsi:type="tFormalExpression" >return true;</conditionExpression>
</sequenceFlow>
<sequenceFlow id="_5-_6" sourceRef="_5" targetRef="_6" />
<sequenceFlow id="_1-_7" sourceRef="_1" targetRef="_7" />

</process>

<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="_ylVWoBOlEDqB7v6qZ-fBHQ" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd http://www.omg.org/spec/DD/20100524/DC DC.xsd http://www.omg.org/spec/DD/20100524/DI DI.xsd " exporter="jBPM Process Modeler" exporterVersion="2.0" targetNamespace="http://www.omg.org/bpmn20">
<bpmn2:itemDefinition id="_countItem" structureRef="Integer"/>
<bpmn2:itemDefinition id="_iItem" structureRef="Integer"/>
<bpmn2:process id="com.sample.looping" drools:packageName="com.sample" drools:version="1.0" drools:adHoc="false" name="Looping" isExecutable="true" processType="Private">
<bpmn2:property id="count" itemSubjectRef="_countItem" name="count"/>
<bpmn2:property id="i" itemSubjectRef="_iItem" name="i"/>
<bpmn2:sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3"/>
<bpmn2:sequenceFlow id="_4-_2" name="i &lt; count" sourceRef="_4" targetRef="_2">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[i < count]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="http://www.java.com/java"><![CDATA[return i < count;]]></bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="_3-_4" sourceRef="_3" targetRef="_4"/>
<bpmn2:sequenceFlow id="_4-_5" name="else" sourceRef="_4" targetRef="_5">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[else]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="http://www.java.com/java"><![CDATA[return true;]]></bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="_5-_6" sourceRef="_5" targetRef="_6"/>
<bpmn2:sequenceFlow id="_7-_2" sourceRef="_7" targetRef="_2"/>
<bpmn2:sequenceFlow id="_1-_7" sourceRef="_1" targetRef="_7"/>
<bpmn2:startEvent id="_1" name="Start">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[Start]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:outgoing>_1-_7</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:exclusiveGateway id="_2" gatewayDirection="Converging">
<bpmn2:incoming>_7-_2</bpmn2:incoming>
<bpmn2:incoming>_4-_2</bpmn2:incoming>
<bpmn2:outgoing>_2-_3</bpmn2:outgoing>
</bpmn2:exclusiveGateway>
<bpmn2:scriptTask id="_3" name="Loop" scriptFormat="http://www.java.com/java">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[Loop]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:incoming>_2-_3</bpmn2:incoming>
<bpmn2:outgoing>_3-_4</bpmn2:outgoing>
<bpmn2:script>System.out.println("i = " + i);
kcontext.setVariable("i", i+1);</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:exclusiveGateway id="_4" gatewayDirection="Diverging">
<bpmn2:incoming>_3-_4</bpmn2:incoming>
<bpmn2:outgoing>_4-_5</bpmn2:outgoing>
<bpmn2:outgoing>_4-_2</bpmn2:outgoing>
</bpmn2:exclusiveGateway>
<bpmn2:scriptTask id="_5" name="Done" scriptFormat="http://www.java.com/java">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[Done]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:incoming>_4-_5</bpmn2:incoming>
<bpmn2:outgoing>_5-_6</bpmn2:outgoing>
<bpmn2:script>System.out.println("Loop completed");</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:endEvent id="_6" name="End">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[End]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:incoming>_5-_6</bpmn2:incoming>
<bpmn2:terminateEventDefinition/>
</bpmn2:endEvent>
<bpmn2:scriptTask id="_7" name="Init" scriptFormat="http://www.java.com/java">
<bpmn2:extensionElements>
<drools:metaData name="elementname">
<drools:metaValue><![CDATA[Init]]></drools:metaValue>
</drools:metaData>
</bpmn2:extensionElements>
<bpmn2:incoming>_1-_7</bpmn2:incoming>
<bpmn2:outgoing>_7-_2</bpmn2:outgoing>
<bpmn2:script>kcontext.setVariable("i", 0);</bpmn2:script>
</bpmn2:scriptTask>
</bpmn2:process>
<bpmndi:BPMNDiagram>
<bpmndi:BPMNPlane bpmnElement="com.sample.looping" >
<bpmndi:BPMNShape bpmnElement="_1" >
<dc:Bounds x="12" y="84" width="48" height="48" />
<bpmndi:BPMNPlane bpmnElement="com.sample.looping">
<bpmndi:BPMNShape id="shape__7" bpmnElement="_7">
<dc:Bounds height="48" width="80" x="234" y="84"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_2" >
<dc:Bounds x="211" y="83" width="48" height="48" />
<bpmndi:BPMNShape id="shape__6" bpmnElement="_6">
<dc:Bounds height="56" width="56" x="1031" y="80"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" >
<dc:Bounds x="280" y="84" width="80" height="48" />
<bpmndi:BPMNShape id="shape__5" bpmnElement="_5">
<dc:Bounds height="48" width="80" x="835" y="84"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_4" >
<dc:Bounds x="417" y="84" width="48" height="48" />
<bpmndi:BPMNShape id="shape__4" bpmnElement="_4">
<dc:Bounds height="56" width="56" x="698" y="80"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_5" >
<dc:Bounds x="483" y="84" width="80" height="48" />
<bpmndi:BPMNShape id="shape__3" bpmnElement="_3">
<dc:Bounds height="48" width="80" x="528" y="84"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_6" >
<dc:Bounds x="612" y="84" width="48" height="48" />
<bpmndi:BPMNShape id="shape__2" bpmnElement="_2">
<dc:Bounds height="56" width="56" x="382" y="80"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_7" >
<dc:Bounds x="85" y="83" width="80" height="48" />
<bpmndi:BPMNShape id="shape__1" bpmnElement="_1">
<dc:Bounds height="56" width="56" x="89" y="80"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_4-_2" >
<di:waypoint x="441" y="108" />
<di:waypoint x="425" y="183" />
<di:waypoint x="219" y="183" />
<di:waypoint x="235" y="107" />
<bpmndi:BPMNEdge id="edge_shape__1_to_shape__7" bpmnElement="_1-_7">
<di:waypoint x="113" y="104"/>
<di:waypoint x="274" y="108"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_7-_2" >
<di:waypoint x="125" y="107" />
<di:waypoint x="235" y="107" />
<bpmndi:BPMNEdge id="edge_shape__7_to_shape__2" bpmnElement="_7-_2">
<di:waypoint x="274" y="108"/>
<di:waypoint x="406" y="104"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_2-_3" >
<di:waypoint x="235" y="107" />
<di:waypoint x="320" y="108" />
<bpmndi:BPMNEdge id="edge_shape__5_to_shape__6" bpmnElement="_5-_6">
<di:waypoint x="875" y="108"/>
<di:waypoint x="1055" y="104"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_3-_4" >
<di:waypoint x="320" y="108" />
<di:waypoint x="441" y="108" />
<bpmndi:BPMNEdge id="edge_shape__4_to_shape__5" bpmnElement="_4-_5">
<di:waypoint x="722" y="104"/>
<di:waypoint x="875" y="108"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_4-_5" >
<di:waypoint x="441" y="108" />
<di:waypoint x="523" y="108" />
<bpmndi:BPMNEdge id="edge_shape__3_to_shape__4" bpmnElement="_3-_4">
<di:waypoint x="568" y="108"/>
<di:waypoint x="722" y="104"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_5-_6" >
<di:waypoint x="523" y="108" />
<di:waypoint x="636" y="108" />
<bpmndi:BPMNEdge id="edge_shape__4_to_shape__2" bpmnElement="_4-_2">
<di:waypoint x="722" y="104"/>
<di:waypoint x="726" y="285"/>
<di:waypoint x="409" y="285"/>
<di:waypoint x="410" y="136"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_1-_7" >
<di:waypoint x="36" y="108" />
<di:waypoint x="125" y="107" />
<bpmndi:BPMNEdge id="edge_shape__2_to_shape__3" bpmnElement="_2-_3">
<di:waypoint x="406" y="104"/>
<di:waypoint x="568" y="108"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>

</definitions>
<bpmn2:relationship type="BPSimData">
<bpmn2:extensionElements>
<bpsim:BPSimData>
<bpsim:Scenario id="default" name="Simulationscenario">
<bpsim:ScenarioParameters/>
<bpsim:ElementParameters elementRef="_7">
<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="_5">
<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="_3">
<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="_1">
<bpsim:TimeParameters>
<bpsim:ProcessingTime>
<bpsim:NormalDistribution mean="0" standardDeviation="0"/>
</bpsim:ProcessingTime>
</bpsim:TimeParameters>
</bpsim:ElementParameters>
</bpsim:Scenario>
</bpsim:BPSimData>
</bpmn2:extensionElements>
<bpmn2:source>_ylVWoBOlEDqB7v6qZ-fBHQ</bpmn2:source>
<bpmn2:target>_ylVWoBOlEDqB7v6qZ-fBHQ</bpmn2:target>
</bpmn2:relationship>
</bpmn2:definitions>