[jbpm-commits] JBoss JBPM SVN: r5352 - in jbpm4/trunk/modules/bpmn/src: main/java/org/jbpm/bpmn/parser and 4 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jul 27 17:31:26 EDT 2009


Author: kukeltje
Date: 2009-07-27 17:31:26 -0400 (Mon, 27 Jul 2009)
New Revision: 5352

Added:
   jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/
   jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayTest.java
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGateway.bpmn.xml
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayConvergingInvalid.bpmn.xml
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayDivergingInvalid.bpmn.xml
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayMixedInvalid.bpmn.xml
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayMixedValid.bpmn.xml
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayNonBoundDefault.bpmn.xml
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayNonExistingDefault.bpmn.xml
Modified:
   jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/DecisionBinding.java
   jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java
Log:
Initial testcases for exclusiveGateway and small some fixes found by the tests ;-)

Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/DecisionBinding.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/DecisionBinding.java	2009-07-27 19:39:15 UTC (rev 5351)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/DecisionBinding.java	2009-07-27 21:31:26 UTC (rev 5352)
@@ -24,6 +24,8 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.jbpm.bpmn.parser.BpmnParser;
+import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.TransitionImpl;
 import org.jbpm.pvm.internal.util.XmlUtil;
@@ -41,6 +43,8 @@
  */
 public class DecisionBinding extends BpmnBinding {
 
+  private static final Log log = Log.getLog(DecisionBinding.class.getName());
+  
   static ObjectBinding objectBinding = new ObjectBinding();
   static WireParser wireParser = WireParser.getInstance();
 
@@ -67,6 +71,7 @@
 
     List<Element> transitionElements = XmlUtil.elements((Element) element.getParentNode(), "sequenceFlow");
     String elementId = element.getAttribute("id");
+    String elementName = element.getAttribute("name");
     // System.out.println("Element name: " + elementId);
 
     int incomming = 0;
@@ -83,7 +88,7 @@
         if (transitionElement.getAttribute("id").equals(default_)) {
           defaultExists = true;
           if (ces.size() != 0) {
-            System.out.println("Default sequenceFlow has conditionExpressio(s). Ignoring them by removing them from the Document model");
+            log.debug("Default sequenceFlow for " + elementName + " has conditionExpressio(s). Ignoring them by removing them from the Document model");
             for (Iterator iterator2 = ces.iterator(); iterator2.hasNext();) {
               Element ce = (Element) iterator2.next();
               transitionElement.removeChild(ce);
@@ -91,7 +96,7 @@
           }
         } else {
           if (default_ != null && ces.size() == 0) {
-            parse.addProblem("exclusiveGateway '" + element.getAttribute("name") + "' has default sequenceFlow '" + default_ + "' but "
+            parse.addProblem("exclusiveGateway '" + elementName + "' has default sequenceFlow '" + default_ + "' but "
                     + transitionElement.getAttribute("id") + " does not have a required conditionExpression", element);
             valid = false; // do not break. Parsing may find other issues;
           }
@@ -100,9 +105,11 @@
         incomming++;
       }
     }
+    
+    log.debug(gatewayDirection +": incomming: " + incomming + ", outgoing: " + outgoing);
 
-    if (("converging".equals(gatewayDirection) && !(incomming > 1) && outgoing != 1)
-            || ("diverging".equals(gatewayDirection) && incomming != 1 && !(outgoing > 1))
+    if (("converging".equals(gatewayDirection) && (!(incomming > 1) || outgoing != 1))
+            || ("diverging".equals(gatewayDirection) && (incomming != 1 || !(outgoing > 1)))
             || ("mixed".equals(gatewayDirection) && (incomming <= 1 || outgoing <= 1))) {
       parse.addProblem("exclusiveGateway '" + element.getAttribute("name") + "' has the wrong number of incomming (" + incomming + ") and outgoing ("
               + outgoing + ") transitions for gatewayDirection='" + gatewayDirection + "'", element);

Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java	2009-07-27 19:39:15 UTC (rev 5351)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java	2009-07-27 21:31:26 UTC (rev 5352)
@@ -211,8 +211,8 @@
       String sourceRef = XmlUtil.attribute(transitionElement, "sourceRef", true, parse);
       String targetRef = XmlUtil.attribute(transitionElement, "targetRef", true, parse);
 
-      System.out.println(transitionId + ": " + sourceRef + " -> " + targetRef);      
-      System.out.println("    with " + XmlUtil.elements(transitionElement, "conditionExpression").size() + " conditionExpressions");
+      log.trace(transitionId + ": " + sourceRef + " -> " + targetRef);      
+      log.trace("    with " + XmlUtil.elements(transitionElement, "conditionExpression").size() + " conditionExpressions");
       
       TransitionImpl transition = compositeElement.findActivity(sourceRef).createOutgoingTransition();
       compositeElement.findActivity(targetRef).addIncomingTransition(transition);
@@ -287,9 +287,11 @@
     }
 
     Element potentialOwner = XmlUtil.element(element, "potentialOwner");
-    String potentialOwnerRef = XmlUtil.attribute(potentialOwner, "resourceRef");
-    // set to fixed expression, more evaluation needed for real BPMN 2.0
-    taskDefinition.setCandidateGroupsExpression(processDefinition.getResource(potentialOwnerRef));
+    if (potentialOwner != null) {
+      String potentialOwnerRef = XmlUtil.attribute(potentialOwner, "resourceRef");
+      // set to fixed expression, more evaluation needed for real BPMN 2.0
+      taskDefinition.setCandidateGroupsExpression(processDefinition.getResource(potentialOwnerRef));
+    }
     return taskDefinition;
   }
 

Copied: jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayTest.java (from rev 5345, jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/test/ShipmentTest.java)
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayTest.java	2009-07-27 21:31:26 UTC (rev 5352)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.bpmn.flownodes;
+
+import java.util.List;
+
+import org.jbpm.bpmn.parser.BpmnParser;
+import org.jbpm.pvm.internal.xml.Problem;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExclusiveGatewayTest extends JbpmTestCase {
+
+  static BpmnParser bpmnParser = new BpmnParser();
+
+  public List<Problem> parse(String resource) {
+
+    List<Problem> problems = bpmnParser.createParse().setResource(resource).execute().getProblems();
+
+    return problems;
+  }
+
+  public void testNormal() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/flownodes/exclusiveGateway.bpmn.xml");
+
+    if (!problems.isEmpty()) {
+      fail("No problems should have occured. Problems: " + problems);
+    }
+  }
+
+  public void testNonBoundDefault() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/flownodes/exclusiveGatewayNonBoundDefault.bpmn.xml");
+
+    if ((problems == null) || (problems.isEmpty())) {
+      fail("expected problems during parse");
+    } else {
+      assertTextPresent("exclusiveGateway 'Just a gateway' default sequenceFlow 'flow5' does not exist or is not related to this node", problems.get(0).getMsg());
+    }
+  }
+  
+  public void testNonExistingDefault() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/flownodes/exclusiveGatewayNonExistingDefault.bpmn.xml");
+
+    if ((problems == null) || (problems.isEmpty())) {
+      fail("expected problems during parse");
+    } else {
+      assertTextPresent("cvc-id.1: There is no ID/IDREF binding for IDREF 'flow666'", problems.get(0).getMsg());
+    }
+  }
+  
+  public void testMixedValid() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/flownodes/exclusiveGatewayMixedValid.bpmn.xml");
+
+    if (!problems.isEmpty()) {
+      fail("No problems should have occured. Problems: " + problems);
+    }
+  }
+
+  
+  public void testMixedInvalid() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/flownodes/exclusiveGatewayMixedInvalid.bpmn.xml");
+
+    if ((problems == null) || (problems.isEmpty())) {
+      fail("expected problems during parse");
+    } else {
+      assertTextPresent("exclusiveGateway 'Just a gateway' has the wrong number of incomming (1) and outgoing (2) transitions for gatewayDirection='mixed'", problems.get(0).getMsg());
+    }
+  }
+  
+  
+  
+  public void testConvergingInvalid() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/flownodes/exclusiveGatewayConvergingInvalid.bpmn.xml");
+
+    if ((problems == null) || (problems.isEmpty())) {
+      fail("expected problems during parse");
+    } else {
+      assertTextPresent("exclusiveGateway 'Just a gateway' has the wrong number of incomming (1) and outgoing (2) transitions for gatewayDirection='converging'", problems.get(0).getMsg());
+    }
+  }
+
+  public void testDivergingInvalid() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/flownodes/exclusiveGatewayDivergingInvalid.bpmn.xml");
+
+    if ((problems == null) || (problems.isEmpty())) {
+      fail("expected problems during parse");
+    } else {
+      assertTextPresent("exclusiveGateway 'Just a gateway' has the wrong number of incomming (2) and outgoing (2) transitions for gatewayDirection='diverging'", problems.get(0).getMsg());
+    }
+  }
+
+}

