[jbpm-commits] JBoss JBPM SVN: r5436 - in jbpm4/trunk/modules/bpmn/src: main/java/org/jbpm/bpmn/flownodes and 3 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Aug 6 16:16:13 EDT 2009
Author: kukeltje
Date: 2009-08-06 16:16:12 -0400 (Thu, 06 Aug 2009)
New Revision: 5436
Added:
jbpm4/trunk/modules/bpmn/src/main/resources/jbpm.bpmn.flownodes.xml
Removed:
jbpm4/trunk/modules/bpmn/src/main/java/jbpm.bpmn.flownodes.xml
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/ExclusiveGatewayActivity.java
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayBinding.java
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ParallelGatewayActivity.java
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/StartActivity.java
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/TaskActivity.java
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java
jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java
jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayTest.java
jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ParallelGatewayTest.java
jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/UserTaskTest.java
Log:
Refactoring
Deleted: jbpm4/trunk/modules/bpmn/src/main/java/jbpm.bpmn.flownodes.xml
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/jbpm.bpmn.flownodes.xml 2009-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/main/java/jbpm.bpmn.flownodes.xml 2009-08-06 20:16:12 UTC (rev 5436)
@@ -1,23 +0,0 @@
-<activities>
-
- <!-- -->
- <activity binding="org.jbpm.bpmn.flownodes.StartBinding" />
- <activity binding="org.jbpm.bpmn.flownodes.EndBinding" />
-
- <!-- Gateway bindings -->
- <activity binding="org.jbpm.bpmn.flownodes.ExclusiveGatewayBinding" />
- <activity binding="org.jbpm.bpmn.flownodes.ParallelGatewayBinding" />
-
- <!-- -->
- <activity binding="org.jbpm.bpmn.flownodes.ReceiveBinding" />
-
- <!-- Task bindings -->
- <activity binding="org.jbpm.bpmn.flownodes.ManualTaskBinding" />
- <activity binding="org.jbpm.bpmn.flownodes.ScriptTaskBinding" />
- <activity binding="org.jbpm.bpmn.flownodes.ServiceTaskBinding" />
- <activity binding="org.jbpm.bpmn.flownodes.TaskBinding" />
- <activity binding="org.jbpm.bpmn.flownodes.UserTaskBinding" />
-
-</activities>
-
-
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-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/BpmnActivity.java 2009-08-06 20:16:12 UTC (rev 5436)
@@ -47,132 +47,104 @@
private static final long serialVersionUID = 1L;
- private static final boolean FORK_ALLOWED = true;
- private static final boolean FORK_DISALLOWED = !FORK_ALLOWED;
- private static final boolean CONDITIONS_CHECKED = true;
- private static final boolean CONDITIONS_IGNORED = !CONDITIONS_CHECKED;
-
- //protected String default_;
- protected List<ActivityResource> activvityResources = new ArrayList();
+ protected static final boolean FORK_ALLOWED = true;
+ protected static final boolean FORK_DISALLOWED = !FORK_ALLOWED;
+ protected static final boolean CONDITIONS_CHECKED = true;
+ protected static final boolean CONDITIONS_IGNORED = !CONDITIONS_CHECKED;
- protected void leaveBpmnActivity(ExecutionImpl execution) {
+ // protected String default_;
+ protected List<ActivityResource> activvityResources = new ArrayList();
- proceedForkedIfAllowed(execution, FORK_ALLOWED, CONDITIONS_CHECKED, null);
+// 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);
+//
+// }
- }
-
- protected void leaveBpmnActivitySingle(ExecutionImpl execution, String default_) {
- proceedForkedIfAllowed(execution, FORK_DISALLOWED, CONDITIONS_CHECKED, default_);
-
- }
-
- protected void leaveBpmnActivityAll(ExecutionImpl execution) {
-
- proceedForkedIfAllowed(execution, FORK_ALLOWED, CONDITIONS_IGNORED, null);
-
- }
-
/**
* In BPMN multiple outgoing sequence flows behave like a fork.
*
* Code copied basically from jPDL fork.
*/
- private void proceedForkedIfAllowed(ExecutionImpl execution, boolean forkAllowed, boolean checkConditions, String default_) {
+ protected void proceed(ExecutionImpl execution, List<Transition> transitions) {
log.debug("Proceeding");
+
Activity activity = execution.getActivity();
-
- // evaluate the conditions and find the transitions that should be forked
- List<Transition> forkingTransitions = new ArrayList<Transition>();
- List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
- log.debug("Analyzing "+ outgoingTransitions.size() + " transitions for " + activity.getName());
- for (Transition transition : outgoingTransitions) {
- log.debug("Analyzing "+ transition.getName());
- Condition condition = transition.getCondition();
- //condition.evaluate(execution); log.debug("Evaluated");
- // also ignore the default transition of the exclusive gateway
- if (((condition == null) || (!checkConditions) || (condition.evaluate(execution))) && (!transition.getName().equals(default_))) {
- forkingTransitions.add(transition);
- }
- }
- log.debug(forkingTransitions.size() + " out of " + outgoingTransitions.size() + " selected for " + activity.getName());
// if no outgoing transitions should be forked,
- if (forkingTransitions.size() == 0) {
-
- if (default_ != null) { // take the default if it is there
- for (Transition transition : outgoingTransitions) {
- if (default_.equals(transition.getName())) {
- // take it
- execution.take(transition);
- }
- }
- } else {
- // end this execution
- execution.end();
- }
+ if (transitions.size() == 0) {
+ execution.end();
}
// if there is exactly 1 transition to be taken, just use the incoming
// execution
- else if (forkingTransitions.size() == 1) {
- execution.take(forkingTransitions.get(0));
+ else if (transitions.size() == 1) {
+ execution.take(transitions.get(0));
// if there are more transitions
} else {
- if (forkAllowed) {
- ExecutionImpl concurrentRoot = null;
- if (Execution.STATE_ACTIVE_ROOT.equals(execution.getState())) {
- concurrentRoot = execution;
- execution.setState(Execution.STATE_INACTIVE_CONCURRENT_ROOT);
- execution.setActivity(null);
- } else if (Execution.STATE_ACTIVE_CONCURRENT.equals(execution.getState())) {
- concurrentRoot = execution.getParent();
- }
+ ExecutionImpl concurrentRoot = null;
+ if (Execution.STATE_ACTIVE_ROOT.equals(execution.getState())) {
+ concurrentRoot = execution;
+ execution.setState(Execution.STATE_INACTIVE_CONCURRENT_ROOT);
+ execution.setActivity(null);
+ } else if (Execution.STATE_ACTIVE_CONCURRENT.equals(execution.getState())) {
+ concurrentRoot = execution.getParent();
+ }
- for (Transition transition : forkingTransitions) {
- // launch a concurrent path of execution
- String childExecutionName = transition.getName();
- ExecutionImpl concurrentExecution = concurrentRoot.createExecution(childExecutionName);
- concurrentExecution.setActivity(activity);
- concurrentExecution.setState(Execution.STATE_ACTIVE_CONCURRENT);
- concurrentExecution.take(transition);
+ for (Transition transition : transitions) {
+ // launch a concurrent path of execution
+ String childExecutionName = transition.getName();
+ ExecutionImpl concurrentExecution = concurrentRoot.createExecution(childExecutionName);
+ concurrentExecution.setActivity(activity);
+ concurrentExecution.setState(Execution.STATE_ACTIVE_CONCURRENT);
+ concurrentExecution.take(transition);
- if (concurrentRoot.isEnded()) {
- break;
- }
+ if (concurrentRoot.isEnded()) {
+ break;
}
- } else {
- throw new JbpmException("To many outgoing transition conditions evaluated to true for " + execution.getActivity());
}
}
-
}
- protected List<Transition> findTransitions(ExecutionImpl execution, Activity activity) {
+ 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>();
List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
for (Transition transition : outgoingTransitions) {
Condition condition = transition.getCondition();
- if ((condition == null) || (condition.evaluate(execution))) {
+ // also ignore the default transition of the exclusive gateway
+ if ((condition == null || !checkConditions || condition.evaluate(execution)) && activity.getDefaultOutgoingTransition() != transition) {
forkingTransitions.add(transition);
}
}
+ log.debug(forkingTransitions.size() + " out of " + outgoingTransitions.size() + " selected for " + activity.getName());
return forkingTransitions;
-
}
-
-// public String getDefault_ () {
-// return this.default_;
-// }
-//
-// public void setDefault_ (String default_) {
-// this.default_ = default_;
-// }
-
+
+ // public String getDefault_ () {
+ // return this.default_;
+ // }
+ //
+ // public void setDefault_ (String default_) {
+ // this.default_ = default_;
+ // }
+
public void addActivityResource(ActivityResource activityResource) {
this.activvityResources.add(activityResource);
}
-
-
+
}
\ No newline at end of file
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayActivity.java 2009-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayActivity.java 2009-08-06 20:16:12 UTC (rev 5436)
@@ -25,6 +25,8 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.bpmn.parser.BindingsParser;
+import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.Condition;
import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -38,15 +40,36 @@
String gatewayDirection = "unspecified"; // is the default behaviour
String default_;
-
+
private static final long serialVersionUID = 1L;
+ private static final Log log = Log.getLog(BindingsParser.class.getName());
+
public void execute(ActivityExecution execution) {
execute((ExecutionImpl) execution);
}
public void execute(ExecutionImpl execution) {
- leaveBpmnActivitySingle(execution, default_);
+
+ List<Transition> transitions = findTransitions(execution, CONDITIONS_CHECKED);
+ int numTransitions = transitions.size();
+
+ if (numTransitions == 0) {
+ Transition defaultTransition = execution.getActivity().getDefaultOutgoingTransition();
+ if (defaultTransition != null) {
+ transitions.add(defaultTransition);
+ } else {
+ throw new JbpmException("No sequenceFlow condition evaluated to true for " + execution.getActivity() + " and no default sequenceFlow was speficied");
+ }
+ } else if (numTransitions > 2) {
+ transitions = transitions.subList(0, 0);
+ log.info("More than one outgoing sequenceFlow conditions evaluated to true for " + execution.getActivity() + ", taking the first one ("
+ + transitions.get(0).getName() + ")");
+ }
+
+ // 1 condition evaluated to true...
+ proceed(execution, transitions);
+
}
public String getGatewayDirection() {
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayBinding.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayBinding.java 2009-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayBinding.java 2009-08-06 20:16:12 UTC (rev 5436)
@@ -68,13 +68,7 @@
if (transitionElement.getAttribute("id").equals(default_)) {
defaultExists = true;
- if (ce != null) {
- // conditionExpression on the default sequenceflow SHALL be ignored
- // according to the spec
- log.debug("Default sequenceFlow (" + default_ + ") for '" + elementName
- + "' has conditionExpressio(s). Ignoring them by removing them from the Document model");
- transitionElement.removeChild(ce);
- }
+ // All but the 'default' sequenceFlow need to have a condition
} else if (default_ != null && ce == null) {
parse.addProblem("exclusiveGateway '" + elementName + "' has default sequenceFlow '" + default_ + "' but " + transitionElement.getAttribute("id")
+ " does not have a required conditionExpression", element);
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ParallelGatewayActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ParallelGatewayActivity.java 2009-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ParallelGatewayActivity.java 2009-08-06 20:16:12 UTC (rev 5436)
@@ -69,7 +69,7 @@
public void fork(ExecutionImpl execution) {
- leaveBpmnActivityAll(execution);
+ proceed(execution, findTransitions(execution, CONDITIONS_IGNORED));
}
@@ -81,7 +81,7 @@
if (Execution.STATE_ACTIVE_ROOT.equals(execution.getState())) {
// just pass through
- Transition transition = activity.getDefaultOutgoingTransition();
+ Transition transition = activity.getOutgoingTransitions().get(0);
if (transition==null) {
throw new JbpmException("join must have an outgoing transition");
}
@@ -112,7 +112,7 @@
}
execution.setActivity(activity, outgoingExecution);
- Transition transition = activity.getDefaultOutgoingTransition();
+ Transition transition = activity.getOutgoingTransitions().get(0);
if (transition==null) {
throw new JbpmException("join must have an outgoing transition");
}
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/StartActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/StartActivity.java 2009-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/StartActivity.java 2009-08-06 20:16:12 UTC (rev 5436)
@@ -22,6 +22,7 @@
package org.jbpm.bpmn.flownodes;
import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
public class StartActivity extends BpmnActivity {
@@ -29,5 +30,10 @@
private static final long serialVersionUID = 1L;
public void execute(ActivityExecution execution) {
+ execute((ExecutionImpl) execution);
}
+
+ public void execute(ExecutionImpl execution) {
+ proceed(execution, findTransitions(execution, CONDITIONS_CHECKED));
+ }
}
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/TaskActivity.java 2009-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/TaskActivity.java 2009-08-06 20:16:12 UTC (rev 5436)
@@ -63,7 +63,7 @@
public void execute(ExecutionImpl execution) {
- leaveBpmnActivity(execution);
+ proceed(execution, findTransitions(execution, CONDITIONS_CHECKED));
}
Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java 2009-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java 2009-08-06 20:16:12 UTC (rev 5436)
@@ -126,7 +126,7 @@
task.setSignalling(false);
execution.setVariable("jbpm_outcome", signalName);
- leaveBpmnActivity(execution);
+ proceed(execution, findTransitions(execution, CONDITIONS_CHECKED));
}
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-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java 2009-08-06 20:16:12 UTC (rev 5436)
@@ -30,6 +30,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import org.dom4j.DocumentFactory;
+import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityBehaviour;
import org.jbpm.bpmn.flownodes.BpmnBinding;
import org.jbpm.bpmn.flownodes.ExclusiveGatewayActivity;
@@ -204,7 +205,7 @@
activity.setType(activityBinding.getTagName());
activity.setName(id);
activity.setDescription(name);
-
+ log.debug("Parse Activity: " + name);
ActivityBehaviour activityBehaviour = (ActivityBehaviour) activityBinding.parse(nestedElement, parse, this);
activity.setBehaviour(activityBehaviour);
} finally {
@@ -226,13 +227,26 @@
log.trace(" with " + ((conditionElement == null) ? "0" : "1") + " conditionExpression");
TransitionImpl transition = compositeElement.findActivity(sourceRef).createOutgoingTransition();
-// Activity a = compositeElement.findActivity(sourceRef);
-// if (a.getType().equals("exclusiveGateway")) {
-// if (transitionId.equals(((ExclusiveGatewayActivity) a).getDefault())) {
-// compositeElement.findActivity(sourceRef).setDefaultOutgoingTransition(transition);
-// }
-// }
+
+ try {
+ // If something went wrong parsing the activity, there is no behaviour and an exception is thrown in .getBehaviour()
+ ActivityBehaviour a = compositeElement.findActivity(sourceRef).getBehaviour();
+ if (a instanceof ExclusiveGatewayActivity) {
+ if (transitionId.equals(((ExclusiveGatewayActivity) a).getDefault())) {
+ compositeElement.findActivity(sourceRef).setDefaultOutgoingTransition(transition);
+ }
+ } else {
+ // Other flownodes do not have default sequenceFlows, so set it to null
+ compositeElement.findActivity(sourceRef).setDefaultOutgoingTransition(null);
+ }
+ } catch (JbpmException je) {
+ // catch it and only re-throw if not this specific exception.
+ if (!je.getMessage().contains("no behaviour on")) {
+ throw je;
+ }
+ }
+
// 8.2.5 of the spec document
if (conditionElement != null) {
String type = conditionElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "type");
Added: jbpm4/trunk/modules/bpmn/src/main/resources/jbpm.bpmn.flownodes.xml
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/resources/jbpm.bpmn.flownodes.xml (rev 0)
+++ jbpm4/trunk/modules/bpmn/src/main/resources/jbpm.bpmn.flownodes.xml 2009-08-06 20:16:12 UTC (rev 5436)
@@ -0,0 +1,23 @@
+<activities>
+
+ <!-- -->
+ <activity binding="org.jbpm.bpmn.flownodes.StartBinding" />
+ <activity binding="org.jbpm.bpmn.flownodes.EndBinding" />
+
+ <!-- Gateway bindings -->
+ <activity binding="org.jbpm.bpmn.flownodes.ExclusiveGatewayBinding" />
+ <activity binding="org.jbpm.bpmn.flownodes.ParallelGatewayBinding" />
+
+ <!-- -->
+ <activity binding="org.jbpm.bpmn.flownodes.ReceiveBinding" />
+
+ <!-- Task bindings -->
+ <activity binding="org.jbpm.bpmn.flownodes.ManualTaskBinding" />
+ <activity binding="org.jbpm.bpmn.flownodes.ScriptTaskBinding" />
+ <activity binding="org.jbpm.bpmn.flownodes.ServiceTaskBinding" />
+ <activity binding="org.jbpm.bpmn.flownodes.TaskBinding" />
+ <activity binding="org.jbpm.bpmn.flownodes.UserTaskBinding" />
+
+</activities>
+
+
Modified: jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayTest.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayTest.java 2009-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ExclusiveGatewayTest.java 2009-08-06 20:16:12 UTC (rev 5436)
@@ -110,7 +110,7 @@
try {
Map variables = new HashMap();
- variables.put("test", "other value");
+ variables.put("test", "no value");
ProcessInstance pi = executionService.startProcessInstanceByKey("ExclusiveGateway", variables );
String pid = pi.getId();
Modified: jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ParallelGatewayTest.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ParallelGatewayTest.java 2009-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/ParallelGatewayTest.java 2009-08-06 20:16:12 UTC (rev 5436)
@@ -65,8 +65,6 @@
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());
@@ -105,5 +103,4 @@
assertTextPresent("parallelGateway 'The Fork' has the wrong number of incomming (1) and outgoing (2) transitions for gatewayDirection='converging'", problems.get(0).getMsg());
}
}
-
}
Modified: jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/UserTaskTest.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/UserTaskTest.java 2009-08-06 14:48:06 UTC (rev 5435)
+++ jbpm4/trunk/modules/bpmn/src/test/java/org/jbpm/bpmn/flownodes/UserTaskTest.java 2009-08-06 20:16:12 UTC (rev 5436)
@@ -28,9 +28,8 @@
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.client.ClientProcessInstance;
+//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;
@@ -40,24 +39,24 @@
*/
public class UserTaskTest extends JbpmTestCase {
- static BpmnParser bpmnParser = new BpmnParser();
+// static BpmnParser bpmnParser = new BpmnParser();
+//
+// public void testParsing() {
+// Parse parse = bpmnParser.createParse().setResource("org/jbpm/bpmn/flownodes/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 testParsing() {
- Parse parse = bpmnParser.createParse().setResource("org/jbpm/bpmn/flownodes/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/flownodes/UserTaskSimple.bpmn.xml").deploy();
More information about the jbpm-commits
mailing list