[jbpm-commits] JBoss JBPM SVN: r3339 - in jbpm3/trunk: modules/core/src/main/java/org/jbpm/graph/def and 2 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Dec 11 08:48:36 EST 2008
Author: thomas.diesler at jboss.com
Date: 2008-12-11 08:48:36 -0500 (Thu, 11 Dec 2008)
New Revision: 3339
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Transition.java
jbpm3/trunk/modules/enterprise/pom.xml
jbpm3/trunk/modules/integration/deploy.sh
jbpm3/trunk/pom.xml
Log:
Skip enterprise tests on no-jboss-bind-address
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Transition.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Transition.java 2008-12-11 12:14:24 UTC (rev 3338)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Transition.java 2008-12-11 13:48:36 UTC (rev 3339)
@@ -33,10 +33,10 @@
import org.jbpm.graph.log.TransitionLog;
import org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator;
-public class Transition extends GraphElement {
+public class Transition extends GraphElement
+{
+ private static final long serialVersionUID = 1L;
- private static final long serialVersionUID = 1L;
-
protected Node from = null;
protected Node to = null;
protected String condition = null;
@@ -44,128 +44,148 @@
// event types //////////////////////////////////////////////////////////////
- public static final String[] supportedEventTypes = new String[]{Event.EVENTTYPE_TRANSITION};
- public String[] getSupportedEventTypes() {
+ public static final String[] supportedEventTypes = new String[] { Event.EVENTTYPE_TRANSITION };
+
+ public String[] getSupportedEventTypes()
+ {
return supportedEventTypes;
}
// constructors /////////////////////////////////////////////////////////////
-
- public Transition() {
+
+ public Transition()
+ {
}
- public Transition(String name) {
+ public Transition(String name)
+ {
super(name);
}
// from /////////////////////////////////////////////////////////////////////
-
- public Node getFrom() {
+
+ public Node getFrom()
+ {
return from;
}
- /**
- * sets the from node unidirectionally. use {@link Node#addLeavingTransition(Transition)}
- * to get bidirectional relations mgmt.
+ /*
+ * sets the from node unidirectionally. use {@link Node#addLeavingTransition(Transition)} to get bidirectional relations mgmt.
*/
- public void setFrom(Node from) {
+ public void setFrom(Node from)
+ {
this.from = from;
}
// to ///////////////////////////////////////////////////////////////////////
-
- /**
- * sets the to node unidirectionally. use {@link Node#addArrivingTransition(Transition)}
- * to get bidirectional relations mgmt.
+
+ /*
+ * sets the to node unidirectionally. use {@link Node#addArrivingTransition(Transition)} to get bidirectional relations mgmt.
*/
- public void setTo(Node to) {
+ public void setTo(Node to)
+ {
this.to = to;
}
- public Node getTo() {
+ public Node getTo()
+ {
return to;
}
-
- /**
+
+ /*
* the condition expresssion for this transition.
*/
- public String getCondition() {
+ public String getCondition()
+ {
return condition;
}
- public void setCondition(String conditionExpression) {
+ public void setCondition(String conditionExpression)
+ {
this.condition = conditionExpression;
}
- public void removeConditionEnforcement() {
+ public void removeConditionEnforcement()
+ {
isConditionEnforced = false;
}
// behaviour ////////////////////////////////////////////////////////////////
-
- /**
+ /*
* passes execution over this transition.
*/
- public void take(ExecutionContext executionContext) {
- // update the runtime context information
+ public void take(ExecutionContext executionContext)
+ {
+ // update the runtime context information
executionContext.getToken().setNode(null);
-
+
Token token = executionContext.getToken();
-
- if ( (condition!=null)
- && (isConditionEnforced)
- ) {
+
+ if ((condition != null) && (isConditionEnforced))
+ {
Object result = JbpmExpressionEvaluator.evaluate(condition, executionContext);
- if (result==null) {
- throw new JbpmException("transition condition "+condition+" evaluated to null");
- } else if ( ! (result instanceof Boolean)) {
- throw new JbpmException("transition condition "+condition+" evaluated to non-boolean: "+result.getClass().getName());
- } else if ( !((Boolean)result).booleanValue()) {
- throw new JbpmException("transition condition "+condition+" evaluated to 'false'");
+ if (result == null)
+ {
+ throw new JbpmException("transition condition " + condition + " evaluated to null");
}
+ else if (!(result instanceof Boolean))
+ {
+ throw new JbpmException("transition condition " + condition + " evaluated to non-boolean: " + result.getClass().getName());
+ }
+ else if (!((Boolean)result).booleanValue())
+ {
+ throw new JbpmException("transition condition " + condition + " evaluated to 'false'");
+ }
}
-
+
// start the transition log
TransitionLog transitionLog = new TransitionLog(this, executionContext.getTransitionSource());
token.startCompositeLog(transitionLog);
- try {
-
+ try
+ {
+
// fire leave events for superstates (if any)
fireSuperStateLeaveEvents(executionContext);
-
+
// fire the transition event (if any)
fireEvent(Event.EVENTTYPE_TRANSITION, executionContext);
-
+
// fire enter events for superstates (if any)
Node destination = fireSuperStateEnterEvents(executionContext);
- // update the ultimate destinationNode of this transition
+ // update the ultimate destinationNode of this transition
transitionLog.setDestinationNode(destination);
-
- } finally {
+
+ }
+ finally
+ {
// end the transition log
token.endCompositeLog();
}
-
+
// pass the token to the destinationNode node
to.enter(executionContext);
}
- Node fireSuperStateEnterEvents(ExecutionContext executionContext) {
+ Node fireSuperStateEnterEvents(ExecutionContext executionContext)
+ {
// calculate the actual destinationNode node
Node destination = to;
- while (destination != null && destination.isSuperStateNode()) {
+ while (destination != null && destination.isSuperStateNode())
+ {
List nodes = destination.getNodes();
- destination = nodes != null && !nodes.isEmpty() ? (Node) nodes.get(0) : null;
+ destination = nodes != null && !nodes.isEmpty() ? (Node)nodes.get(0) : null;
}
-
- if (destination==null) {
- String transitionName = (name!=null ? "'"+name+"'" : "in node '"+from+"'");
- throw new JbpmException("transition "+transitionName+" doesn't have destination. check your processdefinition.xml");
+
+ if (destination == null)
+ {
+ String transitionName = (name != null ? "'" + name + "'" : "in node '" + from + "'");
+ throw new JbpmException("transition " + transitionName + " doesn't have destination. check your processdefinition.xml");
}
// performance optimisation: check if at least there is a candidate superstate to be entered.
- if ( destination.getSuperState()!=null ) {
+ if (destination.getSuperState() != null)
+ {
// collect all the superstates being left
List leavingSuperStates = collectAllSuperStates(destination, from);
// reverse the order so that events are fired from outer to inner superstates
@@ -173,13 +193,15 @@
// fire a superstate-enter event for all superstates being left
fireSuperStateEvents(leavingSuperStates, Event.EVENTTYPE_SUPERSTATE_ENTER, executionContext);
}
-
+
return destination;
}
- void fireSuperStateLeaveEvents(ExecutionContext executionContext) {
+ void fireSuperStateLeaveEvents(ExecutionContext executionContext)
+ {
// performance optimisation: check if at least there is a candidate superstate to be left.
- if (executionContext.getTransitionSource().getSuperState()!=null) {
+ if (executionContext.getTransitionSource().getSuperState() != null)
+ {
// collect all the superstates being left
List leavingSuperStates = collectAllSuperStates(executionContext.getTransitionSource(), to);
// fire a node-leave event for all superstates being left
@@ -187,65 +209,83 @@
}
}
- /**
+ /*
* collect all superstates of a that do not contain node b.
*/
- static List collectAllSuperStates(Node a, Node b) {
+ static List collectAllSuperStates(Node a, Node b)
+ {
SuperState superState = a.getSuperState();
List leavingSuperStates = new ArrayList();
- while (superState!=null) {
- if (!superState.containsNode(b)) {
+ while (superState != null)
+ {
+ if (!superState.containsNode(b))
+ {
leavingSuperStates.add(superState);
superState = superState.getSuperState();
- } else {
+ }
+ else
+ {
superState = null;
}
}
return leavingSuperStates;
}
- /**
+ /*
* fires the give event on all the superstates in the list.
*/
- void fireSuperStateEvents(List superStates, String eventType, ExecutionContext executionContext) {
+ void fireSuperStateEvents(List superStates, String eventType, ExecutionContext executionContext)
+ {
Iterator iter = superStates.iterator();
- while (iter.hasNext()) {
- SuperState leavingSuperState = (SuperState) iter.next();
+ while (iter.hasNext())
+ {
+ SuperState leavingSuperState = (SuperState)iter.next();
leavingSuperState.fireEvent(eventType, executionContext);
}
}
// other
- /////////////////////////////////////////////////////////////////////////////
-
- public void setName(String name) {
- if (from!=null) {
- if ( from.hasLeavingTransition(name) ) {
- throw new IllegalArgumentException("couldn't set name '"+name+"' on transition '"+this+"'cause the from-node of this transition has already another leaving transition with the same name");
+ // ///////////////////////////////////////////////////////////////////////////
+
+ public void setName(String name)
+ {
+ if (from != null)
+ {
+ if (from.hasLeavingTransition(name))
+ {
+ throw new IllegalArgumentException("couldn't set name '" + name + "' on transition '" + this
+ + "'cause the from-node of this transition has already another leaving transition with the same name");
}
Map fromLeavingTransitions = from.getLeavingTransitionsMap();
fromLeavingTransitions.remove(this.name);
- fromLeavingTransitions.put(name,this);
+ fromLeavingTransitions.put(name, this);
}
this.name = name;
}
- public GraphElement getParent() {
+ public GraphElement getParent()
+ {
GraphElement parent = null;
- if ( (from!=null)
- && (to!=null) ) {
- if (from.equals(to)) {
+ if ((from != null) && (to != null))
+ {
+ if (from.equals(to))
+ {
parent = from.getParent();
- } else {
+ }
+ else
+ {
List fromParentChain = from.getParentChain();
List toParentChain = to.getParentChain();
Iterator fromIter = fromParentChain.iterator();
- while ( fromIter.hasNext() && (parent==null) ) {
- GraphElement fromParent = (GraphElement) fromIter.next();
+ while (fromIter.hasNext() && (parent == null))
+ {
+ GraphElement fromParent = (GraphElement)fromIter.next();
Iterator toIter = toParentChain.iterator();
- while ( toIter.hasNext() && (parent==null) ) {
- GraphElement toParent = (GraphElement) toIter.next();
- if (fromParent==toParent) {
+ while (toIter.hasNext() && (parent == null))
+ {
+ GraphElement toParent = (GraphElement)toIter.next();
+ if (fromParent == toParent)
+ {
parent = fromParent;
}
}
Modified: jbpm3/trunk/modules/enterprise/pom.xml
===================================================================
--- jbpm3/trunk/modules/enterprise/pom.xml 2008-12-11 12:14:24 UTC (rev 3338)
+++ jbpm3/trunk/modules/enterprise/pom.xml 2008-12-11 13:48:36 UTC (rev 3339)
@@ -191,32 +191,15 @@
<!-- Profiles -->
<profiles>
- <!--
- Name: no-jboss-bind-address
- Descr: Set the default jboss.bind.address command line cannot overwrite pom properties
- http://jira.codehaus.org/browse/MNG-3546
- -->
- <profile>
- <id>no-jboss-bind-address</id>
- <activation>
- <property>
- <name>!jboss.bind.address</name>
- </property>
- </activation>
- <properties>
- <jboss.bind.address>localhost</jboss.bind.address>
- </properties>
- </profile>
-
<!--
- Name: no-jbpm-target-container
+ Name: no-database
Descr: Setup the default database
-->
<profile>
- <id>no-jbpm-target-container</id>
+ <id>no-database</id>
<activation>
<property>
- <name>!jbpm.target.container</name>
+ <name>!database</name>
</property>
</activation>
<build>
@@ -224,31 +207,27 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <systemProperties>
- <property>
- <name>jbpm.target.container</name>
- <value>jboss422</value>
- </property>
- <property>
- <name>log4j.output.dir</name>
- <value>${basedir}/target</value>
- </property>
- </systemProperties>
+ <excludes>
+ <!-- [JBPM-1708] Enterprise EjbSchedulerTest fails -->
+ <exclude>org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java</exclude>
+ <!-- [JBPM-1811] JmsMessageTest fails intermitently on HSQLDB -->
+ <exclude>org/jbpm/enterprise/jms/JmsMessageTest.java</exclude>
+ </excludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
- <!--
- Name: no-database
- Descr: Setup the default database
+ <!--
+ Name: no-jboss-bind-address
+ Descr: Skip tests if no jboss.bind address is given
-->
<profile>
- <id>no-database</id>
+ <id>no-jboss-bind-address</id>
<activation>
<property>
- <name>!database</name>
+ <name>!jboss.bind.address</name>
</property>
</activation>
<build>
@@ -256,18 +235,13 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <excludes>
- <!-- [JBPM-1708] Enterprise EjbSchedulerTest fails -->
- <exclude>org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java</exclude>
- <!-- [JBPM-1811] JmsMessageTest fails intermitently on HSQLDB -->
- <exclude>org/jbpm/enterprise/jms/JmsMessageTest.java</exclude>
- </excludes>
+ <skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</profile>
-
+
<!--
Name: hsqldb
Descr: Hypersonic Database Setup
Modified: jbpm3/trunk/modules/integration/deploy.sh
===================================================================
--- jbpm3/trunk/modules/integration/deploy.sh 2008-12-11 12:14:24 UTC (rev 3338)
+++ jbpm3/trunk/modules/integration/deploy.sh 2008-12-11 13:48:36 UTC (rev 3339)
@@ -2,5 +2,5 @@
mvn -o install
-rm $JBOSS422/server/default/deploy/jbpm/jbpm-integration.beans/bpm-spec-integration-jbpm3*.jar
+rm $JBOSS422/server/default/deploy/jbpm/jbpm-integration.beans/jbpm-integration-spec*.jar
cp target/bpm-spec-integration-jbpm3-3.3.1-SNAPSHOT.jar $JBOSS422/server/default/deploy/jbpm/jbpm-integration.beans
Modified: jbpm3/trunk/pom.xml
===================================================================
--- jbpm3/trunk/pom.xml 2008-12-11 12:14:24 UTC (rev 3338)
+++ jbpm3/trunk/pom.xml 2008-12-11 13:48:36 UTC (rev 3339)
@@ -447,15 +447,7 @@
</plugins>
</build>
- <!-- DistributionManagement -->
- <distributionManagement>
- <site>
- <id>jbws.dyndns.org</id>
- <url>file:///home/tdiesler/workspace/jbpm-site</url>
- </site>
- </distributionManagement>
-
- <!-- Repositories -->
+ <!-- Repositories -->
<repositories>
<repository>
<id>repository.jboss.org</id>
More information about the jbpm-commits
mailing list