114 lines
4.9 KiB
XML
Executable File
114 lines
4.9 KiB
XML
Executable File
<?xml version="1.0" encoding="UTF-8"?>
|
|
<definitions id="Definition"
|
|
targetNamespace="http://www.jboss.org/drools"
|
|
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">
|
|
|
|
<itemDefinition id="_countItem" structureRef="java.lang.Integer" />
|
|
<itemDefinition id="_iItem" structureRef="java.lang.Integer" />
|
|
|
|
<process processType="Private" isExecutable="true" id="looping" name="looping" tns:packageName="flows" >
|
|
|
|
<!-- 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" scriptFormat="http://www.java.com/java" >
|
|
<script>System.out.println("i = " + i);
|
|
kcontext.setVariable("i", Integer.parseInt(""+i)+1);</script>
|
|
</scriptTask>
|
|
<exclusiveGateway id="_4" name="Gateway" gatewayDirection="Diverging" />
|
|
<scriptTask id="_5" name="Done" scriptFormat="http://www.java.com/java" >
|
|
<script>System.out.println("Loop completed");</script>
|
|
</scriptTask>
|
|
<endEvent id="_6" name="End" >
|
|
<terminateEventDefinition/>
|
|
</endEvent>
|
|
<scriptTask id="_7" name="Init" scriptFormat="http://www.java.com/java" >
|
|
<script>kcontext.setVariable("i", 0);
|
|
kcontext.setVariable("count", 10);</script>
|
|
</scriptTask>
|
|
|
|
<!-- connections -->
|
|
<sequenceFlow id="_4-_2" sourceRef="_4" targetRef="_2" name="i < count" tns:priority="1" >
|
|
<conditionExpression xsi:type="tFormalExpression" language="http://www.java.com/java" >return Long.valueOf(""+i) < Long.valueOf(""+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>
|
|
|
|
<bpmndi:BPMNDiagram>
|
|
<bpmndi:BPMNPlane bpmnElement="looping" >
|
|
<bpmndi:BPMNShape bpmnElement="_1" >
|
|
<dc:Bounds x="16" y="20" width="48" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_2" >
|
|
<dc:Bounds x="231" y="19" width="48" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_3" >
|
|
<dc:Bounds x="314" y="20" width="80" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_4" >
|
|
<dc:Bounds x="473" y="19" width="48" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_5" >
|
|
<dc:Bounds x="544" y="19" width="80" height="49" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_6" >
|
|
<dc:Bounds x="690" y="20" width="48" height="48" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNShape bpmnElement="_7" >
|
|
<dc:Bounds x="96" y="19" width="80" height="49" />
|
|
</bpmndi:BPMNShape>
|
|
<bpmndi:BPMNEdge bpmnElement="_4-_2" >
|
|
<di:waypoint x="497" y="43" />
|
|
<di:waypoint x="483" y="95" />
|
|
<di:waypoint x="240" y="96" />
|
|
<di:waypoint x="255" y="43" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_7-_2" >
|
|
<di:waypoint x="136" y="43" />
|
|
<di:waypoint x="255" y="43" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_2-_3" >
|
|
<di:waypoint x="255" y="43" />
|
|
<di:waypoint x="354" y="44" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_3-_4" >
|
|
<di:waypoint x="354" y="44" />
|
|
<di:waypoint x="497" y="43" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_4-_5" >
|
|
<di:waypoint x="497" y="43" />
|
|
<di:waypoint x="584" y="43" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_5-_6" >
|
|
<di:waypoint x="584" y="43" />
|
|
<di:waypoint x="714" y="44" />
|
|
</bpmndi:BPMNEdge>
|
|
<bpmndi:BPMNEdge bpmnElement="_1-_7" >
|
|
<di:waypoint x="40" y="44" />
|
|
<di:waypoint x="136" y="43" />
|
|
</bpmndi:BPMNEdge>
|
|
</bpmndi:BPMNPlane>
|
|
</bpmndi:BPMNDiagram>
|
|
|
|
</definitions> |