[jbpm-commits] JBoss JBPM SVN: r5887 - in jbpm4/trunk: modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes and 11 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Nov 9 08:54:11 EST 2009


Author: tom.baeyens at jboss.com
Date: 2009-11-09 08:54:10 -0500 (Mon, 09 Nov 2009)
New Revision: 5887

Added:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/BshScriptEngine.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/BshScriptEngineFactory.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyCompiledScript.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyScriptEngine.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyScriptEngineFactory.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptContextEngineView.java
   jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.scriptmanager.xml
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ExclusiveGatewayTest.java
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ParallelGatewayTest.java
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ScriptTaskTest.java
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/UserTaskTest.java
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskGroup.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskSequenceFlowCondition.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskSimple.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGateway.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayConvergingInvalid.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayDivergingInvalid.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayInvalidConditionExpression.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayMixedInvalid.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayMixedValid.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayNonBoundDefault.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayNonExistingDefault.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayXPath.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/forkWithUncontrolledSequenceFlow.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/forkWithUncontrolledSequenceFlowCondition.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/parallelGateway.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/parallelGatewayInvalid.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/scriptTask.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.java.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.pdf
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.ws.bpmn.xml
   jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/xmlTestDocument.xml
Removed:
   jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/example/
   jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/
   jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExpressionCondition.java
Modified:
   jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java
   jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java
   jbpm4/trunk/modules/pvm/pom.xml
   jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml
   jbpm4/trunk/modules/test-db/pom.xml
   jbpm4/trunk/pom.xml
Log:
moved bpmn test suite to jbpm-test-db module

Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java	2009-11-06 19:42:41 UTC (rev 5886)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -25,7 +25,6 @@
 import java.util.List;
 
 import org.jbpm.api.Execution;
-import org.jbpm.api.JbpmException;
 import org.jbpm.api.activity.ActivityBehaviour;
 import org.jbpm.bpmn.parser.BindingsParser;
 import org.jbpm.internal.log.Log;
@@ -33,7 +32,6 @@
 import org.jbpm.pvm.internal.model.Condition;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.model.Transition;
