Skip to content

Commit

Permalink
corrected test szenarios
Browse files Browse the repository at this point in the history
issue #302
  • Loading branch information
rsoika committed Sep 21, 2017
1 parent 12bdc28 commit f157c4f
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -700,18 +700,19 @@ private void addImixsEvent(String eventID, ItemCollection sourceTask) throws Mod
// build the condition
if (targetTask != null) {
String sExpression = findConditionBySquenceFlow(condFlow);
if (sExpression!=null && !sExpression.trim().isEmpty()) {
if (sExpression != null && !sExpression.trim().isEmpty()) {
logger.fine("add condition: " + targetTask.getItemValueInteger("numProcessid") + "="
+ sExpression);
conditions.put("task=" + targetTask.getItemValueInteger("numProcessid"), sExpression);
conditions.put("task=" + targetTask.getItemValueInteger("numProcessid"),
sExpression);
}
} else {
// test for an event....
String targetEventID = new ElementResolver().findImixsTargetEventID(condFlow);
ItemCollection targetEvent = eventCache.get(targetEventID);
if (targetEvent != null) {
String sExpression = findConditionBySquenceFlow(condFlow);
if (sExpression!=null && !sExpression.trim().isEmpty()) {
if (sExpression != null && !sExpression.trim().isEmpty()) {
logger.fine("add condition: " + targetEvent.getItemValueInteger("numActivityid")
+ "=" + sExpression);
conditions.put("event=" + targetEvent.getItemValueInteger("numActivityid"),
Expand Down Expand Up @@ -739,7 +740,6 @@ private void addImixsEvent(String eventID, ItemCollection sourceTask) throws Mod
for (SequenceFlow flow : outgoingList) {
if (parallelGatewayCache.contains(flow.target)) {

boolean foundConditionForMasterVersion=false;
String parallelGatewayID = flow.target;
// get all outgoing flows from this gateway
List<SequenceFlow> parallelFlows = this.findOutgoingFlows(parallelGatewayID);
Expand All @@ -748,39 +748,27 @@ private void addImixsEvent(String eventID, ItemCollection sourceTask) throws Mod
// build the condition
if (targetTask != null) {
String sExpression = findConditionBySquenceFlow(parallelFlow);
if (sExpression!=null && !sExpression.trim().isEmpty()) {
if (sExpression != null && !sExpression.trim().isEmpty()) {
logger.fine("add condition: " + targetTask.getItemValueInteger("numProcessid") + "="
+ sExpression);
conditions.put("task=" + targetTask.getItemValueInteger("numProcessid"), sExpression);

if (foundConditionForMasterVersion) {
logger.warning("ParallelGateway does not uniquely define an outcome for the Master Version! Multiple condition defined!");
}
foundConditionForMasterVersion=true;
conditions.put("task=" + targetTask.getItemValueInteger("numProcessid"),
sExpression);
}
} else {
// test for an event....
String targetEventID = new ElementResolver().findImixsTargetEventID(parallelFlow);
ItemCollection targetEvent = eventCache.get(targetEventID);
if (targetEvent != null) {
String sExpression = findConditionBySquenceFlow(parallelFlow);
if (sExpression!=null && !sExpression.trim().isEmpty()) {
if (sExpression != null && !sExpression.trim().isEmpty()) {
logger.fine("add condition: " + targetEvent.getItemValueInteger("numActivityid")
+ "=" + sExpression);
conditions.put("event=" + targetEvent.getItemValueInteger("numActivityid"),
sExpression);
if (foundConditionForMasterVersion) {
logger.warning("ParallelGateway does not uniquely define an outcome for the Master Version! Multiple condition defined!");
}
foundConditionForMasterVersion=true;
}
}

}
}
if (!foundConditionForMasterVersion) {
logger.warning("ParallelGateway dose not uniquely define an outcome for the Master Version! Master condition is missing");
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void testSimple()
// test events for task 1000
List<ItemCollection> events = model.findAllEventsByTask(1000);
Assert.assertNotNull(events);
Assert.assertEquals(1, events.size());
Assert.assertEquals(2, events.size());

// test activity 1000.10 submit
ItemCollection activity = model.getEvent(1000, 10);
Expand All @@ -83,12 +83,11 @@ public void testSimple()
// Now we need to evaluate if the Event is marked as an conditional Event with
// the condition list copied from the gateway.
Assert.assertTrue(activity.hasItem("keySplitConditions"));
Map<String,String> conditions=(Map<String,String>) activity.getItemValue("keySplitConditions").get(0);
Map<String, String> conditions = (Map<String, String>) activity.getItemValue("keySplitConditions").get(0);
Assert.assertNotNull(conditions);
Assert.assertEquals("true", conditions.get("task=1100"));
}






}
33 changes: 25 additions & 8 deletions imixs-workflow-core/src/test/resources/bpmn/split_event1.bpmn
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<imixs:value><![CDATA[workitemarchive]]></imixs:value>
</imixs:item>
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
<bpmn2:incoming>SequenceFlow_7</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
</bpmn2:task>
<bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_3" imixs:activityid="10" name="split event">
Expand All @@ -52,15 +52,20 @@
<bpmn2:parallelGateway id="ParallelGateway_1" name="split" gatewayDirection="Diverging">
<bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
<bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
<bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
</bpmn2:parallelGateway>
<bpmn2:sequenceFlow id="SequenceFlow_2" sourceRef="IntermediateCatchEvent_3" targetRef="ParallelGateway_1"/>
<bpmn2:sequenceFlow id="SequenceFlow_3" name="Master (true)" sourceRef="ParallelGateway_1" targetRef="Task_4">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_6">true</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_6" name="Version (false)" sourceRef="ParallelGateway_1" targetRef="Task_5">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_1">false</bpmn2:conditionExpression>
<bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_1" imixs:activityid="20" name="update">
<bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing>
</bpmn2:intermediateCatchEvent>
<bpmn2:sequenceFlow id="SequenceFlow_5" name="Version (false)" sourceRef="ParallelGateway_1" targetRef="IntermediateCatchEvent_1">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_2">false</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_7" sourceRef="IntermediateCatchEvent_1" targetRef="Task_5"/>
</bpmn2:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1" name="Default Process Diagram">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="simple">
Expand Down Expand Up @@ -106,6 +111,12 @@
<dc:Bounds height="14.0" width="23.0" x="373.0" y="101.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_IntermediateCatchEvent_1" bpmnElement="IntermediateCatchEvent_1">
<dc:Bounds height="36.0" width="36.0" x="481.0" y="152.0"/>
<bpmndi:BPMNLabel id="BPMNLabel_10">
<dc:Bounds height="14.0" width="38.0" x="480.0" y="188.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_1" targetElement="BPMNShape_Task_3">
<di:waypoint xsi:type="dc:Point" x="106.0" y="76.0"/>
<di:waypoint xsi:type="dc:Point" x="128.0" y="76.0"/>
Expand Down Expand Up @@ -144,14 +155,20 @@
<dc:Bounds height="14.0" width="69.0" x="446.0" y="77.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_ParallelGateway_1" targetElement="BPMNShape_Task_5">
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="BPMNShape_ParallelGateway_1" targetElement="BPMNShape_IntermediateCatchEvent_1">
<di:waypoint xsi:type="dc:Point" x="385.0" y="101.0"/>
<di:waypoint xsi:type="dc:Point" x="385.0" y="170.0"/>
<di:waypoint xsi:type="dc:Point" x="550.0" y="170.0"/>
<bpmndi:BPMNLabel id="BPMNLabel_11">
<dc:Bounds height="14.0" width="79.0" x="394.0" y="171.0"/>
<di:waypoint xsi:type="dc:Point" x="481.0" y="170.0"/>
<bpmndi:BPMNLabel id="BPMNLabel_13">
<dc:Bounds height="14.0" width="79.0" x="360.0" y="171.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="SequenceFlow_7" sourceElement="BPMNShape_IntermediateCatchEvent_1" targetElement="BPMNShape_Task_5">
<di:waypoint xsi:type="dc:Point" x="517.0" y="170.0"/>
<di:waypoint xsi:type="dc:Point" x="533.0" y="170.0"/>
<di:waypoint xsi:type="dc:Point" x="550.0" y="170.0"/>
<bpmndi:BPMNLabel id="BPMNLabel_15"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
<bpmndi:BPMNLabelStyle id="BPMNLabelStyle_1">
<dc:Font name="arial" size="9.0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<imixs:value><![CDATA[workitemarchive]]></imixs:value>
</imixs:item>
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_7</bpmn2:incoming>
<bpmn2:incoming>SequenceFlow_6</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_12</bpmn2:outgoing>
</bpmn2:task>
<bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_3" imixs:activityid="10" name="split event">
Expand All @@ -52,20 +52,15 @@
<bpmn2:parallelGateway id="ParallelGateway_1" name="split" gatewayDirection="Diverging">
<bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
<bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
<bpmn2:outgoing>SequenceFlow_6</bpmn2:outgoing>
</bpmn2:parallelGateway>
<bpmn2:sequenceFlow id="SequenceFlow_2" sourceRef="IntermediateCatchEvent_3" targetRef="ParallelGateway_1"/>
<bpmn2:sequenceFlow id="SequenceFlow_3" name="Master (true)" sourceRef="ParallelGateway_1" targetRef="Task_4">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_6">true</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_1" imixs:activityid="20" name="update">
<bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_7</bpmn2:outgoing>
</bpmn2:intermediateCatchEvent>
<bpmn2:sequenceFlow id="SequenceFlow_5" name="Version (false)" sourceRef="ParallelGateway_1" targetRef="IntermediateCatchEvent_1">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_2">false</bpmn2:conditionExpression>
<bpmn2:sequenceFlow id="SequenceFlow_6" name="Version (false)" sourceRef="ParallelGateway_1" targetRef="Task_5">
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" id="FormalExpression_1">false</bpmn2:conditionExpression>
</bpmn2:sequenceFlow>
<bpmn2:sequenceFlow id="SequenceFlow_7" sourceRef="IntermediateCatchEvent_1" targetRef="Task_5"/>
</bpmn2:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1" name="Default Process Diagram">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="simple">
Expand Down Expand Up @@ -111,12 +106,6 @@
<dc:Bounds height="14.0" width="23.0" x="373.0" y="101.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="BPMNShape_IntermediateCatchEvent_1" bpmnElement="IntermediateCatchEvent_1">
<dc:Bounds height="36.0" width="36.0" x="481.0" y="152.0"/>
<bpmndi:BPMNLabel id="BPMNLabel_10">
<dc:Bounds height="14.0" width="38.0" x="480.0" y="188.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_1" bpmnElement="SequenceFlow_1" sourceElement="BPMNShape_1" targetElement="BPMNShape_Task_3">
<di:waypoint xsi:type="dc:Point" x="106.0" y="76.0"/>
<di:waypoint xsi:type="dc:Point" x="128.0" y="76.0"/>
Expand Down Expand Up @@ -155,19 +144,13 @@
<dc:Bounds height="14.0" width="69.0" x="446.0" y="77.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_5" bpmnElement="SequenceFlow_5" sourceElement="BPMNShape_ParallelGateway_1" targetElement="BPMNShape_IntermediateCatchEvent_1">
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_6" bpmnElement="SequenceFlow_6" sourceElement="BPMNShape_ParallelGateway_1" targetElement="BPMNShape_Task_5">
<di:waypoint xsi:type="dc:Point" x="385.0" y="101.0"/>
<di:waypoint xsi:type="dc:Point" x="385.0" y="170.0"/>
<di:waypoint xsi:type="dc:Point" x="481.0" y="170.0"/>
<bpmndi:BPMNLabel id="BPMNLabel_13">
<dc:Bounds height="14.0" width="79.0" x="360.0" y="171.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_7" bpmnElement="SequenceFlow_7" sourceElement="BPMNShape_IntermediateCatchEvent_1" targetElement="BPMNShape_Task_5">
<di:waypoint xsi:type="dc:Point" x="517.0" y="170.0"/>
<di:waypoint xsi:type="dc:Point" x="533.0" y="170.0"/>
<di:waypoint xsi:type="dc:Point" x="550.0" y="170.0"/>
<bpmndi:BPMNLabel id="BPMNLabel_15"/>
<bpmndi:BPMNLabel id="BPMNLabel_11">
<dc:Bounds height="14.0" width="79.0" x="394.0" y="171.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
<bpmndi:BPMNLabelStyle id="BPMNLabelStyle_1">
Expand Down

0 comments on commit f157c4f

Please sign in to comment.