Added: jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGateway.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGateway.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGateway.bpmn.xml	2009-07-27 21:31:26 UTC (rev 5352)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ExclusiveGatewayNormal"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 /home/kukel/workspace-jbpm4/jbpm/modules/bpmn/src/main/resources/BPMN20.xsd"
+	xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" typeLanguage="http://www.w3.org/2001/XMLSchema"
+	expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
+
+	<bpmn:process id="Shipment" name="Shipment">
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start"
+			targetRef="exclusiveGateway" name="Start->exclusiveGateway" />
+
+		<bpmn:exclusiveGateway id="exclusiveGateway"
+			name="Just a gateway" />
+
+		<!-- Sequence Flow -->
+
+		<bpmn:sequenceFlow id="flow2" sourceRef="exclusiveGateway"
+			targetRef="doSomething">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">
+				getDataObject('lieferungVariable')/confirmationRequired=true
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow3" sourceRef="exclusiveGateway"
+			targetRef="doSomethingElse">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">not(
+				getDataObject('lieferungVariable')/confirmationRequired=true )
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+
+		<bpmn:userTask id="doSomething" name="Anything at all"
+			implementation="other"></bpmn:userTask>
+		<bpmn:sequenceFlow id="flow4" sourceRef="doSomething"
+			targetRef="End" />
+
+		<bpmn:userTask id="doSomethingElse" name="But completely different"
+			implementation="other" />
+		<bpmn:sequenceFlow id="flow5" sourceRef="doSomethingElse"
+			targetRef="End" />
+
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Added: jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayConvergingInvalid.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayConvergingInvalid.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayConvergingInvalid.bpmn.xml	2009-07-27 21:31:26 UTC (rev 5352)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ExclusiveGatewayNormal"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 /home/kukel/workspace-jbpm4/jbpm/modules/bpmn/src/main/resources/BPMN20.xsd"
+	xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" typeLanguage="http://www.w3.org/2001/XMLSchema"
+	expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
+
+	<bpmn:process id="Shipment" name="Shipment">
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start"
+			targetRef="exclusiveGateway" name="Start->exclusiveGateway" />
+
+		<bpmn:exclusiveGateway id="exclusiveGateway" default="flow5"
+			name="Just a gateway" gatewayDirection="converging"/>
+
+		<!-- Sequence Flow -->
+
+		<bpmn:sequenceFlow id="flow2" sourceRef="exclusiveGateway"
+			targetRef="doSomething">
+			<bpmn:conditionExpression xsi:type="bpmn:tExpression">
+				Has to be valid
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow3" sourceRef="exclusiveGateway"
+			targetRef="doSomethingElse">
+			<bpmn:conditionExpression xsi:type="bpmn:tExpression">
+				Otherwise this one
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+
+		<bpmn:userTask id="doSomething" name="Anything at all"
+			implementation="other"></bpmn:userTask>
+		<bpmn:sequenceFlow id="flow4" sourceRef="doSomething"
+			targetRef="End" />
+
+		<bpmn:userTask id="doSomethingElse" name="But completely different"
+			implementation="other" />
+		<bpmn:sequenceFlow id="flow5" sourceRef="doSomethingElse"
+			targetRef="End" />
+
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Added: jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayDivergingInvalid.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayDivergingInvalid.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayDivergingInvalid.bpmn.xml	2009-07-27 21:31:26 UTC (rev 5352)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ExclusiveGatewayNormal"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 /home/kukel/workspace-jbpm4/jbpm/modules/bpmn/src/main/resources/BPMN20.xsd"
+	xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" typeLanguage="http://www.w3.org/2001/XMLSchema"
+	expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
+
+	<bpmn:process id="Shipment" name="Shipment">
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start"
+			targetRef="exclusiveGatewayPre" name="Start->exclusiveGateway" />
+
+		<bpmn:exclusiveGateway id="exclusiveGatewayPre"
+			name="Just a dummy gateway"/>
+
+		<bpmn:sequenceFlow id="flow6" sourceRef="exclusiveGatewayPre"
+			targetRef="exclusiveGateway" name="exclusiveGateway->exclusiveGatewayPre" />
+
+		<bpmn:sequenceFlow id="flow7" sourceRef="exclusiveGatewayPre"
+			targetRef="exclusiveGateway" name="exclusiveGateway->exclusiveGatewayPre" />
+
+		<bpmn:exclusiveGateway id="exclusiveGateway"
+			name="Just a gateway" gatewayDirection="diverging"/>
+
+		<bpmn:sequenceFlow id="flow2" sourceRef="exclusiveGateway"
+			targetRef="doSomething">
+			<bpmn:conditionExpression xsi:type="bpmn:tExpression">
+				Has to be valid
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow3" sourceRef="exclusiveGateway"
+			targetRef="doSomethingElse">
+			<bpmn:conditionExpression xsi:type="bpmn:tExpression">
+				Otherwise this one
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+
+		<bpmn:userTask id="doSomething" name="Anything at all"
+			implementation="other"></bpmn:userTask>
+		<bpmn:sequenceFlow id="flow4" sourceRef="doSomething"
+			targetRef="End" />
+
+		<bpmn:userTask id="doSomethingElse" name="But completely different"
+			implementation="other" />
+		<bpmn:sequenceFlow id="flow5" sourceRef="doSomethingElse"
+			targetRef="End" />
+
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Added: jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayMixedInvalid.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayMixedInvalid.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayMixedInvalid.bpmn.xml	2009-07-27 21:31:26 UTC (rev 5352)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ExclusiveGatewayNormal"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 /home/kukel/workspace-jbpm4/jbpm/modules/bpmn/src/main/resources/BPMN20.xsd"
+	xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" typeLanguage="http://www.w3.org/2001/XMLSchema"
+	expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
+
+	<bpmn:process id="Shipment" name="Shipment">
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start"
+			targetRef="exclusiveGateway" name="Start->exclusiveGateway" />
+
+		<bpmn:exclusiveGateway id="exclusiveGateway" default="flow5"
+			name="Just a gateway" gatewayDirection="mixed"/>
+
+		<!-- Sequence Flow -->
+
+		<bpmn:sequenceFlow id="flow2" sourceRef="exclusiveGateway"
+			targetRef="doSomething">
+			<bpmn:conditionExpression xsi:type="bpmn:tExpression">
+				Has to be valid
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow3" sourceRef="exclusiveGateway"
+			targetRef="doSomethingElse">
+			<bpmn:conditionExpression xsi:type="bpmn:tExpression">
+				Otherwise this one
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+
+		<bpmn:userTask id="doSomething" name="Anything at all"
+			implementation="other"></bpmn:userTask>
+		<bpmn:sequenceFlow id="flow4" sourceRef="doSomething"
+			targetRef="End" />
+
+		<bpmn:userTask id="doSomethingElse" name="But completely different"
+			implementation="other" />
+		<bpmn:sequenceFlow id="flow5" sourceRef="doSomethingElse"
+			targetRef="End" />
+
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Added: jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayMixedValid.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayMixedValid.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayMixedValid.bpmn.xml	2009-07-27 21:31:26 UTC (rev 5352)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ExclusiveGatewayNormal"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 /home/kukel/workspace-jbpm4/jbpm/modules/bpmn/src/main/resources/BPMN20.xsd"
+	xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" typeLanguage="http://www.w3.org/2001/XMLSchema"
+	expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
+
+	<bpmn:process id="Shipment" name="Shipment">
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start"
+			targetRef="exclusiveGatewayPre" name="Start->exclusiveGateway" />
+
+		<bpmn:exclusiveGateway id="exclusiveGatewayPre"
+			name="Just a dummy gateway"/>
+
+		<bpmn:sequenceFlow id="flow6" sourceRef="exclusiveGatewayPre"
+			targetRef="exclusiveGateway" name="exclusiveGateway->exclusiveGatewayPre" />
+
+		<bpmn:sequenceFlow id="flow7" sourceRef="exclusiveGatewayPre"
+			targetRef="exclusiveGateway" name="exclusiveGateway->exclusiveGatewayPre" />
+
+		<bpmn:exclusiveGateway id="exclusiveGateway"
+			name="Just a gateway" gatewayDirection="mixed"/>
+
+		<bpmn:sequenceFlow id="flow2" sourceRef="exclusiveGateway"
+			targetRef="doSomething">
+			<bpmn:conditionExpression xsi:type="bpmn:tExpression">
+				Has to be valid
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow3" sourceRef="exclusiveGateway"
+			targetRef="doSomethingElse">
+			<bpmn:conditionExpression xsi:type="bpmn:tExpression">
+				Otherwise this one
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+
+		<bpmn:userTask id="doSomething" name="Anything at all"
+			implementation="other"></bpmn:userTask>
+		<bpmn:sequenceFlow id="flow4" sourceRef="doSomething"
+			targetRef="End" />
+
+		<bpmn:userTask id="doSomethingElse" name="But completely different"
+			implementation="other" />
+		<bpmn:sequenceFlow id="flow5" sourceRef="doSomethingElse"
+			targetRef="End" />
+
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Added: jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayNonBoundDefault.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayNonBoundDefault.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayNonBoundDefault.bpmn.xml	2009-07-27 21:31:26 UTC (rev 5352)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ExclusiveGatewayNormal"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 /home/kukel/workspace-jbpm4/jbpm/modules/bpmn/src/main/resources/BPMN20.xsd"
+	xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" typeLanguage="http://www.w3.org/2001/XMLSchema"
+	expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
+
+	<bpmn:process id="Shipment" name="Shipment">
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start"
+			targetRef="exclusiveGateway" name="Start->exclusiveGateway" />
+
+		<bpmn:exclusiveGateway id="exclusiveGateway" default="flow5"
+			name="Just a gateway" />
+
+		<!-- Sequence Flow -->
+
+		<bpmn:sequenceFlow id="flow2" sourceRef="exclusiveGateway"
+			targetRef="doSomething">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">
+				getDataObject('lieferungVariable')/confirmationRequired=true
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow3" sourceRef="exclusiveGateway"
+			targetRef="doSomethingElse">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">not(
+				getDataObject('lieferungVariable')/confirmationRequired=true )
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+
+		<bpmn:userTask id="doSomething" name="Anything at all"
+			implementation="other"></bpmn:userTask>
+		<bpmn:sequenceFlow id="flow4" sourceRef="doSomething"
+			targetRef="End" />
+
+		<bpmn:userTask id="doSomethingElse" name="But completely different"
+			implementation="other" />
+		<bpmn:sequenceFlow id="flow5" sourceRef="doSomethingElse"
+			targetRef="End" />
+
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Added: jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayNonExistingDefault.bpmn.xml
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayNonExistingDefault.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayNonExistingDefault.bpmn.xml	2009-07-27 21:31:26 UTC (rev 5352)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ExclusiveGatewayNormal"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 /home/kukel/workspace-jbpm4/jbpm/modules/bpmn/src/main/resources/BPMN20.xsd"
+	xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" typeLanguage="http://www.w3.org/2001/XMLSchema"
+	expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
+
+	<bpmn:process id="Shipment" name="Shipment">
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start"
+			targetRef="exclusiveGateway" name="Start->exclusiveGateway" />
+
+		<bpmn:exclusiveGateway id="exclusiveGateway" default="flow666"
+			name="Just a gateway" />
+
+		<!-- Sequence Flow -->
+
+		<bpmn:sequenceFlow id="flow2" sourceRef="exclusiveGateway"
+			targetRef="doSomething">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">
+				getDataObject('lieferungVariable')/confirmationRequired=true
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow3" sourceRef="exclusiveGateway"
+			targetRef="doSomethingElse">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">not(
+				getDataObject('lieferungVariable')/confirmationRequired=true )
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+
+		<bpmn:userTask id="doSomething" name="Anything at all"
+			implementation="other"></bpmn:userTask>
+		<bpmn:sequenceFlow id="flow4" sourceRef="doSomething"
+			targetRef="End" />
+
+		<bpmn:userTask id="doSomethingElse" name="But completely different"
+			implementation="other" />
+		<bpmn:sequenceFlow id="flow5" sourceRef="doSomethingElse"
+			targetRef="End" />
+
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>



More information about the jbpm-commits mailing list