-import org.jbpm.pvm.internal.model.TransitionImpl;
 
 /**
  * Basic activity for BPMN activities (tasks, gateways and event)
@@ -52,26 +50,8 @@
   protected static final boolean CONDITIONS_CHECKED = true;
   protected static final boolean CONDITIONS_IGNORED = !CONDITIONS_CHECKED;
 
-  // protected String default_;
-  protected List<ActivityResource> activvityResources = new ArrayList();
+  protected List<ActivityResource> activvityResources = new ArrayList<ActivityResource>();
 
-//  protected void leaveBpmnActivity(ExecutionImpl execution) {
-//
-//    proceedForkedIfAllowed(execution, FORK_ALLOWED, CONDITIONS_CHECKED);
-//
-//  }
-//
-//  protected void leaveBpmnActivitySingle(ExecutionImpl execution) {
-//    proceedForkedIfAllowed(execution, FORK_DISALLOWED, CONDITIONS_CHECKED);
-//
-//  }
-//
-//  protected void leaveBpmnActivityAll(ExecutionImpl execution) {
-//
-//    proceedForkedIfAllowed(execution, FORK_ALLOWED, CONDITIONS_IGNORED);
-//
-//  }
-
   /**
    * In BPMN multiple outgoing sequence flows behave like a fork.
    * 
@@ -119,7 +99,6 @@
   }
 
   protected List<Transition> findTransitions(ExecutionImpl execution, boolean checkConditions) {
-
     Activity activity = execution.getActivity();
     // evaluate the conditions and find the transitions that should be forked
     List<Transition> forkingTransitions = new ArrayList<Transition>();
@@ -127,7 +106,12 @@
     for (Transition transition : outgoingTransitions) {
       Condition condition = transition.getCondition();
       // also ignore the default transition of the exclusive gateway
-      if ((condition == null || !checkConditions || condition.evaluate(execution)) && activity.getDefaultOutgoingTransition() != transition) {
+      if ( ( (condition == null) 
+             || (!checkConditions) 
+             || (condition.evaluate(execution))
+           ) 
+           && (activity.getDefaultOutgoingTransition() != transition)
+         ) {
         forkingTransitions.add(transition);
       }
     }
@@ -135,14 +119,6 @@
     return forkingTransitions;
   }
 
-  // public String getDefault_ () {
-  // return this.default_;
-  // }
-  //  
-  // public void setDefault_ (String default_) {
-  // this.default_ = default_;
-  // }
-
   public void addActivityResource(ActivityResource activityResource) {
     this.activvityResources.add(activityResource);
   }

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-11-06 19:42:41 UTC (rev 5886)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -38,6 +38,7 @@
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.CompositeElementImpl;
+import org.jbpm.pvm.internal.model.ExpressionCondition;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.pvm.internal.model.ScopeElementImpl;
 import org.jbpm.pvm.internal.model.TransitionImpl;
@@ -266,9 +267,10 @@
           // TODO: add looking up the default language in the document if lang
           // is null.
           
-// TODO refactor according to PVM updates.  see package org.jbpm.pvm.internal.wire.usercode          
-//          ExpressionEvaluatorDescriptor expressionDescriptor = new ExpressionEvaluatorDescriptor(expr, lang);
-//          transition.setConditionDescriptor(expressionDescriptor);
+          ExpressionCondition expressionCondition = new ExpressionCondition();
+          expressionCondition.setExpression(expr);
+          expressionCondition.setLanguage(lang);
+          transition.setCondition(expressionCondition);
 
         } else {
           parse.addProblem("Type of the conditionExpression on sequenceFlow with id=" + transitionId + " is of onsupported type 'bpmn:tExpression'",

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java	2009-11-06 19:42:41 UTC (rev 5886)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -25,6 +25,7 @@
 
 import org.jbpm.jpdl.internal.xml.JpdlParser;
 import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.ExpressionCondition;
 import org.jbpm.pvm.internal.model.TransitionImpl;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.wire.usercode.UserCodeCondition;

Deleted: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExpressionCondition.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExpressionCondition.java	2009-11-06 19:42:41 UTC (rev 5886)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExpressionCondition.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -1,55 +0,0 @@
-/*
- * 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.jpdl.internal.activity;
-
-import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.OpenExecution;
-import org.jbpm.pvm.internal.model.Condition;
-import org.jbpm.pvm.internal.script.ScriptManager;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ExpressionCondition implements Condition {
-
-  private static final long serialVersionUID = 1L;
-  
-  protected String expression;
-  protected String language;
-  
-  public boolean evaluate(OpenExecution execution) {
-    ScriptManager scriptManager = ScriptManager.getScriptManager();
-    Object result = scriptManager.evaluateExpression(expression, language);
-    if (result instanceof Boolean) {
-      return ((Boolean) result).booleanValue();
-    }
-    throw new JbpmException("expression condition '"+expression+"' did not return a boolean: "+result);
-  }
-
-  public void setExpression(String expression) {
-    this.expression = expression;
-  }
-  public void setLanguage(String language) {
-    this.language = language;
-  }
-}

Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml	2009-11-06 19:42:41 UTC (rev 5886)
+++ jbpm4/trunk/modules/pvm/pom.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -77,6 +77,14 @@
       <scope>provided</scope>
     </dependency>
     <dependency>
+      <groupId>org.beanshell</groupId>
+      <artifactId>bsh</artifactId>
+    </dependency>
+    <dependency>
+       <groupId>org.codehaus.groovy</groupId>
+       <artifactId>groovy-all</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java (from rev 5886, jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ExpressionCondition.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,54 @@
+/*
+ * 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.pvm.internal.model;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.model.OpenExecution;
+import org.jbpm.pvm.internal.script.ScriptManager;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExpressionCondition implements Condition {
+
+  private static final long serialVersionUID = 1L;
+  
+  protected String expression;
+  protected String language;
+  
+  public boolean evaluate(OpenExecution execution) {
+    ScriptManager scriptManager = ScriptManager.getScriptManager();
+    Object result = scriptManager.evaluateExpression(expression, language);
+    if (result instanceof Boolean) {
+      return ((Boolean) result).booleanValue();
+    }
+    throw new JbpmException("expression condition '"+expression+"' did not return a boolean: "+result);
+  }
+
+  public void setExpression(String expression) {
+    this.expression = expression;
+  }
+  public void setLanguage(String language) {
+    this.language = language;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExpressionCondition.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/BshScriptEngine.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/BshScriptEngine.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/BshScriptEngine.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,340 @@
+package org.jbpm.pvm.internal.script;
+
+import java.io.*;
+import java.util.Map;
+import javax.script.*;
+import bsh.*;
+import static javax.script.ScriptContext.*;
+
+/*
+	Notes
+	This engine supports open-ended pluggable scriptcontexts
+*/
+public class BshScriptEngine extends AbstractScriptEngine
+	implements Compilable, Invocable
+{
+	// The BeanShell global namespace for the interpreter is stored in the
+	// engine scope map under this key.
+	static final String engineNameSpaceKey = "org_beanshell_engine_namespace";
+
+	private BshScriptEngineFactory factory;
+	private bsh.Interpreter interpreter;
+
+	public BshScriptEngine() {
+		this( null );
+	}
+
+	public BshScriptEngine( BshScriptEngineFactory factory ) 
+	{
+		this.factory = factory;
+		getInterpreter(); // go ahead and prime the interpreter now
+	}
+
+	protected Interpreter getInterpreter()
+	{
+		if ( interpreter == null ) {
+			this.interpreter = new bsh.Interpreter();
+			interpreter.setNameSpace(null); // should always be set by context
+		}
+
+		return interpreter;
+	}
+
+	public Object eval( String script, ScriptContext scriptContext )
+		throws ScriptException
+	{
+		return evalSource( script, scriptContext );
+	}
+
+	public Object eval( Reader reader, ScriptContext scriptContext )
+		throws ScriptException
+	{
+		return evalSource( reader, scriptContext );
+	}
+
+	/*
+		This is the primary implementation method.
+		We respect the String/Reader difference here in BeanShell because
+		BeanShell will do a few extra things in the string case... e.g.
+		tack on a trailing ";" semicolon if necessary.
+	*/
+	private Object evalSource( Object source, ScriptContext scriptContext )
+		throws ScriptException
+	{
+		bsh.NameSpace contextNameSpace = getEngineNameSpace( scriptContext );
+		Interpreter bsh = getInterpreter();
+		bsh.setNameSpace( contextNameSpace );
+
+		// This is a big hack, convert writer to PrintStream
+		bsh.setOut( new PrintStream(
+			new WriterOutputStream( scriptContext.getWriter() ) ) );
+		bsh.setErr( new PrintStream(
+			new WriterOutputStream( scriptContext.getErrorWriter() ) ) );
+
+		try {
+			if ( source instanceof Reader )
+				return bsh.eval( (Reader) source );
+			else
+				return bsh.eval( (String) source );
+		} catch ( ParseException e ) {
+			// explicit parsing error
+			throw new ScriptException(
+				e.toString(), e.getErrorSourceFile(), e.getErrorLineNumber() );
+		} catch ( TargetError e ) {
+			// The script threw an application level exception
+			// set it as the cause ?
+			ScriptException se = new ScriptException(
+				e.toString(), e.getErrorSourceFile(), e.getErrorLineNumber() );
+			se.initCause( e.getTarget() );
+			throw se;
+		} catch ( EvalError e ) {
+			// The script couldn't be evaluated properly
+			throw new ScriptException(
+				e.toString(), e.getErrorSourceFile(), e.getErrorLineNumber() );
+		} catch ( InterpreterError e ) {
+			// The interpreter had a fatal problem
+			throw new ScriptException( e.toString() );
+		}
+	}
+
+
+
+	/*
+		Check the context for an existing global namespace embedded
+		in the script context engine scope.  If none exists, ininitialize the
+		context with one.
+	*/
+	private static NameSpace getEngineNameSpace( ScriptContext scriptContext )
+	{
+		NameSpace ns = (NameSpace)scriptContext.getAttribute(
+			engineNameSpaceKey, ENGINE_SCOPE );
+
+		if ( ns == null )
+		{
+			// Create a global namespace for the interpreter
+			Map engineView = new ScriptContextEngineView( scriptContext );
+			ns = new ExternalNameSpace(
+				null/*parent*/, "javax_script_context", engineView );
+
+			scriptContext.setAttribute( engineNameSpaceKey, ns, ENGINE_SCOPE );
+		}
+
+		return ns;
+	}
+
+	public Bindings createBindings()
+	{
+		return new SimpleBindings();
+	}
+
+    public ScriptEngineFactory getFactory()
+	{
+		if ( factory == null )
+			factory = new BshScriptEngineFactory();
+		return factory;
+	}
+
+	/**
+	 * Compiles the script (source represented as a <code>String</code>) for later
+	 * execution.
+	 *
+	 * @param script The source of the script, represented as a
+	 * <code>String</code>.
+	 *
+	 * @return An subclass of <code>CompiledScript</code> to be executed later
+	 *         using one of the <code>eval</code> methods of <code>CompiledScript</code>.
+	 *
+	 * @throws ScriptException if compilation fails.
+	 * @throws NullPointerException if the argument is null.
+	 */
+
+	public CompiledScript compile( String script ) throws
+		ScriptException
+	{
+		return compile( new StringReader( script ) );
+	}
+
+	/**
+	 * Compiles the script (source read from <code>Reader</code>) for later
+	 * execution.  Functionality is identical to <code>compile(String)</code> other
+	 * than the way in which the source is passed.
+	 *
+	 * @param script The reader from which the script source is obtained.
+	 *
+	 * @return An implementation of <code>CompiledScript</code> to be executed
+	 *         later using one of its <code>eval</code> methods of
+	 *         <code>CompiledScript</code>.
+	 *
+	 * @throws ScriptException if compilation fails.
+	 * @throws NullPointerException if argument is null.
+	 */
+	public CompiledScript compile( Reader script ) throws
+		ScriptException
+	{
+		// todo
+		throw new Error("unimplemented");
+	}
+
+	/**
+	 * Calls a procedure compiled during a previous script execution, which is
+	 * retained in the state of the <code>ScriptEngine<code>.
+	 *
+	 * @param name The name of the script method to be called.
+	 * @param thiz thiz is an instance of the script class returned by a previous execution or
+	 * invocation, the named method is called through that instance.
+	 * @param args Arguments to pass to the procedure.  The rules for converting
+	 * the arguments to scripting variables are implementation-specific.
+	 *
+	 * @return The value returned by the method.  The rules for converting the
+	 *         scripting variable returned by the procedure to a Java Object are
+	 *         implementation-specific.
+	 *
+	 * @throws javax.script.ScriptException if an error occurrs during invocation
+	 * of the method.
+	 * @throws NoSuchMethodException if method with given name or matching argument
+	 * types cannot be found.
+	 * @throws NullPointerException if method name is null.
+	 */
+	public Object invokeMethod( Object thiz, String name, Object... args ) throws ScriptException, NoSuchMethodException
+	{
+		if ( ! (thiz instanceof bsh.This) )
+			throw new ScriptException( "Illegal objec type: " +thiz.getClass() );
+
+		bsh.This bshObject = (bsh.This)thiz;
+
+		try {
+			return bshObject.invokeMethod( name, args );
+		} catch ( ParseException e ) {
+			// explicit parsing error
+			throw new ScriptException(
+				e.toString(), e.getErrorSourceFile(), e.getErrorLineNumber() );
+		} catch ( TargetError e ) {
+			// The script threw an application level exception
+			// set it as the cause ?
+			ScriptException se = new ScriptException(
+				e.toString(), e.getErrorSourceFile(), e.getErrorLineNumber() );
+			se.initCause( e.getTarget() );
+			throw se;
+		} catch ( EvalError e ) {
+			// The script couldn't be evaluated properly
+			throw new ScriptException(
+				e.toString(), e.getErrorSourceFile(), e.getErrorLineNumber() );
+		} catch ( InterpreterError e ) {
+			// The interpreter had a fatal problem
+			throw new ScriptException( e.toString() );
+		}
+	}
+
+	/**
+	 * Used to call top-level procedures defined in scripts.
+	 *
+	 * @param name Name of the procedure
+	 * @param args Arguments to pass to the procedure
+	 *
+	 * @return The value returned by the procedure
+	 *
+	 * @throws javax.script.ScriptException if an error occurrs during invocation
+	 * of the method.
+	 * @throws NoSuchMethodException if procedure with given name or matching
+	 * argument types cannot be found.
+	 * @throws NullPointerException if procedure name is null.
+	 */
+	public Object invokeFunction( String name, Object... args )
+		throws ScriptException, NoSuchMethodException
+	{
+		return invokeMethod( getGlobal(), name, args );
+	}
+
+		/**
+	 * Returns an implementation of an interface using procedures compiled in the
+	 * interpreter. The methods of the interface may be implemented using the
+	 * <code>invokeFunction</code> method.
+	 *
+	 * @param clasz The <code>Class</code> object of the interface to return.
+	 *
+	 * @return An instance of requested interface - null if the requested interface
+	 *         is unavailable, i. e. if compiled methods in the
+	 *         <code>ScriptEngine</code> cannot be found matching the ones in the
+	 *         requested interface.
+	 *
+	 * @throws IllegalArgumentException if the specified <code>Class</code> object
+	 * does not exist or is not an interface.
+	 */
+	public <T> T getInterface( Class<T> clasz )
+	{
+		try {
+			return (T) getGlobal().getInterface( clasz );
+		} catch ( UtilEvalError utilEvalError ) {
+			utilEvalError.printStackTrace();
+			return null;
+		}
+	}
+
+	/**
+	 * Returns an implementation of an interface using member functions of a
+	 * scripting object compiled in the interpreter. The methods of the interface
+	 * may be implemented using invokeMethod(Object, String, Object...) method.
+	 *
+	 * @param thiz The scripting object whose member functions are used to
+	 * implement the methods of the interface.
+	 * @param clasz The <code>Class</code> object of the interface to return.
+	 *
+	 * @return An instance of requested interface - null if the requested
+	 *         interface is unavailable, i. e. if compiled methods in the
+	 *         <code>ScriptEngine</code> cannot be found matching the ones in the
+	 *         requested interface.
+	 *
+	 * @throws IllegalArgumentException if the specified <code>Class</code> object
+	 * does not exist or is not an interface, or if the specified Object is null
+	 * or does not represent a scripting object.
+	 */
+	public <T> T getInterface( Object thiz, Class<T> clasz )
+	{
+		if ( !(thiz instanceof bsh.This) )
+			throw new IllegalArgumentException(
+				"invalid object type: "+thiz.getClass() );
+
+		try {
+			bsh.This bshThis = (bsh.This)thiz;
+			return (T) bshThis.getInterface( clasz );
+		} catch ( UtilEvalError utilEvalError ) {
+			utilEvalError.printStackTrace( System.err );
+			return null;
+		}
+	}
+
+	private bsh.This getGlobal()
+	{
+		// requires 2.0b5 to make getThis() public
+		return getEngineNameSpace( getContext() ).getThis( getInterpreter() );
+	}
+
+	/*
+		This is a total hack.  We need to introduce a writer to the
+		Interpreter.
+	*/
+	class WriterOutputStream extends OutputStream
+	{
+		Writer writer;
+		WriterOutputStream( Writer writer )
+		{
+			this.writer = writer;
+		}
+
+		public void write( int b ) throws IOException
+		{
+			writer.write(b);
+		}
+
+		public void flush() throws IOException
+		{
+			writer.flush();
+		}
+
+		public void close() throws IOException
+		{
+			writer.close();
+		}
+	}
+
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/BshScriptEngine.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/BshScriptEngineFactory.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/BshScriptEngineFactory.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/BshScriptEngineFactory.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,115 @@
+package org.jbpm.pvm.internal.script;
+
+import javax.script.*;
+import java.util.List;
+import java.util.Arrays;
+
+public class BshScriptEngineFactory implements
+	javax.script.ScriptEngineFactory
+{
+	// Begin impl ScriptEnginInfo
+	
+	final List<String> extensions = Arrays.asList( "bsh", "java" );
+
+	final List<String> mimeTypes = Arrays.asList(
+		"application/x-beanshell", 
+		"application/x-bsh",
+		"application/x-java-source" 
+	);
+
+	final List<String> names = Arrays.asList( "beanshell", "bsh", "java" );
+
+    public String getEngineName() {
+		return "BeanShell Engine";
+	}
+
+    public String getEngineVersion() {
+		return "1.0";
+	}
+
+    public List<String> getExtensions() {
+		return extensions;
+	}
+
+    public List<String> getMimeTypes() {
+		return mimeTypes;
+	}
+
+    public List<String> getNames() {
+		return names;
+	}
+
+    public String getLanguageName() {
+		return "BeanShell";
+	}
+
+    public String getLanguageVersion() {
+		return bsh.Interpreter.VERSION + "";
+	}
+
+    public Object getParameter( String param ) {
+	    if ( param.equals( ScriptEngine.ENGINE ) )
+			return getEngineName();
+		if ( param.equals( ScriptEngine.ENGINE_VERSION ) )
+			return getEngineVersion();
+		if ( param.equals( ScriptEngine.NAME ) )
+			return getEngineName();
+		if ( param.equals( ScriptEngine.LANGUAGE ) )
+			return getLanguageName();
+		if ( param.equals( ScriptEngine.LANGUAGE_VERSION ) )
+			return getLanguageVersion();
+		if ( param.equals( "THREADING" ) )
+			return "MULTITHREADED";
+
+		return null;
+	}
+
+    public String getMethodCallSyntax( 
+		String objectName, String methodName, String ... args ) 
+	{
+		// Note: this is very close to the bsh.StringUtil.methodString()
+		// method, which constructs a method signature from arg *types*.  Maybe
+		// combine these later.
+
+        StringBuilder sb = new StringBuilder();
+		if ( objectName != null )
+			sb.append( objectName + "." );
+		sb.append( methodName + "(" );
+        if ( args.length > 0 )
+			sb.append(" ");
+        for( int i=0; i<args.length; i++ )
+            sb.append( ( (args[i] == null) ? "null" : args[i] ) 
+				+ ( i < (args.length-1) ? ", " : " " ) );
+        sb.append(")");
+        return sb.toString();
+	}
+
+    public String getOutputStatement( String message ) {
+		return "print( \"" + message + "\" );";
+	}
+
+    public String getProgram( String ... statements )
+	{
+		StringBuilder sb = new StringBuilder();
+		for( int i=0; i< statements.length; i++ )
+		{
+			sb.append( statements[i] );
+			if ( !statements[i].endsWith(";") )
+				sb.append( ";" );
+			sb.append("\n");
+		}
+		return sb.toString();
+	}
+
+	// End impl ScriptEngineInfo
+
+	// Begin impl ScriptEngineFactory
+
+	public ScriptEngine getScriptEngine() 
+	{
+		return new BshScriptEngine();
+	}
+		
+	// End impl ScriptEngineFactory
+}
+


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/BshScriptEngineFactory.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyCompiledScript.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyCompiledScript.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyCompiledScript.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 
+ * Use is subject to license terms.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are 
+ * permitted provided that the following conditions are met: Redistributions of source code 
+ * must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of 
+ * conditions and the following disclaimer in the documentation and/or other materials 
+ * provided with the distribution. Neither the name of the Sun Microsystems nor the names of 
+ * is contributors may be used to endorse or promote products derived from this software 
+ * without specific prior written permission. 
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * GroovyCompiledScript.java
+ * @author Mike Grogan
+ * @author A. Sundararajan
+ */
+
+package org.jbpm.pvm.internal.script;
+import javax.script.*;
+
+
+public class GroovyCompiledScript extends CompiledScript {
+    
+    private GroovyScriptEngine engine;
+    private Class clasz;
+    
+    public GroovyCompiledScript(GroovyScriptEngine engine, Class clasz) {
+        this.engine = engine;
+        this.clasz = clasz;
+    }
+    
+    public Object eval(ScriptContext context) throws ScriptException {
+        return engine.eval(clasz, context);
+    }    
+    
+    public ScriptEngine getEngine() {
+        return engine;
+    }
+    
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyCompiledScript.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyScriptEngine.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyScriptEngine.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyScriptEngine.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,356 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.  
+ * Use is subject to license terms.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are 
+ * permitted provided that the following conditions are met: Redistributions of source code 
+ * must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of 
+ * conditions and the following disclaimer in the documentation and/or other materials 
+ * provided with the distribution. Neither the name of the Sun Microsystems nor the names of 
+ * is contributors may be used to endorse or promote products derived from this software 
+ * without specific prior written permission. 
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+/*
+ * GroovyScriptEngine.java
+ * @author Mike Grogan
+ * @author A. Sundararajan
+ */
+package org.jbpm.pvm.internal.script;
+import java.io.*;
+import java.util.*;
+import javax.script.*;
+import groovy.lang.*;
+import org.codehaus.groovy.syntax.SyntaxException;
+import org.codehaus.groovy.runtime.InvokerHelper;
+import org.codehaus.groovy.runtime.MetaClassHelper;
+import org.codehaus.groovy.runtime.MethodClosure;
+import org.codehaus.groovy.control.CompilerConfiguration;
+import org.codehaus.groovy.control.CompilationFailedException;
+import java.lang.reflect.*;
+
+public class GroovyScriptEngine 
+    extends AbstractScriptEngine implements Compilable, Invocable {
+
+    private static boolean DEBUG = false;
+
+    // script-string-to-generated Class map
+    private Map<String, Class> classMap;
+    // global closures map - this is used to simulate a single
+    // global functions namespace 
+    private Map<String, Closure> globalClosures;
+    // class loader for Groovy generated classes
+    private GroovyClassLoader loader;
+    // lazily initialized factory
+    private volatile GroovyScriptEngineFactory factory;
+
+    // counter used to generate unique global Script class names
+    private static int counter;
+ 
+    static {
+        counter = 0;
+    }
+    
+    public GroovyScriptEngine() {    
+        classMap = Collections.synchronizedMap(new HashMap<String, Class>());
+        globalClosures = Collections.synchronizedMap(new HashMap<String, Closure>());
+        loader = new GroovyClassLoader(getParentLoader(),
+                                       new CompilerConfiguration());
+    }
+
+    public Object eval(Reader reader, ScriptContext ctx) 
+                       throws ScriptException {
+        return eval(readFully(reader), ctx);
+    }
+    
+    public Object eval(String script, ScriptContext ctx) 
+                       throws ScriptException {
+        try {
+            return eval(getScriptClass(script), ctx);
+        } catch (SyntaxException e) {
+            throw new ScriptException(e.getMessage(), 
+                                      e.getSourceLocator(), e.getLine());
+        } catch (Exception e) {
+            if (DEBUG) e.printStackTrace();
+            throw new ScriptException(e);
+        }
+    }
+    
+    public Bindings createBindings() {
+        return new SimpleBindings();
+    }
+    
+    public ScriptEngineFactory getFactory() {
+        if (factory == null) {
+            synchronized (this) {
+                if (factory == null) {
+                    factory = new GroovyScriptEngineFactory();
+                }
+            }
+        }
+        return factory;
+    }
+   
+    // javax.script.Compilable methods 
+    public CompiledScript compile(String scriptSource) throws ScriptException {
+        try {
+            return new GroovyCompiledScript(this, 
+                                    getScriptClass(scriptSource));
+        } catch (SyntaxException e) {
+            throw new ScriptException(e.getMessage(), 
+                                      e.getSourceLocator(), e.getLine());
+        } catch (IOException e) {
+            throw new ScriptException(e);
+        } catch (CompilationFailedException ee) {
+            throw new ScriptException(ee);
+        }
+    }   
+    
+    public CompiledScript compile(Reader reader) throws ScriptException {
+        return compile(readFully(reader));
+    }
+   
+    // javax.script.Invocable methods.
+    public Object invokeFunction(String name, Object... args) 
+             throws ScriptException, NoSuchMethodException  {
+        return invokeImpl(null, name, args);
+    }
+   
+    public Object invokeMethod(Object thiz, String name, Object... args) 
+             throws ScriptException, NoSuchMethodException  {
+        if (thiz == null) {
+            throw new IllegalArgumentException("script object is null");
+        }
+        return invokeImpl(thiz, name, args);
+    }
+	        
+    public <T> T getInterface(Class<T> clasz) {
+        return makeInterface(null, clasz);
+    }
+
+    public <T> T getInterface(Object thiz, Class<T> clasz) {
+        if (thiz == null) {
+            throw new IllegalArgumentException("script object is null");
+        }
+        return makeInterface(thiz, clasz);
+    }
+
+    // package-privates
+    Object eval(Class scriptClass, final ScriptContext ctx) throws ScriptException {
+        //add context to bindings
+        ctx.setAttribute("context", ctx, ScriptContext.ENGINE_SCOPE);
+        
+        //direct output to ctx.getWriter
+        Writer writer = ctx.getWriter();
+        ctx.setAttribute("out", (writer instanceof PrintWriter) ? 
+                                 writer :
+                                 new PrintWriter(writer),
+                                 ScriptContext.ENGINE_SCOPE);
+        /*
+         * We use the following Binding instance so that global variable lookup
+         * will be done in the current ScriptContext instance.
+         */
+        Binding binding = new Binding(ctx.getBindings(ScriptContext.ENGINE_SCOPE)) {
+                              @Override
+                              public Object getVariable(String name) {
+                                  synchronized (ctx) {
+                                      int scope = ctx.getAttributesScope(name);
+                                      if (scope != -1) {
+                                          return ctx.getAttribute(name, scope);
+                                      }
+                                  }
+                                  throw new MissingPropertyException(name, getClass());
+                              }
+                              @Override
+                              public void setVariable(String name, Object value) {
+                                  synchronized (ctx) {
+                                      int scope = ctx.getAttributesScope(name);
+                                      if (scope == -1) {    
+                                          scope = ScriptContext.ENGINE_SCOPE;
+                                      } 
+                                      ctx.setAttribute(name, value, scope);
+                                  }
+                              }
+                          };
+
+        try {
+            Script scriptObject = InvokerHelper.createScript(scriptClass, binding);
+
+            // create a Map of MethodClosures from this new script object
+            Method[] methods = scriptClass.getMethods();
+            Map<String, Closure> closures = new HashMap<String, Closure>();
+            for (Method m : methods) {
+                String name = m.getName();
+                closures.put(name, new MethodClosure(scriptObject, name));
+            }
+
+            // save all current closures into global closures map
+            globalClosures.putAll(closures);
+
+            MetaClass oldMetaClass = scriptObject.getMetaClass();
+
+            /*
+             * We override the MetaClass of this script object so that we can
+             * forward calls to global closures (of previous or future "eval" calls)
+             * This gives the illusion of working on the same "global" scope.
+             */
+            scriptObject.setMetaClass(new DelegatingMetaClass(oldMetaClass) {
+                        @Override
+                        public Object invokeMethod(Object object, String name, Object args) {
+                            if (args == null) {
+                                return invokeMethod(object, name, MetaClassHelper.EMPTY_ARRAY);
+                            }
+                            if (args instanceof Tuple) {
+                                return invokeMethod(object, name, ((Tuple)args).toArray());
+                            }
+                            if (args instanceof Object[]) {
+                                return invokeMethod(object, name, (Object[]) args);
+                            } else {
+                                return invokeMethod(object, name, new Object[] { args });
+                            }
+                        }
+
+                        @Override
+                        public Object invokeMethod(Object object, String name, Object[] args) {
+                            try {
+                                return super.invokeMethod(object, name, args);
+                            } catch (MissingMethodException mme) {
+                                return callGlobal(name, args, ctx);
+                            }
+                        }
+                        @Override
+                        public Object invokeStaticMethod(Object object, String name, Object[] args) {
+                            try {
+                                return super.invokeStaticMethod(object, name, args);
+                            } catch (MissingMethodException mme) {
+                                return callGlobal(name, args, ctx);
+                            }
+                        }
+                    });
+
+            return scriptObject.run();
+        } catch (Exception e) {
+            throw new ScriptException(e);
+        }
+    }
+
+    Class getScriptClass(String script) 
+                         throws SyntaxException, 
+                                CompilationFailedException, 
+                                IOException {
+        Class clazz = classMap.get(script);
+        if (clazz != null) {
+            return clazz;
+        }
+       
+        InputStream stream = new ByteArrayInputStream(script.getBytes()); 
+        clazz = loader.parseClass(stream, generateScriptName());
+        classMap.put(script, clazz);
+        return clazz;
+    }
+
+    //-- Internals only below this point
+
+    // invokes the specified method/function on the given object.
+    private Object invokeImpl(Object thiz, String name, Object... args) 
+             throws ScriptException, NoSuchMethodException  {
+        if (name == null) {
+            throw new NullPointerException("method name is null");
+        }
+
+        try {
+            if (thiz != null) {
+                return InvokerHelper.invokeMethod(thiz, name, args);
+            } else {
+                return callGlobal(name, args);
+            }
+        } catch (MissingMethodException mme) {
+            throw new NoSuchMethodException(mme.getMessage());
+        } catch (Exception e) {
+            throw new ScriptException(e);
+        }
+    } 
+
+    // call the script global function of the given name
+    private Object callGlobal(String name, Object[] args) {
+        return callGlobal(name, args, context);
+    }
+
+    private Object callGlobal(String name, Object[] args, ScriptContext ctx) {
+        Closure closure = globalClosures.get(name);
+        if (closure != null) {
+            return closure.call(args);
+        } else {
+            // Look for closure valued variable in the 
+            // given ScriptContext. If available, call it.
+            Object value = ctx.getAttribute(name);
+            if (value instanceof Closure) {
+                return ((Closure)value).call(args);
+            } // else fall thru..
+        }
+        throw new MissingMethodException(name, getClass(), args);     
+    }
+
+    // generate a unique name for top-level Script classes
+    private synchronized String generateScriptName() {
+        return "Script" + (++counter) + ".groovy";
+    }
+
+    private <T> T makeInterface(Object obj, Class<T> clazz) {
+        final Object thiz = obj;
+        if (clazz == null || !clazz.isInterface()) {
+            throw new IllegalArgumentException("interface Class expected");
+        }
+        return (T) Proxy.newProxyInstance(
+            clazz.getClassLoader(),
+            new Class[] { clazz },
+            new InvocationHandler() {
+                public Object invoke(Object proxy, Method m, Object[] args)
+                                     throws Throwable {
+                    return invokeImpl(thiz, m.getName(), args);
+                }
+            });
+    }
+
+    // determine appropriate class loader to serve as parent loader
+    // for GroovyClassLoader instance
+    private ClassLoader getParentLoader() {
+        // check whether thread context loader can "see" Groovy Script class
+        ClassLoader ctxtLoader = Thread.currentThread().getContextClassLoader();
+        try {
+            Class c = ctxtLoader.loadClass("org.codehaus.groovy.Script");
+            if (c == Script.class) {
+                return ctxtLoader;
+            }
+        } catch (ClassNotFoundException cnfe) {
+        }
+        // exception was thrown or we get wrong class
+        return Script.class.getClassLoader();
+    }
+
+    private String readFully(Reader reader) throws ScriptException {
+        char[] arr = new char[8*1024]; // 8K at a time
+        StringBuilder buf = new StringBuilder();
+        int numChars;
+        try {
+            while ((numChars = reader.read(arr, 0, arr.length)) > 0) {
+                buf.append(arr, 0, numChars);
+            }
+        } catch (IOException exp) {
+            throw new ScriptException(exp);
+        }
+        return buf.toString();
+    }
+} 


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyScriptEngine.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyScriptEngineFactory.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyScriptEngineFactory.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyScriptEngineFactory.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.  
+ * Use is subject to license terms.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are 
+ * permitted provided that the following conditions are met: Redistributions of source code 
+ * must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of 
+ * conditions and the following disclaimer in the documentation and/or other materials 
+ * provided with the distribution. Neither the name of the Sun Microsystems nor the names of 
+ * is contributors may be used to endorse or promote products derived from this software 
+ * without specific prior written permission. 
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * GroovyScriptEngineFactory.java
+ * @author Mike Grogan
+ * @author A. Sundararajan
+ */
+
+package org.jbpm.pvm.internal.script;
+
+import javax.script.*;
+import java.util.*;
+
+public class GroovyScriptEngineFactory implements ScriptEngineFactory {
+	
+	private static String VERSION = "1.5.6";
+    
+    public String getEngineName() {
+        return "groovy";
+    }
+
+    public String getEngineVersion() {
+        return org.codehaus.groovy.runtime.InvokerHelper.getVersion();
+    }
+
+    public String getLanguageName() {
+        return "groovy";
+    }
+
+    public String getLanguageVersion() {
+        return VERSION;
+    }
+    
+    public List<String> getExtensions() {
+        return extensions;
+    }
+
+    public List<String> getMimeTypes() {
+        return mimeTypes;
+    }
+    
+    public List<String> getNames() {
+        return names;
+    }
+    
+    public Object getParameter(String key) {
+       
+        if (ScriptEngine.NAME.equals(key)) {
+            return "Groovy";
+        } else if (ScriptEngine.ENGINE.equals(key)) {
+            return "Groovy Script Engine";
+        } else if (ScriptEngine.ENGINE_VERSION.equals(key)) {
+            return org.codehaus.groovy.runtime.InvokerHelper.getVersion();
+        } else if (ScriptEngine.LANGUAGE.equals(key)) {
+            return "Groovy";
+        } else if (ScriptEngine.LANGUAGE_VERSION.equals(key)) {
+            return VERSION;
+        } else if ("THREADING".equals(key)) {
+            return "MULTITHREADED";
+        } else {
+            throw new IllegalArgumentException("Invalid key");
+        }
+    
+    }
+    
+   
+    public ScriptEngine getScriptEngine() {
+        return new GroovyScriptEngine();
+    }
+    
+     public String getMethodCallSyntax(String obj, String method, 
+                                        String... args) {
+        
+        String ret = obj + "." + method + "(";
+        int len = args.length;
+        if (len == 0) {
+            ret += ")";
+            return ret;
+        }
+        
+        for (int i = 0; i < len; i++) {
+            ret += args[i];
+            if (i != len - 1) {
+                ret += ",";
+            } else {
+                ret += ")";
+            }
+        }
+        return ret;
+    }    
+    
+    public String getOutputStatement(String toDisplay) {
+        StringBuilder buf = new StringBuilder();
+        buf.append("println(\"");
+        int len = toDisplay.length();
+        for (int i = 0; i < len; i++) {
+            char ch = toDisplay.charAt(i);
+            switch (ch) {
+            case '"':
+                buf.append("\\\"");
+                break;
+            case '\\':
+                buf.append("\\\\");
+                break;
+            default:
+                buf.append(ch);
+                break;
+            }
+        }
+        buf.append("\")");
+        return buf.toString();
+    }    
+    
+    public String getProgram(String... statements) {
+        StringBuilder ret = new StringBuilder();
+        int len = statements.length;
+        for (int i = 0; i < len; i++) {
+            ret.append(statements[i]);
+            ret.append('\n');
+        }
+        return ret.toString();
+    }
+
+    private static List<String> names;
+    private static List<String> extensions;
+    private static List<String> mimeTypes;
+
+    static {
+        names = new ArrayList<String>(1);
+        names.add("groovy");
+        names = Collections.unmodifiableList(names);
+
+        extensions = names;
+
+        mimeTypes = new ArrayList<String>(0);
+        mimeTypes = Collections.unmodifiableList(mimeTypes);
+    }    
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/GroovyScriptEngineFactory.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptContextEngineView.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptContextEngineView.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptContextEngineView.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,268 @@
+package org.jbpm.pvm.internal.script;
+
+import javax.script.ScriptContext;
+import java.util.*;
+import static javax.script.ScriptContext.*;
+
+/**
+ * This class implements an ENGINE_SCOPE centric Map view of the ScriptContext
+ * for engine implementations.  This class can be used to simplify engine
+ * implementations which have the capability to bind their namespaces to Maps
+ * or other external interfaces.
+ *
+ * Get operations on this view delegate to the
+ * ScriptContext inheriting get() method that automatically traverses the
+ * binding scopes in order or precedence.  Put operations on this view always
+ * store values in the ENGINE_SCOPE bindings.  Other operations such as
+ * size() and contains() are implemented appropriately, but perhaps not as
+ * efficiently as possible.
+ *
+*/
+public class ScriptContextEngineView implements Map<String,Object>
+{
+	ScriptContext context;
+
+	public ScriptContextEngineView( ScriptContext context )
+	{
+		this.context = context;
+	}
+
+	/**
+	 * Returns the number of unique object bindings in all scopes.
+	 * (duplicate, shadowed, bindings count as a single binging).
+	 */
+	public int size()
+	{
+		return totalKeySet().size();
+	}
+
+	/**
+	 * Returns true if no bindings are present in any scope of the context.
+	 */
+	public boolean isEmpty()
+	{
+		return totalKeySet().size() == 0;
+	}
+
+	/**
+	 * Returns true if the key name is bound in any scope in the context.
+	 * The key must be a String.
+	 *
+	 * @param key key whose presence in this map is to be tested.
+	 *
+	 * @return <tt>true</tt> if this map contains a mapping for the specified key.
+	 *
+	 * @throws ClassCastException if the key is of an inappropriate type for this
+	 * map (optional).
+	 * @throws NullPointerException if the key is <tt>null</tt> and this map does
+	 * not permit <tt>null</tt> keys (optional).
+	 */
+	// Why isn't the compiler allowing this?
+	//public boolean containsKey( String key )
+	public boolean containsKey( Object key )
+	{
+		return context.getAttribute( (String)key ) != null;
+	}
+
+	/**
+	 * Returns <tt>true</tt> if this map maps one or more keys to the specified
+	 * value.  More formally, returns <tt>true</tt> if and only if this map
+	 * contains at least one mapping to a value <tt>v</tt> such that
+	 * <tt>(value==null ? v==null : value.equals(v))</tt>.  This operation will
+	 * probably require time linear in the map size for most implementations of the
+	 * <tt>Map</tt> interface.
+	 *
+	 * @param value value whose presence in this map is to be tested.
+	 *
+	 * @return <tt>true</tt> if this map maps one or more keys to the specified
+	 *         value.
+	 *
+	 * @throws ClassCastException if the value is of an inappropriate type for this
+	 * map (optional).
+	 * @throws NullPointerException if the value is <tt>null</tt> and this map does
+	 * not permit <tt>null</tt> values (optional).
+	 */
+	public boolean containsValue( Object value )
+	{
+		Set values = totalValueSet();
+		return values.contains( value );
+	}
+
+	/**
+	 * Returns the value bound in the most specific (lowest numbered)
+	 * bindings space for this key.
+	 * key must be a String.
+	 *
+	 * @param key key whose associated value is to be returned.
+	 *
+	 * @return the value to which this map maps the specified key, or <tt>null</tt>
+	 *         if the map contains no mapping for this key.
+	 *
+	 * @throws ClassCastException if the key is of an inappropriate type for this
+	 * map (optional).
+	 * @throws NullPointerException if the key is <tt>null</tt> and this map does
+	 * not permit <tt>null</tt> keys (optional).
+	 * @see #containsKey(Object)
+	 */
+	public Object get( Object key )
+	{
+		return context.getAttribute( (String)key );
+	}
+
+	/**
+	 * Set the key, value binding in the ENGINE_SCOPE of the context.
+	 *
+	 * @param key key with which the specified value is to be associated.
+	 * @param value value to be associated with the specified key.
+	 *
+	 * @return previous value associated with specified key, or <tt>null</tt> if
+	 *         there was no mapping for key.  A <tt>null</tt> return can also
+	 *         indicate that the map previously associated <tt>null</tt> with the
+	 *         specified key, if the implementation supports <tt>null</tt> values.
+	 *
+	 * @throws UnsupportedOperationException if the <tt>put</tt> operation is not
+	 * supported by this map.
+	 * @throws ClassCastException if the class of the specified key or value
+	 * prevents it from being stored in this map.
+	 * @throws IllegalArgumentException if some aspect of this key or value
+	 * prevents it from being stored in this map.
+	 * @throws NullPointerException if this map does not permit <tt>null</tt> keys
+	 * or values, and the specified key or value is <tt>null</tt>.
+	 */
+	public Object put( String key, Object value )
+	{
+		Object oldValue =
+			context.getAttribute( key, ENGINE_SCOPE );
+		context.setAttribute( key, value, ENGINE_SCOPE );
+		return oldValue;
+	}
+
+
+	/**
+	 * Put the bindings into the ENGINE_SCOPE of the context.
+	 *
+	 * @param t Mappings to be stored in this map.
+	 *
+	 * @throws UnsupportedOperationException if the <tt>putAll</tt> method is not
+	 * supported by this map.
+	 * @throws ClassCastException if the class of a key or value in the specified
+	 * map prevents it from being stored in this map.
+	 * @throws IllegalArgumentException some aspect of a key or value in the
+	 * specified map prevents it from being stored in this map.
+	 * @throws NullPointerException if the specified map is <tt>null</tt>, or if
+	 * this map does not permit <tt>null</tt> keys or values, and the specified map
+	 * contains <tt>null</tt> keys or values.
+	 */
+	public void putAll( Map<? extends String, ? extends Object> t )
+	{
+		context.getBindings( ENGINE_SCOPE ).putAll( t );
+	}
+
+	/**
+	 * Removes the mapping from the engine scope.
+	 * <p/>
+	 * <p>Returns the value to which the map previously associated the key, or
+	 * <tt>null</tt> if the map contained no mapping for this key.  (A
+	 * <tt>null</tt> return can also indicate that the map previously associated
+	 * <tt>null</tt> with the specified key if the implementation supports
+	 * <tt>null</tt> values.)  The map will not contain a mapping for the specified
+	 * key once the call returns.
+	 *
+	 * @param okey key whose mapping is to be removed from the map.
+	 *
+	 * @return previous value associated with specified key, or <tt>null</tt> if
+	 *         there was no mapping for key.
+	 *
+	 * @throws ClassCastException if the key is of an inappropriate type for this
+	 * map (optional).
+	 * @throws NullPointerException if the key is <tt>null</tt> and this map does
+	 * not permit <tt>null</tt> keys (optional).
+	 * @throws UnsupportedOperationException if the <tt>remove</tt> method is not
+	 * supported by this map.
+	 */
+	// Why is the compiler complaining about this?
+	//public Object remove( String key )
+	public Object remove( Object okey )
+	{
+		// This shouldn't be necessary... we don't map Objects, Strings.
+		String key = (String)okey;
+		Object oldValue =
+			context.getAttribute( key, ENGINE_SCOPE );
+		context.removeAttribute( key, ENGINE_SCOPE );
+		return oldValue;
+	}
+
+	/**
+	 * Removes all mappings from this map (optional operation).
+	 *
+	 * @throws UnsupportedOperationException clear is not supported by this map.
+	 */
+	public void clear()
+	{
+		context.getBindings( ENGINE_SCOPE ).clear();
+	}
+
+	/**
+	 * Returns the total key set of all scopes.
+	 * This method violates the Map contract by returning an unmodifiable set.
+	 *
+	 * @return a set view of the keys contained in this map.
+	 */
+	public Set keySet()
+	{
+		return totalKeySet();
+	}
+
+	/**
+	 *
+	 * Returns the total values set of all scopes.
+	 * This method violates the Map contract by returning an unmodifiable set.
+	 *
+	 * @return a collection view of the values contained in this map.
+	 */
+	public Collection values()
+	{
+		return totalValueSet();
+	}
+
+	/**
+	 * Returns a set view of the mappings contained in this map.  Each element in
+	 * the returned set is a {@link java.util.Map.Entry}.  The set is backed by the
+	 * map, so changes to the map are reflected in the set, and vice-versa. If the
+	 * map is modified while an iteration over the set is in progress (except
+	 * through the iterator's own <tt>remove</tt> operation, or through the
+	 * <tt>setValue</tt> operation on a map entry returned by the iterator) the
+	 * results of the iteration are undefined.  The set supports element removal,
+	 * which removes the corresponding mapping from the map, via the
+	 * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>, <tt>removeAll</tt>,
+	 * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not support the
+	 * <tt>add</tt> or <tt>addAll</tt> operations.
+	 *
+	 * @return a set view of the mappings contained in this map.
+	 */
+	public Set<Entry<String,Object>> entrySet()
+	{
+		throw new Error("unimplemented");
+	}
+
+	private Set totalKeySet()
+	{
+		Set keys = new HashSet();
+		List<Integer> scopes = context.getScopes();
+		for ( int i : scopes ) {
+			keys.addAll( context.getBindings( i ).keySet() );
+		}
+		return Collections.unmodifiableSet(keys);
+	}
+	private Set totalValueSet()
+	{
+		Set values = new HashSet();
+		List<Integer> scopes = context.getScopes();
+		for ( int i : scopes ) {
+			values.addAll( context.getBindings( i ).values() );
+		}
+		return Collections.unmodifiableSet(values);
+	}
+
+}
+


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptContextEngineView.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml	2009-11-06 19:42:41 UTC (rev 5886)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -2,6 +2,8 @@
 
 <jbpm-configuration>
 
+  <import resource="jbpm.default.scriptmanager.xml" />
+
   <process-engine-context>
   
     <repository-service />
@@ -24,11 +26,6 @@
 
     <object class="org.jbpm.pvm.internal.id.DatabaseIdComposer" init="eager" />
 
-    <script-manager default-expression-language="juel"
-                    default-script-language="juel">
-      <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
-    </script-manager>
-    
     <types resource="jbpm.variable.types.xml" />
 
     <address-resolver />

Added: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.scriptmanager.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.scriptmanager.xml	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.scriptmanager.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+  <process-engine-context>
+  
+    <script-manager default-expression-language="juel"
+                    default-script-language="juel">
+      <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
+      <script-language name="bsh" factory="org.jbpm.pvm.internal.script.BshScriptEngineFactory" />
+      <script-language name="groovy" factory="org.jbpm.pvm.internal.script.GroovyScriptEngineFactory" />
+    </script-manager>
+    
+  </process-engine-context>
+
+</jbpm-configuration>


Property changes on: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.scriptmanager.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: jbpm4/trunk/modules/test-db/pom.xml
===================================================================
--- jbpm4/trunk/modules/test-db/pom.xml	2009-11-06 19:42:41 UTC (rev 5886)
+++ jbpm4/trunk/modules/test-db/pom.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -57,7 +57,6 @@
       <artifactId>jbpm-console-reports</artifactId>
       <scope>test</scope>
     </dependency>
-
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring</artifactId>
@@ -91,6 +90,12 @@
           </execution>
         </executions>
       </plugin>
+      
+      <!--             <exclude>org/jbpm/bpmn/flownodes/ExclusiveGatewayTest.java</exclude>
+            <exclude>org/jbpm/bpmn/flownodes/ScriptTaskTest.java</exclude>
+            <exclude>org/jbpm/bpmn/flownodes/UserTaskTest.java</exclude>
+       -->
+      
     </plugins>
   </build>
 

Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ExclusiveGatewayTest.java (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayTest.java)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ExclusiveGatewayTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ExclusiveGatewayTest.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,252 @@
+/*
+ * 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;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.dom4j.DocumentFactory;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.TaskQuery;
+import org.jbpm.api.task.Task;
+import org.jbpm.bpmn.parser.BpmnParser;
+import org.jbpm.pvm.internal.util.XmlUtil;
+import org.jbpm.pvm.internal.xml.Problem;
+import org.jbpm.test.JbpmTestCase;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Tom Baeyens
+ * @author Ronald van Kuijk (kukeltje)
+ */
+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/exclusiveGateway.bpmn.xml");
+
+    if (!problems.isEmpty()) {
+      fail("No problems should have occured. Problems: " + problems);
+    }
+  }
+  
+  public void testNormalXPath() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/exclusiveGatewayXPath.bpmn.xml");
+
+    if (!problems.isEmpty()) {
+      fail("No problems should have occured. Problems: " + problems);
+    }
+  }
+  
+  public void testNormalExecuteDecisionCondition() {
+
+    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/exclusiveGateway.bpmn.xml").deploy();
+
+    try {
+        Map variables = new HashMap();
+        
+        variables.put("test", "value");
+        
+        ProcessInstance pi = executionService.startProcessInstanceByKey("ExclusiveGateway", variables );
+        String pid = pi.getId();
+        
+        TaskQuery taskQuery = taskService.createTaskQuery();
+        List<Task> allTasks = taskQuery.list();
+
+        assertEquals(1, allTasks.size());
+        assertEquals("doSomething", allTasks.get(0).getActivityName());
+        
+        taskService.completeTask( allTasks.get(0).getId());
+
+        // process instance should be ended
+        pi = executionService.findProcessInstanceById(pid);
+        assertNull(pi);
+        
+    }
+    finally {
+        repositoryService.deleteDeploymentCascade(deploymentId);
+    }
+  }
+  
+  public void testNormalExecuteDefault() {
+
+    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/exclusiveGateway.bpmn.xml").deploy();
+
+    try {
+        Map variables = new HashMap();
+        
+        variables.put("test", "no value");
+        
+        ProcessInstance pi = executionService.startProcessInstanceByKey("ExclusiveGateway", variables );
+        String pid = pi.getId();
+        
+        TaskQuery taskQuery = taskService.createTaskQuery();
+        List<Task> allTasks = taskQuery.list();
+
+        assertEquals(1, allTasks.size());
+        assertEquals("doSomethingElse", allTasks.get(0).getActivityName());
+        
+        taskService.completeTask( allTasks.get(0).getId());
+
+        // process instance should be ended
+        pi = executionService.findProcessInstanceById(pid);
+        assertNull(pi);
+        
+    }
+    finally {
+        repositoryService.deleteDeploymentCascade(deploymentId);
+    }
+  }
+  
+  public void testNormalExecuteDecisionConditionXPath() {
+
+    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/exclusiveGatewayXPath.bpmn.xml").deploy();
+
+    try {
+        Map variables = new HashMap();
+        Document objectData;
+        
+        objectData = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(this.getClass().getResourceAsStream("xmlTestDocument.xml"));
+        variables.put("justadocument", objectData);
+        variables.put("test", "just");
+        
+        ProcessInstance pi = executionService.startProcessInstanceByKey("ExclusiveGateway", variables );
+        String pid = pi.getId();
+        
+        TaskQuery taskQuery = taskService.createTaskQuery();
+        List<Task> allTasks = taskQuery.list();
+
+        assertEquals(1, allTasks.size());
+        assertEquals("doSomething", allTasks.get(0).getActivityName());
+        
+        taskService.completeTask( allTasks.get(0).getId());
+
+        // process instance should be ended
+        pi = executionService.findProcessInstanceById(pid);
+        assertNull(pi);
+        
+    } catch (SAXException e) {
+      e.printStackTrace();
+    } catch (IOException e) {
+      e.printStackTrace();
+    } catch (ParserConfigurationException e) {
+      e.printStackTrace();
+    }
+    finally {
+        repositoryService.deleteDeploymentCascade(deploymentId);
+    }
+  }
+
+
+  public void testNonBoundDefault() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/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/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/exclusiveGatewayMixedValid.bpmn.xml");
+
+    if (!problems.isEmpty()) {
+      fail("No problems should have occured. Problems: " + problems);
+    }
+  }
+
+  
+  public void testMixedInvalid() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/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/exclusiveGatewayConvergingInvalid.bpmn.xml");
+
+    if ((problems == null) || (problems.isEmpty())) {
+      fail("expected problems during parse");
+    } else {
+      assertTextPresent("Gateway '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/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());
+    }
+  }
+  
+  public void testInvalidConditionExpression() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/exclusiveGatewayInvalidConditionExpression.bpmn.xml");
+
+    if ((problems == null) || (problems.isEmpty())) {
+      fail("expected problems during parse");
+    } else {
+      assertTextPresent("Type of the conditionExpression on sequenceFlow with id=flow2 is of onsupported type 'bpmn:tExpression", problems.get(0).getMsg());
+    }
+  }
+
+}


