[jbpm-commits] JBoss JBPM SVN: r6253 - in jbpm3/branches/jbpm-3.2-soa/modules: core/src/main/java/org/jbpm/graph/node and 6 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Apr 8 01:44:43 EDT 2010
Author: alex.guizar at jboss.com
Date: 2010-04-08 01:44:42 -0400 (Thu, 08 Apr 2010)
New Revision: 6253
Added:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2834/
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2834/JBPM2834Test.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2834/
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2834/gpd.xml
jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2834/processdefinition.xml
Modified:
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Transition.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/Decision.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/MailNode.java
jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/TaskNode.java
jbpm3/branches/jbpm-3.2-soa/modules/simulation/src/main/java/org/jbpm/sim/jpdl/SimDecision.java
jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/jpdl.xml
Log:
JBPM-2834: amend Node.getDefaultLeavingTransition to return the first transition if there is no unconditional transition;
edit the decision.element section of the jpdl chapter
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2010-04-07 11:39:24 UTC (rev 6252)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Node.java 2010-04-08 05:44:42 UTC (rev 6253)
@@ -282,6 +282,8 @@
Transition transition = (Transition) i.next();
if (transition.getCondition() == null) return transition;
}
+ // there is no unconditional transition, just pick the first one
+ if (!leavingTransitions.isEmpty()) return (Transition) leavingTransitions.get(0);
}
else if (superState != null) {
return superState.getDefaultLeavingTransition();
@@ -406,7 +408,7 @@
// execute the action
executeAction(action, executionContext);
}
- catch (Exception exception) {
+ catch (RuntimeException exception) {
// NOTE that Errors are not caught because that might halt the JVM
// and mask the original Error.
// search for an exception handler or throw to the client
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Transition.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Transition.java 2010-04-07 11:39:24 UTC (rev 6252)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/def/Transition.java 2010-04-08 05:44:42 UTC (rev 6253)
@@ -108,6 +108,18 @@
this.condition = conditionExpression;
}
+ public boolean isConditionEnforced() {
+ return isConditionEnforced;
+ }
+
+ public void setConditionEnforced(boolean conditionEnforced) {
+ isConditionEnforced = conditionEnforced;
+ }
+
+ /**
+ * @deprecated call {@link #setConditionEnforced(boolean)
+ * setConditionEnforced(false)} instead
+ */
public void removeConditionEnforcement() {
isConditionEnforced = false;
}
@@ -118,27 +130,27 @@
* passes execution over this transition.
*/
public void take(ExecutionContext executionContext) {
- // update the runtime context information
- executionContext.getToken().setNode(null);
-
- Token token = executionContext.getToken();
-
if (condition != null && isConditionEnforced) {
Object result = JbpmExpressionEvaluator.evaluate(condition, executionContext);
- if (result == null) {
- throw new JbpmException("condition evaluated to null: " + condition);
+ if (result instanceof Boolean) {
+ Boolean go = (Boolean) result;
+ if (!go.booleanValue()) {
+ throw new JbpmException("condition '" + condition + "' guarding " + this + " not met");
+ }
}
- else if (!(result instanceof Boolean)) {
- throw new JbpmException("condition result is not boolean: " + condition);
+ else {
+ throw new JbpmException("expected boolean result from condition '" + condition
+ + "' guarding " + this + ", but was " + result);
}
- else if (((Boolean) result).booleanValue() == false) {
- throw new JbpmException("condition is false: " + condition);
- }
}
+ // update the runtime context information
+ Token token = executionContext.getToken();
+ token.setNode(null);
+
// start the transition log
- TransitionLog transitionLog = new TransitionLog(this, executionContext
- .getTransitionSource());
+ TransitionLog transitionLog = new TransitionLog(this,
+ executionContext.getTransitionSource());
token.startCompositeLog(transitionLog);
try {
// fire leave events for superstates (if any)
@@ -180,8 +192,7 @@
// reverse order so that events fire from outer to inner superstates
Collections.reverse(leavingSuperStates);
// fire a superstate-enter event for all superstates being left
- fireSuperStateEvents(leavingSuperStates, Event.EVENTTYPE_SUPERSTATE_ENTER,
- executionContext);
+ fireSuperStateEvents(leavingSuperStates, Event.EVENTTYPE_SUPERSTATE_ENTER, executionContext);
}
return destination;
@@ -191,11 +202,9 @@
// optimisation: check if there is a candidate superstate to be left
if (executionContext.getTransitionSource().getSuperState() != null) {
// collect all the superstates being left
- List leavingSuperStates = collectAllSuperStates(executionContext.getTransitionSource(),
- to);
+ List leavingSuperStates = collectAllSuperStates(executionContext.getTransitionSource(), to);
// fire a node-leave event for all superstates being left
- fireSuperStateEvents(leavingSuperStates, Event.EVENTTYPE_SUPERSTATE_LEAVE,
- executionContext);
+ fireSuperStateEvents(leavingSuperStates, Event.EVENTTYPE_SUPERSTATE_LEAVE, executionContext);
}
}
@@ -255,8 +264,8 @@
public void setName(String name) {
if (from != null) {
if (from.hasLeavingTransition(name)) {
- throw new IllegalArgumentException("cannot rename " + this
- + " because " + from + " already has a transition named " + name);
+ throw new IllegalArgumentException("cannot rename " + this + " because " + from
+ + " already has a transition named " + name);
}
Map fromLeavingTransitions = from.getLeavingTransitionsMap();
fromLeavingTransitions.put(name, this);
@@ -268,10 +277,8 @@
if (from != null && to != null) {
if (from.equals(to)) return from.getParent();
- for (GraphElement fromParent = from; fromParent != null; fromParent =
- fromParent.getParent()) {
- for (GraphElement toParent = to; toParent != null; toParent =
- toParent.getParent()) {
+ for (GraphElement fromParent = from; fromParent != null; fromParent = fromParent.getParent()) {
+ for (GraphElement toParent = to; toParent != null; toParent = toParent.getParent()) {
if (fromParent.equals(toParent)) return fromParent;
}
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/Decision.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/Decision.java 2010-04-07 11:39:24 UTC (rev 6252)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/Decision.java 2010-04-08 05:44:42 UTC (rev 6253)
@@ -72,13 +72,20 @@
}
}
+ public Transition addLeavingTransition(Transition leavingTransition) {
+ // since the decision node evaluates transition conditions,
+ // the condition of the leaving transition will always be met.
+ // hence the condition enforcement can be disabled safely
+ leavingTransition.setConditionEnforced(false);
+ return super.addLeavingTransition(leavingTransition);
+ }
+
public void execute(ExecutionContext executionContext) {
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
// set context class loader correctly for delegation class
// https://jira.jboss.org/jira/browse/JBPM-1448
- ClassLoader processClassLoader = JbpmConfiguration.getProcessClassLoader(executionContext
- .getProcessDefinition());
+ ClassLoader processClassLoader = JbpmConfiguration.getProcessClassLoader(executionContext.getProcessDefinition());
Thread.currentThread().setContextClassLoader(processClassLoader);
Transition transition = null;
@@ -92,8 +99,7 @@
}
}
else if (decisionExpression != null) {
- Object result = JbpmExpressionEvaluator
- .evaluate(decisionExpression, executionContext);
+ Object result = JbpmExpressionEvaluator.evaluate(decisionExpression, executionContext);
if (result == null) {
throw new JbpmException("expression evaluated to null: " + decisionExpression);
}
@@ -116,10 +122,7 @@
String transitionName = decisionCondition.getTransitionName();
// select transition by name
transition = getLeavingTransition(transitionName);
- if (transition != null) {
- transition.removeConditionEnforcement();
- break;
- }
+ if (transition != null) break;
}
}
}
@@ -152,12 +155,6 @@
if (transition == null) throw new JbpmException(this + " has no default transition");
}
- // since the decision node evaluates transition conditions,
- // the condition of the taken transition will always be met.
- // therefore we can safely turn off the standard condition enforcement
- // in the transitions after a decision node.
- transition.removeConditionEnforcement();
-
log.debug(executionContext.getToken() + " leaves " + this + " over " + transition);
executionContext.leaveNode(transition);
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/MailNode.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/MailNode.java 2010-04-07 11:39:24 UTC (rev 6252)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/MailNode.java 2010-04-08 05:44:42 UTC (rev 6253)
@@ -1,7 +1,6 @@
package org.jbpm.graph.node;
import org.dom4j.Element;
-import org.jbpm.JbpmException;
import org.jbpm.graph.def.Action;
import org.jbpm.graph.def.Node;
import org.jbpm.graph.exe.ExecutionContext;
@@ -26,14 +25,16 @@
public void execute(ExecutionContext executionContext) {
try {
+ // execute mail action
executeAction(action, executionContext);
- } catch (JbpmException e) {
- throw e;
- } catch (Exception e) {
- throw new JbpmException("couldn't send email", e);
}
+ catch (RuntimeException exception) {
+ // NOTE that Errors are not caught because that might halt the JVM
+ // and mask the original Error.
+ // search for an exception handler or throw to the client
+ raiseException(exception, executionContext);
+ }
leave(executionContext);
}
-
-
+
}
Modified: jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/TaskNode.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/TaskNode.java 2010-04-07 11:39:24 UTC (rev 6252)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/main/java/org/jbpm/graph/node/TaskNode.java 2010-04-08 05:44:42 UTC (rev 6253)
@@ -82,46 +82,30 @@
public static final int SIGNAL_LAST_WAIT = 5;
public static int parseSignal(String text) {
- if ("unsynchronized".equalsIgnoreCase(text)) {
- return SIGNAL_UNSYNCHRONIZED;
- }
- else if ("never".equalsIgnoreCase(text)) {
- return SIGNAL_NEVER;
- }
- else if ("first".equalsIgnoreCase(text)) {
- return SIGNAL_FIRST;
- }
- else if ("first-wait".equalsIgnoreCase(text)) {
- return SIGNAL_FIRST_WAIT;
- }
- else if ("last-wait".equalsIgnoreCase(text)) {
- return SIGNAL_LAST_WAIT;
- }
- else { // return default
- return SIGNAL_LAST;
- }
+ if ("unsynchronized".equalsIgnoreCase(text)) return SIGNAL_UNSYNCHRONIZED;
+ if ("never".equalsIgnoreCase(text)) return SIGNAL_NEVER;
+ if ("first".equalsIgnoreCase(text)) return SIGNAL_FIRST;
+ if ("first-wait".equalsIgnoreCase(text)) return SIGNAL_FIRST_WAIT;
+ if ("last-wait".equalsIgnoreCase(text)) return SIGNAL_LAST_WAIT;
+ // default value
+ return SIGNAL_LAST;
}
public static String signalToString(int signal) {
- if (signal == SIGNAL_UNSYNCHRONIZED) {
+ switch (signal) {
+ case SIGNAL_UNSYNCHRONIZED:
return "unsynchronized";
- }
- else if (signal == SIGNAL_NEVER) {
+ case SIGNAL_NEVER:
return "never";
- }
- else if (signal == SIGNAL_FIRST) {
+ case SIGNAL_FIRST:
return "first";
- }
- else if (signal == SIGNAL_FIRST_WAIT) {
+ case SIGNAL_FIRST_WAIT:
return "first-wait";
- }
- else if (signal == SIGNAL_LAST) {
+ case SIGNAL_LAST:
return "last";
- }
- else if (signal == SIGNAL_LAST_WAIT) {
+ case SIGNAL_LAST_WAIT:
return "last-wait";
- }
- else {
+ default:
return null;
}
}
@@ -171,7 +155,6 @@
// ///////////////////////////////////////////////////////////////////////////
public void execute(ExecutionContext executionContext) {
-
TaskMgmtInstance tmi = getTaskMgmtInstance(executionContext.getToken());
// if this tasknode should create instances
@@ -199,9 +182,7 @@
continueExecution = false;
}
- if (continueExecution) {
- leave(executionContext);
- }
+ if (continueExecution) leave(executionContext);
}
private boolean evaluateTaskCondition(String condition, ExecutionContext executionContext) {
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2834/JBPM2834Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2834/JBPM2834Test.java (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2834/JBPM2834Test.java 2010-04-08 05:44:42 UTC (rev 6253)
@@ -0,0 +1,62 @@
+/*
+ * 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.jbpm2834;
+
+import org.jbpm.AbstractJbpmTestCase;
+import org.jbpm.JbpmException;
+import org.jbpm.graph.def.Node;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.node.State;
+
+/**
+ * {@link Node#getDefaultLeavingTransition()} returns <code>null</code> when
+ * there is no unconditional transition.
+ *
+ * @see <a href="https://jira.jboss.org/jira/browse/JBPM-2834">JBPM-2834</a>
+ * @author Alejandro Guizar
+ */
+public class JBPM2834Test extends AbstractJbpmTestCase {
+
+ public void testConditionalDefaultLeavingTransition() {
+ // parse definition
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("org/jbpm/jbpm2834/processdefinition.xml");
+ // start instance
+ ProcessInstance processInstance = new ProcessInstance(processDefinition);
+ processInstance.signal();
+ // check default leaving transition
+ State state = (State) processInstance.getRootToken().getNode();
+ assertEquals("default", state.getDefaultLeavingTransition().getName());
+ // check condition is still enforced
+ try {
+ processInstance.signal();
+ fail("expected condition to be enforced");
+ }
+ catch (JbpmException e) {
+ assert e.getMessage().indexOf("condition") != -1 : e;
+ }
+ // satisfy condition
+ processInstance.getContextInstance().setVariable("go", Boolean.TRUE);
+ processInstance.signal();
+ assert processInstance.hasEnded() : "expected " + processInstance + " to have ended";
+ }
+}
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/java/org/jbpm/jbpm2834/JBPM2834Test.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2834/gpd.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2834/gpd.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2834/gpd.xml 2010-04-08 05:44:42 UTC (rev 6253)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<root-container name="jbpm2834" width="884" height="567">
+ <node name="start" x="24" y="24" width="121" height="37">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="state1" x="24" y="96" width="121" height="37">
+ <edge>
+ <label x="5" y="-10"/>
+ </edge>
+ </node>
+ <node name="end1" x="24" y="168" width="121" height="37"/>
+ <deployment serverName="" serverPort="" serverDeployer="">
+ <classesAndResources/>
+ <filesAndFolders>
+ <element value="/jbpm-jpdl/src/test/resources/org/jbpm/jbpm2834/gpd.xml"/>
+ <element value="/jbpm-jpdl/src/test/resources/org/jbpm/jbpm2834/processdefinition.xml"/>
+ </filesAndFolders>
+ </deployment>
+</root-container>
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2834/gpd.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Added: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2834/processdefinition.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2834/processdefinition.xml (rev 0)
+++ jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2834/processdefinition.xml 2010-04-08 05:44:42 UTC (rev 6253)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="jbpm2834">
+ <start-state name="start">
+ <transition to="state1" />
+ </start-state>
+
+ <state name="state1">
+ <transition to="end1" name="default">
+ <condition expression="${go}"></condition>
+ </transition>
+ </state>
+
+ <end-state name="end1" />
+</process-definition>
\ No newline at end of file
Property changes on: jbpm3/branches/jbpm-3.2-soa/modules/core/src/test/resources/org/jbpm/jbpm2834/processdefinition.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ native
Modified: jbpm3/branches/jbpm-3.2-soa/modules/simulation/src/main/java/org/jbpm/sim/jpdl/SimDecision.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/simulation/src/main/java/org/jbpm/sim/jpdl/SimDecision.java 2010-04-07 11:39:24 UTC (rev 6252)
+++ jbpm3/branches/jbpm-3.2-soa/modules/simulation/src/main/java/org/jbpm/sim/jpdl/SimDecision.java 2010-04-08 05:44:42 UTC (rev 6253)
@@ -2,32 +2,28 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.jbpm.graph.def.Transition;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.node.Decision;
import org.jbpm.sim.def.JbpmSimulationModel;
public class SimDecision extends Decision {
-
+
private static final long serialVersionUID = 1L;
- private static Log log = LogFactory.getLog(SimDecision.class);
+ private static final Log log = LogFactory.getLog(SimDecision.class);
public void execute(ExecutionContext executionContext) {
- SimulationInstance simulationInstance = (SimulationInstance)executionContext.getProcessInstance().getInstance(SimulationInstance.class);
+ SimulationInstance simulationInstance = (SimulationInstance) executionContext.getProcessInstance()
+ .getInstance(SimulationInstance.class);
JbpmSimulationModel simulationModel = simulationInstance.getSimulationModel();
-
+
// if we have probabilities configured for the leaving transitions
// don't execute the decision, but let the simulation framework decide
- if (simulationModel.hasLeavingTransitionProbabilitiesConfigured(executionContext.getNode())) {
-
- Transition transition = simulationModel.getLeavingTransition(executionContext.getNode());
+ if (simulationModel.hasLeavingTransitionProbabilitiesConfigured(this)) {
+ Transition transition = simulationModel.getLeavingTransition(this);
- // since the decision node evaluates condition expressions, the condition of the
- // taken transition will always be met. therefore we can safely turn off the
- // standard condition enforcement in the transitions after a decision node.
- transition.removeConditionEnforcement();
-
- log.debug("simulation made " + this + " to take '" + transition + "'");
+ log.debug(executionContext.getToken() + " leaves " + this + " over " + transition);
executionContext.leaveNode(transition);
}
else {
Modified: jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/jpdl.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/jpdl.xml 2010-04-07 11:39:24 UTC (rev 6252)
+++ jbpm3/branches/jbpm-3.2-soa/modules/userguide/src/main/docbook/en/modules/jpdl.xml 2010-04-08 05:44:42 UTC (rev 6253)
@@ -370,11 +370,17 @@
is valid, but cannot be executed.</entry>
</row>
<row>
- <entry>{<link linkend="endstate.element">end-state</link>|<link linkend="state.element">state</link>|<link linkend="node.element">node</link>|<link linkend="tasknode.element">task-node</link>|<link linkend="processstate.element">process-state</link>|<link linkend="superstate.element">super-state</link>|<link linkend="fork.element">fork</link>|<link linkend="join.element">join</link>|<link linkend="decision.element">decision</link>}</entry>
+ <entry>{<link linkend="endstate.element">end-state</link>|
+ <link linkend="state.element">state</link>|<link linkend="node.element">node</link>|
+ <link linkend="tasknode.element">task-node</link>|
+ <link linkend="processstate.element">process-state</link>|
+ <link linkend="superstate.element">super-state</link>|
+ <link linkend="fork.element">fork</link>|<link linkend="join.element">join</link>|
+ <link linkend="decision.element">decision</link>}</entry>
<entry>element</entry>
<entry>[0..*]</entry>
- <entry>the nodes of the process definition. Note that a process without nodes is valid, but
- cannot be executed.</entry>
+ <entry>the nodes of the process definition. Note that a process without nodes is valid,
+ but cannot be executed.</entry>
</row>
<row>
<entry><link linkend="event.element">event</link></entry>
@@ -383,11 +389,14 @@
<entry>the process events that serve as a container for actions</entry>
</row>
<row>
- <entry>{<link linkend="action.element">action</link>|<link linkend="script.element">script</link>|<link linkend="create.timer.element">create-timer</link>|<link linkend="cancel.timer.element">cancel-timer</link>}</entry>
+ <entry>{<link linkend="action.element">action</link>|
+ <link linkend="script.element">script</link>|
+ <link linkend="create.timer.element">create-timer</link>|
+ <link linkend="cancel.timer.element">cancel-timer</link>}</entry>
<entry>element</entry>
<entry>[0..*]</entry>
- <entry>global defined actions that can be referenced from events and transitions. Note that
- these actions must specify a name in order to be referenced.</entry>
+ <entry>global defined actions that can be referenced from events and transitions.
+ Notice these actions must specify a name in order to be referenced.</entry>
</row>
<row>
<entry><link linkend="task.element">task</link></entry>
@@ -423,7 +432,10 @@
</thead>
<tbody>
<row>
- <entry>{<link linkend="action.element">action</link>|<link linkend="script.element">script</link>|<link linkend="create.timer.element">create-timer</link>|<link linkend="cancel.timer.element">cancel-timer</link>}</entry>
+ <entry>{<link linkend="action.element">action</link>|
+ <link linkend="script.element">script</link>|
+ <link linkend="create.timer.element">create-timer</link>|
+ <link linkend="cancel.timer.element">cancel-timer</link>}</entry>
<entry>element</entry>
<entry>1</entry>
<entry>a custom action that represents the behaviour for this node</entry>
@@ -750,7 +762,15 @@
</thead>
<tbody>
<row>
- <entry>{<link linkend="endstate.element">end-state</link>|<link linkend="state.element">state</link>|<link linkend="node.element">node</link>|<link linkend="tasknode.element">task-node</link>|<link linkend="processstate.element">process-state</link>|<link linkend="superstate.element">super-state</link>|<link linkend="fork.element">fork</link>|<link linkend="join.element">join</link>|<link linkend="decision.element">decision</link>}</entry>
+ <entry>{<link linkend="endstate.element">end-state</link>|
+ <link linkend="state.element">state</link>|
+ <link linkend="node.element">node</link>|
+ <link linkend="tasknode.element">task-node</link>|
+ <link linkend="processstate.element">process-state</link>|
+ <link linkend="superstate.element">super-state</link>|
+ <link linkend="fork.element">fork</link>|
+ <link linkend="join.element">join</link>|
+ <link linkend="decision.element">decision</link>}</entry>
<entry>element</entry>
<entry>[0..*]</entry>
<entry>the nodes of the superstate. superstates can be nested.</entry>
@@ -836,26 +856,21 @@
<row>
<entry><link linkend="handler.element">handler</link></entry>
<entry>element</entry>
- <entry>either a 'handler' element or conditions on the transitions should be specified</entry>
- <entry>the name of a <literal>org.jbpm.jpdl.Def.DecisionHandler</literal> implementation</entry>
+ <entry>required, unless conditions are placed in the leaving transitions</entry>
+ <entry>the fully qualified name of a class that implements the
+ <literal>org.jbpm.graph.node.DecisionHandler</literal> interface</entry>
</row>
<row>
<entry>transition conditions</entry>
- <entry>attribute or element text on the transitions leaving a decision</entry>
+ <entry>'condition' attribute or element in each child 'transition' element</entry>
<entry></entry>
- <entry>the leaving transitions. Each leaving transitions of a
- node can have a condition. The decision will use these conditions to look
- for the first transition for which the condition evaluates to true.
- The first transition represents the otherwise branch. So first, all
- transitions with a condition are evaluated. If one of those evaluate to true,
- that transition is taken. If no transition with a condition resolves to true,
- the default transition (=the first one) is taken.
- <!-- OOPS i wich this were true, but i think i never implemented it that way :-(
- A transition without a condition is considered to evaluate to true
- (to model the 'otherwise' branch).
- -->
- See
- <link linkend="condition.element">the condition element</link>
+ <entry>Every transition may have a guard condition. The decision node
+ examines the leaving transitions having a condition, and selects the first
+ transition whose condition is true. In case no condition is met, the
+ <emphasis>default</emphasis> transition is taken. The default transition is
+ the first unconditional transition if there is one, or else the first
+ conditional transition. Transitions are considered in document order.
+ See <link linkend="condition.element">the condition element</link>
</entry>
</row>
<row>
More information about the jbpm-commits
mailing list