Property changes on: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ExclusiveGatewayTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ParallelGatewayTest.java (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ParallelGatewayTest.java)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ParallelGatewayTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ParallelGatewayTest.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,106 @@
+/*
+ * 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;
+
+import java.util.List;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.TaskQuery;
+import org.jbpm.api.task.Task;
+import org.jbpm.bpmn.parser.BpmnParser;
+import org.jbpm.pvm.internal.xml.Problem;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * @author Ronald van Kuijk (kukeltje)
+ */
+public class ParallelGatewayTest 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 testNormalParse() {
+
+    List<Problem> problems = parse("org/jbpm/bpmn/parallelGateway.bpmn.xml");
+
+    if (!problems.isEmpty()) {
+      fail("No problems should have occured. Problems: " + problems);
+    }
+  }
+
+  public void testNormalExecute() {
+
+    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/parallelGateway.bpmn.xml").deploy();
+
+    try {
+        ProcessInstance pi = executionService.startProcessInstanceByKey("ParallelGateway");
+        
+        String pid = pi.getId();
+                        
+        TaskQuery taskQuery = taskService.createTaskQuery();
+        List<Task> allTasks = taskQuery.list();
+
+        assertEquals(2, allTasks.size());
+        assertEquals("UserTaskLeg1", allTasks.get(0).getActivityName());
+        assertEquals("UserTaskLeg2", allTasks.get(1).getActivityName());
+        
+        // specifying a transition is unnecessary, BPMN has outgoing AND semantic!
+        // TODO: fix
+        // Currently not passing any 'outcome'
+        taskService.completeTask( allTasks.get(0).getId());
+        
+        pi = executionService.findProcessInstanceById(pid);
+        // process instance should not be ended yet
+        assertNotNull(pi);
+        
+        taskService.completeTask( allTasks.get(1).getId());
+
+        assertEquals(0, taskQuery.list().size());
+                
+        pi = executionService.findProcessInstanceById(pid);
+        // process instance is ended
+        assertNull(pi);
+        
+    }
+    finally {
+        repositoryService.deleteDeploymentCascade(deploymentId);
+    }
+  }
+  
+   
+
+  public void testInvalid() {
+    List<Problem> problems = parse("org/jbpm/bpmn/parallelGatewayInvalid.bpmn.xml");
+
+    if ((problems == null) || (problems.isEmpty())) {
+      fail("expected problems during parse");
+    } else {
+      assertTextPresent("parallelGateway 'The Fork' has the wrong number of incomming (1) and outgoing (2) transitions for gatewayDirection='converging'", problems.get(0).getMsg());
+    }
+  }
+}

Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ScriptTaskTest.java (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ScriptTaskTest.java)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ScriptTaskTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/ScriptTaskTest.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,78 @@
+/*
+ * 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;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.bpmn.parser.BpmnParser;
+import org.jbpm.pvm.internal.xml.Problem;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * @author Tom Baeyens
+ * @author Ronald van Kuijk (kukeltje)
+ */
+public class ScriptTaskTest 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/scriptTask.bpmn.xml");
+
+    if (!problems.isEmpty()) {
+      fail("No problems should have occured. Problems: " + problems);
+    }
+  }
+  
+  public void testNormalExecute() {
+
+    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/scriptTask.bpmn.xml").deploy();
+
+    try {
+        Map variables = new HashMap();
+        String[] values = {"st", "nd", "rd", "th", "th"}; 
+        variables.put("test", values);
+        
+        ProcessInstance pi = executionService.startProcessInstanceByKey("ScriptTask", variables );
+        String pid = pi.getId();
+
+        // process instance should be ended
+        pi = executionService.findProcessInstanceById(pid);
+        assertNull(pi);
+        
+    }
+    finally {
+        repositoryService.deleteDeploymentCascade(deploymentId);
+    }
+  }
+}

Copied: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/UserTaskTest.java (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/UserTaskTest.java)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/UserTaskTest.java	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/bpmn/UserTaskTest.java	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,251 @@
+/*
+ * 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;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.TaskQuery;
+import org.jbpm.api.task.Task;
+//import org.jbpm.bpmn.model.BpmnProcessDefinition;
+//import org.jbpm.bpmn.parser.BpmnParser;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * @author Bernd Ruecker (bernd.ruecker at camunda.com)
+ */
+public class UserTaskTest extends JbpmTestCase {
+
+//  static BpmnParser bpmnParser = new BpmnParser();
+//
+//  public void testParsing() {
+//    Parse parse = bpmnParser.createParse().setResource("org/jbpm/bpmn/UserTaskSimple.bpmn.xml").execute();
+//
+//    if (!parse.getProblems().isEmpty()) {
+//      fail("No problems should have occured. Problems: " + parse.getProblems());
+//    }
+//
+//    List<BpmnProcessDefinition> processDefinitions = (List<BpmnProcessDefinition>) parse.getDocumentObject();
+//
+//    assertEquals(1, processDefinitions.size());
+//
+//    BpmnProcessDefinition pd = processDefinitions.get(0);
+//    assertNotNull(pd);
+//    assertEquals("UserTaskSimpleProcess", pd.getKey());
+//  }
+
+  public void testNormalUserAssignment() {
+    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/UserTaskSimple.bpmn.xml").deploy();
+
+    try {
+      Map variables = new HashMap();
+      variables.put("assignedUser", "User1");
+      ProcessInstance pi = executionService.startProcessInstanceByKey("UserTaskSimpleProcess", variables);
+      assertEquals("UserTask", ((ExecutionImpl) pi).getActivityName());
+
+      TaskQuery taskQuery = taskService.createTaskQuery();
+      List<Task> allTasks = taskQuery.list();
+      assertEquals(1, allTasks.size());
+      assertEquals("UserTask", allTasks.get(0).getActivityName());
+      assertEquals("User1", allTasks.get(0).getAssignee());
+      assertEquals("MyForm.ftl", allTasks.get(0).getFormResourceName());
+
+      // speciifiing a transition is unnecessary, BPMN has outgoing AND
+      // semantic!
+      // TODO: fix
+      taskService.completeTask(allTasks.get(0).getId(), "flow2");
+
+      assertEquals(0, taskQuery.list().size());
+
+      // process instance is ended
+      pi = executionService.findProcessInstanceById(pi.getId());
+      // One way or another I would also expect this to work... pi is gone from
+      // database immediately when ended. Only in History DB
+      // assertEquals(true, pi.isEnded());
+      assertNull(pi);
+    } finally {
+      repositoryService.deleteDeploymentCascade(deploymentId);
+    }
+  }
+
+  public void testNormalGroupAssignment() {
+    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/UserTaskGroup.bpmn.xml").deploy();
+
+    try {
+      Map variables = new HashMap();
+      variables.put("assignedGroup", "Group1");
+      ProcessInstance pi = executionService.startProcessInstanceByKey("UserTaskGroupProcess", variables);
+
+      assertEquals("UserTask", ((ExecutionImpl) pi).getActivityName());
+
+      TaskQuery taskQuery = taskService.createTaskQuery();
+      List<Task> allTasks = taskQuery.list();
+      assertEquals(1, allTasks.size());
+
+      List<Task> groupTasks = taskService.findGroupTasks("Group1");
+      assertEquals(1, groupTasks.size());
+      assertEquals("UserTask", groupTasks.get(0).getActivityName());
+
+      assertEquals("UserTask", allTasks.get(0).getActivityName());
+
+      assertNull(allTasks.get(0).getAssignee());
+
+      taskService.takeTask(allTasks.get(0).getId(), "User1");
+
+      groupTasks = taskService.findGroupTasks("Group1");
+      assertEquals(0, groupTasks.size());
+
+      List<Task> userTasks = taskService.findPersonalTasks("User1");
+      assertEquals(1, userTasks.size());
+      assertEquals("UserTask", userTasks.get(0).getActivityName());
+
+      taskService.completeTask(userTasks.get(0).getId(), "flow2");
+
+      assertEquals(0, taskQuery.list().size());
+
+      // process instance is ended
+      pi = executionService.findProcessInstanceById(pi.getId());
+      assertNull(pi);
+    } finally {
+      repositoryService.deleteDeploymentCascade(deploymentId);
+    }
+  }
+
+  public void testNormalSequenceFlowCondition() {
+    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/UserTaskSequenceFlowCondition.bpmn.xml").deploy();
+
+    try {
+      Map variables = new HashMap();
+      ProcessInstance pi = executionService.startProcessInstanceByKey("UserTaskSequenceFlowConditionProcess");
+
+      assertEquals("UserTask", ((ExecutionImpl) pi).getActivityName());
+
+      TaskQuery taskQuery = taskService.createTaskQuery();
+      List<Task> allTasks = taskQuery.list();
+      assertEquals(1, allTasks.size());
+
+      // Flow does not exist so task should be ended hence process endded since it is the only execution
+      taskService.completeTask(allTasks.get(0).getId(), "NoFlow");
+      
+      assertEquals(0, taskQuery.list().size());
+
+      // process instance is ended
+      pi = executionService.findProcessInstanceById(pi.getId());
+      assertNull(pi);
+    } finally {
+      repositoryService.deleteDeploymentCascade(deploymentId);
+    }
+  }
+
+  
+  
+  /**
+   * check that multiple outgoing sequence flows will be handled as fork, like
+   * specified in BPMN
+   * 
+   * Check with user tasks, sicne the engine stops there for sure.
+   */
+  public void testUncontrolledSequenceFlowAsFork() {
+    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/forkWithUncontrolledSequenceFlow.bpmn.xml")
+            .deploy();
+
+    try {
+
+      ProcessInstance pi = executionService.startProcessInstanceByKey("ForkWithUncontrolledSequenceFlowProcess");
+
+      String pid = pi.getId();
+
+      TaskQuery taskQuery = taskService.createTaskQuery();
+      List<Task> allTasks = taskQuery.list();
+
+      // since the uncontrolled sequence flow OUT of the activity behaves as a
+      // fork
+      // we now have two tasks
+      assertEquals(2, allTasks.size());
+      assertEquals("UserTaskLeg1", allTasks.get(0).getActivityName());
+      assertEquals("UserTaskLeg2", allTasks.get(1).getActivityName());
+
+      // specifying a transition is unnecessary, BPMN has outgoing AND semantic!
+      // TODO: fix
+      // Currently not passing any 'outcome'
+      taskService.completeTask(allTasks.get(0).getId()); // define output /
+      // flow?
+      taskService.completeTask(allTasks.get(1).getId());
+
+      assertEquals(0, taskQuery.list().size());
+
+      pi = executionService.findProcessInstanceById(pid);
+      // process instance is ended
+      assertNull(pi);
+
+    } finally {
+      repositoryService.deleteDeploymentCascade(deploymentId);
+    }
+
+  }
+
+  /**
+   * check that multiple outgoing sequence flows will be handled as fork, like
+   * specified in BPMN
+   * 
+   * Check with user tasks, sicne the engine stops there for sure.
+   */
+  public void testUncontrolledSequenceFlowConditionAsFork() {
+    String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("org/jbpm/bpmn/forkWithUncontrolledSequenceFlowCondition.bpmn.xml")
+            .deploy();
+
+    try {
+
+      ProcessInstance pi = executionService.startProcessInstanceByKey("ForkWithUncontrolledSequenceFlowConditionProcess");
+
+      String pid = pi.getId();
+
+      TaskQuery taskQuery = taskService.createTaskQuery();
+      List<Task> allTasks = taskQuery.list();
+
+      assertEquals(1, allTasks.size());
+      assertEquals("forkingTask", allTasks.get(0).getActivityName());
+      taskService.completeTask(allTasks.get(0).getId(), "NoFlow");
+      
+      // Even though the 'uncontrolled sequence flow' OUT of the activity behaves as a
+      // fork we now have one task since one sequenceflow has a condition that evaluates to false
+
+      allTasks = taskQuery.list();
+      assertEquals(1, allTasks.size());
+      assertEquals("UserTaskLeg2", allTasks.get(0).getActivityName());
+      taskService.completeTask(allTasks.get(0).getId());
+
+      pi = executionService.findProcessInstanceById(pid);
+      // process instance is ended
+      assertNull(pi);
+
+    } finally {
+      repositoryService.deleteDeploymentCascade(deploymentId);
+    }
+
+  }
+  
+}

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskGroup.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/UserTaskGroup.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskGroup.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskGroup.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="UserTaskGroup"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../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/"
+	xmlns:jbpm="http://jbpm.org/4.0/bpmn2">
+
+	<bpmn:resource name="sampleHumanResource" />
+
+	<bpmn:process id="UserTaskGroupProcess" name="Simple process with user task for group">
+
+
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" name="fromStartToUserTask"
+			sourceRef="Start" targetRef="UserTask" />
+
+		<bpmn:userTask id="UserTask" name="user task"
+			implementation="other">
+			<!-- use jbpm internal task management -->
+			<bpmn:potentialOwner id="myPerformer" resourceRef="sampleResource" jbpm:type="group">
+				<bpmn:resourceAssignmentExpression
+					id="rae">
+					<bpmn:formalExpression language="juel">
+						${assignedGroup}</bpmn:formalExpression>
+				</bpmn:resourceAssignmentExpression>
+			</bpmn:potentialOwner>
+						<bpmn:potentialOwner id="myPerformer2" resourceRef="sampleResource">
+				<bpmn:resourceAssignmentExpression
+					id="rae2">
+					<bpmn:formalExpression language="juel">
+						${assignedGroup}</bpmn:formalExpression>
+				</bpmn:resourceAssignmentExpression>
+			</bpmn:potentialOwner>
+			<bpmn:rendering id="myRendering">
+				<jbpm:form>MyForm.ftl</jbpm:form>
+			</bpmn:rendering>
+		</bpmn:userTask>
+
+		<bpmn:sequenceFlow id="flow2" name="fromUserTaskToEnd"
+			sourceRef="UserTask" targetRef="End" />
+
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskSequenceFlowCondition.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/UserTaskSequenceFlowCondition.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskSequenceFlowCondition.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskSequenceFlowCondition.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="UserTaskSequenceFlowCondition"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../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:resource name="sampleHumanResource" />
+
+	<bpmn:process id="UserTaskSequenceFlowConditionProcess"
+		name="Simple process with user task and condition on sequenceFlow">
+
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" name="fromStartToUserTask"
+			sourceRef="Start" targetRef="UserTask" />
+
+		<bpmn:userTask id="UserTask" name="user task"
+			implementation="other">
+			<!-- use jbpm internal task management -->
+			<bpmn:performer id="myPerformer" resourceRef="sampleResource" />
+		</bpmn:userTask>
+
+		<bpmn:sequenceFlow id="flow2" name="fromUserTaskToUSerTask2"
+			sourceRef="UserTask" targetRef="UserTask2">
+			<bpmn:conditionExpression id="flow2Cond"
+				xsi:type="bpmn:tFormalExpression">${jbpm_outcome == 'flow'}</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+
+		<bpmn:userTask id="UserTask2" name="another user task"
+			implementation="other">
+			<!-- use jbpm internal task management -->
+			<bpmn:performer id="myPerformer2" resourceRef="sampleResource" />
+		</bpmn:userTask>
+
+		<bpmn:sequenceFlow id="flow3" name="fromUserTask2ToEnd"
+			sourceRef="UserTask2" targetRef="End">
+		</bpmn:sequenceFlow>
+
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskSimple.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/UserTaskSimple.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskSimple.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/UserTaskSimple.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="UserTaskSimple"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../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/"
+	xmlns:jbpm="http://jbpm.org/4.0/bpmn2">
+
+	<bpmn:resource name="sampleHumanResource" />
+
+	<bpmn:process id="UserTaskSimpleProcess" name="Simple process with user task">
+
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" name="fromStartToUserTask"
+			sourceRef="Start" targetRef="UserTask" />
+
+		<bpmn:userTask id="UserTask" name="user task"
+			implementation="other">
+			<!-- use jbpm internal task management -->
+			<bpmn:performer id="myPerformer" resourceRef="sampleResource">
+				<bpmn:resourceAssignmentExpression
+					id="rae">
+					<bpmn:formalExpression language="juel">
+						${assignedUser}</bpmn:formalExpression>
+				</bpmn:resourceAssignmentExpression>
+			</bpmn:performer>
+			<bpmn:rendering id="myRendering">
+				<jbpm:form>MyForm.ftl</jbpm:form>
+			</bpmn:rendering>
+		</bpmn:userTask>
+
+		<bpmn:sequenceFlow id="flow2" name="fromUserTaskToEnd"
+			sourceRef="UserTask" targetRef="End" />
+
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGateway.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGateway.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGateway.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGateway.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,41 @@
+<?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 ../../../../../../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="ExclusiveGateway" name="ExclusiveGateway">
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start"
+			targetRef="exclusiveGatewayDecision" name="Start->exclusiveGateway" />
+
+		<bpmn:exclusiveGateway id="exclusiveGatewayDecision"
+			name="Just a gateway" default="flow3"/>
+
+		<!-- Sequence Flow -->
+
+		<bpmn:sequenceFlow id="flow2" sourceRef="exclusiveGatewayDecision"
+			targetRef="doSomething">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${test == 'value'}</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow3" sourceRef="exclusiveGatewayDecision"
+			targetRef="doSomethingElse">
+		</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>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayConvergingInvalid.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayConvergingInvalid.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayConvergingInvalid.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayConvergingInvalid.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -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 ../../../../../../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>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayDivergingInvalid.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayDivergingInvalid.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayDivergingInvalid.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayDivergingInvalid.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -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 ../../../../../../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>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayInvalidConditionExpression.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayInvalidConditionExpression.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayInvalidConditionExpression.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayInvalidConditionExpression.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -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 ../../../../../../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:tExpression">
+				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>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayMixedInvalid.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayMixedInvalid.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayMixedInvalid.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayMixedInvalid.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -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 ../../../../../../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>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayMixedValid.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayMixedValid.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayMixedValid.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayMixedValid.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -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 ../../../../../../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->exclusiveGatewayPre" />
+
+		<bpmn:exclusiveGateway id="exclusiveGatewayPre"
+			name="Just a dummy gateway"/>
+
+		<bpmn:sequenceFlow id="flow6" sourceRef="exclusiveGatewayPre"
+			targetRef="exclusiveGateway" name="exclusiveGatewayPre->exclusiveGateway" />
+
+		<bpmn:sequenceFlow id="flow7" sourceRef="exclusiveGatewayPre"
+			targetRef="exclusiveGateway" name="exclusiveGatewayPre->exclusiveGateway" />
+
+		<bpmn:exclusiveGateway id="exclusiveGateway"
+			name="Just a gateway" gatewayDirection="mixed"/>
+
+		<bpmn:sequenceFlow id="flow2" sourceRef="exclusiveGateway"
+			targetRef="doSomething">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">
+				Has to be valid
+			</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow3" sourceRef="exclusiveGateway"
+			targetRef="doSomethingElse">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">
+				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>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayNonBoundDefault.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayNonBoundDefault.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayNonBoundDefault.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayNonBoundDefault.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -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 ../../../../../../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>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayNonExistingDefault.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayNonExistingDefault.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayNonExistingDefault.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayNonExistingDefault.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -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 ../../../../../../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>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayXPath.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/exclusiveGatewayXPath.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayXPath.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/exclusiveGatewayXPath.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,41 @@
+<?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 ../../../../../../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="ExclusiveGateway" name="ExclusiveGateway">
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start"
+			targetRef="exclusiveGatewayDecision" name="Start->exclusiveGateway" />
+
+		<bpmn:exclusiveGateway id="exclusiveGatewayDecision"
+			name="Just a gateway" default="flow3"/>
+
+		<!-- Sequence Flow -->
+
+		<bpmn:sequenceFlow id="flow2" sourceRef="exclusiveGatewayDecision"
+			targetRef="doSomething">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression" language="xpath">getObjectData("justadocument")/root/child1/text()=$test</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow3" sourceRef="exclusiveGatewayDecision"
+			targetRef="doSomethingElse">
+		</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>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/forkWithUncontrolledSequenceFlow.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/forkWithUncontrolledSequenceFlow.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/forkWithUncontrolledSequenceFlow.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/forkWithUncontrolledSequenceFlow.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ForkWithUncontrolledSequenceFlow"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../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:resource name="sampleResource" />	
+
+	<bpmn:process id="ForkWithUncontrolledSequenceFlowProcess" name="ForkWithUncontrolledSequenceFlow">
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" name="fromStartToFork"
+			sourceRef="Start"
+			targetRef="forkingTask"  />
+
+		<bpmn:task id="forkingTask" name="The Fork" />
+
+		<bpmn:sequenceFlow id="flow2a" name="Leg 1"
+			sourceRef="forkingTask"
+			targetRef="UserTaskLeg1" />
+		<bpmn:userTask id="UserTaskLeg1" name="user task leg1" implementation="other">
+			<bpmn:potentialOwner resourceRef="sampleResource" />
+		</bpmn:userTask>
+		<bpmn:sequenceFlow id="flow2b" name="Leg 1 -> Join"
+			sourceRef="UserTaskLeg1"
+			targetRef="parallelGatewayJoin"  />
+			
+		<bpmn:sequenceFlow id="flow3a" name="Leg 2" 
+			sourceRef="forkingTask"
+			targetRef="UserTaskLeg2" />
+		<bpmn:userTask id="UserTaskLeg2" name="user task leg2" implementation="other">
+			<bpmn:potentialOwner resourceRef="sampleResource" />
+		</bpmn:userTask>
+		<bpmn:sequenceFlow id="flow3b" name="Leg 2 -> Join"
+			sourceRef="UserTaskLeg2"
+			targetRef="parallelGatewayJoin"  />
+			
+
+		<bpmn:parallelGateway id="parallelGatewayJoin" name="The Join" 
+			gatewayDirection="converging"/>
+		<bpmn:sequenceFlow id="flow4" 
+			sourceRef="parallelGatewayJoin"
+			targetRef="End">
+		</bpmn:sequenceFlow>
+
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/forkWithUncontrolledSequenceFlowCondition.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/forkWithUncontrolledSequenceFlowCondition.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/forkWithUncontrolledSequenceFlowCondition.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/forkWithUncontrolledSequenceFlowCondition.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ForkWithUncontrolledSequenceFlowCondition"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 ../../../../../../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:resource name="sampleResource" />
+
+	<bpmn:process id="ForkWithUncontrolledSequenceFlowConditionProcess"
+		name="ForkWithUncontrolledSequenceFlowCondition">
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" name="fromStartToForkingTask"
+			sourceRef="Start" targetRef="forkingTask" />
+
+		<bpmn:userTask id="forkingTask" name="The Fork" />
+
+		<bpmn:sequenceFlow id="flow2a" name="Leg 1"
+			sourceRef="forkingTask" targetRef="UserTaskLeg1">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${jbpm_outcome == 'flow'}</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+
+		<bpmn:userTask id="UserTaskLeg1" name="user task leg1"
+			implementation="other">
+			<bpmn:potentialOwner resourceRef="sampleResource" />
+		</bpmn:userTask>
+
+		<bpmn:sequenceFlow id="flow2b" name="Leg 1 -> Join"
+			sourceRef="UserTaskLeg1" targetRef="parallelGatewayJoin" />
+
+		<bpmn:sequenceFlow id="flow3a" name="Leg 2"
+			sourceRef="forkingTask" targetRef="UserTaskLeg2" />
+		<bpmn:userTask id="UserTaskLeg2" name="user task leg2"
+			implementation="other">
+			<bpmn:potentialOwner resourceRef="sampleResource" />
+		</bpmn:userTask>
+
+		<bpmn:sequenceFlow id="flow3b" name="Leg 2 -> Join"
+			sourceRef="UserTaskLeg2" targetRef="parallelGatewayJoin" />
+
+
+		<bpmn:parallelGateway id="parallelGatewayJoin"
+			name="The Join" gatewayDirection="converging" />
+		<bpmn:sequenceFlow id="flow4" sourceRef="parallelGatewayJoin"
+			targetRef="End">
+		</bpmn:sequenceFlow>
+
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/parallelGateway.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/parallelGateway.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/parallelGateway.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/parallelGateway.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,50 @@
+<?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 ../../../../../../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="ParallelGateway" name="ParallelGateway">
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" name="fromStartToFork"
+			sourceRef="Start"
+			targetRef="parallelGatewayFork"  />
+
+		<bpmn:parallelGateway id="parallelGatewayFork" name="The Fork" 
+			gatewayDirection="diverging"/>
+
+		<bpmn:sequenceFlow id="flow2a" name="Leg 1"
+			sourceRef="parallelGatewayFork"
+			targetRef="UserTaskLeg1" />
+		<bpmn:userTask id="UserTaskLeg1" name="user task leg1" implementation="other">
+			<bpmn:potentialOwner resourceRef="sampleResource" />
+		</bpmn:userTask>
+		<bpmn:sequenceFlow id="flow2b" name="Leg 1 -> Join"
+			sourceRef="UserTaskLeg1"
+			targetRef="parallelGatewayJoin"  />
+			
+		<bpmn:sequenceFlow id="flow3a" name="Leg 2" 
+			sourceRef="parallelGatewayFork"
+			targetRef="UserTaskLeg2" />
+		<bpmn:userTask id="UserTaskLeg2" name="user task leg2" implementation="other">
+			<bpmn:potentialOwner resourceRef="sampleResource" />
+		</bpmn:userTask>
+		<bpmn:sequenceFlow id="flow3b" name="Leg 2 -> Join"
+			sourceRef="UserTaskLeg2"
+			targetRef="parallelGatewayJoin"  />
+			
+
+		<bpmn:parallelGateway id="parallelGatewayJoin" name="The Join" 
+			gatewayDirection="converging"/>
+		<bpmn:sequenceFlow id="flow4" 
+			sourceRef="parallelGatewayJoin"
+			targetRef="End">
+		</bpmn:sequenceFlow>
+
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/parallelGatewayInvalid.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/parallelGatewayInvalid.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/parallelGatewayInvalid.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/parallelGatewayInvalid.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,34 @@
+<?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 ../../../../../../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="parallelGatewayFork" name="fromStartToFork" />
+
+		<bpmn:parallelGateway id="parallelGatewayFork"
+			name="The Fork" gatewayDirection="converging"/>
+
+		<bpmn:sequenceFlow id="flow2" sourceRef="parallelGatewayFork"
+			targetRef="parallelGatewayJoin" name="Leg 1" />
+
+		<bpmn:sequenceFlow id="flow3" sourceRef="parallelGatewayFork"
+			targetRef="parallelGatewayJoin" name="Leg 2" />
+
+		<bpmn:parallelGateway id="parallelGatewayJoin"
+			name="The Join" gatewayDirection="diverging"/>
+
+		<bpmn:sequenceFlow id="flow4" sourceRef="parallelGatewayJoin"
+			targetRef="End">
+		</bpmn:sequenceFlow>
+
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/scriptTask.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/scriptTask.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/scriptTask.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/scriptTask.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,31 @@
+<?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 ../../../../../../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="ScriptTask" name="ScriptTask">
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start" />
+
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start"
+			targetRef="scriptTask" name="Start->ScriptTask" />
+
+		<bpmn:scriptTask id="scriptTask" name="Script Task"
+			scriptLanguage="bsh" >
+			<bpmn:script><![CDATA[
+for(int i=0;i<5;i++){
+  System.out.println((i+1) + test[i] + " universe");
+}]]>
+</bpmn:script>
+		</bpmn:scriptTask>
+		<bpmn:sequenceFlow id="flow2" sourceRef="scriptTask"
+			targetRef="End" />
+
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End" />
+	</bpmn:process>
+</bpmn:definitions>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.java.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.java.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.java.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.java.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ShipmentDefinitions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\BPMN20.xsd" xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" xmlns:sample="http://sample.bpmn.camunda.com/" xmlns:xbpmn="http://bpmn.camunda.com/" xmlns:tns="http://sample.bpmn.camunda.com/" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
+	
+	<!-- imports -->
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\SampleService.xsd" importType="http://www.w3.org/2001/XMLSchema"/>
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\SampleService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/soap/"/>
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\ShipmentProcessService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/soap/"/>
+	
+	<!-- definition structures for process variables -->
+	<bpmn:itemDefinition id="lieferungDef" itemKind="Information" structureRef="sample:shipment"/>
+	
+	<!-- definition structures for messages -->
+	<bpmn:itemDefinition id="ProzessStartenDef" itemKind="Information" structureRef="sample:startShipmentProces"/>
+	<bpmn:itemDefinition id="LieferungAnlegenDef" itemKind="Information" structureRef="sample:createShipment"/>
+	<bpmn:itemDefinition id="KommissioniertDef" itemKind="Information" structureRef="sample:notifyShipmentConsigned"/>
+	
+	<!-- messages -->
+	<bpmn:message name="ProzessStarten" id="ProzessStartenNachricht" structureRef="tns:ProzessStartenDef"/>
+	<bpmn:message name="LieferungAnlegen" id="LieferungAnlegenNachricht" structureRef="tns:LieferungAnlegenDef"/>
+	<bpmn:message name="Kommissioniert" id="KommissioniertNachricht" structureRef="tns:KommissioniertDef"/>
+	
+	<!-- Services -->
+	<!-- serivceReference ?? -->
+	<!-- conversation? Participant? -->
+	
+	<bpmn:endPoint id="ProzessEndpoint">
+		<xbpmn:url/>
+	</bpmn:endPoint>
+	<bpmn:endPoint id="LiefersystemEndpoint">
+		<xbpmn:url/>
+	</bpmn:endPoint>
+	
+	<!-- interfaces -->
+	<bpmn:interface id="ProzessInterface" name="Lieferprozess Schnittstelle">
+		<bpmn:operation name="startShipmentProcess">
+			<bpmn:inMessageRef>tns:ProzessStartenNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+		<bpmn:operation name="notifyShipmentConsigned">
+			<bpmn:inMessageRef>tns:KommissioniertNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+	</bpmn:interface>
+	<bpmn:interface id="LiefersystemInterface" name="Liefersystem Schnittstelle">
+		<bpmn:operation name="createShiptment">
+			<bpmn:inMessageRef>tns:LieferungAnlegenNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+	</bpmn:interface>
+	<!-- Resources / Performers -->
+	<bpmn:resource id="VertriebResource" name="Vertrieb"/>
+	<!-- process definition -->
+	<bpmn:process id="Shipment" name="Shipment">
+		<bpmn:documentation id="doc1">Teilprozess der Lieferung</bpmn:documentation>
+		
+		<!-- process variables -->
+		<bpmn:dataObject id="lieferungVariable" name="Lieferung" itemSubjectRef="tns:lieferungDef"/>
+		
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start">
+			<bpmn:dataOutput id="ProzessStartOutput" itemSubjectRef="tns:ProzessStartenNachricht"/>
+			<bpmn:dataOutputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">getDataOutput('ProzessStartOutput')/shipment</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>ProzessStartOutput</bpmn:sourceRef>
+				<bpmn:targetRef>tns:lieferungVariable</bpmn:targetRef>
+			</bpmn:dataOutputAssociation>
+			<bpmn:messageEventDefinition messageRef="tns:ProzessStartenNachricht">
+				<bpmn:operationRef>tns:startShipmentProcess</bpmn:operationRef>
+			</bpmn:messageEventDefinition>
+		</bpmn:startEvent>
+		
+		<!-- Activity 1: Service Task -->
+		<bpmn:serviceTask id="LieferungBuchen" name="Lieferung buchen" implementation="WebService" operationRef="createShipment">
+			<xbpmn:url/>
+			<bpmn:ioSpecification>
+				<bpmn:dataInput id="LieferungBuchenInput" isCollection="false" itemSubjectRef="tns:LieferungAnlegenNachricht"/>
+				<bpmn:inputSet>
+					<bpmn:dataInputRefs>LieferungBuchenInput</bpmn:dataInputRefs>
+				</bpmn:inputSet>
+				<bpmn:outputSet/>
+			</bpmn:ioSpecification>
+			<bpmn:dataInputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">bpmn:getDataObject('lieferungVariable')</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">bpmn:getDataInput('LieferungBuchenInput'/shipment/</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>tns:lieferungVariable</bpmn:sourceRef>
+				<bpmn:targetRef>LieferungBuchenInput</bpmn:targetRef>
+			</bpmn:dataInputAssociation>
+		</bpmn:serviceTask>
+		
+		<!-- Activity 2: Receive Task -->
+		<bpmn:receiveTask id="WartenAufLieferung" name="Warten auf Lieferung" instantiate="false" implementation="WebService" operationRef="notifyShipmentConsigned" messageRef="tns:Kommissioniert">
+			<bpmn:ioSpecification>
+				<bpmn:dataOutput id="KommissioniertOutput" itemSubjectRef="tns:KommissioniertNachricht"/>
+				<bpmn:inputSet/>
+				<bpmn:outputSet>
+					<bpmn:dataOutputRefs>KommissioniertOutput</bpmn:dataOutputRefs>
+				</bpmn:outputSet>
+			</bpmn:ioSpecification>
+
+			<bpmn:dataOutputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">getDataOutput('KommissioniertOutput')/shipment</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>KommissioniertOutput</bpmn:sourceRef>
+				<bpmn:targetRef>tns:lieferungVariable</bpmn:targetRef>
+			</bpmn:dataOutputAssociation>
+		</bpmn:receiveTask>
+		
+		<!-- Gateway -->
+		<bpmn:exclusiveGateway id="PruefeAvisierung" name="Avisierung benoetigt?"/>
+		
+		<!-- Activity 3: User Task -->
+		<bpmn:userTask id="LieferterminAvisieren" name="Liefertermin avisieren" implementation="other">
+			<!--		<bpmn:humanPerformer resourceRef="tns:Vertrieb"></bpmn:humanPerformer>-->
+			<bpmn:potentialOwner resourceRef="tns:VertriebResource"/>
+		</bpmn:userTask>
+		
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End"/>
+		
+		<!-- Sequence Flow -->
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start" targetRef="LieferungBuchen" name="Start->LieferungBuchen"/>
+		<bpmn:sequenceFlow id="flow2" sourceRef="LieferungBuchen" targetRef="WartenAufLieferung"/>
+		<bpmn:sequenceFlow id="flow3" sourceRef="WartenAufLieferung" targetRef="PruefeAvisierung"/>
+		<bpmn:sequenceFlow id="flow4" sourceRef="PruefeAvisierung" targetRef="LieferterminAvisieren">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')/confirmationRequired=true</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow5" sourceRef="PruefeAvisierung" targetRef="End">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">not( getDataObject('lieferungVariable')/confirmationRequired=true )</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow6" sourceRef="LieferterminAvisieren" targetRef="End"/>
+	</bpmn:process>
+
+<!--	
+	<bpmn:correlationSubscription>
+	</bpmn:correlationSubscription>
+-->
+	
+	<!-- TODO: Correlation / Conversation -->
+	<bpmn:conversation>
+		<bpmn:correlationKey>
+			<bpmn:correlationPropertyRef>test</bpmn:correlationPropertyRef>
+		</bpmn:correlationKey>
+	</bpmn:conversation>
+</bpmn:definitions>


Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.java.bpmn.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.pdf (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.pdf)
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.pdf
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.ws.bpmn.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/test/shipment.ws.bpmn.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.ws.bpmn.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/shipment.ws.bpmn.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions id="ShipmentDefinitions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\BPMN20.xsd" xmlns:bpmn="http://schema.omg.org/spec/BPMN/2.0" xmlns:sample="http://sample.bpmn.camunda.com/" xmlns:xbpmn="http://bpmn.camunda.com/" xmlns:tns="http://sample.bpmn.camunda.com/" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://sample.bpmn.camunda.com/">
+	
+	<!-- imports -->
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\SampleService.xsd" importType="http://www.w3.org/2001/XMLSchema"/>
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\SampleService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/soap/"/>
+	<bpmn:import namespace="http://sample.bpmn.camunda.com/" location="D:\Projekte\workspace\jbpm4\BPMN-2.0\src\resource\ShipmentProcessService.wsdl" importType="http://schemas.xmlsoap.org/wsdl/soap/"/>
+	
+	<!-- definition structures for process variables -->
+	<bpmn:itemDefinition id="lieferungDef" itemKind="Information" structureRef="sample:shipment"/>
+	
+	<!-- definition structures for messages -->
+	<bpmn:itemDefinition id="ProzessStartenDef" itemKind="Information" structureRef="sample:startShipmentProces"/>
+	<bpmn:itemDefinition id="LieferungAnlegenDef" itemKind="Information" structureRef="sample:createShipment"/>
+	<bpmn:itemDefinition id="KommissioniertDef" itemKind="Information" structureRef="sample:notifyShipmentConsigned"/>
+	
+	<!-- messages -->
+	<bpmn:message name="ProzessStarten" id="ProzessStartenNachricht" structureRef="tns:ProzessStartenDef"/>
+	<bpmn:message name="LieferungAnlegen" id="LieferungAnlegenNachricht" structureRef="tns:LieferungAnlegenDef"/>
+	<bpmn:message name="Kommissioniert" id="KommissioniertNachricht" structureRef="tns:KommissioniertDef"/>
+	
+	<!-- Services -->
+	<!-- serivceReference ?? -->
+	<!-- conversation? Participant? -->
+	
+	<bpmn:endPoint id="ProzessEndpoint">
+		<xbpmn:url/>
+	</bpmn:endPoint>
+	<bpmn:endPoint id="LiefersystemEndpoint">
+		<xbpmn:url/>
+	</bpmn:endPoint>
+	
+	<!-- interfaces -->
+	<bpmn:interface id="ProzessInterface" name="Lieferprozess Schnittstelle">
+		<bpmn:operation name="startShipmentProcess">
+			<bpmn:inMessageRef>tns:ProzessStartenNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+		<bpmn:operation name="notifyShipmentConsigned">
+			<bpmn:inMessageRef>tns:KommissioniertNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+	</bpmn:interface>
+	<bpmn:interface id="LiefersystemInterface" name="Liefersystem Schnittstelle">
+		<bpmn:operation name="createShiptment">
+			<bpmn:inMessageRef>tns:LieferungAnlegenNachricht</bpmn:inMessageRef>
+		</bpmn:operation>
+	</bpmn:interface>
+	<!-- Resources / Performers -->
+	<bpmn:resource id="VertriebResource" name="Vertrieb"/>
+	<!-- process definition -->
+	<bpmn:process id="Shipment" name="Shipment">
+		<bpmn:documentation id="doc1">Teilprozess der Lieferung</bpmn:documentation>
+		
+		<!-- process variables -->
+		<bpmn:dataObject id="lieferungVariable" name="Lieferung" itemSubjectRef="tns:lieferungDef"/>
+		
+		<!-- Start-Event -->
+		<bpmn:startEvent id="Start">
+			<bpmn:dataOutput id="ProzessStartOutput" itemSubjectRef="tns:ProzessStartenNachricht"/>
+			<bpmn:dataOutputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">getDataOutput('ProzessStartOutput')/shipment</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>ProzessStartOutput</bpmn:sourceRef>
+				<bpmn:targetRef>tns:lieferungVariable</bpmn:targetRef>
+			</bpmn:dataOutputAssociation>
+			<bpmn:messageEventDefinition messageRef="tns:ProzessStartenNachricht">
+				<bpmn:operationRef>tns:startShipmentProcess</bpmn:operationRef>
+			</bpmn:messageEventDefinition>
+		</bpmn:startEvent>
+		
+		<!-- Activity 1: Service Task -->
+		<bpmn:serviceTask id="LieferungBuchen" name="Lieferung buchen" implementation="WebService" operationRef="createShipment">
+			<xbpmn:url/>
+			<bpmn:ioSpecification>
+				<bpmn:dataInput id="LieferungBuchenInput" isCollection="false" itemSubjectRef="tns:LieferungAnlegenNachricht"/>
+				<bpmn:inputSet>
+					<bpmn:dataInputRefs>LieferungBuchenInput</bpmn:dataInputRefs>
+				</bpmn:inputSet>
+				<bpmn:outputSet/>
+			</bpmn:ioSpecification>
+			<bpmn:dataInputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">bpmn:getDataObject('lieferungVariable')</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">bpmn:getDataInput('LieferungBuchenInput'/shipment/</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>tns:lieferungVariable</bpmn:sourceRef>
+				<bpmn:targetRef>LieferungBuchenInput</bpmn:targetRef>
+			</bpmn:dataInputAssociation>
+		</bpmn:serviceTask>
+		
+		<!-- Activity 2: Receive Task -->
+		<bpmn:receiveTask id="WartenAufLieferung" name="Warten auf Lieferung" instantiate="false" implementation="WebService" operationRef="notifyShipmentConsigned" messageRef="tns:Kommissioniert">
+			<bpmn:ioSpecification>
+				<bpmn:dataOutput id="KommissioniertOutput" itemSubjectRef="tns:KommissioniertNachricht"/>
+				<bpmn:inputSet/>
+				<bpmn:outputSet>
+					<bpmn:dataOutputRefs>KommissioniertOutput</bpmn:dataOutputRefs>
+				</bpmn:outputSet>
+			</bpmn:ioSpecification>
+
+			<bpmn:dataOutputAssociation>
+				<bpmn:assignment>
+					<bpmn:from xsi:type="bpmn:tFormalExpression">getDataOutput('KommissioniertOutput')/shipment</bpmn:from>
+					<bpmn:to xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')</bpmn:to>
+				</bpmn:assignment>
+				<bpmn:sourceRef>KommissioniertOutput</bpmn:sourceRef>
+				<bpmn:targetRef>tns:lieferungVariable</bpmn:targetRef>
+			</bpmn:dataOutputAssociation>
+		</bpmn:receiveTask>
+		
+		<!-- Gateway -->
+		<bpmn:exclusiveGateway id="PruefeAvisierung" name="Avisierung benoetigt?"/>
+		
+		<!-- Activity 3: User Task -->
+		<bpmn:userTask id="LieferterminAvisieren" name="Liefertermin avisieren" implementation="other">
+			<!--		<bpmn:humanPerformer resourceRef="tns:Vertrieb"></bpmn:humanPerformer>-->
+			<bpmn:potentialOwner resourceRef="tns:VertriebResource"/>
+		</bpmn:userTask>
+		
+		<!-- End Events -->
+		<bpmn:endEvent id="End" name="End"/>
+		
+		<!-- Sequence Flow -->
+		<bpmn:sequenceFlow id="flow1" sourceRef="Start" targetRef="LieferungBuchen" name="Start->LieferungBuchen"/>
+		<bpmn:sequenceFlow id="flow2" sourceRef="LieferungBuchen" targetRef="WartenAufLieferung"/>
+		<bpmn:sequenceFlow id="flow3" sourceRef="WartenAufLieferung" targetRef="PruefeAvisierung"/>
+		<bpmn:sequenceFlow id="flow4" sourceRef="PruefeAvisierung" targetRef="LieferterminAvisieren">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">getDataObject('lieferungVariable')/confirmationRequired=true</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow5" sourceRef="PruefeAvisierung" targetRef="End">
+			<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">not( getDataObject('lieferungVariable')/confirmationRequired=true )</bpmn:conditionExpression>
+		</bpmn:sequenceFlow>
+		<bpmn:sequenceFlow id="flow6" sourceRef="LieferterminAvisieren" targetRef="End"/>
+	</bpmn:process>
+
+<!--	
+	<bpmn:correlationSubscription>
+	</bpmn:correlationSubscription>
+-->
+	
+	<!-- TODO: Correlation / Conversation -->
+	<bpmn:conversation>
+		<bpmn:correlationKey>
+			<bpmn:correlationPropertyRef>test</bpmn:correlationPropertyRef>
+		</bpmn:correlationKey>
+	</bpmn:conversation>
+</bpmn:definitions>

Copied: jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/xmlTestDocument.xml (from rev 5886, jbpm4/trunk/modules/bpmn/src/test/resources/org/jbpm/bpmn/flownodes/xmlTestDocument.xml)
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/xmlTestDocument.xml	                        (rev 0)
+++ jbpm4/trunk/modules/test-db/src/test/resources/org/jbpm/bpmn/xmlTestDocument.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -0,0 +1,6 @@
+<root>
+	<child1>just</child1>
+	<child2>for</child2>
+	<child3>demo</child3>
+	<child4>purposes</child4>
+</root>
\ No newline at end of file

Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml	2009-11-06 19:42:41 UTC (rev 5886)
+++ jbpm4/trunk/pom.xml	2009-11-09 13:54:10 UTC (rev 5887)
@@ -47,6 +47,8 @@
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <apache.ant.version>1.7.0</apache.ant.version>
+    <beanshell.version>2.0b5</beanshell.version>
+    <groovy.version>1.5.6</groovy.version>
     <cactus.version>1.8.1</cactus.version>
     <aspectjrt.version>1.5.3</aspectjrt.version>
     <freemarker.version>2.3.15</freemarker.version>
@@ -55,7 +57,6 @@
     <hibernate.version>3.3.1.GA</hibernate.version>
     <slf4j.version>1.5.2</slf4j.version>
     <hsqldb.version>1.8.0.7</hsqldb.version>
-    <izpack.version>4.2.1</izpack.version>
     <jboss.identity.version>1.0.0.Beta1</jboss.identity.version>
     <jboss.j2ee.version>4.2.2.GA</jboss.j2ee.version>
     <jboss.client.version>5.0.1.GA</jboss.client.version>
@@ -172,12 +173,6 @@
 	      <version>${version}</version>
 	    </dependency>
       <dependency>
-        <groupId>org.eclipse.birt</groupId>
-        <artifactId>report-engine</artifactId>
-        <type>zip</type>
-        <version>${report.engine.version}</version>
-      </dependency>
-      <dependency>
         <groupId>org.jbpm.jbpm4</groupId>
         <artifactId>jbpm-console-reports</artifactId>
         <version>${version}</version>
@@ -187,43 +182,12 @@
 	      <artifactId>jbpm-jboss4</artifactId>
 	      <version>${version}</version>
 	    </dependency>
-
-      <!-- GWT console -->
       <dependency>
-        <groupId>org.jboss.bpm</groupId>
-        <artifactId>gwt-console</artifactId>
-        <version>${gwt.console.version}</version>
-        <classifier>jbpm</classifier>
-	      <type>war</type>
-      </dependency>
-      <dependency>
-        <groupId>org.jboss.bpm</groupId>
-        <artifactId>gwt-console-server</artifactId>
-        <version>${gwt.console.version}</version>
-        <classifier>jbpm</classifier>
-	      <type>war</type>
-      </dependency>
-      <dependency>
-        <groupId>org.jboss.bpm</groupId>
-        <artifactId>gwt-console-server-integration</artifactId>
-        <version>${gwt.console.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.jboss.bpm</groupId>
-        <artifactId>gwt-console-rpc</artifactId>
-        <version>${gwt.console.version}</version>
-        <scope>provided</scope>
-      </dependency>
-
-      <!-- GPD -->
-      <dependency>
         <groupId>org.jbpm.jbpm4</groupId>
         <artifactId>jbpm-gpd</artifactId>
         <type>zip</type>
         <version>${jbpm.gpd.version}</version>
       </dependency>
-
-      <!-- Signavio editor -->
       <dependency>
         <groupId>org.jbpm.jbpm4.dependencies.signavio</groupId>
         <artifactId>jbpmeditor</artifactId>
@@ -239,11 +203,6 @@
 	      <version>${aspectjrt.version}</version>
 	    </dependency>
       <dependency>
-        <groupId>org.apache.ant</groupId>
-        <artifactId>ant</artifactId>
-        <version>${apache.ant.version}</version>
-      </dependency>
-      <dependency>
         <groupId>cactus</groupId>
         <artifactId>cactus.core</artifactId>
         <version>${cactus.version}</version>
@@ -259,67 +218,15 @@
         <version>${cactus.version}</version>
       </dependency>
       <dependency>
-       <groupId>org.freemarker</groupId>
-       <artifactId>freemarker</artifactId>
-       <version>${freemarker.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.hibernate</groupId>
-        <artifactId>hibernate-core</artifactId>
-        <version>${hibernate.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.slf4j</groupId>
-        <artifactId>slf4j-api</artifactId>
-        <version>${slf4j.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.slf4j</groupId>
-        <artifactId>slf4j-jdk14</artifactId>
-        <version>${slf4j.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.jboss.identity.idm</groupId>
-        <artifactId>idm-core</artifactId>
-        <version>${jboss.identity.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.jboss.identity.idm</groupId>
-        <artifactId>idm-hibernate</artifactId>
-        <version>${jboss.identity.version}</version>
-      </dependency>
-      <dependency>
         <groupId>hsqldb</groupId>
         <artifactId>hsqldb</artifactId>
         <version>${hsqldb.version}</version>
       </dependency>
       <dependency>
-        <groupId>izpack</groupId>
-        <artifactId>standalone-compiler</artifactId>
-        <version>${izpack.version}</version>
-      </dependency>
-
-      <!-- AS 5 dependencies -->
-      <dependency>
-        <groupId>org.jboss.javaee</groupId>
-        <artifactId>jboss-javaee</artifactId>
-        <version>${jboss.client.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.jboss.jbossas</groupId>
-        <artifactId>jboss-as-client</artifactId>
-        <version>${jboss.client.version}</version>
-        <type>pom</type>
-      </dependency>
-
-      <!-- enterprise module deepends on j2ee -->
-      <dependency>
         <groupId>jboss</groupId>
         <artifactId>jboss-j2ee</artifactId>
         <version>${jboss.j2ee.version}</version>
       </dependency>
-
-
       <dependency>
         <groupId>juel</groupId>
         <artifactId>juel</artifactId>
@@ -351,16 +258,103 @@
         <version>${log4j.version}</version>
       </dependency>
       <dependency>
+        <groupId>javax.mail</groupId>
+        <artifactId>mail</artifactId>
+        <version>${mail.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.ant</groupId>
+        <artifactId>ant</artifactId>
+        <version>${apache.ant.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.beanshell</groupId>
+        <artifactId>bsh</artifactId>
+        <version>${beanshell.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.groovy</groupId>
+        <artifactId>groovy-all</artifactId>
+        <version>${groovy.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.eclipse.birt</groupId>
+        <artifactId>report-engine</artifactId>
+        <type>zip</type>
+        <version>${report.engine.version}</version>
+      </dependency>
+      <dependency>
+       <groupId>org.freemarker</groupId>
+       <artifactId>freemarker</artifactId>
+       <version>${freemarker.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.hibernate</groupId>
+        <artifactId>hibernate-core</artifactId>
+        <version>${hibernate.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.identity.idm</groupId>
+        <artifactId>idm-core</artifactId>
+        <version>${jboss.identity.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.identity.idm</groupId>
+        <artifactId>idm-hibernate</artifactId>
+        <version>${jboss.identity.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.bpm</groupId>
+        <artifactId>gwt-console</artifactId>
+        <version>${gwt.console.version}</version>
+        <classifier>jbpm</classifier>
+        <type>war</type>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.bpm</groupId>
+        <artifactId>gwt-console-server</artifactId>
+        <version>${gwt.console.version}</version>
+        <classifier>jbpm</classifier>
+        <type>war</type>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.bpm</groupId>
+        <artifactId>gwt-console-server-integration</artifactId>
+        <version>${gwt.console.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.bpm</groupId>
+        <artifactId>gwt-console-rpc</artifactId>
+        <version>${gwt.console.version}</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.javaee</groupId>
+        <artifactId>jboss-javaee</artifactId>
+        <version>${jboss.client.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.jbossas</groupId>
+        <artifactId>jboss-as-client</artifactId>
+        <version>${jboss.client.version}</version>
+        <type>pom</type>
+      </dependency>
+      <dependency>
         <groupId>org.livetribe</groupId>
         <artifactId>livetribe-jsr223</artifactId>
         <version>${jsr233.version}</version>
       </dependency>
       <dependency>
-        <groupId>javax.mail</groupId>
-        <artifactId>mail</artifactId>
-        <version>${mail.version}</version>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-api</artifactId>
+        <version>${slf4j.version}</version>
       </dependency>
       <dependency>
+        <groupId>org.slf4j</groupId>
+        <artifactId>slf4j-jdk14</artifactId>
+        <version>${slf4j.version}</version>
+      </dependency>
+      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring</artifactId>
         <version>${spring.version}</version>



More information about the jbpm-commits mailing list