[jbpm-commits] JBoss JBPM SVN: r3682 - in jbpm4/trunk/modules: api/src/main/java/org/jbpm/activity and 48 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Jan 20 04:19:06 EST 2009


Author: tom.baeyens at jboss.com
Date: 2009-01-20 04:19:05 -0500 (Tue, 20 Jan 2009)
New Revision: 3682

Added:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ExternalActivityBehaviour.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Activity.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
Removed:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/Activity.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ExternalActivity.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Node.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/NodeImpl.java
Modified:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/package.html
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/client/ClientExecution.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/CompositeElement.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Event.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/ObservableElement.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenExecution.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenProcessDefinition.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Transition.java
   jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ExecutionModes.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Architecture.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch04-ImplementingBasicActivities.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch05-ProcessAnatomy.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch06-ImplementingAdvancedActivities.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-DelegationClasses.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Persistence.xml
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-ProcessLanguages.xml
   jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/conditions/ExclusiveConditionsTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/expression/ExclusiveExpressionTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ExclusiveHandlerTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/hql/process.jpdl.xml
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ForkActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JoinActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivityBinding.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlExternalActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StartBinding.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateBinding.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartNodes.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/UnresolvedTransition.java
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/NodeParsingTest.java
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBehaviourBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/CompositeBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/FlowBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ProcessDefinitionBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionsCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ExecutionType.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessElementImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNode.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNodeMessage.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildNode.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ProceedToDestination.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TakeTransition.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/package.html
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
   jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.cache.xml
   jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.definition.hbm.xml
   jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml
   jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.job.hbm.xml
   jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.types.xml
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/AutomaticActivity.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLn.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLnBuilder.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/WaitState.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestActivity.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestBehaviourBuilder.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/AutomaticActivity.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/WaitState.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveMessagesTest.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/spring/SpringTest.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/TaskDefinition.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycle.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java
   jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleState.java
   jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java
   jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
   jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/activities/ExclusiveTest.java
   jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/activities/StateTest.java
   jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/svc/ExecutionServiceTest.java
   jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/svc/ProcessServiceTest.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/ProcessExecutionTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/AutomaticActivity.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/AutomaticDecisionTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/BasicExecutionFlowTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventPropagationTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExceptionHandlerTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExecutionStateTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExternalDecisionTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/LoopingTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeStateTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/VariableTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/WaitState.java
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml
Log:
JBPM-1974 rename node to activity

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/Execution.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -48,7 +48,7 @@
  * execution.  Also {@link #createProcessInstance(String) creation} and 
  * {@link #removeExecution(Execution) removal} of child executions are unchecked, 
  * which means that those methods can be invoked by external API clients and 
- * node behaviour methods, even while the execution is in a locked state. 
+ * activity behaviour methods, even while the execution is in a locked state. 
  * </p>    
  * 
  * <p>Make sure that comparisons between {@link #getState()} and the 
@@ -125,8 +125,8 @@
   String getId();
   
   /** represents the current position in the process by indicating the 
-   * name of the current node. */
-  String getNodeName();
+   * name of the current activity. */
+  String getActivityName();
 
   /** the <a href="#state">state</a> of this execution.  */
   String getState();

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/ExecutionService.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -70,7 +70,7 @@
     *   for which the latest version will be taken. 
     * @param variables are the initial values of the process variables that 
     *   will be set before the execution starts (read: before the initial 
-    *   node is executed). */
+    *   activity is executed). */
    Execution startExecutionByKey(String processDefinitionKey, Map<String, Object> variables);
 
    /** starts a new execution in the latest version of the given processDefinitionName. 

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/Activity.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/Activity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/Activity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -1,49 +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.activity;
-
-import java.io.Serializable;
-
-/** piece of Java code that is to be included in a process as the runtime 
- * node behaviour or as a hidden listener to process events.
- * 
- * @author Tom Baeyens
- */
-public interface Activity extends Serializable {
-  
-  /** piece of Java code that is to be included in a process as node behaviour 
-   * or as a hidden listener to process events.
-   * 
-   * <p>Activities can be used to implement the behaviour of nodes, in 
-   * which case this behaviour is associated to a graphical node in the diagram,
-   * or they can be added as events, in that case, they are being hidden from 
-   * the diagram.
-   * </p>
-   * 
-   * <p>If an activity is the node behaviour, then it can control the propagation 
-   * of execution.  Node behaviours can be external activities.  That means their 
-   * runtime behaviour is a wait state.  In that case, {@link ExternalActivity} 
-   * should be implemented to also handle the external triggers. 
-   * </p>
-   */
-  void execute(ActivityExecution execution) throws Exception;
-}

Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java (from rev 3641, jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/Activity.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java	                        (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -0,0 +1,49 @@
+/*
+ * 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.activity;
+
+import java.io.Serializable;
+
+/** piece of Java code that is to be included in a process as the runtime 
+ * activity behaviour or as a hidden listener to process events.
+ * 
+ * @author Tom Baeyens
+ */
+public interface ActivityBehaviour extends Serializable {
+  
+  /** piece of Java code that is to be included in a process as activity behaviour 
+   * or as a hidden listener to process events.
+   * 
+   * <p>Activities can be used to implement the behaviour of activities, in 
+   * which case this behaviour is associated to a graphical activity in the diagram,
+   * or they can be added as events, in that case, they are being hidden from 
+   * the diagram.
+   * </p>
+   * 
+   * <p>If an activity is the activity behaviour, then it can control the propagation 
+   * of execution.  Node behaviours can be external activities.  That means their 
+   * runtime behaviour is a wait state.  In that case, {@link ExternalActivityBehaviour} 
+   * should be implemented to also handle the external triggers. 
+   * </p>
+   */
+  void execute(ActivityExecution execution) throws Exception;
+}


Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityBehaviour.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + LF

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ActivityExecution.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -26,7 +26,7 @@
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.client.ClientProcessInstance;
 import org.jbpm.env.Environment;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.ObservableElement;
 import org.jbpm.model.OpenExecution;
 import org.jbpm.model.Transition;
@@ -35,7 +35,7 @@
 
 
 /** view upon an {@link Execution path of execution} exposed to 
- * {@link Activity} implementations.
+ * {@link ActivityBehaviour} implementations.
  *  
  * @author Tom Baeyens
  */
@@ -43,7 +43,7 @@
   
   // wait state behaviour /////////////////////////////////////////////////////
   
-  /** makes this execution wait in the current node until an external trigger is given 
+  /** makes this execution wait in the current activity until an external trigger is given 
    * with one of the {@link #signal()} methods. */
   void waitForSignal();
 
@@ -52,48 +52,48 @@
   /** takes the default transition.  
    * 
    * <p>This method can only be called from inside
-   * {@link ExternalActivity} implementations and in rare occasions also from outside 
+   * {@link ExternalActivityBehaviour} implementations and in rare occasions also from outside 
    * of the execution (from an external client while the process is in a wait state).
    * For external clients, it is more normal to use the {@link #signal()} 
-   * method as in that case, it's the current node (hence the process language)that 
+   * method as in that case, it's the current activity (hence the process language)that 
    * will decide how to interpret the signal.
    * </p>
    * 
-   * @throws JbpmException in case there is no default transition in the current node 
-   * or in case this method is called from inside an {@link Activity} */
+   * @throws JbpmException in case there is no default transition in the current activity 
+   * or in case this method is called from inside an {@link ActivityBehaviour} */
   void takeDefaultTransition();
 
   /** takes the outgoing transition with the given name. 
    * 
    * <p>This method can only be called 
-   * from inside {@link ExternalActivity} implementations and in rare occasions also from 
+   * from inside {@link ExternalActivityBehaviour} implementations and in rare occasions also from 
    * outside of the execution (from an external client while the process is in a wait state).
    * For external clients, it is more normal to use the {@link #signal(String)} 
-   * method as in that case, it's the current node (hence the process language)that 
+   * method as in that case, it's the current activity (hence the process language)that 
    * will decide how to interpret the signal.</p>
    * 
    * <p>Transitions will be looked up recursively starting from the 
-   * {@link #getNode() current node} and then up the {@link Node#getParent() node-parent-hierarchy} </p>
+   * {@link #getNode() current activity} and then up the {@link Activity#getParent() activity-parent-hierarchy} </p>
    * 
    * @param transitionName is the name of the transition to take.  A null value will 
    * match the first unnamed transition.
    *   
-   * @throws JbpmException in case no such transition is found in {@link #getNode() the current node} 
-   * or in case this method is called from inside an {@link Activity}.*/
+   * @throws JbpmException in case no such transition is found in {@link #getNode() the current activity} 
+   * or in case this method is called from inside an {@link ActivityBehaviour}.*/
   void take(String transitionName);
 
   /** takes the given outgoing transition.  
    * 
    * <p>This method can only be called 
-   * from inside {@link ExternalActivity} implementations and in rare occasions also from 
+   * from inside {@link ExternalActivityBehaviour} implementations and in rare occasions also from 
    * outside of the execution (from an external client while the process is in a wait state).
    * For external clients, it is more normal to use the {@link #signal(String)} 
-   * method as in that case, it's the current node (hence the process language)that 
+   * method as in that case, it's the current activity (hence the process language)that 
    * will decide how to interpret the signal.</p>
    * 
    * <p>CAUTION: It's up to the client to make sure 
    * that this transition makes sense as there is no check whether the given transition 
-   * is an outgoing transition of the current node.  The motivation for that is 
+   * is an outgoing transition of the current activity.  The motivation for that is 
    * that in case of superstates, that check can become too 'expensive'. </p> */
   void take(Transition transition);
 
@@ -101,38 +101,38 @@
    * @throws JbpmException if the execution is not part of this process instance. */
   void take(Transition transition, Execution execution);
   
-  // execute a child node /////////////////////////////////////////////////////
+  // execute a child activity /////////////////////////////////////////////////////
   
-  /** executes the given nested node. 
+  /** executes the given nested activity. 
    * 
-   * <p>The nodeName is looked up in the current node's nested nodes.</p>
+   * <p>The activityName is looked up in the current activity's nested activities.</p>
    * 
    * <p>This method can only be called 
-   * from inside {@link ExternalActivity} implementations and in rare occasions also from 
+   * from inside {@link ExternalActivityBehaviour} implementations and in rare occasions also from 
    * outside of the execution (from an external client while the process is in a wait state).
    * For external clients, it is more normal to use the {@link #signal(String)} 
-   * method as in that case, it's the current node (hence the process language)that 
+   * method as in that case, it's the current activity (hence the process language)that 
    * will decide how to interpret the signal.</p> */
-  void execute(String nodeName);
+  void execute(String activityName);
   
-  /** executes the given node. 
+  /** executes the given activity. 
    * 
    * <p>This method can only be called 
-   * from inside {@link ExternalActivity} implementations and in rare occasions also from 
+   * from inside {@link ExternalActivityBehaviour} implementations and in rare occasions also from 
    * outside of the execution (from an external client while the process is in a wait state).
    * For external clients, it is more normal to use the {@link #signal(String)} 
-   * method as in that case, it's the current node (hence the process language)that 
+   * method as in that case, it's the current activity (hence the process language)that 
    * will decide how to interpret the signal.</p>
    */
-  void execute(Node node);
+  void execute(Activity activity);
   
-  // reposition the execution in another node /////////////////////////////////
+  // reposition the execution in another activity /////////////////////////////////
 
-  /** position this execution in the destination node. */
-  void setNode(Node destination);
+  /** position this execution in the destination activity. */
+  void setNode(Activity destination);
 
-  /** position the given execution in the destination node */
-  void setNode(Node destination, Execution execution);
+  /** position the given execution in the destination activity */
+  void setNode(Activity destination, Execution execution);
   
   // managing the parent-child relation ///////////////////////////////////////
 
@@ -198,8 +198,8 @@
    * a parent execution to start executing in case this is the last concurrent 
    * execution for which the parent is waiting.</p>
    * 
-   * <p>This method should not be called in {@link Activity}s.  It can be called from 
-   * outside the process execution and in {@link ExternalActivity}s. </p> */
+   * <p>This method should not be called in {@link ActivityBehaviour}s.  It can be called from 
+   * outside the process execution and in {@link ExternalActivityBehaviour}s. </p> */
   void end();
 
   /** ends this execution and all it's child executions with a user defined 
@@ -257,19 +257,19 @@
   // TODO evaluate the previous methods (JBPM-)
   // these methods are kind of performance optimisations.  a sequence and 
   // some other specific control flow implementations can be optimised if they 
-  // have access to the previous node or transition.
+  // have access to the previous activity or transition.
   // Those activities could also be implemented by letting the activities store 
   // the contextual information in process variables or some other execution 
   // context.  But with the previous properties as done now, these control flow 
-  // nodes can be implemented without storing an extra record.  It's only a property
-  // that is only updated when the node configuration indicates that it's needed.
+  // activities can be implemented without storing an extra record.  It's only a property
+  // that is only updated when the activity configuration indicates that it's needed.
   // (see also Node.isPreviousNeeded())
   
-  /** returns the previously executed node only if {@link Node#isPreviousNeeded()}
+  /** returns the previously executed activity only if {@link Activity#isPreviousNeeded()}
    * is set to true. */  
-  Node getPreviousNode();
+  Activity getPreviousNode();
   
-  /** returns the previously taken transition only if {@link Node#isPreviousNeeded()}
+  /** returns the previously taken transition only if {@link Activity#isPreviousNeeded()}
    * is set to true. */  
   Transition getPreviousTransition();
 }

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ExternalActivity.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ExternalActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ExternalActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -1,68 +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.activity;
-
-import java.util.Map;
-
-import org.jbpm.Execution;
-
-
-/** extends {@link Activity} for handling external triggers after a wait state.
- * 
- * <p>Process languages will provide a set of these node implementations. But 
- * languages like jPDL even allow users to provide their own node behaviour with 
- * this interface.
- * </p> 
- * 
- * @author Tom Baeyens
- */
-public interface ExternalActivity extends Activity {
-  
-  /** handles an external trigger.  
-   * 
-   * <p>An external trigger that comes into an execution 
-   * through one of the {@link Execution#signal()} methods, will be delegated to 
-   * the node in which the execution is positioned when it receives the external 
-   * trigger.
-   * </p>  
-   * 
-   * <p>The signal method implements how the
-   * node will react on that signal.  For example, the outgoing transition 
-   * could be taken that corresponds with the given signal.   
-   * </p>
-   * 
-   * @param execution the {@link Execution} for which the signal is given
-   * 
-   * @param signalName is an abstract text that can be associated with a signal.  this 
-   *   corresponds to e.g. a method name in a java class interface.  The implementation 
-   *   can decide e.g. to use the signal to identify the outgoing transition.
-   *   
-   * @param parameters is extra information that can be provided with a signal.
-   *   In this way, it is somewhat similar to the parameters that can be fed into a method 
-   *   invocation through reflection.
-   *   
-   * @throws Exception to indicate any kind of failure.  Note that exceptions are 
-   *   considered non recoverable.  After an Exception, the execution should not be 
-   *   used any more and if this is during a transaction, the transaction should be 
-   *   rolled back. */
-  void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception;
-}

Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ExternalActivityBehaviour.java (from rev 3641, jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ExternalActivity.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ExternalActivityBehaviour.java	                        (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ExternalActivityBehaviour.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -0,0 +1,68 @@
+/*
+ * 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.activity;
+
+import java.util.Map;
+
+import org.jbpm.Execution;
+
+
+/** extends {@link ActivityBehaviour} for handling external triggers after a wait state.
+ * 
+ * <p>Process languages will provide a set of these activity implementations. But 
+ * languages like jPDL even allow users to provide their own activity behaviour with 
+ * this interface.
+ * </p> 
+ * 
+ * @author Tom Baeyens
+ */
+public interface ExternalActivityBehaviour extends ActivityBehaviour {
+  
+  /** handles an external trigger.  
+   * 
+   * <p>An external trigger that comes into an execution 
+   * through one of the {@link Execution#signal()} methods, will be delegated to 
+   * the activity in which the execution is positioned when it receives the external 
+   * trigger.
+   * </p>  
+   * 
+   * <p>The signal method implements how the
+   * activity will react on that signal.  For example, the outgoing transition 
+   * could be taken that corresponds with the given signal.   
+   * </p>
+   * 
+   * @param execution the {@link Execution} for which the signal is given
+   * 
+   * @param signalName is an abstract text that can be associated with a signal.  this 
+   *   corresponds to e.g. a method name in a java class interface.  The implementation 
+   *   can decide e.g. to use the signal to identify the outgoing transition.
+   *   
+   * @param parameters is extra information that can be provided with a signal.
+   *   In this way, it is somewhat similar to the parameters that can be fed into a method 
+   *   invocation through reflection.
+   *   
+   * @throws Exception to indicate any kind of failure.  Note that exceptions are 
+   *   considered non recoverable.  After an Exception, the execution should not be 
+   *   used any more and if this is during a transaction, the transaction should be 
+   *   rolled back. */
+  void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception;
+}


Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/ExternalActivityBehaviour.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + LF

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/package.html
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/package.html	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/activity/package.html	2009-01-20 09:19:05 UTC (rev 3682)
@@ -1,4 +1,4 @@
 <body>interfaces for implementing 
 {@link org.jbpm.pvm.activity.Activity activities}, which represent the 
-runtime behaviour of nodes.
+runtime behaviour of activities.
 </body>
\ No newline at end of file

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/client/ClientExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/client/ClientExecution.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/client/ClientExecution.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,8 +25,8 @@
 
 import org.jbpm.Execution;
 import org.jbpm.JbpmException;
-import org.jbpm.activity.Activity;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ActivityBehaviour;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.model.OpenExecution;
 
 /** view upon an {@link Execution path of execution} exposed to 
@@ -43,8 +43,8 @@
    * <p>All child executions will be ended and removed.  This execution
    * will not be removed from its parent.</p>
    * 
-   * <p>This method should not be called in {@link Activity}s.  It can be called from 
-   * outside the process execution and in {@link ExternalActivity}s. </p> */
+   * <p>This method should not be called in {@link ActivityBehaviour}s.  It can be called from 
+   * outside the process execution and in {@link ExternalActivityBehaviour}s. </p> */
   void end();
 
   /** ends this execution and all it's child executions with a user defined 
@@ -56,7 +56,7 @@
   /** feeds a external trigger into this execution.
    * 
    * <p>Typically a signal causes the execution to proceed, but that doesn't necessarily 
-   * has to be the case .  The {@link ExternalActivity} is responsible for interpreting 
+   * has to be the case .  The {@link ExternalActivityBehaviour} is responsible for interpreting 
    * the signal and acting upon it.
    * </p>
    * 
@@ -66,15 +66,15 @@
    * 
    * <p>Since it's an external trigger, this method requires that this execution is 
    * waiting for an external trigger.  So this method must be called as an external client
-   * and can not be called while this execution is executing.  In an {@link Activity} for 
+   * and can not be called while this execution is executing.  In an {@link ActivityBehaviour} for 
    * example you're not allowed to call the signal on the execution cause it is executing.  
    * But you are allowed to invoke this method on any other execution (at least, if that 
    * one is waiting for an external trigger).</p>
    * 
    * <p>Typically a signal will cause the execution to start executing, but that is 
    * not a must.  What happens with this signal is defined in the 
-   * {@link ExternalActivity#signal(Execution, String, Map)} of 
-   * the {@link #getNode() current node}. </p>
+   * {@link ExternalActivityBehaviour#signal(Execution, String, Map)} of 
+   * the {@link #getNode() current activity}. </p>
    *  
    * @see #signal(String) */
   void signal();
@@ -105,8 +105,8 @@
    * 
    * <p>The parameters parameter provide extra information to the signal.
    * Typically, the parameters are set as variables but 
-   * the process language can overwrite that behaviour in the current node.  
-   * See {@link ExternalActivity#signal(Execution, String, Map)} for more information. 
+   * the process language can overwrite that behaviour in the current activity.  
+   * See {@link ExternalActivityBehaviour#signal(Execution, String, Map)} for more information. 
    * </p>
    * 
    * @see #signal() See the unnamed signal for more information
@@ -116,7 +116,7 @@
   /** feeds a external trigger into the given execution.
    * 
    * <p>Typically a signal causes the execution to proceed, but that doesn't necessarily 
-   * has to be the case .  The {@link ExternalActivity} is responsible for interpreting 
+   * has to be the case .  The {@link ExternalActivityBehaviour} is responsible for interpreting 
    * the signal and acting upon it.
    * </p>
    * 
@@ -126,15 +126,15 @@
    * 
    * <p>Since it's an external trigger, this method requires that this execution is 
    * waiting for an external trigger.  So this method must be called as an external client
-   * and can not be called while this execution is executing.  In an {@link Activity} for 
+   * and can not be called while this execution is executing.  In an {@link ActivityBehaviour} for 
    * example you're not allowed to call the signal on the execution cause it is executing.  
    * But you are allowed to invoke this method on any other execution (at least, if that 
    * one is waiting for an external trigger).</p>
    * 
    * <p>Typically a signal will cause the execution to start executing, but that is 
    * not a must.  What happens with this signal is defined in the 
-   * {@link ExternalActivity#signal(Execution, String, Map)} of 
-   * the {@link #getNode() current node}. </p>
+   * {@link ExternalActivityBehaviour#signal(Execution, String, Map)} of 
+   * the {@link #getNode() current activity}. </p>
    *  
    * @see #signal(String) */
   void signal(Execution execution);
@@ -165,8 +165,8 @@
    * 
    * <p>The parameters parameter provide extra information to the signal.
    * Typically, the parameters are set as variables but 
-   * the process language can overwrite that behaviour in the current node.  
-   * See {@link ExternalActivity#signal(Execution, String, Map)} for more information. 
+   * the process language can overwrite that behaviour in the current activity.  
+   * See {@link ExternalActivityBehaviour#signal(Execution, String, Map)} for more information. 
    * </p>
    * 
    * @see #signal() See the unnamed signal for more information

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/listener/EventListenerExecution.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -22,7 +22,7 @@
 package org.jbpm.listener;
 
 import org.jbpm.Execution;
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.model.Event;
 import org.jbpm.model.ObservableElement;
 import org.jbpm.model.OpenExecution;
@@ -40,7 +40,7 @@
 
   /** the original object that fired the event, part of the current position in the 
    * process graph.  Can be null in case no event is being fired. This is mostly the 
-   * object that is listened to with an {@link Activity}, but the eventSource can also 
+   * object that is listened to with an {@link ActivityBehaviour}, but the eventSource can also 
    * be a child of the object to which is listened in case of event propagation. */
   ObservableElement getEventSource();
   

Copied: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Activity.java (from rev 3641, jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Node.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Activity.java	                        (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Activity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -0,0 +1,132 @@
+/*
+ * 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.model;
+
+import java.util.List;
+import java.util.Map;
+
+import org.jbpm.Execution;
+
+
+/**
+ * a activity in a {@link OpenProcessDefinition} graph.
+ * 
+ * <p>The activity supports both graph based process models as well as 
+ * block structured (tree based) process models.  First we describe 
+ * tranisions that can be used to form graph based process structures 
+ * and then we'll describe activity composition to form block structured
+ * process models.  Both models can be combined as well.
+ * </p>
+ * 
+ * <p>Nodes have {@link #getIncomingTransitions() incoming}
+ * and {@link #getOutgoingTransitions() outgoing transitions}.
+ * These are lists of transitions.
+ * </p>
+ * 
+ * <p>Optionally, transitions can have names.  In that case the 
+ * transition {@link #getOutgoingTransition(String) names are associated 
+ * to activity's outgoing transitions}.  The {@link #getOutgoingTransitionsMap() map 
+ * of outgoing transitions} provides easy access to the named transitions.
+ * </p> 
+ *   
+ * <p>One of the outgoing transitions can optionally be marked as 
+ * {@link #getDefaultTransition() the default transition}.
+ * </p>
+ * 
+ * <p>Block structured process languages have composite activities that can be 
+ * modeled with the {@link #getParent() parent}-{@link #getActivities() child} 
+ * relation.
+ * </p> 
+ * 
+ * @author Tom Baeyens
+ */
+public interface Activity extends CompositeElement {
+
+  /** the list of outgoing transitions.
+   * Caution: the actual member is returned.  No copy is made. */
+  List<Transition> getOutgoingTransitions();
+
+  /** the default outgoing transition. */
+  Transition getDefaultTransition();
+
+  /** the first leaving transition with the given name or null of no
+   * such leaving transition exists. If the multiple transitions have 
+   * the given transition name, the first (in order of {@link #getOutgoingTransitions()})
+   * will be returned.
+   *  
+   * @param transitionName is the name of the transition to take.  A null value will 
+   * match the first unnamed transition. */
+  Transition getOutgoingTransition(String transitionName);
+
+  /** indicates if a leaving transition with the given transitionName exists. 
+   * A null value matches an unnamed transition. */
+  boolean hasOutgoingTransition(String transitionName);
+
+  /** indicates if this activity has leaving transitions */
+  boolean hasOutgoingTransitions();
+
+  /** the leaving transitions, keyed by transition name.  If a transition with 
+   * the same name occurs mutltiple times, the first one is returned.
+   * Leaving transitions with a null value for their name are not included 
+   * in the map.
+   * Beware: the actual member is returned.  No copy is made.  In fact, the 
+   * returned map is maintained as a cache.  So updates to the map will 
+   * influence subsequent retrievals of outgoing transitions by name. */
+  Map<String, Transition> getOutgoingTransitionsMap();
+  
+  /** searches for the given transitionName in this activity and then up the 
+   * parent chain. Returns null if no such transition is found. */
+  Transition findOutgoingTransition(String transitionName);
+
+  /** the list of arriving transitions.
+   * Beware: the actual member is returned.  No copy is made. */
+  List<Transition> getIncomingTransitions();
+
+  /** indicates if this activity has arriving transitions */
+  boolean hasIncomingTransitions();
+  
+  /** retrieve the parent activity in the composite activity structure.  This is 
+   * different from {@link ObservableElement#getParent()} in that it is restricted 
+   * to the parent activities.  It doesn't take into account the process definition. */ 
+  Activity getParentNode();
+
+  /** indicates if this activity should be executed 
+   * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a>. */
+  boolean isExecutionAsync();
+
+  /** indicates if signals should be processed  
+   * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a>. */
+  boolean isSignalAsync();
+
+  /** indicates if execution should proceed  
+   * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a> 
+   * when this activity is left over any of the outgoing transitions. */
+  boolean isLeaveAsync();
+
+  /** indicates if this activity behaviour needs to know 
+   * {@link Execution#getPreviousNode() the previous activity} or 
+   * {@link Execution#getPreviousTransition() previous transition}. 
+   * If this property is set to true, the properties {@link Execution#getPreviousNode()}
+   * and {@link Execution#getPreviousTransition()} will be available to the 
+   * activity behaviour when it is executed or signalled. */
+  boolean isPreviousNeeded();
+}
\ No newline at end of file


Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Activity.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + LF

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/CompositeElement.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/CompositeElement.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/CompositeElement.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -26,37 +26,42 @@
 
 
 
-/** node container base class for {@link OpenProcessDefinition} and {@link Node}.
+/** activity container base class for {@link OpenProcessDefinition} and {@link Activity}.
  * 
  * @author Tom Baeyens
  */
 public interface CompositeElement extends ObservableElement {
 
-  /** indicates if this processDefinition has nodes. */
-  boolean hasNodes();
+  /** indicates if this processDefinition has activities. */
+  boolean hasActivities();
 
-  /** the list of composite nodes.
+  /** the list of direct composite activities.  Recursively contained 
+   * activities are not included in the list. 
    * Beware: the actual member is returned.  No copy is made. */
-  List<Node> getNodes();
+  List<Activity> getActivities();
 
-  /** indicates if a node with the given name exists in this processDefinition. */
-  boolean hasNode(String nodeName);
+  /** indicates if an activity with the given name exists directly in 
+   * this element.  Only the direct contained activities are 
+   * searched.  No recursive search is made. */
+  boolean hasActivity(String activityName);
 
-  /** the first composite node with the given name or null of no
-   * such node exists. */
-  Node getNode(String nodeName);
+  /** the first composite activity with the given name or null of no
+   * such activity exists. Only the direct contained activities are 
+   * searched.  No recursive search is made. */
+  Activity getActivity(String activityName);
 
-  /** searches for the given node in this node, including this node and 
-   * all child nodes recursively.  The search is done depth-first. 
-   * A null value for nodeName matches a node without a name. */
-  Node findNode(String nodeName);
+  /** searches for the given activity in this element recursively, 
+   * including this activity and all child activities.  The search 
+   * is done depth-first. A null value for activityName matches a activity 
+   * without a name. */
+  Activity findActivity(String activityName);
 
-  /** the composite nodes, keyed by node name.  If a node with 
-   * the same name occurs mutltiple times, the first in the list
-   * is included in the map. Nodes with a null value for their name 
+  /** the composite activities, keyed by activity name.  If an activity 
+   * with the same name occurs mutltiple times, the first in the list
+   * is included in the map. Activities with a null value for their name 
    * are not included in the map. 
    * Beware: the actual member is returned.  No copy is made. In fact, the 
    * returned map is maintained as a cache.  So updates to the map will 
-   * influence subsequent retrievals of nodes by name.*/
-  Map<String, Node> getNodesMap();
+   * influence subsequent retrievals of activities by name.*/
+  Map<String, Activity> getActivitiesMap();
 }

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Event.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Event.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Event.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -42,8 +42,8 @@
   String PROCESS_END = "process-end";
   /** <b>WARNING: this event name will be subject to change in the next release. See <a href="https://jira.jboss.org/jira/browse/JBPM-1753">JBPM-1753</a></b> 
    * @deprecated */
-  String NODE_BEGIN = "node-begin";
+  String NODE_BEGIN = "activity-begin";
   /** <b>WARNING: this event name will be subject to change in the next release. See <a href="https://jira.jboss.org/jira/browse/JBPM-1753">JBPM-1753</a></b> 
    * @deprecated */
-  String NODE_END = "node-end";
+  String NODE_END = "activity-end";
 }

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Node.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Node.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Node.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -1,132 +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.model;
-
-import java.util.List;
-import java.util.Map;
-
-import org.jbpm.Execution;
-
-
-/**
- * a node in a {@link OpenProcessDefinition} graph.
- * 
- * <p>The node supports both graph based process models as well as 
- * block structured (tree based) process models.  First we describe 
- * tranisions that can be used to form graph based process structures 
- * and then we'll describe node composition to form block structured
- * process models.  Both models can be combined as well.
- * </p>
- * 
- * <p>Nodes have {@link #getIncomingTransitions() incoming}
- * and {@link #getOutgoingTransitions() outgoing transitions}.
- * These are lists of transitions.
- * </p>
- * 
- * <p>Optionally, transitions can have names.  In that case the 
- * transition {@link #getOutgoingTransition(String) names are associated 
- * to node's outgoing transitions}.  The {@link #getOutgoingTransitionsMap() map 
- * of outgoing transitions} provides easy access to the named transitions.
- * </p> 
- *   
- * <p>One of the outgoing transitions can optionally be marked as 
- * {@link #getDefaultTransition() the default transition}.
- * </p>
- * 
- * <p>Block structured process languages have composite nodes that can be 
- * modeled with the {@link #getParent() parent}-{@link #getNodes() child} 
- * relation.
- * </p> 
- * 
- * @author Tom Baeyens
- */
-public interface Node extends CompositeElement {
-
-  /** the list of outgoing transitions.
-   * Caution: the actual member is returned.  No copy is made. */
-  List<Transition> getOutgoingTransitions();
-
-  /** the default outgoing transition. */
-  Transition getDefaultTransition();
-
-  /** the first leaving transition with the given name or null of no
-   * such leaving transition exists. If the multiple transitions have 
-   * the given transition name, the first (in order of {@link #getOutgoingTransitions()})
-   * will be returned.
-   *  
-   * @param transitionName is the name of the transition to take.  A null value will 
-   * match the first unnamed transition. */
-  Transition getOutgoingTransition(String transitionName);
-
-  /** indicates if a leaving transition with the given transitionName exists. 
-   * A null value matches an unnamed transition. */
-  boolean hasOutgoingTransition(String transitionName);
-
-  /** indicates if this node has leaving transitions */
-  boolean hasOutgoingTransitions();
-
-  /** the leaving transitions, keyed by transition name.  If a transition with 
-   * the same name occurs mutltiple times, the first one is returned.
-   * Leaving transitions with a null value for their name are not included 
-   * in the map.
-   * Beware: the actual member is returned.  No copy is made.  In fact, the 
-   * returned map is maintained as a cache.  So updates to the map will 
-   * influence subsequent retrievals of outgoing transitions by name. */
-  Map<String, Transition> getOutgoingTransitionsMap();
-  
-  /** searches for the given transitionName in this node and then up the 
-   * parent chain. Returns null if no such transition is found. */
-  Transition findOutgoingTransition(String transitionName);
-
-  /** the list of arriving transitions.
-   * Beware: the actual member is returned.  No copy is made. */
-  List<Transition> getIncomingTransitions();
-
-  /** indicates if this node has arriving transitions */
-  boolean hasIncomingTransitions();
-  
-  /** retrieve the parent node in the composite node structure.  This is 
-   * different from {@link ObservableElement#getParent()} in that it is restricted 
-   * to the parent nodes.  It doesn't take into account the process definition. */ 
-  Node getParentNode();
-
-  /** indicates if this node should be executed 
-   * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a>. */
-  boolean isExecutionAsync();
-
-  /** indicates if signals should be processed  
-   * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a>. */
-  boolean isSignalAsync();
-
-  /** indicates if execution should proceed  
-   * <a href="package-summary.html#asynchronouscontinuations">asynchronously</a> 
-   * when this node is left over any of the outgoing transitions. */
-  boolean isLeaveAsync();
-
-  /** indicates if this node behaviour needs to know 
-   * {@link Execution#getPreviousNode() the previous node} or 
-   * {@link Execution#getPreviousTransition() previous transition}. 
-   * If this property is set to true, the properties {@link Execution#getPreviousNode()}
-   * and {@link Execution#getPreviousTransition()} will be available to the 
-   * node behaviour when it is executed or signalled. */
-  boolean isPreviousNeeded();
-}
\ No newline at end of file

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/ObservableElement.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/ObservableElement.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/ObservableElement.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -60,6 +60,6 @@
    * search the parent hierarchy for the given event. */
   boolean hasEvent(String eventName);
   
-  /** the enclosing node or the process definition */
+  /** the enclosing activity or the process definition */
   ObservableElement getParent();
 }

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenExecution.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenExecution.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -50,8 +50,8 @@
   /** the process definition for this execution.*/
   OpenProcessDefinition getProcessDefinition();
   
-  /** the current node */
-  Node getNode();
+  /** the current activity */
+  Activity getNode();
   
   /** update the state */
   void setState(String state);

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenProcessDefinition.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/OpenProcessDefinition.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -40,9 +40,9 @@
  * </p>
  * 
  * <h2>Structure</h2>
- * <p>A processDefinition contains a set of nodes.  Nodes can be connected with 
- * transitions or nodes can have nested nodes.  But the transitions and 
- * nested nodes can be combined.
+ * <p>A processDefinition contains a set of activities.  Nodes can be connected with 
+ * transitions or activities can have nested activities.  But the transitions and 
+ * nested activities can be combined.
  * </p>
  * 
  * <h2>Execution</h2>
@@ -53,7 +53,7 @@
  */
 public interface OpenProcessDefinition extends ProcessDefinition, CompositeElement {
   
-  /** the initial node of this process definition */
-  Node getInitial();
+  /** the initial activity of this process definition */
+  Activity getInitial();
 
 }
\ No newline at end of file

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Transition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Transition.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/model/Transition.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -50,17 +50,17 @@
  * process graph to transactions on the server.  If the transition is taken 
  * in one (the current) transaction, then the async condition should be empty 
  * or evaluate to false.  If the arrival of the execution in the destination 
- * node should occur in a separate execution 
+ * activity should occur in a separate execution 
  * 
  * @author Tom Baeyens
  */
 public interface Transition extends ObservableElement {
   
-  /** the node from which this transition leaves. */
-  Node getSource();
+  /** the activity from which this transition leaves. */
+  Activity getSource();
 
-  /** the node in which this transition arrives. */ 
-  Node getDestination();
+  /** the activity in which this transition arrives. */ 
+  Activity getDestination();
   
   /** the general purpose condition that can be used in various ways by the 
    * activities. */

Modified: jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd
===================================================================
--- jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/api/src/main/resources/jpdl.xsd	2009-01-20 09:19:05 UTC (rev 3682)
@@ -11,7 +11,7 @@
     <documentation>Schema for jPDL 4 process descriptions; 
     element process is the top level element.
       
-      TODO: Add node pluggability.  (add the proper any's and 
+      TODO: Add activity pluggability.  (add the proper any's and 
             anyAttributes)
     
       TODO: Pull up expression.  The expression element in the 
@@ -86,7 +86,7 @@
           <sequence>
             <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
           </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
         </complexType>
       </element>
 
@@ -97,7 +97,7 @@
         <complexType>
           <sequence>
           </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
           <attribute name="ends" default="process-instance">
             <simpleType>
               <restriction base="string">
@@ -118,7 +118,7 @@
         <complexType>
           <sequence>
           </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
           <attribute name="ends" default="process-instance">
             <simpleType>
               <restriction base="string">
@@ -136,7 +136,7 @@
         <complexType>
           <sequence>
           </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
           <attribute name="ends" default="process-instance">
             <simpleType>
               <restriction base="string">
@@ -158,7 +158,7 @@
           <sequence>
             <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
           </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
         </complexType>
       </element>
 
@@ -194,7 +194,7 @@
               <!-- TODO add conditions -->
             </element>
           </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
           <attribute name="expr" type="string">
             <annotation><documentation>The script that will be evaluated and resolve to 
             the name of the outgoing flow.
@@ -215,7 +215,7 @@
           <sequence>
             <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
           </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
         </complexType>
       </element>
     
@@ -227,7 +227,7 @@
           <sequence>
             <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
           </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
         </complexType>
       </element>
 
@@ -240,7 +240,7 @@
               <sequence>
                 <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
               </sequence>
-              <attributeGroup ref="tns:nodeAttributes" />
+              <attributeGroup ref="tns:activityAttributes" />
             </extension>
           </complexContent>
         </complexType>
@@ -255,7 +255,7 @@
               <sequence>
                 <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
               </sequence>
-              <attributeGroup ref="tns:nodeAttributes" />
+              <attributeGroup ref="tns:activityAttributes" />
             </extension>
           </complexContent>
         </complexType>
@@ -270,7 +270,7 @@
               <sequence>
                 <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
               </sequence>
-              <attributeGroup ref="tns:nodeAttributes" />
+              <attributeGroup ref="tns:activityAttributes" />
             </extension>
           </complexContent>
         </complexType>
@@ -288,7 +288,7 @@
               <sequence>
                 <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
               </sequence>
-              <attributeGroup ref="tns:nodeAttributes" />
+              <attributeGroup ref="tns:activityAttributes" />
             </extension>
           </complexContent>
         </complexType>
@@ -303,7 +303,7 @@
               <sequence>
                 <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
               </sequence>
-              <attributeGroup ref="tns:nodeAttributes" />
+              <attributeGroup ref="tns:activityAttributes" />
             </extension>
           </complexContent>
         </complexType>
@@ -316,7 +316,7 @@
           <sequence>
             <element ref="tns:flow" minOccurs="0" maxOccurs="unbounded" />
           </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
           <attribute name="assignee" type="string" use="required">
             <annotation><documentation>User id to whom this task should be assigned.
             </documentation></annotation>
@@ -343,12 +343,12 @@
             </element>
             <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
           </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
         </complexType>
       </element>
 
       <element name="super-state">
-        <annotation><documentation>Scope enclosing a number of nodes.
+        <annotation><documentation>Scope enclosing a number of activities.
         </documentation></annotation>
         <complexType>
           <sequence>
@@ -359,7 +359,7 @@
             </element>
             <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
           </sequence>
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
         </complexType>
       </element>
     
@@ -374,7 +374,7 @@
               <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
             </element>
           </sequence> 
-          <attributeGroup ref="tns:nodeAttributes" />
+          <attributeGroup ref="tns:activityAttributes" />
         </complexType>
       </element>
       
@@ -390,7 +390,7 @@
                   <annotation><documentation>Events on which listeners can be registered.</documentation></annotation>
                 </element>
               </sequence>
-              <attributeGroup ref="tns:nodeAttributes" />
+              <attributeGroup ref="tns:activityAttributes" />
             </extension>
           </complexContent>
         </complexType>
@@ -409,7 +409,7 @@
                 </element>
                 <element ref="tns:timer" minOccurs="0" maxOccurs="unbounded"/>
               </sequence>
-              <attributeGroup ref="tns:nodeAttributes" />
+              <attributeGroup ref="tns:activityAttributes" />
             </extension>
           </complexContent>
         </complexType>
@@ -565,7 +565,7 @@
     </attribute>
   </complexType>
   
-  <attributeGroup name="nodeAttributes">
+  <attributeGroup name="activityAttributes">
     <attribute name="name" type="string">
       <annotation><documentation>The id of this activity.  The name should be unique
       in the complete scope of the process.</documentation></annotation>
@@ -589,7 +589,7 @@
       <annotation><documentation>Name of this outgoing flow</documentation></annotation>
     </attribute>
     <attribute name="to" type="string">
-      <annotation><documentation>Name of the destination node of this flow. 
+      <annotation><documentation>Name of the destination activity of this flow. 
       </documentation></annotation>
     </attribute>
     <attribute name="g" type="string">
@@ -599,7 +599,7 @@
   </complexType>
   
   <element name="flow" type="tns:flowType">
-    <annotation><documentation>A flow from one node to another.</documentation></annotation>
+    <annotation><documentation>A flow from one activity to another.</documentation></annotation>
   </element>
   
   <element name="on">

Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch01-Introduction.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -43,7 +43,7 @@
       <mediaobject><imageobject><imagedata align="center" fileref="images/process.loan.png"/></imageobject></mediaobject>
     </figure>
     <para>Typically, process definitions are static.  A process definition is composed of 
-    nodes and transitions.  The runtime behaviour of a node is encapsulated in a so called 
+    activities and transitions.  The runtime behaviour of a activity is encapsulated in a so called 
     Activity and it's decoupled from the process graph structure.  
     </para>
     <figure id="class.diagram.process.definition">
@@ -54,11 +54,11 @@
     Machine doesn't contain any such activity implementations.  It only provides the 
     execution environment and an activity API to write <literal>Activity</literal> 
     implementations as Java components.  Activities can also be wait states.  This means 
-    that the node control flow goes outside the process system. For example a human task 
+    that the activity control flow goes outside the process system. For example a human task 
     or invoking an service asynchronously.
     </para>
     <para>Many executions can be started for one process definition. An execution is a pointer 
-    that keeps track of the current node.
+    that keeps track of the current activity.
     </para>
     <figure id="example.execution">
       <title>Example execution</title>
@@ -79,7 +79,7 @@
     <para>The key features of this library are
     <itemizedlist>
       <listitem>Create executable processes that are based on a diagram structure</listitem>
-      <listitem>Runtime behaviour of the nodes can be provided as Activity implementations</listitem>
+      <listitem>Runtime behaviour of the activities can be provided as Activity implementations</listitem>
       <listitem>Activities can be wait states</listitem>
       <listitem>There are no constraints on the process graph structure</listitem>
       <listitem>Processes diagrams can be based on composition (aka block structured)</listitem>
@@ -99,7 +99,7 @@
     <itemizedlist>
       <listitem>jPDL: Workflow language that combines powerful human task capabilities with easy binding to Java.</listitem>
       <listitem>BPEL: Web-Service orchestration (to be exact for the purists: BPEL is a WSDL service orchestration language)</listitem>
-      <listitem>Pageflow: To describe navigation handling in a web application, pages can be seen as nodes and the nagivation between the pages as transitions.</listitem>
+      <listitem>Pageflow: To describe navigation handling in a web application, pages can be seen as activities and the nagivation between the pages as transitions.</listitem>
       <listitem>XPDL: A graph based process language standardized by the Workflow Management Coalition (WfMC)</listitem>
     </itemizedlist>
     <para>Even while the nature of these languages is already very diverse, these are 

Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ExecutionModes.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ExecutionModes.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch02-ExecutionModes.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -28,16 +28,16 @@
       <mediaobject><imageobject><imagedata align="center" fileref="images/process.loan.png"/></imageobject></mediaobject>
     </figure>
     <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build("loan")
-  .node("submit loan request").initial().behaviour(AutomaticActivity.class)
+  .activity("submit loan request").initial().behaviour(AutomaticActivity.class)
     .transition().to("evaluate")
-  .node("evaluate").behaviour(WaitState.class)
+  .activity("evaluate").behaviour(WaitState.class)
     .transition("approve").to("wire money")
     .transition("reject").to("end")
-  .node("wire money").behaviour(AutomaticActivity.class)
+  .activity("wire money").behaviour(AutomaticActivity.class)
     .transition().to("archive")
-  .node("archive").behaviour(WaitState.class)
+  .activity("archive").behaviour(WaitState.class)
     .transition().to("end")
-  .node("end").behaviour(WaitState.class)
+  .activity("end").behaviour(WaitState.class)
 .done();</programlisting>
       <para>The <literal>ProcessFactory</literal> is a helper class that provides convenience 
       for building an object graph that represents a process definition.  
@@ -56,13 +56,13 @@
       </para>  
       <para>The <literal>execution</literal> can be seen as a state machine that operates as 
       described in the process definition.  Starting a process 
-      instance means that the initial node of the process definition is executed.
+      instance means that the initial activity of the process definition is executed.
       Since this is an automatic activity, the execution will proceed to the 
-      <literal>evaluate</literal> node.  The <literal>evaluate</literal> node is a wait state.
-      When the execution arrived at the evaluate node, the method <literal>startProcessInstance</literal>
+      <literal>evaluate</literal> activity.  The <literal>evaluate</literal> activity is a wait state.
+      When the execution arrived at the evaluate activity, the method <literal>startProcessInstance</literal>
       will return and waits until an external signal is provided with the <literal>signal</literal>
       method.  So after the <literal>startProcessInstance</literal> we can verify if the 
-      execution is positioned in the evaluate node. 
+      execution is positioned in the evaluate activity. 
       </para>
       <programlisting>assertEquals("evaluate", execution.getNodeName());</programlisting>
       <para>To make the process execute further, we provide an external trigger with the 
@@ -76,14 +76,14 @@
       the next wait state <literal>archive</literal>.
       </para>
       <programlisting>assertEquals("archive", execution.getNodeName());</programlisting>
-      <para>When the execution is waiting in the archive node, the default signal will
+      <para>When the execution is waiting in the archive activity, the default signal will
       make it take the first unnamed transition.
       </para>
       <programlisting>execution.signal();
 assertEquals("end", execution.getNodeName());</programlisting>
       <para>The process has executed in the thread of the client.  The 
       <literal>startProcessInstance</literal> method only returned when the <literal>evaluate</literal> 
-      node was reached.  In other words, the <literal>ClientProcessDefinition.startProcessInstance</literal>
+      activity was reached.  In other words, the <literal>ClientProcessDefinition.startProcessInstance</literal>
       and <literal>ClientExecution.signal</literal> methods are blocking until the next 
       wait state is reached.
       </para>
@@ -188,16 +188,16 @@
       <para>In this example, we'll supply a process definition programmatically
       for deployment.</para>
       <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build("loan")
-  .node("submit loan request").initial().behaviour(AutomaticActivity.class)
+  .activity("submit loan request").initial().behaviour(AutomaticActivity.class)
     .transition().to("evaluate")
-  .node("evaluate").behaviour(WaitState.class)
+  .activity("evaluate").behaviour(WaitState.class)
     .transition("approve").to("wire money")
     .transition("reject").to("end")
-  .node("wire money").behaviour(AutomaticActivity.class)
+  .activity("wire money").behaviour(AutomaticActivity.class)
     .transition().to("archive")
-  .node("archive").behaviour(WaitState.class)
+  .activity("archive").behaviour(WaitState.class)
     .transition().to("end")
-  .node("end").behaviour(WaitState.class)
+  .activity("end").behaviour(WaitState.class)
 .done();
 
 Deployment deployment = new Deployment(processDefinition);
@@ -222,7 +222,7 @@
     above will only keep the transaction and session open for the duration of the
     service method.  So navigating the relations outside of the service methods might result 
     into a hibernate <literal>LazyInitializationException</literal>.  But the 
-    current node name can still be verified:
+    current activity name can still be verified:
     </para>
     <programlisting>assertEquals("evaluate", execution.getNodeName());</programlisting>
     <para>Also very important is the generated id that can be obtained.  The default 
@@ -252,16 +252,16 @@
   
   private static ClientProcessDefinition createLoanProcess() {
     ClientProcessDefinition processDefinition = ProcessFactory.build(&quot;loan&quot;)
-      .node(&quot;submit loan request&quot;).initial().behaviour(AutomaticActivity.class)
+      .activity(&quot;submit loan request&quot;).initial().behaviour(AutomaticActivity.class)
         .transition().to(&quot;evaluate&quot;)
-      .node(&quot;evaluate&quot;).behaviour(WaitState.class)
+      .activity(&quot;evaluate&quot;).behaviour(WaitState.class)
         .transition(&quot;approve&quot;).to(&quot;wire money&quot;)
         .transition(&quot;reject&quot;).to(&quot;end&quot;)
-      .node(&quot;wire money&quot;).behaviour(AutomaticActivity.class)
+      .activity(&quot;wire money&quot;).behaviour(AutomaticActivity.class)
         .transition().to(&quot;archive&quot;)
-      .node(&quot;archive&quot;).behaviour(WaitState.class)
+      .activity(&quot;archive&quot;).behaviour(WaitState.class)
         .transition().to(&quot;end&quot;)
-      .node(&quot;end&quot;).behaviour(WaitState.class)
+      .activity(&quot;end&quot;).behaviour(WaitState.class)
     .done();
     
     return processDefinition;

Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Architecture.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Architecture.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Architecture.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -36,8 +36,8 @@
     <programlisting>public interface Activity extends Serializable {
   void execute(ActivityExecution execution) throws Exception;
 }</programlisting>
-    <para>An activity is the behaviour of the node to which it is associated.
-    The provided execution is the execution that arrives in the node.
+    <para>An activity is the behaviour of the activity to which it is associated.
+    The provided execution is the execution that arrives in the activity.
     The interface <literal>ActivityExecution</literal> exposes special 
     methods to control the execution flow.
     </para>
@@ -45,7 +45,7 @@
 
   void waitForSignal();
   void take(String transitionName);
-  void execute(String nodeName);
+  void execute(String activityName);
 
   ...
 
@@ -55,8 +55,8 @@
   <section>
     <title>Event listener API</title>
     <para>The event listener API allows for listeners to be developed in Java code 
-    and that are invoked on specific process events like entering a node or leaving 
-    a node.  It is very similar to the activity API, but the difference is  
+    and that are invoked on specific process events like entering a activity or leaving 
+    a activity.  It is very similar to the activity API, but the difference is  
     that the propagation of the execution flow cannot be controlled.  E.g. when an execution 
     is taking a transition, a listener to that event can be notified, but since the 
     transition is already being taking, the execution flow cannot be changed 

Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch04-ImplementingBasicActivities.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch04-ImplementingBasicActivities.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch04-ImplementingBasicActivities.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -10,7 +10,7 @@
   <section id="activity">
     <title>Activity</title>
     <para>The PVM library doesn't have a fixed set of process constructs. 
-    Instead, runtime behaviour of a node is delegated to an <literal>Activity</literal>.  
+    Instead, runtime behaviour of a activity is delegated to an <literal>Activity</literal>.  
     In other words, <literal>Activity</literal> is an interface to implement the runtime 
     behaviour of process constructs in plain Java.
     </para>
@@ -19,11 +19,11 @@
   void <emphasis role="bold">execute</emphasis>(ActivityExecution execution) throws Exception;
   
 }</programlisting>
-    <para>When an activity is used as the node behaviour, it is in full control of the further 
-    propagation of the execution.  In other words, a node behaviour can decide what the execution 
+    <para>When an activity is used as the activity behaviour, it is in full control of the further 
+    propagation of the execution.  In other words, a activity behaviour can decide what the execution 
     should do next.  For example, it can take a transition with 
     <literal>execution.take(Transition)</literal> or go into a wait state with 
-    <literal>execution.waitForSignal()</literal>.  In case the node behaviour does not invoke 
+    <literal>execution.waitForSignal()</literal>.  In case the activity behaviour does not invoke 
     any of the above execution propagation methods, the execution will 
     <link linkend="implicitproceedbehaviour">proceed in a default way</link>.
     </para>
@@ -53,9 +53,9 @@
       <mediaobject><imageobject><imagedata align="center" fileref="images/process.ab.png"/></imageobject></mediaobject>
     </figure>
     <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build()
-    .<emphasis role="bold">node("a").initial()</emphasis>.behaviour(<emphasis role="bold">new Display("hello")</emphasis>)
+    .<emphasis role="bold">activity("a").initial()</emphasis>.behaviour(<emphasis role="bold">new Display("hello")</emphasis>)
       .transition().to("b")
-    .<emphasis role="bold">node("b")</emphasis>.behaviour(<emphasis role="bold">new Display("world")</emphasis>)
+    .<emphasis role="bold">activity("b")</emphasis>.behaviour(<emphasis role="bold">new Display("world")</emphasis>)
 .done();</programlisting>
     <para>Now we can execute this process as follows:</para>
     <programlisting>Execution execution = processDefinition.startExecution();</programlisting>
@@ -72,14 +72,14 @@
     <para>The other part that needs explanation is that this activity 
     implementation does not contain any instructions for the propagation of the
     execution.  When a new process instance is started, the execution is positioned
-    in the initial node and that activity is executed.  The method 
+    in the initial activity and that activity is executed.  The method 
     <literal>Display.execute</literal> makes use of what is called implicit propagation 
     of execution.  Concretely this means that the activity itself does not 
     invoke any of the methods on the execution to propagate it.  In that case 
     implicit propagation kicks in.  Implicit propagation will take the first 
     transition if there is one.  If not, it will end the execution.  This explains 
-    why both nodes <literal>a</literal> and <literal>b</literal> are executed and that 
-    the execution stops after node <literal>b</literal> is executed. 
+    why both activities <literal>a</literal> and <literal>b</literal> are executed and that 
+    the execution stops after activity <literal>b</literal> is executed. 
     </para>
     <para>More details about the implicit proceed behaviour can be found 
     in <xref linkend="implicitproceedbehaviour" /></para>
@@ -102,8 +102,8 @@
               Map&lt;String, Object&gt; parameters) throws Exception;
               
 }</programlisting>
-    <para>Just like with plain activities, when an execution arrives in a node, the 
-    <literal>execute</literal>-method of the node behaviour is invoked.
+    <para>Just like with plain activities, when an execution arrives in a activity, the 
+    <literal>execute</literal>-method of the activity behaviour is invoked.
     In external activities, the execute method typically does something to 
     transfer the responsibility to another system and then enters a wait 
     state by invoking <literal>execution.waitForSignal()</literal>.  For 
@@ -111,10 +111,10 @@
     person by creating a task entry in a task management system and then
     wait until the person completes the task.
     </para>
-    <para>In case a node behaves as a wait state, then the execution will 
-    wait in that node until the execution's <literal>signal</literal> method 
+    <para>In case a activity behaves as a wait state, then the execution will 
+    wait in that activity until the execution's <literal>signal</literal> method 
     is invoked.  The execution will delegate that signal to the behaviour Activity 
-    of the current node.
+    of the current activity.
     </para>
     <para>So the Activity's <literal>signal</literal>-method is invoked 
     when the execution receives an external trigger during the wait state.  With the 
@@ -123,7 +123,7 @@
     signal method on the execution.
     </para>  
     <para>A signal can optionally have a signal name and a map of parameters.  Most 
-    common way on how node behaviours interprete the signal and parameters is that 
+    common way on how activity behaviours interprete the signal and parameters is that 
     the signal relates to the outgoing transition that needs to be taken and that the 
     parameters are set as variables on the execution. But those are just examples, it 
     is up to the activity to use the signal and the parameters as it pleases.
@@ -158,24 +158,24 @@
     transition and the execution will be propagated over that transition.
     </para>
     <para>Here's the same simple process that has a transition from a to b.  This 
-    time, the behaviour of the two nodes will be WaitState's.
+    time, the behaviour of the two activities will be WaitState's.
     </para>
     <figure id="process.diagram">
       <title>The external activity example process</title>
       <mediaobject><imageobject><imagedata align="center" fileref="images/process.ab.png"/></imageobject></mediaobject>
     </figure>
     <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build()
-    <emphasis role="bold">.node("a").initial().behaviour(new WaitState())</emphasis>
+    <emphasis role="bold">.activity("a").initial().behaviour(new WaitState())</emphasis>
       .transition().to("b")
-    <emphasis role="bold">.node("b").behaviour(new WaitState())</emphasis>
+    <emphasis role="bold">.activity("b").behaviour(new WaitState())</emphasis>
 .done();</programlisting>
     <para>Let's start a new process instance for this process definition:</para>
     <programlisting>ClientExecution execution = processDefinition.startProcessInstance();</programlisting>
     <para>Starting this process will execute the <literal>WaitState</literal> activity 
-    in node <literal>a</literal>.  <literal>WaitState.execute</literal> will invoke 
+    in activity <literal>a</literal>.  <literal>WaitState.execute</literal> will invoke 
     <literal>ActivityExecution.waitForSignal</literal>.  So when the 
     <literal>processDefinition.startProcessInstance()</literal> returns, the execution 
-    will still be positioned in node a.  
+    will still be positioned in activity a.  
     </para>
     <programlisting>assertEquals("a", execution.getNodeName());</programlisting>
     <para>Then we provide the external trigger by calling the <literal>signal</literal> 
@@ -183,17 +183,17 @@
     </para>
     <programlisting>execution.signal();</programlisting>
     <para>The <literal>execution.signal()</literal> will delegate to the activity 
-    of the current node.  So in this case that is the <literal>WaitState</literal>
-    activity in node <literal>a</literal>.  The <literal>WaitState.signal</literal>
+    of the current activity.  So in this case that is the <literal>WaitState</literal>
+    activity in activity <literal>a</literal>.  The <literal>WaitState.signal</literal>
     will invoke the <literal>ActivityExecution.take(String transitionName)</literal>.
     Since we didn't supply a signalName, the first transition with name <literal>null</literal>
-    will be taken.  The only transition we specified out of node <literal>a</literal> 
-    didn't get a name so that one will be taken.  And that transition points to node 
-    <literal>b</literal>.  When the execution arrives in node <literal>b</literal>,
-    the <literal>WaitState</literal> in node <literal>b</literal> is executed. 
-    Similar as we saw above, the execution will wait in node <literal>b</literal>
+    will be taken.  The only transition we specified out of activity <literal>a</literal> 
+    didn't get a name so that one will be taken.  And that transition points to activity 
+    <literal>b</literal>.  When the execution arrives in activity <literal>b</literal>,
+    the <literal>WaitState</literal> in activity <literal>b</literal> is executed. 
+    Similar as we saw above, the execution will wait in activity <literal>b</literal>
     and this time the <literal>signal</literal> method will return, leaving the 
-    execution positioned in node <literal>b</literal>.  
+    execution positioned in activity <literal>b</literal>.  
     </para>
     <programlisting>assertEquals("b", execution.getNodeName());</programlisting>
   </section>
@@ -218,16 +218,16 @@
     interface</ulink>.    
     </para>
     <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build("loan")
-  .node(<emphasis role="bold">"submit loan request"</emphasis>).initial().behaviour(new Display("loan request submitted"))
+  .activity(<emphasis role="bold">"submit loan request"</emphasis>).initial().behaviour(new Display("loan request submitted"))
     .transition().to("evaluate")
-  <emphasis role="bold">.node("evaluate").behaviour(new WaitState())</emphasis>
+  <emphasis role="bold">.activity("evaluate").behaviour(new WaitState())</emphasis>
     .transition("approve").to("wire money")
     .transition("reject").to("end")
-  <emphasis role="bold">.node("wire money").behaviour(new Display("wire the money"))</emphasis>
+  <emphasis role="bold">.activity("wire money").behaviour(new Display("wire the money"))</emphasis>
     .transition().to("archive")
-  <emphasis role="bold">.node("archive").behaviour(new WaitState())</emphasis>
+  <emphasis role="bold">.activity("archive").behaviour(new WaitState())</emphasis>
     .transition().to("end")
-  <emphasis role="bold">.node("end").behaviour(new WaitState())</emphasis>
+  <emphasis role="bold">.activity("end").behaviour(new WaitState())</emphasis>
 .done();</programlisting>
     <para>For more details about the ProcessFactory, see <ulink url="../../api/org/jbpm/pvm/package-summary.html">the
     api docs</ulink>.  An alternative for 
@@ -236,9 +236,9 @@
     <literal>org.jbpm.pvm.internal.model</literal> directly. That approach is typically taken by 
     process languages.  
     </para>
-    <para>The initial node <literal>submit loan request</literal> and the node 
-    <literal>wire the money</literal> are automatic nodes.  In this example, 
-    the <literal>Display</literal> implementation of node 
+    <para>The initial activity <literal>submit loan request</literal> and the activity 
+    <literal>wire the money</literal> are automatic activities.  In this example, 
+    the <literal>Display</literal> implementation of activity 
     <literal>wire the money</literal> uses the Java API's to just print a 
     message to the console.  But the witty reader can imagine an alternative 
     <literal>Activity</literal> implementation that uses the Java API of a payment 
@@ -247,12 +247,12 @@
     <para>A new execution for the process above can be started like this
     </para>
     <programlisting>ClientExecution execution = processDefinition.startProcessInstance();</programlisting>
-    <para>When the <literal>startExecution</literal>-method returns, the node 
+    <para>When the <literal>startExecution</literal>-method returns, the activity 
     <literal>submit loan request</literal> will be executed and the execution will be 
-    positioned in the node <literal>evaluate</literal>.
+    positioned in the activity <literal>evaluate</literal>.
     </para>
     <figure id="execution.loan.evaluate">
-      <title>Execution positioned in the 'evaluate' node</title>
+      <title>Execution positioned in the 'evaluate' activity</title>
       <mediaobject><imageobject><imagedata align="center" fileref="images/execution.loan.evaluate.png"/></imageobject></mediaobject>
     </figure>
     <para>Now, the execution is at an interesting point.  There are two transitions out of 
@@ -263,17 +263,17 @@
     </para>
     <programlisting>execution.signal("approve");</programlisting>
     <para>The <literal>approve</literal> signal will cause the execution to take the <literal>approve</literal>
-    transition and it will arrive in the node <literal>wire money</literal>.
+    transition and it will arrive in the activity <literal>wire money</literal>.
     </para>
-    <para>In node <literal>wire money</literal>, the message will be printed to the console.
+    <para>In activity <literal>wire money</literal>, the message will be printed to the console.
     Since, the <literal>Display</literal> activity didn't invoke the 
     <literal>execution.waitForSignal()</literal>, nor any of the other execution propagation 
     methods, the implicit proceed behaviour will just make the execution continue 
-    over the outgoing transition to node <literal>archive</literal>, which is again 
+    over the outgoing transition to activity <literal>archive</literal>, which is again 
     a <literal>WaitState</literal>.
     </para>
     <figure id="execution.loan.archive">
-      <title>Execution positioned in 'archive' node</title>
+      <title>Execution positioned in 'archive' activity</title>
       <mediaobject><imageobject><imagedata align="center" fileref="images/execution.loan.archive.png"/></imageobject></mediaobject>
     </figure>
     <para>So only when the <literal>archive</literal> wait state is reached, 
@@ -283,7 +283,7 @@
     <programlisting>execution.signal("approve");</programlisting>
     <para>will bring the execution eventually in the end state.</para>
     <figure id="execution.loan.end">
-      <title>Execution positioned in the 'end' node</title>
+      <title>Execution positioned in the 'end' activity</title>
       <mediaobject><imageobject><imagedata align="center" fileref="images/execution.loan.end.png"/></imageobject></mediaobject>
     </figure>
   </section>
@@ -318,15 +318,15 @@
       <listitem><literal><emphasis role="bold">Event.TRANSITION_TAKE</emphasis> = "transition-take"</literal> : 
       fired on transitions when transitions are taken. 
       </listitem>
-      <listitem><literal><emphasis role="bold">Event.NODE_BEGIN</emphasis> = "node-begin"</literal> : fired on the node 
-      when execution enters that node.  This happens when execution takes a transition 
-      to that node, when a child node is being executed with <literal>execution.execute(Node)</literal>
-      or when a transition is taken from a node outside that node to a contained node.
+      <listitem><literal><emphasis role="bold">Event.NODE_BEGIN</emphasis> = "activity-begin"</literal> : fired on the activity 
+      when execution enters that activity.  This happens when execution takes a transition 
+      to that activity, when a child activity is being executed with <literal>execution.execute(Node)</literal>
+      or when a transition is taken from a activity outside that activity to a contained activity.
       The latter refers to super states in state machines.  
       </listitem>
-      <listitem><literal><emphasis role="bold">Event.NODE_END</emphasis> = "node-end"</literal> : fired on the node 
-      when a transition is taken out of that node or when a child node execution is 
-      finished and the execution is propagated to the parent node.
+      <listitem><literal><emphasis role="bold">Event.NODE_END</emphasis> = "activity-end"</literal> : fired on the activity 
+      when a transition is taken out of that activity or when a child activity execution is 
+      finished and the execution is propagated to the parent activity.
       </listitem>
       <listitem><literal><emphasis role="bold">Event.PROCESS_BEGIN</emphasis> = "process-begin"</literal> : fired on a process 
       when a new process is started.
@@ -349,7 +349,7 @@
     <para>A list of <literal>EventListeners</literal> can be associated to an 
     event. But event listeners can not influence the control flow of the execution since 
     they are merely listeners to an execution which is already in progress.  This is different from 
-    activities that serve as the behaviour for nodes.  Node behaviour activities are responsible 
+    activities that serve as the behaviour for activities.  Node behaviour activities are responsible 
     for propagating the execution. 
     </para>
     <para>We'll create a <literal>PrintLn</literal> event listener which is 
@@ -374,14 +374,14 @@
       <mediaobject><imageobject><imagedata align="center" fileref="images/process.ab.png"/></imageobject></mediaobject>
     </figure>
     <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build()
-  .node("a").initial().behaviour(new AutomaticActivity())
-    <emphasis role="bold">.event("node-end")
+  .activity("a").initial().behaviour(new AutomaticActivity())
+    <emphasis role="bold">.event("activity-end")
       .listener(new PrintLn("leaving a"))
       .listener(new PrintLn("second message while leaving a"))</emphasis>
     .transition().to("b")
       <emphasis role="bold">.listener(new PrintLn("taking transition"))</emphasis>
-  .node("b").behaviour(new WaitState())
-    .event("node-begin")
+  .activity("b").behaviour(new WaitState())
+    .event("activity-begin")
       <emphasis role="bold">.listener(new PrintLn("entering b"))</emphasis>
 .done();</programlisting>
      <para>The first event shows how to register multiple listeners to the same 
@@ -402,12 +402,12 @@
   <section>
     <title>Event propagation</title>
     <para>Events are by default propagated to enclosing process elements.  The motivation 
-    is to allow for listeners on process definitions or composite nodes that get executed
+    is to allow for listeners on process definitions or composite activities that get executed
     for all events that occur within that process element.  For example this feature 
-    allows to register an event listener on a process definition or a composite node on 
-    <literal>node-end</literal> events.  Such action will be executed if that node is 
-    left.  And if that event listener is registered on a composite node, it will also be executed 
-    for all nodes that are left within that composite node. 
+    allows to register an event listener on a process definition or a composite activity on 
+    <literal>activity-end</literal> events.  Such action will be executed if that activity is 
+    left.  And if that event listener is registered on a composite activity, it will also be executed 
+    for all activities that are left within that composite activity. 
     </para>
     <para>To show this clearly, we'll create a <literal>DisplaySource</literal> event listener
     that will print the message <literal>leaving</literal> and the source of the event
@@ -421,62 +421,62 @@
 }</programlisting>
     <para>Note that the purpose of event listeners is not to be visible, that's why the event listener 
     itself should not be displayed in the diagram. A <literal>DisplaySource</literal> event listener
-    will be added as a listener to the event <literal>node-end</literal> on the composite node.  
+    will be added as a listener to the event <literal>activity-end</literal> on the composite activity.  
     </para>
     <para>The next process shows how the <literal>DisplaySource</literal> event listener is registered 
-    as a listener to to the 'node-end' event on the <literal>composite</literal> node:</para>
+    as a listener to to the 'activity-end' event on the <literal>composite</literal> activity:</para>
     <figure id="process.propagate">
-      <title>A process with an invisible event listener on a node-end event on a composite node.</title>
+      <title>A process with an invisible event listener on a activity-end event on a composite activity.</title>
       <mediaobject><imageobject><imagedata align="center" fileref="images/process.propagate.png"/></imageobject></mediaobject>
     </figure>
     <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build("propagate")
   <emphasis role="bold">.compositeNode("composite")
     .event(Event.NODE_END) 
       .listener(new DisplaySource())</emphasis>
-    .node("a").initial().behaviour(new WaitState())
+    .activity("a").initial().behaviour(new WaitState())
       .transition().to("b")
-    .node("b").behaviour(new WaitState())
+    .activity("b").behaviour(new WaitState())
       .transition().to("c")
   .compositeEnd()
-  .node("c").behaviour(new WaitState())
+  .activity("c").behaviour(new WaitState())
 .done();</programlisting>
     <para>Next we'll start an execution.</para>
     <programlisting>ClientExecution execution = processDefinition.startProcessInstance();</programlisting>
-    <para>After starting a new execution, the execution will be in node <literal>a</literal> as 
-    that is the initial node.  No nodes have been left so no message is logged.  Next a signal 
+    <para>After starting a new execution, the execution will be in activity <literal>a</literal> as 
+    that is the initial activity.  No activities have been left so no message is logged.  Next a signal 
     will be given to the execution, causing it to take the transition from <literal>a</literal>
     to <literal>b</literal>.
     </para>
     <programlisting>execution.signal();</programlisting>  
     <para>When the signal method returns, the execution will have taken the transition and 
-    the <literal>node-end</literal> event will be fired on node <literal>a</literal>.  That 
+    the <literal>activity-end</literal> event will be fired on activity <literal>a</literal>.  That 
     event will be propagated to the 
-    composite node and to the process definition.  Since our <literal>DisplaySource</literal> 
+    composite activity and to the process definition.  Since our <literal>DisplaySource</literal> 
     event listener is placed 
-    on the <literal>composite</literal> node, it will receive the event and print the following 
+    on the <literal>composite</literal> activity, it will receive the event and print the following 
     message on the console:
     </para>
-    <programlisting>leaving node(a)</programlisting>
+    <programlisting>leaving activity(a)</programlisting>
     <para>Another</para>
     <programlisting>execution.signal();</programlisting>
-    <para>will take the transition from b to c.  That will fire two node-leave events.  One on  
-    node b and one on node composite.  So the following lines will be appended to the console 
+    <para>will take the transition from b to c.  That will fire two activity-leave events.  One on  
+    activity b and one on activity composite.  So the following lines will be appended to the console 
     output:</para>  
-    <programlisting>leaving node(b)
-leaving node(composite)</programlisting>
+    <programlisting>leaving activity(b)
+leaving activity(composite)</programlisting>
     <para>Event propagation is build on the hierarchical composition structure of the process 
     definition.  The top level element is always the process definition.  The process 
-    definition contains a list of nodes.  Each node can be a leaf node or it can be a 
-    composite node, which means that it contains a list of nested nodes.  Nested nodes 
+    definition contains a list of activities.  Each activity can be a leaf activity or it can be a 
+    composite activity, which means that it contains a list of nested activities.  Nested activities 
     can be used for e.g. super states or composite activities in nested process languages like BPEL.    
     </para>
-    <para>So the even model also works similarly for composite nodes as it did for the process 
+    <para>So the even model also works similarly for composite activities as it did for the process 
     definition above.  Suppose that 'Phase one' models 
     a super state as in state machines.  Then event propagation allows to subscribe to all events 
     within that super state.  The idea is that the hierarchical composition corresponds to 
     diagram representation. If an element 'e' is drawn inside another element 'p', then p 
-    is the parent of e. A process definition has a set of top level nodes.  Every node can have 
-    a set of nested nodes.  The parent of a transition is considered as the first common 
+    is the parent of e. A process definition has a set of top level activities.  Every activity can have 
+    a set of nested activities.  The parent of a transition is considered as the first common 
     parent for it's source and destination.  
     </para>
     <para>If an event listener is not interested in propagated events, propagation can be disabled 
@@ -486,7 +486,7 @@
     remains the same.
     </para>
     <figure id="process.propagate.propagation.disabled">
-      <title>A process with an event listener to 'node-end' events with propagation disabled.</title>
+      <title>A process with an event listener to 'activity-end' events with propagation disabled.</title>
       <mediaobject><imageobject><imagedata align="center" fileref="images/process.propagate.png"/></imageobject></mediaobject>
     </figure>
     <para>Building the process with the process factory:
@@ -496,16 +496,16 @@
     .event(Event.NODE_END) 
       .listener(new DisplaySource())
       <emphasis role="bold">.propagationDisabled()</emphasis>
-    .node("a").initial().behaviour(new WaitState())
+    .activity("a").initial().behaviour(new WaitState())
       .transition().to("b")
-    .node("b").behaviour(new WaitState())
+    .activity("b").behaviour(new WaitState())
       .transition().to("c")
   .compositeEnd()
-  .node("c").behaviour(new WaitState())
+  .activity("c").behaviour(new WaitState())
 .done();</programlisting>
-    <para>So when the first signal is given for this process, again the <literal>node-end</literal> 
-    event will be fired on node <literal>a</literal>, but now the event listener on the composite 
-    node will not be executed cause 
+    <para>So when the first signal is given for this process, again the <literal>activity-end</literal> 
+    event will be fired on activity <literal>a</literal>, but now the event listener on the composite 
+    activity will not be executed cause 
     propagated events have been disabled.  Disabling propagation is a property on the individual 
     event listener and doesn't influence the other listeners.  The event will always be fired and 
     propagated over the whole parent hierarchy.
@@ -518,19 +518,19 @@
     <para>Next, the second signal will take the transition from b to c.  
     </para>
     <programlisting>execution.signal()</programlisting>
-    <para>Again two <literal>node-end</literal>
-    events are fired just like above on nodes <literal>b</literal> and <literal>composite</literal> 
+    <para>Again two <literal>activity-end</literal>
+    events are fired just like above on activities <literal>b</literal> and <literal>composite</literal> 
     respectively.  The first event 
-    is the <literal>node-end</literal> event on node <literal>b</literal>.  That will be propagated 
-    to the <literal>composite</literal> node.  So the event 
+    is the <literal>activity-end</literal> event on activity <literal>b</literal>.  That will be propagated 
+    to the <literal>composite</literal> activity.  So the event 
     listener will not be executed for this event cause it has propagation disabled.  But the 
-    event listener will be executed for the <literal>node-end</literal> event on the 
-    <literal>composite</literal> node.  That is not 
-    propagated, but fired directly on the <literal>composite</literal> node.  So the event 
+    event listener will be executed for the <literal>activity-end</literal> event on the 
+    <literal>composite</literal> activity.  That is not 
+    propagated, but fired directly on the <literal>composite</literal> activity.  So the event 
     listener will now be executed 
-    only once for the composite node as shown in the following console output: 
+    only once for the composite activity as shown in the following console output: 
     </para>
-    <programlisting>leaving node(composite)</programlisting>
+    <programlisting>leaving activity(composite)</programlisting>
   </section>
 
 </chapter>

Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch05-ProcessAnatomy.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch05-ProcessAnatomy.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch05-ProcessAnatomy.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -2,15 +2,15 @@
   <title>Process anatomy</title>
   
   <para>Above we already touched briefly on the two main process constructs: 
-  Nodes, transitions and node composition.  This chapter explores in full 
+  Nodes, transitions and activity composition.  This chapter explores in full 
   all the possibilities of the process definition structures.
   </para>
   
   <para>There are basically two forms of process languages: graph based and composite 
   process languages.  First of all, the process supports both.  Even graph based execution 
-  and node composition can be used in combination to implement something like UML super states.
+  and activity composition can be used in combination to implement something like UML super states.
   Furthermore, automatic functional activities can be implemented so that they can be 
-  used with transitions as well as with node composition.
+  used with transitions as well as with activity composition.
   </para>
 
   <figure id="process.anatomy">
@@ -23,7 +23,7 @@
   </para>
   
   <figure id="transition">
-    <title>Any two nodes can be connected with a transition.</title>
+    <title>Any two activities can be connected with a transition.</title>
     <mediaobject><imageobject><imagedata align="center" fileref="images/transition.png"/></imageobject></mediaobject>
   </figure>
 
@@ -31,32 +31,32 @@
     <title>A self transition.</title>
     <mediaobject><imageobject><imagedata align="center" fileref="images/self.transition.png"/></imageobject></mediaobject>
   </figure>
-  <figure id="composite.node">
-    <title>Composite node is a list of nested nodes.</title>
-    <mediaobject><imageobject><imagedata align="center" fileref="images/composite.node.png"/></imageobject></mediaobject>
+  <figure id="composite.activity">
+    <title>Composite activity is a list of nested activities.</title>
+    <mediaobject><imageobject><imagedata align="center" fileref="images/composite.activity.png"/></imageobject></mediaobject>
   </figure>
   <figure id="transition.into.composite">
-    <title>Transition to a node inside a composite.</title>
+    <title>Transition to a activity inside a composite.</title>
     <mediaobject><imageobject><imagedata align="center" fileref="images/transition.into.composite.png"/></imageobject></mediaobject>
   </figure>
   <figure id="transition.out.of.composite">
-    <title>Transition from a node inside a composite to a node outside the composite.</title>
+    <title>Transition from a activity inside a composite to a activity outside the composite.</title>
     <mediaobject><imageobject><imagedata align="center" fileref="images/transition.out.of.composite.png"/></imageobject></mediaobject>
   </figure>
   <figure id="transition.inheritence">
-    <title>Transition of composite nodes are inherited.  The node inside can take the transition of the composite node.</title>
+    <title>Transition of composite activities are inherited.  The activity inside can take the transition of the composite activity.</title>
     <mediaobject><imageobject><imagedata align="center" fileref="images/transition.inheritence.png"/></imageobject></mediaobject>
   </figure>
   <figure id="transition.to.outer">
-    <title>Transition from a node to an outer composite.</title>
+    <title>Transition from a activity to an outer composite.</title>
     <mediaobject><imageobject><imagedata align="center" fileref="images/transition.to.outer.png"/></imageobject></mediaobject>
   </figure>
   <figure id="transition.to.inner">
-    <title>Transition from a composite node to an inner composed node.</title>
+    <title>Transition from a composite activity to an inner composed activity.</title>
     <mediaobject><imageobject><imagedata align="center" fileref="images/transition.to.inner.png"/></imageobject></mediaobject>
   </figure>
   <figure id="initial.in.composite">
-    <title>An initial node inside a composite node.</title>
+    <title>An initial activity inside a composite activity.</title>
     <mediaobject><imageobject><imagedata align="center" fileref="images/initial.in.composite.png"/></imageobject></mediaobject>
   </figure>
 </chapter>
\ No newline at end of file

Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch06-ImplementingAdvancedActivities.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch06-ImplementingAdvancedActivities.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch06-ImplementingAdvancedActivities.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -4,7 +4,7 @@
   <!-- ### LOOPS ########################################################## -->
   <section>
     <title>Loops</title>
-    <para>Activities can implement loops based on transitions or on node composition.  
+    <para>Activities can implement loops based on transitions or on activity composition.  
     Loops can contain wait states.    
     </para>
     <para>To support high numbers of automatic loop executions, the Process Virtual Machine 
@@ -21,7 +21,7 @@
   <!-- ### DEFAULT PROCEED BEHAVIOUR ###################################### -->
   <section id="implicitproceedbehaviour">
     <title>Implicit proceed behaviour</title>
-    <para>When an <literal>Activity</literal> is used as node behaviour, it can 
+    <para>When an <literal>Activity</literal> is used as activity behaviour, it can 
     explicitely propagate the execution with following methods:
     </para>
     <itemizedlist>
@@ -31,14 +31,14 @@
       <listitem><literal>execute(Node)</literal></listitem>
       <listitem><literal>createExecution(*)</literal></listitem>
     </itemizedlist>
-    <para>When <literal>Activity</literal> implementations used for node behviour 
+    <para>When <literal>Activity</literal> implementations used for activity behviour 
     don't call any of the following execution propagation methods, then, after 
     the activity is executed, the execution will apply the implicit proceed behaviour. 
     </para>
     <para>The implicit proceed behaviour is defined as follows:</para>
     <itemizedlist>
-      <listitem>If the current node has a default outgoing transition, take it.</listitem>
-      <listitem>If the current node has a parent node, move back to the parent node.</listitem>
+      <listitem>If the current activity has a default outgoing transition, take it.</listitem>
+      <listitem>If the current activity has a parent activity, move back to the parent activity.</listitem>
       <listitem>Otherwise, end this execution.</listitem>
     </itemizedlist>
     <para>Process languages can overwrite the implicit proceed behaviour 
@@ -98,7 +98,7 @@
     and the <link linkend="architecture">asynchronous command service</link>.
     </para>
     <para>The next process will show the basics concretely.  It has three wait states 
-    and four automatic nodes.
+    and four automatic activities.
     </para>
     <figure id="process.automatic">
       <title>Process with many sequential automatic activities.</title>
@@ -106,30 +106,30 @@
     </figure>
     <para>Here's how to build the process:</para>
     <programlisting>ClientProcessDefinition processDefinition = ProcessFactory.build("automatic")
-    .<emphasis role="bold">node("wait 1").initial()</emphasis>.behaviour(new <emphasis role="bold">WaitState</emphasis>())
+    .<emphasis role="bold">activity("wait 1").initial()</emphasis>.behaviour(new <emphasis role="bold">WaitState</emphasis>())
       .transition().to("automatic 1")
-    .<emphasis role="bold">node("automatic 1")</emphasis>.behaviour(new <emphasis role="bold">Display("one")</emphasis>)
+    .<emphasis role="bold">activity("automatic 1")</emphasis>.behaviour(new <emphasis role="bold">Display("one")</emphasis>)
       .transition().to("wait 2")
-    .<emphasis role="bold">node("wait 2")</emphasis>.behaviour(new <emphasis role="bold">WaitState</emphasis>())
+    .<emphasis role="bold">activity("wait 2")</emphasis>.behaviour(new <emphasis role="bold">WaitState</emphasis>())
       .transition().to("automatic 2")
-    .<emphasis role="bold">node("automatic 2")</emphasis>.behaviour(new <emphasis role="bold">Display("two")</emphasis>)
+    .<emphasis role="bold">activity("automatic 2")</emphasis>.behaviour(new <emphasis role="bold">Display("two")</emphasis>)
       .transition().to("automatic 3")
-    .<emphasis role="bold">node("automatic 3")</emphasis>.behaviour(new <emphasis role="bold">Display("three")</emphasis>)
+    .<emphasis role="bold">activity("automatic 3")</emphasis>.behaviour(new <emphasis role="bold">Display("three")</emphasis>)
       .transition().to("automatic 4")
-    .<emphasis role="bold">node("automatic 4")</emphasis>.behaviour(new <emphasis role="bold">Display("four")</emphasis>)
+    .<emphasis role="bold">activity("automatic 4")</emphasis>.behaviour(new <emphasis role="bold">Display("four")</emphasis>)
       .transition().to("wait 3")
-    .<emphasis role="bold">node("wait 3")</emphasis>.behaviour(new <emphasis role="bold">WaitState</emphasis>())
+    .<emphasis role="bold">activity("wait 3")</emphasis>.behaviour(new <emphasis role="bold">WaitState</emphasis>())
 .done();</programlisting>
     <para>Let's walk you through one execution of this process.  
     </para>
     <programlisting>ClientExecution execution = processDefinition.startProcessInstance();</programlisting>
-    <para>Starting a new execution means that the initial node is executed.  So if an automatic 
-    activity is the initial node, this means that immediately the first unnamed outgoing transition 
+    <para>Starting a new execution means that the initial activity is executed.  So if an automatic 
+    activity is the initial activity, this means that immediately the first unnamed outgoing transition 
     is taken.  This happens all inside of the invocation of <literal>startProcessInstance</literal>.
     </para>
-    <para>In this case however, the initial node is a wait state.  So 
+    <para>In this case however, the initial activity is a wait state.  So 
     the method <literal>startProcessInstance</literal> returns immediately and the execution will be 
-    positioned in the initial node 'wait 1'.
+    positioned in the initial activity 'wait 1'.
     </para>
     <figure id="execution.automatic.wait1">
       <title>A new execution will be positioned in 'wait 1'.</title>
@@ -139,7 +139,7 @@
     <programlisting>execution.signal();</programlisting>
     <para>As explained above when <link linkend="externalactivityexample">introducing the WaitState</link>, 
     that signal will cause the default transition to be taken.  The 
-    transition will move the execution to node <literal>automatic 1</literal> and execute it.  
+    transition will move the execution to activity <literal>automatic 1</literal> and execute it.  
     The execute method of the <literal>Display</literal> activity in <literal>automatic 1</literal> 
     print a line to the console and it will <emphasis role="bold">not</emphasis> call 
     <literal>execution.waitForSignal()</literal>.  Therefore, the execution will proceed by 
@@ -266,14 +266,14 @@
       <mediaobject><imageobject><imagedata align="center" fileref="images/execution.concurrency.png"/></imageobject></mediaobject>
     </figure>
     <para>There is a billing and a shipping path of execution.  In this case, the 
-    flat bar nodes represent nodes that fork and join.  The execution shows a three 
+    flat bar activities represent activities that fork and join.  The execution shows a three 
     executions.  The main path of execution is inactive (represented as gray) and the 
-    billing and shipping paths of execution are active and point to the node 
+    billing and shipping paths of execution are active and point to the activity 
     <literal>bill</literal> and <literal>ship</literal> respectively.
     </para>
-    <para>It's up to the node behaviour implementations how they want to use this 
+    <para>It's up to the activity behaviour implementations how they want to use this 
     execution structure.  Suppose that multiple tasks have to be completed before the 
-    execution is to proceed.  The node behaviour can spawn a series of child executions 
+    execution is to proceed.  The activity behaviour can spawn a series of child executions 
     for this.  Or alternatively, the task component could support task groups that 
     are associated to one single execution.  In that case, the task component becomes
     responsible for synchronizing the tasks, thereby moving this responsibility 
@@ -346,7 +346,7 @@
     Firing events, updating variables, updating priority and adding comments 
     are not considered to change an execution. Also creation and removal of child 
     executions are unchecked, which means that those methods can be invoked by 
-    external API clients and node behaviour methods, even while the execution 
+    external API clients and activity behaviour methods, even while the execution 
     is in a locked state.
     </para> 
     <para>Make sure that comparisons between getState() and the STATE_* constants 
@@ -379,13 +379,13 @@
     of a service invocation, a timer could cause the execution to take the timeout transition.
     When the response arrives after the timeout, the service invocation entity should 
     make sure it doesn't signal the execution.  So the service invocation can be 
-    seen as a node instance (aka activity instance) and is unique for every execution 
-    of the node.
+    seen as a activity instance (aka activity instance) and is unique for every execution 
+    of the activity.
     </para>
     <para>External entities themselves are responsible for managing the execution 
     lock.  If the timers and client applications are consequent in addressing the 
     external entities instead of the execution directly, then locking is in theory 
-    unnecessary.  It's up to the node behaviour implementations whether they want 
+    unnecessary.  It's up to the activity behaviour implementations whether they want 
     to take the overhead of locking and unlocking.
     </para>
   </section>

Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-DelegationClasses.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-DelegationClasses.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-DelegationClasses.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -38,7 +38,7 @@
   
    <section>
      <title>Design time versus runtime</title>
-     <para>TODO: the node behaviour allows for design time as well as runtime behaviour.</para>
+     <para>TODO: the activity behaviour allows for design time as well as runtime behaviour.</para>
    </section>
     
    <section>

Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Persistence.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Persistence.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-Persistence.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -118,7 +118,7 @@
       <title>The persistent process</title>
       <mediaobject><imageobject><imagedata align="center" fileref="images/ch09.persistent.process.png"/></imageobject></mediaobject>
     </figure>
-    <para>The activities in the three nodes will be wait states just like 
+    <para>The activities in the three activities will be wait states just like 
     in <xref linkend="externalactivityexample" /> 
     </para>
     <para>To make sure we can persist this class, we create the hibernate mapping for 
@@ -155,25 +155,25 @@
   PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
   
   ProcessDefinition processDefinition = ProcessFactory.build("persisted process")
-    .node("one").initial().behaviour(new State())
+    .activity("one").initial().behaviour(new State())
       .transition().to("two")
-    .node("two").behaviour(new State())
+    .activity("two").behaviour(new State())
       .transition().to("three")
-    .node("three").behaviour(new State())
+    .activity("three").behaviour(new State())
   .done();
   
   pvmDbSession.save(processDefinition);
 } finally {
   environment.close();
 }</programlisting>
-    <para>In the previous transaction, the process definition, the nodes and transitions 
+    <para>In the previous transaction, the process definition, the activities and transitions 
     will be inserted into the database tables.
     </para>
     <para>Next we'll show how a new process execution can be started for this 
     process definition.  Note that in this case, we provide <link linkend="businesskey">a 
     business key</link> called 'first'.  This will make it easy for us to retrieve 
     the same execution from the database in subsequent transactions.  After starting 
-    the new process execution, it will wait in node 'one' cause the behaviour is a 
+    the new process execution, it will wait in activity 'one' cause the behaviour is a 
     wait state.
     </para>
     <programlisting>environment = environmentFactory.openEnvironment();
@@ -217,7 +217,7 @@
 }</programlisting>
     <para>The previous transaction will result in an update of the existing 
     execution, reassigning the foreign key to reference another record in 
-    the node table.
+    the activity table.
     </para>
     <programlisting>UPDATE JBPM_EXECUTION 
 SET
@@ -232,7 +232,7 @@
     </para>
     <para>In the example code, there is one more transaction that is 
     completely similar to the previous which takes the execution from 
-    node 'two' to node 'three'. 
+    activity 'two' to activity 'three'. 
     </para>
     <para>All of this shows that the PVM can move from one wait state to 
     another wait state transactionally.  Each transaction correcponds to 

Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-ProcessLanguages.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-ProcessLanguages.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/chxx-ProcessLanguages.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -7,13 +7,13 @@
   </para>
   <para>TODO: overriding the default proceed()
   </para>
-  <para>TODO: node type implementations
+  <para>TODO: activity type implementations
   </para>
   <para>TODO: persistence
   </para>
   <para>TODO: compensation: languages like bpel and bpnm define that 
        as a normal contination that fits within the process 
        structures available in the pvm (taking a transition and 
-       executing a nested node). 
+       executing a nested activity). 
   </para>
 </chapter>
\ No newline at end of file

Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,14 +24,14 @@
 import java.util.Map;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
-import org.jbpm.model.Node;
+import org.jbpm.activity.ExternalActivityBehaviour;
+import org.jbpm.model.Activity;
 import org.jbpm.model.Transition;
 
 /**
  * @author Alejandro Guizar
  */
-public class WaitState implements ExternalActivity {
+public class WaitState implements ExternalActivityBehaviour {
 
   private static final long serialVersionUID = 1L;
 
@@ -45,10 +45,10 @@
       execution.setVariables(parameters);
     }
 
-    Node node = execution.getNode();
-    execution.fire(signalName, node);
+    Activity activity = execution.getNode();
+    execution.fire(signalName, activity);
 
-    Transition transition = node.findOutgoingTransition(signalName);
+    Transition transition = activity.findOutgoingTransition(signalName);
     if (transition != null) {
       execution.take(transition);
     }

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/multiple/EndMultipleTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -37,7 +37,7 @@
     String executionId = execution.getId();
     execution = executionService.signalExecutionById(executionId, "200");
     assertTrue(execution.isEnded());
-    assertEquals("ok", execution.getNodeName());
+    assertEquals("ok", execution.getActivityName());
   }
 
   public void testEndMultipleBadRequest() {
@@ -47,7 +47,7 @@
     String executionId = execution.getId();
     execution = executionService.signalExecutionById(executionId, "400");
     assertTrue(execution.isEnded());
-    assertEquals("bad request", execution.getNodeName());
+    assertEquals("bad request", execution.getActivityName());
   }
 
   public void testEndMultipleInternalServerError() {
@@ -57,6 +57,6 @@
     String executionId = execution.getId();
     execution = executionService.signalExecutionById(executionId, "500");
     assertTrue(execution.isEnded());
-    assertEquals("internal server error", execution.getNodeName());
+    assertEquals("internal server error", execution.getActivityName());
   }
 }

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/end/state/EndStateTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -37,7 +37,7 @@
     String executionId = execution.getId();
     execution = executionService.signalExecutionById(executionId, "200");
     assertEquals("completed", execution.getState());
-    assertEquals("ok", execution.getNodeName());
+    assertEquals("ok", execution.getActivityName());
   }
 
   public void testEndStateErrorBadRequest() {
@@ -47,7 +47,7 @@
     String executionId = execution.getId();
     execution = executionService.signalExecutionById(executionId, "400");
     assertEquals("cancel", execution.getState());
-    assertEquals("bad request", execution.getNodeName());
+    assertEquals("bad request", execution.getActivityName());
   }
 
   public void testEndStateErrorInternalServerError() {
@@ -57,6 +57,6 @@
     String executionId = execution.getId();
     execution = executionService.signalExecutionById(executionId, "500");
     assertEquals("error", execution.getState());
-    assertEquals("internal server error", execution.getNodeName());
+    assertEquals("internal server error", execution.getActivityName());
   }
 }

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/conditions/ExclusiveConditionsTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/conditions/ExclusiveConditionsTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/conditions/ExclusiveConditionsTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -39,7 +39,7 @@
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("content", "good");
     Execution execution = executionService.startExecutionByKey("ExclusiveConditions", variables);
-    assertEquals("submit document", execution.getNodeName());
+    assertEquals("submit document", execution.getActivityName());
   }
 
   public void testExclusiveConditionsBad() {
@@ -48,7 +48,7 @@
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("content", "bad");
     Execution execution = executionService.startExecutionByKey("ExclusiveConditions", variables);
-    assertEquals("try again", execution.getNodeName());
+    assertEquals("try again", execution.getActivityName());
   }
 
   public void testExclusiveConditionsUgly() {
@@ -57,7 +57,7 @@
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("content", "ugly");
     Execution execution = executionService.startExecutionByKey("ExclusiveConditions", variables);
-    assertEquals("give up", execution.getNodeName());
+    assertEquals("give up", execution.getActivityName());
   }
 
 }

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/expression/ExclusiveExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/expression/ExclusiveExpressionTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/expression/ExclusiveExpressionTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -39,7 +39,7 @@
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("content", "good");
     Execution execution = executionService.startExecutionByKey("ExclusiveExpression", variables);
-    assertEquals("submit document", execution.getNodeName());
+    assertEquals("submit document", execution.getActivityName());
   }
 
   public void testExclusiveExpressionBad() {
@@ -48,7 +48,7 @@
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("content", "bad");
     Execution execution = executionService.startExecutionByKey("ExclusiveExpression", variables);
-    assertEquals("try again", execution.getNodeName());
+    assertEquals("try again", execution.getActivityName());
   }
 
   public void testExclusiveExpressionUgly() {
@@ -57,7 +57,7 @@
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("content", "ugly");
     Execution execution = executionService.startExecutionByKey("ExclusiveExpression", variables);
-    assertEquals("give up", execution.getNodeName());
+    assertEquals("give up", execution.getActivityName());
   }
 
 }

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ExclusiveHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ExclusiveHandlerTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/exclusive/handler/ExclusiveHandlerTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -39,7 +39,7 @@
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("content", "you're great");
     Execution execution = executionService.startExecutionByKey("ExclusiveHandler", variables);
-    assertEquals("submit document", execution.getNodeName());
+    assertEquals("submit document", execution.getActivityName());
   }
 
   public void testExclusiveHandlerImprove() {
@@ -48,7 +48,7 @@
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("content", "you gotta improve");
     Execution execution = executionService.startExecutionByKey("ExclusiveHandler", variables);
-    assertEquals("try again", execution.getNodeName());
+    assertEquals("try again", execution.getActivityName());
   }
 
   public void testExclusiveHandlerSuck() {
@@ -57,6 +57,6 @@
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("content", "you suck");
     Execution execution = executionService.startExecutionByKey("ExclusiveHandler", variables);
-    assertEquals("give up", execution.getNodeName());
+    assertEquals("give up", execution.getActivityName());
   }
 }

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/hql/HqlTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -46,12 +46,12 @@
     Map<String, Object> variables = executionService.getVariables(executionId, variableNames);
 
     Map<String, Object> expectedVariables = new HashMap<String, Object>();
-    List<String> nodeNames = new ArrayList<String>();
-    nodeNames.add("get process names");
-    nodeNames.add("count nodes");
-    expectedVariables.put("nodes with o", nodeNames);
+    List<String> activityNames = new ArrayList<String>();
+    activityNames.add("get process names");
+    activityNames.add("count activities");
+    expectedVariables.put("activities with o", activityNames);
 
-    expectedVariables.put("nodes", new Long(4));
+    expectedVariables.put("activities", new Long(4));
 
     assertEquals(expectedVariables, variables);
   }

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/sql/SqlTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -41,12 +41,12 @@
     
     List<String> expectedNodeNames = new ArrayList<String>();
     expectedNodeNames.add("get process names");
-    expectedNodeNames.add("count nodes");
-    Object nodeNames = executionService.getVariable(executionId, "nodes with o");
-    assertEquals(expectedNodeNames, nodeNames);
+    expectedNodeNames.add("count activities");
+    Object activityNames = executionService.getVariable(executionId, "activities with o");
+    assertEquals(expectedNodeNames, activityNames);
     
-    Object nodes = executionService.getVariable(executionId, "nodes");
-    assertEquals("4", nodes.toString());
+    Object activities = executionService.getVariable(executionId, "activities");
+    assertEquals("4", activities.toString());
   }
 
 }

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/choice/StateChoiceTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -36,7 +36,7 @@
     Execution execution = executionService.startExecutionByKey("StateChoice");
     String executionId = execution.getId();
     execution = executionService.signalExecutionById(executionId, "accept");
-    assertEquals("submit document", execution.getNodeName());
+    assertEquals("submit document", execution.getActivityName());
   }
 
   public void testStateChoiceReject() {
@@ -45,6 +45,6 @@
     Execution execution = executionService.startExecutionByKey("StateChoice");
     String executionId = execution.getId();
     execution = executionService.signalExecutionById(executionId, "reject");
-    assertEquals("try again", execution.getNodeName());
+    assertEquals("try again", execution.getActivityName());
   }
 }

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/state/sequence/StateSequenceTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -34,14 +34,14 @@
     deployJpdlResource("org/jbpm/examples/state/sequence/process.jpdl.xml");
     
     Execution execution = executionService.startExecutionByKey("StateSequence");
-    assertEquals("a", execution.getNodeName());
+    assertEquals("a", execution.getActivityName());
 
     String executionId = execution.getId();
     execution = executionService.signalExecutionById(executionId);
-    assertEquals("b", execution.getNodeName());
+    assertEquals("b", execution.getActivityName());
 
     execution = executionService.signalExecutionById(executionId);
-    assertEquals("c", execution.getNodeName());
+    assertEquals("c", execution.getActivityName());
   }
 
 }

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/task/TaskTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -54,7 +54,7 @@
 
     // verify that process moved to the next state
     execution = executionService.findExecution(executionId);
-    assertEquals("wait", execution.getNodeName());
+    assertEquals("wait", execution.getActivityName());
   }
 
 }

Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/hql/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/hql/process.jpdl.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/hql/process.jpdl.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -7,26 +7,26 @@
   </start>
 
   <hql name="get process names"
-       var="nodes with o"
+       var="activities with o"
        g="96,16,115,52">
     <query>
-      select node.name
-      from org.jbpm.pvm.internal.model.NodeImpl as node
-      where node.name like :nodeName
+      select activity.name
+      from org.jbpm.pvm.internal.model.ActivityImpl as activity
+      where activity.name like :activityName
     </query>
     <parameters>
-      <string name="nodeName" value="%o%" />
+      <string name="activityName" value="%o%" />
     </parameters>
-    <flow to="count nodes" />
+    <flow to="count activities" />
   </hql>
   
-  <hql name="count nodes"
-       var="nodes"
+  <hql name="count activities"
+       var="activities"
        unique="true"
        g="243,16,95,52">
     <query>
       select count(*)
-      from org.jbpm.pvm.internal.model.NodeImpl
+      from org.jbpm.pvm.internal.model.ActivityImpl
     </query>
     <flow to="wait" />
   </hql>

Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/sql/process.jpdl.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -7,26 +7,26 @@
   </start>
 
   <sql name="get process names"
-       var="nodes with o"
+       var="activities with o"
        g="96,16,126,52">
     <query>
       select NAME_
-      from JBPM_NODE 
-      where NAME_ like :nodeName
+      from JBPM_ACTIVITY 
+      where NAME_ like :activityName
     </query>
     <parameters>
-      <string name="nodeName" value="%o%" />
+      <string name="activityName" value="%o%" />
     </parameters>
-    <flow to="count nodes" />
+    <flow to="count activities" />
   </sql>
   
-  <sql name="count nodes"
-       var="nodes"
+  <sql name="count activities"
+       var="activities"
        unique="true"
        g="254,16,92,52">
     <query>
       select count(*)
-      from JBPM_NODE
+      from JBPM_ACTIVITY
     </query>
     <flow to="wait" />
   </sql>

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveBinding.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,7 +24,7 @@
 import java.util.List;
 
 import org.jbpm.pvm.internal.model.ExpressionEvaluator;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.TransitionImpl;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.wire.binding.ObjectBinding;
@@ -75,8 +75,8 @@
     
     boolean hasConditions = false;
     List<Element> transitionElements = XmlUtil.elements(element, "flow");
-    NodeImpl node = parse.findObject(NodeImpl.class);
-    List<TransitionImpl> transitions = (List) node.getOutgoingTransitions();
+    ActivityImpl activity = parse.findObject(ActivityImpl.class);
+    List<TransitionImpl> transitions = (List) activity.getOutgoingTransitions();
     
     for (int i=0; i<transitionElements.size(); i++) {
       TransitionImpl transition = transitions.get(i);

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveConditionActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -26,7 +26,7 @@
 import org.jbpm.activity.ActivityExecution;
 import org.jbpm.jpdl.JpdlException;
 import org.jbpm.model.Condition;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.Transition;
 
 
@@ -46,8 +46,8 @@
   }
 
   private Transition findTransition(ActivityExecution execution) {
-    Node node = execution.getNode();
-    List<Transition> outgoingTransitions = node.getOutgoingTransitions();
+    Activity activity = execution.getNode();
+    List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
     for (Transition transition : outgoingTransitions) {
       Condition condition = transition.getCondition();
       if  ( (condition==null)

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveExpressionActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,7 +24,7 @@
 import org.jbpm.JbpmException;
 import org.jbpm.activity.ActivityExecution;
 import org.jbpm.env.EnvironmentHelper;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.Transition;
 import org.jbpm.pvm.internal.script.ScriptManager;
 
@@ -39,7 +39,7 @@
   protected String lang;
 
   public void execute(ActivityExecution execution) throws Exception {
-    Node node = execution.getNode();
+    Activity activity = execution.getNode();
     String transitionName = null;
 
     ScriptManager scriptManager = EnvironmentHelper.get(ScriptManager.class);
@@ -47,13 +47,13 @@
     if ( (result!=null)
          && (! (result instanceof String))
        ) {
-      throw new JbpmException("expression '"+expr+"' in exclusive '"+node.getName()+"' returned "+result.getClass().getName()+" instead of a transitionName (String): "+result);
+      throw new JbpmException("expression '"+expr+"' in exclusive '"+activity.getName()+"' returned "+result.getClass().getName()+" instead of a transitionName (String): "+result);
     }
     transitionName = (String) result;
     
-    Transition transition = node.getOutgoingTransition(transitionName);
+    Transition transition = activity.getOutgoingTransition(transitionName);
     if (transition==null) {
-      throw new JbpmException("expression '"+expr+"' in exclusive '"+node.getName()+"' returned unexisting outgoing transition name: "+transitionName);
+      throw new JbpmException("expression '"+expr+"' in exclusive '"+activity.getName()+"' returned unexisting outgoing transition name: "+transitionName);
     }
 
     execution.take(transition);

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ExclusiveHandlerActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -26,7 +26,7 @@
 import org.jbpm.env.Environment;
 import org.jbpm.jpdl.ExclusiveHandler;
 import org.jbpm.jpdl.JpdlException;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.Transition;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.WireContext;
@@ -42,7 +42,7 @@
   protected Descriptor exclusiveHandlerDescriptor;
 
   public void execute(ActivityExecution execution) throws Exception {
-    Node node = execution.getNode();
+    Activity activity = execution.getNode();
     String transitionName = null;
 
     Object object = null; 
@@ -54,7 +54,7 @@
     }
     
     if (object==null) {
-      throw new JpdlException("exclusive handler for "+node+" is null");
+      throw new JpdlException("exclusive handler for "+activity+" is null");
     }
     if (! (object instanceof ExclusiveHandler)) {
       throw new JpdlException("handler for exclusive is not a "+ExclusiveHandler.class.getName()+": "+object.getClass().getName());
@@ -62,9 +62,9 @@
     ExclusiveHandler exclusiveHandler = (ExclusiveHandler) object;
     transitionName = exclusiveHandler.select(execution);
 
-    Transition transition = node.getOutgoingTransition(transitionName);
+    Transition transition = activity.getOutgoingTransition(transitionName);
     if (transition==null) {
-      throw new JbpmException("handler in exclusive '"+node.getName()+"' returned unexisting outgoing transition name: "+transitionName);
+      throw new JbpmException("handler in exclusive '"+activity.getName()+"' returned unexisting outgoing transition name: "+transitionName);
     }
 
     execution.take(transition);

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ForkActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ForkActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/ForkActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,7 +25,7 @@
 
 import org.jbpm.Execution;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.OpenExecution;
 import org.jbpm.model.Transition;
 
@@ -40,8 +40,8 @@
   public void execute(ActivityExecution execution) throws Exception {
     OpenExecution processInstance = execution.getProcessInstance();
 
-    Node node = execution.getNode();
-    List<Transition> outgoingTransitions = node.getOutgoingTransitions();
+    Activity activity = execution.getNode();
+    List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
 
     // for each outgoing transition
     for (Transition outgoingTransition: outgoingTransitions) {

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JoinActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JoinActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JoinActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -27,7 +27,7 @@
 
 import org.jbpm.Execution;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.OpenExecution;
 import org.jbpm.model.Transition;
 
@@ -45,7 +45,7 @@
     execution.setState(Execution.STATE_INACTIVE);
     execution.waitForSignal();
     
-    Node join = execution.getNode();
+    Activity join = execution.getNode();
     List<OpenExecution> joinedExecutions = findJoinedExecutions(execution, join);
     
     if (isComplete(joinedExecutions, join)) {
@@ -68,13 +68,13 @@
     }
   }
   
-  List<OpenExecution> findJoinedExecutions(OpenExecution execution, Node join) {
+  List<OpenExecution> findJoinedExecutions(OpenExecution execution, Activity join) {
     List<OpenExecution> joinedExecutions = new ArrayList<OpenExecution>();
     scanRecursive(execution.getProcessInstance(), join, joinedExecutions);
     return joinedExecutions;
   }
 
-  void scanRecursive(OpenExecution execution, Node join, List<OpenExecution> joinedExecutions) {
+  void scanRecursive(OpenExecution execution, Activity join, List<OpenExecution> joinedExecutions) {
     // if the execution is positioned in the join
     if (join.equals(execution.getNode())) {
       joinedExecutions.add(execution);
@@ -87,7 +87,7 @@
     }
   }
 
-  boolean isComplete(List<OpenExecution> joinedExecutions, Node join) {
+  boolean isComplete(List<OpenExecution> joinedExecutions, Activity join) {
     int executionsToJoin = join.getIncomingTransitions().size();
     return (executionsToJoin==joinedExecutions.size());
   }

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,12 +21,12 @@
  */
 package org.jbpm.jpdl.activity;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 
 /**
  * @author Tom Baeyens
  */
-public abstract class JpdlActivity implements Activity {
+public abstract class JpdlActivity implements ActivityBehaviour {
   
   private static final long serialVersionUID = 1L;
 

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivityBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivityBinding.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlActivityBinding.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,7 +24,7 @@
 import java.util.List;
 
 import org.jbpm.jpdl.xml.UnresolvedTransitions;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.TransitionImpl;
 import org.jbpm.pvm.internal.util.TagBinding;
 import org.jbpm.pvm.internal.util.XmlUtil;
@@ -41,7 +41,7 @@
     super(tagName, "http://jbpm.org/4/jpdl", "activity");
   }
   
-  public void parseName(Element element, NodeImpl node, Parse parse) {
+  public void parseName(Element element, ActivityImpl activity, Parse parse) {
     String name = XmlUtil.attribute(element, "name", isNameRequired(), parse);
     
     if (name!=null) {
@@ -51,7 +51,7 @@
       } else if (name.indexOf('/')!=-1) {
         parse.addProblem(XmlUtil.errorMessageAttribute(element, "name", name, "contains slash (/)"));
       }
-      node.setName(name);
+      activity.setName(name);
     }
   }
 
@@ -59,12 +59,12 @@
     return true;
   }
 
-  public void parseFlows(Element element, NodeImpl node, Parse parse) {
+  public void parseFlows(Element element, ActivityImpl activity, Parse parse) {
     List<Element> transitionElements = XmlUtil.elements(element, "flow");
     UnresolvedTransitions unresolvedTransitions = parse.findObject(UnresolvedTransitions.class);
     for (Element transitionElement: transitionElements) {
       String transitionName = XmlUtil.attribute(transitionElement, "name", false, parse);
-      TransitionImpl transition = node.createOutgoingTransition(transitionName);
+      TransitionImpl transition = activity.createOutgoingTransition(transitionName);
       unresolvedTransitions.add(transition, transitionElement);
     }
   }

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlExternalActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlExternalActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/JpdlExternalActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,11 +21,11 @@
  */
 package org.jbpm.jpdl.activity;
 
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 
 /**
  * @author Tom Baeyens
  */
-public abstract class JpdlExternalActivity extends JpdlActivity implements ExternalActivity {
+public abstract class JpdlExternalActivity extends JpdlActivity implements ExternalActivityBehaviour {
 
 }

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StartBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StartBinding.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StartBinding.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -22,7 +22,7 @@
 package org.jbpm.jpdl.activity;
 
 import org.jbpm.jpdl.xml.StartNodes;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.xml.Parse;
 import org.jbpm.pvm.internal.xml.Parser;
 import org.w3c.dom.Element;
@@ -38,7 +38,7 @@
   }
 
   public Object parse(Element element, Parse parse, Parser parser) {
-    NodeImpl startNode = parse.findObject(NodeImpl.class);
+    ActivityImpl startNode = parse.findObject(ActivityImpl.class);
     StartNodes startNodes = parse.findObject(StartNodes.class);
     startNodes.add(startNode);
     return new StartActivity();

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,7 +24,7 @@
 import java.util.Map;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.Transition;
 
 /**
@@ -39,15 +39,15 @@
   }
 
   public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) {
-    Node node = execution.getNode();
+    Activity activity = execution.getNode();
     
     if (parameters!=null) {
       execution.setVariables(parameters);
     }
     
-    execution.fire(signalName, node);
+    execution.fire(signalName, activity);
     
-    Transition transition = node.findOutgoingTransition(signalName);
+    Transition transition = activity.findOutgoingTransition(signalName);
     if (transition!=null) {
       execution.take(transition);
     } else {

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateBinding.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateBinding.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/StateBinding.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,7 +21,7 @@
  */
 package org.jbpm.jpdl.activity;
 
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.xml.Parse;
 import org.jbpm.pvm.internal.xml.Parser;

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/activity/TaskActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -39,7 +39,7 @@
   public void execute(ActivityExecution execution) {
     TaskDbSession taskDbSession = Environment.getFromCurrent(TaskDbSession.class);
     TaskImpl task = TaskImpl.create(execution);
-    task.setName(execution.getNodeName());
+    task.setName(execution.getActivityName());
     task.setAssignee(assignee);
     taskDbSession.saveTask(task);
     

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -28,11 +28,11 @@
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.SAXParser;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.jpdl.JpdlProcessDefinition;
 import org.jbpm.jpdl.activity.JpdlActivityBinding;
 import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.pvm.internal.util.ReflectUtil;
 import org.jbpm.pvm.internal.util.XmlUtil;
@@ -127,13 +127,13 @@
       for (Element element: elements) {
         JpdlActivityBinding activityBinding = (JpdlActivityBinding) getBinding(element, "activity");
         if (activityBinding!=null) {
-          NodeImpl node = (NodeImpl) processDefinition.createNode();
-          parse.pushObject(node);
+          ActivityImpl activity = (ActivityImpl) processDefinition.createNode();
+          parse.pushObject(activity);
           try {
-            activityBinding.parseName(element, node, parse);
-            activityBinding.parseFlows(element, node, parse);
-            Activity activity = (Activity) activityBinding.parse(element, parse, this);
-            node.setBehaviour(activity);
+            activityBinding.parseName(element, activity, parse);
+            activityBinding.parseFlows(element, activity, parse);
+            ActivityBehaviour activityBehaviour = (ActivityBehaviour) activityBinding.parse(element, parse, this);
+            activity.setBehaviour(activityBehaviour);
           } finally {
             parse.popObject();
           }
@@ -149,9 +149,9 @@
       // TODO remove the initial attribute parsing
       String initialNodeName = XmlUtil.attribute(documentElement, "initial", false, parse);
       if (initialNodeName!=null) {
-        NodeImpl initial = processDefinition.getNode(initialNodeName);
+        ActivityImpl initial = processDefinition.getActivity(initialNodeName);
         if (initial==null) {
-          parse.addProblem("initial node '"+initialNodeName+"' was not found");
+          parse.addProblem("initial activity '"+initialNodeName+"' was not found");
         } else {
           processDefinition.setInitial(initial);
         }
@@ -168,7 +168,7 @@
       parse.addProblem("multiple start events not yet supported");
       // TODO verify that all start events have conditions
     } else {
-      NodeImpl uniqueStartEvent = startNodes.get(0);
+      ActivityImpl uniqueStartEvent = startNodes.get(0);
       processDefinition.setInitial(uniqueStartEvent);
     }
     

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartNodes.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartNodes.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/StartNodes.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,7 +24,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 
 
 /**
@@ -32,10 +32,10 @@
  */
 public class StartNodes {
   
-  List<NodeImpl> startEvents = new ArrayList<NodeImpl>();
+  List<ActivityImpl> startEvents = new ArrayList<ActivityImpl>();
   
   
-  public void add(NodeImpl startEventNode) {
+  public void add(ActivityImpl startEventNode) {
     startEvents.add(startEventNode);
   }
 
@@ -43,7 +43,7 @@
     return startEvents.size();
   }
 
-  public NodeImpl get(int i) {
+  public ActivityImpl get(int i) {
     return startEvents.get(i);
   }
 

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/UnresolvedTransition.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/UnresolvedTransition.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/UnresolvedTransition.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,7 +21,7 @@
  */
 package org.jbpm.jpdl.xml;
 
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.pvm.internal.model.TransitionImpl;
 import org.jbpm.pvm.internal.util.XmlUtil;
@@ -38,11 +38,11 @@
   public void resolve(ProcessDefinitionImpl processDefinition, Parse parse) {
     String to = XmlUtil.attribute(transitionElement, "to", true, parse);
     if (to!=null) {
-      NodeImpl destination = (NodeImpl) processDefinition.findNode(to);
+      ActivityImpl destination = (ActivityImpl) processDefinition.findActivity(to);
       if (destination!=null) {
         destination.addIncomingTransition(transition);
       } else {
-        parse.addProblem(XmlUtil.errorMessageAttribute(transitionElement, "to", to, "doesn't reference an existing node name"));
+        parse.addProblem(XmlUtil.errorMessageAttribute(transitionElement, "to", to, "doesn't reference an existing activity name"));
       }
     }
   }

Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/NodeParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/NodeParsingTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/NodeParsingTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -34,10 +34,10 @@
   public void testInvalidNodeName() {
     List<Problem> problems = parseProblems(
       "<process name='p'>" +
-      "  <state name='invalid / nodename' />" +
+      "  <state name='invalid / activityname' />" +
       "</process>"
     );
-    assertTextPresent("attribute <state name=\"invalid / nodename\" contains slash (/)", problems.get(0).getMsg());
+    assertTextPresent("attribute <state name=\"invalid / activityname\" contains slash (/)", problems.get(0).getMsg());
   }
 
   public void testEmptyNodeName() {

Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/ProcessParsingTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -38,9 +38,9 @@
       "</process>"
     );
     assertEquals("p", processDefinition.getName());
-    assertNotNull(processDefinition.getNode("n"));
-    assertSame(processDefinition.getNode("n"), processDefinition.getInitial());
-    assertEquals(1, processDefinition.getNodes().size());
+    assertNotNull(processDefinition.getActivity("n"));
+    assertSame(processDefinition.getActivity("n"), processDefinition.getInitial());
+    assertEquals(1, processDefinition.getActivities().size());
   }
 
   public void testProcessWithoutAttributes() {
@@ -80,7 +80,7 @@
     List<Problem> problems = parseProblems(
       "<process name='p' initial='ufo' />"
     );
-    assertTextPresent("initial node 'ufo' was not found", problems.get(0).getMsg());
+    assertTextPresent("initial activity 'ufo' was not found", problems.get(0).getMsg());
   }
 
   public void testProcessWithEmptyInitial() {

Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,7 +25,7 @@
 
 import org.jbpm.Problem;
 import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.Transition;
 
 
@@ -43,11 +43,11 @@
       "  <state name='b' />" +
       "</process>"
     );
-    Node a = processDefinition.getNode("a");
+    Activity a = processDefinition.getActivity("a");
     assertNotNull(a);
     Transition transition = a.getOutgoingTransitions().get(0);
     assertNotNull(transition);
-    Node b = processDefinition.getNode("b");
+    Activity b = processDefinition.getActivity("b");
     assertNotNull(b);
     assertSame(b, transition.getDestination());
   }
@@ -60,7 +60,7 @@
       "  </state>" +
       "</process>"
     );
-    Node a = processDefinition.getNode("a");
+    Activity a = processDefinition.getActivity("a");
     assertNotNull(a);
     Transition transition = a.getOutgoingTransitions().get(0);
     assertNotNull(transition);
@@ -97,7 +97,7 @@
       "  </state>" +
       "</process>"
     );
-    assertTextPresent("attribute <transition to=\"unexisting\" doesn't reference an existing node name", problems.get(0).getMsg());
+    assertTextPresent("attribute <transition to=\"unexisting\" doesn't reference an existing activity name", problems.get(0).getMsg());
   }
 
   public void testMultipleOutgoingTransitions() {
@@ -112,9 +112,9 @@
       "  <state name='c' />" +
       "</process>"
     );
-    Node a = processDefinition.getNode("a");
-    Node b = processDefinition.getNode("b");
-    Node c = processDefinition.getNode("c");
+    Activity a = processDefinition.getActivity("a");
+    Activity b = processDefinition.getActivity("b");
+    Activity c = processDefinition.getActivity("c");
 
     assertSame(b, a.getOutgoingTransitions().get(0).getDestination());
     assertSame(b, a.getOutgoingTransitions().get(1).getDestination());
@@ -134,9 +134,9 @@
       "  <state name='c' />" +
       "</process>"
     );
-    Node a = processDefinition.getNode("a");
-    Node b = processDefinition.getNode("b");
-    Node c = processDefinition.getNode("c");
+    Activity a = processDefinition.getActivity("a");
+    Activity b = processDefinition.getActivity("b");
+    Activity c = processDefinition.getActivity("c");
 
     assertSame(c, a.getOutgoingTransitions().get(0).getDestination());
     assertSame(c, a.getOutgoingTransitions().get(1).getDestination());

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBehaviourBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBehaviourBuilder.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBehaviourBuilder.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,7 +21,7 @@
  */
 package org.jbpm.pvm.internal.builder;
 
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 
 
 /**
@@ -30,11 +30,11 @@
 public class ActivityBehaviourBuilder {
   
   protected ActivityBuilder activityBuilder;
-  protected NodeImpl node;
+  protected ActivityImpl activity;
 
   public ActivityBehaviourBuilder(ActivityBuilder activityBuilder) {
     this.activityBuilder = activityBuilder;
-    this.node = activityBuilder.node;
+    this.activity = activityBuilder.activity;
   }
   
   public ActivityBuilder endBehaviour() {

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBuilder.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ActivityBuilder.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -23,7 +23,7 @@
 
 import java.lang.reflect.Constructor;
 
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 
 /**
@@ -35,21 +35,21 @@
 
   /** the enclosing composite */
   protected CompositeBuilder compositeBuilder;
-  protected NodeImpl node;
+  protected ActivityImpl activity;
   
-  public ActivityBuilder(CompositeBuilder compositeBuilder, String nodeName) {
+  public ActivityBuilder(CompositeBuilder compositeBuilder, String activityName) {
     this.compositeBuilder = compositeBuilder;
-    this.node = compositeBuilder.createActivity();
-    this.compositeElement = node;
-    this.node.setName(nodeName);
+    this.activity = compositeBuilder.createActivity();
+    this.compositeElement = activity;
+    this.activity.setName(activityName);
   }
   
   public ActivityBuilder initial() {
-    setProcessDefinitionInitial(node);
+    setProcessDefinitionInitial(activity);
     return this;
   }
   
-  protected void setProcessDefinitionInitial(NodeImpl initial) {
+  protected void setProcessDefinitionInitial(ActivityImpl initial) {
     compositeBuilder.setProcessDefinitionInitial(initial);
   }
 
@@ -57,14 +57,14 @@
     return startBehaviour(null, activityBehaviourBuilderType);
   }
 
-  public <T extends ActivityBehaviourBuilder> T startBehaviour(String nodeName, Class<T> activityBehaviourBuilderType) {
+  public <T extends ActivityBehaviourBuilder> T startBehaviour(String activityName, Class<T> activityBehaviourBuilderType) {
     if (activityBehaviourBuilderType==null) {
       throw new RuntimeException("activityBuilderType is null");
     }
     try {
       Constructor<T> constructor = activityBehaviourBuilderType.getConstructor(ACTIVITYBEHAVIOURBUILDER_PARAMTYPES);
-      T nodeBuilder = constructor.newInstance(new Object[]{this});
-      return nodeBuilder;
+      T activityBuilder = constructor.newInstance(new Object[]{this});
+      return activityBuilder;
     } catch (Exception e) {
       throw new RuntimeException("couldn't instantiate activity behaviour builder type "+activityBehaviourBuilderType.getName(), e);
     }
@@ -76,7 +76,7 @@
   
   public FlowBuilder startFlow(String to) {
     UnresolvedFlow unresolvedFlow = new UnresolvedFlow();
-    unresolvedFlow.transition = node.createOutgoingTransition();
+    unresolvedFlow.transition = activity.createOutgoingTransition();
     unresolvedFlow.destinationName = to;
     addUnresolvedFlow(unresolvedFlow);
     return new FlowBuilder(this, unresolvedFlow.transition);
@@ -97,7 +97,7 @@
   }
 
   public ActivityBuilder asyncExecute() {
-    node.setExecutionAsync(true);
+    activity.setExecutionAsync(true);
     return this;
   }
 
@@ -106,12 +106,12 @@
   }
 
   public ActivityBuilder needsPrevious() {
-    node.setPreviousNeeded(true);
+    activity.setPreviousNeeded(true);
     return this;
   }
 
   public ActivityBuilder scope() {
-    node.setLocalScope(true);
+    activity.setLocalScope(true);
     return this;
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/CompositeBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/CompositeBuilder.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/CompositeBuilder.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -22,10 +22,10 @@
 package org.jbpm.pvm.internal.builder;
 
 import org.jbpm.JbpmException;
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.pvm.internal.model.CompositeElementImpl;
 import org.jbpm.pvm.internal.model.EventImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
@@ -40,9 +40,9 @@
   
   public abstract ProcessDefinitionImpl endProcess();
   protected abstract void addUnresolvedFlow(UnresolvedFlow unresolvedFlow);
-  protected abstract void setProcessDefinitionInitial(NodeImpl initial);
+  protected abstract void setProcessDefinitionInitial(ActivityImpl initial);
 
-  protected NodeImpl createActivity() {
+  protected ActivityImpl createActivity() {
     return compositeElement.createNode();
   }
 
@@ -78,42 +78,42 @@
     return startActivity((String)null);
   }
 
-  public ActivityBuilder startActivity(String nodeName) {
-    return new ActivityBuilder(this, nodeName);
+  public ActivityBuilder startActivity(String activityName) {
+    return new ActivityBuilder(this, activityName);
   }
 
   public ActivityBuilder startActivity(Descriptor activityDescriptor) {
     return startActivity(null, activityDescriptor);
   }
 
-  public ActivityBuilder startActivity(String nodeName, Descriptor activityDescriptor) {
+  public ActivityBuilder startActivity(String activityName, Descriptor activityDescriptor) {
     if (activityDescriptor==null) {
       throw new RuntimeException("activityDescriptor is null");
     }
-    ActivityBuilder activityBuilder = new ActivityBuilder(this, nodeName);
-    activityBuilder.node.setBehaviour(activityDescriptor);
+    ActivityBuilder activityBuilder = new ActivityBuilder(this, activityName);
+    activityBuilder.activity.setBehaviour(activityDescriptor);
     return activityBuilder;
   }
 
-  public ActivityBuilder startActivity(Activity activity) {
-    return startActivity(null, activity);
+  public ActivityBuilder startActivity(ActivityBehaviour activityBehaviour) {
+    return startActivity(null, activityBehaviour);
   }
 
-  public ActivityBuilder startActivity(String nodeName, Activity activity) {
-    if (activity==null) {
+  public ActivityBuilder startActivity(String activityName, ActivityBehaviour activityBehaviour) {
+    if (activityBehaviour==null) {
       throw new RuntimeException("activity is null");
     }
-    ActivityBuilder activityBuilder = new ActivityBuilder(this, nodeName);
-    activityBuilder.node.setBehaviour(activity);
+    ActivityBuilder activityBuilder = new ActivityBuilder(this, activityName);
+    activityBuilder.activity.setBehaviour(activityBehaviour);
     return activityBuilder;
   }
 
-  public ActivityBuilder startActivity(Class<? extends Activity> activityClass) {
+  public ActivityBuilder startActivity(Class<? extends ActivityBehaviour> activityClass) {
     return startActivity(null, new ObjectDescriptor(activityClass));
   }
 
-  public ActivityBuilder startActivity(String nodeName, Class<? extends Activity> activityClass) {
-    return startActivity(nodeName, new ObjectDescriptor(activityClass));
+  public ActivityBuilder startActivity(String activityName, Class<? extends ActivityBehaviour> activityClass) {
+    return startActivity(activityName, new ObjectDescriptor(activityClass));
   }
 
   public EventBuilder startEvent(String eventName) {

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/FlowBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/FlowBuilder.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/FlowBuilder.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -36,9 +36,9 @@
   protected ActivityBuilder activityBuilder;
   protected TransitionImpl transition;
   
-  public FlowBuilder(ActivityBuilder nodeBuilder, TransitionImpl transition) {
+  public FlowBuilder(ActivityBuilder activityBuilder, TransitionImpl transition) {
     super(transition, Event.TRANSITION_TAKE);
-    this.activityBuilder = nodeBuilder;
+    this.activityBuilder = activityBuilder;
     this.transition = transition;
   }
   

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ProcessDefinitionBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ProcessDefinitionBuilder.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/ProcessDefinitionBuilder.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,7 +25,7 @@
 import java.util.List;
 
 import org.jbpm.log.Log;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 
 /**
@@ -70,7 +70,7 @@
 
   protected void resolveFlows() {
     for (UnresolvedFlow unresolvedFlow: unresolvedFlows) {
-      NodeImpl destination = (NodeImpl) processDefinition.findNode(unresolvedFlow.destinationName);
+      ActivityImpl destination = (ActivityImpl) processDefinition.findActivity(unresolvedFlow.destinationName);
       if (destination==null) {
         errorUnexistingFlowDestination(unresolvedFlow);
       }
@@ -97,14 +97,14 @@
     unresolvedFlows.add(unresolvedFlow);
   }
 
-  protected void setProcessDefinitionInitial(NodeImpl initial) {
+  protected void setProcessDefinitionInitial(ActivityImpl initial) {
     if (processDefinition.getInitial()!=null) {
       errorMultipleInitials(initial);
     }
     processDefinition.setInitial(initial);
   }
 
-  protected void errorMultipleInitials(NodeImpl initial) {
+  protected void errorMultipleInitials(ActivityImpl initial) {
     log.error("multiple initial activities: "+processDefinition.getInitial()+" and "+initial);
   }
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionsCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionsCmd.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionsCmd.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -30,7 +30,7 @@
 import org.jbpm.client.ClientExecution;
 import org.jbpm.cmd.Command;
 import org.jbpm.env.Environment;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.OpenExecution;
 import org.jbpm.session.PvmDbSession;
 
@@ -66,11 +66,11 @@
 
     executions.add(execution);
     
-    // initialize node relation.  this is necessary for the method  
+    // initialize activity relation.  this is necessary for the method  
     // Execution.getNodeName()
-    Node node = execution.getNode();
-    if (node!=null) {
-      node.getName();
+    Activity activity = execution.getNode();
+    if (activity!=null) {
+      activity.getName();
     }
     
     Collection<OpenExecution> childExecutions = execution.getExecutions();

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ExecutionType.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ExecutionType.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/ExecutionType.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -14,7 +14,7 @@
 import org.jbpm.Execution;
 import org.jbpm.log.Log;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.pvm.internal.util.ReflectUtil;
 
@@ -39,9 +39,9 @@
   
   public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
     ExecutionImpl execution = createExecution(owner);
-    String nodeName = rs.getString(names[0]);
-    NodeImpl node = (NodeImpl) execution.getProcessDefinition().getNode(nodeName);
-    execution.setNode(node);
+    String activityName = rs.getString(names[0]);
+    ActivityImpl activity = (ActivityImpl) execution.getProcessDefinition().getActivity(activityName);
+    execution.setActivity(activity);
     execution.setState(Execution.STATE_ACTIVE);
     return execution;
   }
@@ -70,9 +70,9 @@
   public void nullSafeSet(PreparedStatement st, Object owner, int index) throws HibernateException, SQLException {
     if (owner!=null) {
       ExecutionImpl execution = (ExecutionImpl) owner;
-      String nodeName = execution.getNode().getName();
-      log.trace("binding 'execution-state{"+nodeName+"}' to parameter: "+index);
-      st.setString(index, nodeName);
+      String activityName = execution.getNode().getName();
+      log.trace("binding 'execution-state{"+activityName+"}' to parameter: "+index);
+      st.setString(index, activityName);
     }
   }
 
@@ -85,11 +85,11 @@
     
     ExecutionImpl original = (ExecutionImpl) object;
 
-    NodeImpl node = new NodeImpl();
-    node.setName(original.getNode().getName());
+    ActivityImpl activity = new ActivityImpl();
+    activity.setName(original.getNode().getName());
     
     ExecutionImpl copy = new ExecutionImpl();
-    copy.setNode(node);
+    copy.setActivity(activity);
 
     return copy;
   }
@@ -100,10 +100,10 @@
     ExecutionImpl execution0 = (ExecutionImpl) arg0;
     ExecutionImpl execution1 = (ExecutionImpl) arg1;
     
-    String nodeName0 = execution0.getNode().getName();
-    String nodeName1 = execution1.getNode().getName();
+    String activityName0 = execution0.getNode().getName();
+    String activityName1 = execution1.getNode().getName();
     
-    return nodeName0.equals(nodeName1);
+    return activityName0.equals(activityName1);
   }
 
   public int hashCode(Object object) throws HibernateException {

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java (from rev 3663, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/NodeImpl.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -0,0 +1,486 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jbpm.JbpmException;
+import org.jbpm.activity.ActivityBehaviour;
+import org.jbpm.model.Activity;
+import org.jbpm.model.Transition;
+import org.jbpm.pvm.internal.wire.Descriptor;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ActivityImpl extends CompositeElementImpl implements Activity {
+
+  private static final long serialVersionUID = 1L;
+  
+  protected ObjectReference<ActivityBehaviour> behaviourReference;
+  protected List<TransitionImpl> outgoingTransitions;
+  protected List<TransitionImpl> incomingTransitions;
+  protected TransitionImpl defaultTransition;
+  protected ActivityImpl parentNode;
+
+  protected boolean isLocalScope;
+  protected boolean isExecutionAsync;
+  protected boolean isSignalAsync;
+  protected boolean isLeaveAsync;
+  protected boolean isPreviousNeeded;
+  
+  transient protected Map<String, TransitionImpl> outgoingTransitionsMap;
+  
+  /**
+   * Use {@link ProcessDefinitionImpl#createNode()} or {@link ActivityImpl#createNode()} instead.
+   */
+  public ActivityImpl() {
+    super();
+  }
+  
+  // specialized activity containment methods /////////////////////////////////////
+  
+  public ActivityImpl addNode(ActivityImpl activity) {
+    activity.setParentNode(this);
+    super.addNode(activity);
+    return activity;
+  }
+  
+  public Activity findActivity(String activityName) {
+    if (activityName==null) {
+      if (name==null) {
+        return this;
+      }
+    } else if (activityName.equals(name)) {
+      return this;
+    }
+    return super.findActivity(activityName);
+  }
+
+  // leaving transitions //////////////////////////////////////////////////////
+
+  /** creates an outgoing transition from this activity. */
+  public TransitionImpl createOutgoingTransition() {
+    // create a new transition
+    TransitionImpl transition = new TransitionImpl();
+    
+    // wire it between the source and destination
+    addOutgoingTransition(transition);
+
+    // if there is no default transition yet
+    if (defaultTransition==null) {
+      // make this the default outgoing transition
+      defaultTransition = transition;
+    }
+    
+    return transition;
+  }
+  
+
+  // TODO remove
+  public Transition createOutgoingTransition(ActivityImpl destination) {
+    return createOutgoingTransition(destination, null);
+  }
+
+  // TODO remove
+  public TransitionImpl createOutgoingTransition(ActivityImpl destination, String transitionName) {
+    TransitionImpl transition = createOutgoingTransition(transitionName);
+    if (destination!=null) {
+      destination.addIncomingTransition(transition);
+    }
+    return transition;
+  }
+  
+  // TODO remove
+  public TransitionImpl createOutgoingTransition(String transitionName) {
+    // create a new transition
+    TransitionImpl transition = new TransitionImpl();
+    transition.setName(transitionName);
+    
+    // wire it between the source and destination
+    addOutgoingTransition(transition);
+
+    // if there is no default transition yet
+    if (defaultTransition==null) {
+      // make this the default outgoing transition
+      defaultTransition = transition;
+    }
+    
+    return transition;
+  }
+
+  /**
+   * adds the given transition as a leaving transition to this activity.
+   * Also the source of the transition is set to this activity.
+   * Adding a transition that is already contained in the leaving 
+   * transitions has no effect. 
+   * @return the added transition. 
+   * @throws NullPointerException if transition is null.
+   */
+  public Transition addOutgoingTransition(TransitionImpl transition) {
+    transition.setSource(this);
+    
+    if (outgoingTransitions==null) {
+      outgoingTransitions = new ArrayList<TransitionImpl>();
+    }
+    if (! outgoingTransitions.contains(transition)) {
+      outgoingTransitions.add(transition);
+    }
+    outgoingTransitionsMap = null;
+    return transition;
+  }
+  
+  /**
+   * removes the given transition from the leaving transitions.
+   * Also the transition's source will be nulled.
+   * This method will do nothing if the transition is null or if 
+   * the given transition is not in the list of this activity's leaving 
+   * transitions.
+   * In case this is the transition that was in the 
+   * outgoingTransitionsMap and another transition exists with the same
+   * name, that transition (the first) will be put in the 
+   * outgoingTransitionsMap as a replacement for the removed transition.
+   * If the transition is actually removed from the list of 
+   * leaving transitions, the transition's source will be nulled. 
+   */
+  public boolean removeOutgoingTransition(TransitionImpl transition) {
+    if ( (transition!=null)
+         && (outgoingTransitions!=null)
+       ) {
+      boolean isRemoved = outgoingTransitions.remove(transition);
+      if (isRemoved) {
+        transition.setSource(null);
+        if (outgoingTransitions.isEmpty()) {
+          outgoingTransitions = null;
+        }
+        outgoingTransitionsMap = null;
+      }
+      return isRemoved;
+    }
+    return false;
+  }
+
+  /** the first leaving transition with the given name or null of no
+   * such leaving transition exists.
+   */
+  public TransitionImpl getOutgoingTransition(String transitionName) {
+    return (getOutgoingTransitionsMap()!=null ? outgoingTransitionsMap.get(transitionName) : null);
+  }
+  
+  /** searches for the given transitionName in this activity and then up the 
+   * parent chain. Returns null if no such transition is found. */
+  public TransitionImpl findOutgoingTransition(String transitionName) {
+    TransitionImpl transition = getOutgoingTransition(transitionName);
+    if (transition!=null) {
+      return transition;
+    }
+    if (parentNode!=null) {
+      return parentNode.findOutgoingTransition(transitionName);
+    }
+    return null;
+  }
+  
+  /** searches for the default transition in this activity and then up the 
+   * parent chain. Returns null if no such transition is found. */
+  public TransitionImpl findDefaultTransition() {
+    if (defaultTransition!=null) {
+      return defaultTransition;
+    }
+    if (parentNode!=null) {
+      return parentNode.findDefaultTransition();
+    }
+    return null;
+  }
+
+  
+  /** the list of leaving transitions.
+   * Beware: the actual member is returned.  No copy is made. 
+   */
+  public List<Transition> getOutgoingTransitions() {
+    return (List) outgoingTransitions;
+  }
+
+  /** indicates if a leaving transition with the given transitionName exists. */
+  public boolean hasOutgoingTransition(String transitionName) {
+    return (getOutgoingTransition(transitionName)!=null);
+  }
+
+  /** indicates if this activity has leaving transitions */
+  public boolean hasOutgoingTransitions() {
+    return ((outgoingTransitions!=null) && (!outgoingTransitions.isEmpty()));
+  }
+
+  /** sets the outgoingTransitions to the given list of outgoingTransitions.
+   * A copy of the collection is made.  Also the outgoingTransitionsMap will 
+   * be updated and the source of all the transitions in the given list will 
+   * be set to this activity.
+   * In case there was a leaving transitions list present, these transition's
+   * source will be nulled.
+   */
+  public void setOutgoingTransitions(List<TransitionImpl> outgoingTransitions) {
+    if (this.outgoingTransitions!=null) {
+      for (TransitionImpl removedTransition: this.outgoingTransitions) {
+        removedTransition.setSource(null);
+      }
+    }
+    if (outgoingTransitions!=null) {
+      this.outgoingTransitions = new ArrayList<TransitionImpl>(outgoingTransitions);
+      for (TransitionImpl addedTransition: outgoingTransitions) {
+        addedTransition.setSource(this);
+      }
+    } else {
+      this.outgoingTransitions = null;
+    }
+    this.outgoingTransitionsMap = null;
+  }
+
+  /** the leaving transitions, keyed by transition name.  If a transition with 
+   * the same name occurs mutltiple times, the first one is returned.
+   * Leaving transitions with a null value for their name are not included 
+   * in the map.
+   * Beware: the actual member is returned.  No copy is made. 
+   */
+  public Map<String, Transition> getOutgoingTransitionsMap() {
+    if(outgoingTransitionsMap == null){
+      this.outgoingTransitionsMap = getTransitionsMap(outgoingTransitions);
+    }
+    return (Map) outgoingTransitionsMap;
+  }
+
+  // arriving transitions /////////////////////////////////////////////////////
+  
+  /**
+   * adds the given transition as an arriving transition to this activity.
+   * Also the source of the transition is set to this activity. 
+   * @return the added transition. 
+   * @throws NullPointerException if transition is null.
+   */
+  public Transition addIncomingTransition(TransitionImpl transition) {
+    transition.setDestination(this);
+    if (incomingTransitions==null) {
+      incomingTransitions = new ArrayList<TransitionImpl>();
+    }
+    incomingTransitions.add(transition);
+    return transition;
+  }
+
+  /** removes the given transition if it is contained in the arriving
+   * transitions of this activity.  If this transition was actually removed,
+   * its destination pointer is nulled.
+   * @return true if a transition was removed.
+   */
+  public boolean removeIncomingTransition(TransitionImpl transition) {
+    if ( (transition!=null)
+         && (incomingTransitions!=null)
+         && (incomingTransitions.remove(transition))
+       ) {
+      transition.setDestination(null);
+      if (incomingTransitions.isEmpty()) {
+        incomingTransitions = null;
+      }
+      return true;
+    }
+    return false;
+  }
+
+  /** the list of arriving transitions.
+   * Beware: the actual member is returned.  No copy is made.
+   */ 
+  public List<Transition> getIncomingTransitions() {
+    return (List) incomingTransitions;
+  }
+
+  /** indicates if this activity has arriving transitions */
+  public boolean hasIncomingTransitions() {
+    return ((incomingTransitions!=null) && (!incomingTransitions.isEmpty()));
+  }
+
+
+  /** sets the incomingTransitions to the given list of incomingTransitions.
+   * A copy of the collection is made.  Also the destination of all the transitions 
+   * in the given list will be set to this activity.
+   * In case there was an arriving transitions list present, these transition's
+   * destination will be nulled.
+   */
+  public void setIncomingTransitions(List<TransitionImpl> incomingTransitions) {
+    if (this.incomingTransitions!=null) {
+      for (TransitionImpl removedTransition: this.incomingTransitions) {
+        removedTransition.setDestination(null);
+      }
+    }
+    if (incomingTransitions!=null) {
+      this.incomingTransitions = new ArrayList<TransitionImpl>(incomingTransitions);
+      for (TransitionImpl addedTransition: incomingTransitions) {
+        addedTransition.setDestination(this);
+      }
+    } else {
+      this.incomingTransitions = null;
+    }
+  }
+
+
+  // behaviour ////////////////////////////////////////////////////////////////
+
+  /** sets the given activity as the behaviour for this activity. 
+   * An object reference for the given activity is created. */ 
+  public void setBehaviour(ActivityBehaviour activityBehaviour) {
+    behaviourReference = new ObjectReference<ActivityBehaviour>(activityBehaviour);
+  }
+
+  /** sets the activity that can be created from the given descriptor as the 
+   * behaviour for this activity.   It is assumed that the descriptor will 
+   * create an {@link ActivityBehaviour}
+   * An object reference for the given descriptor is created. */ 
+  public void setBehaviour(Descriptor descriptor) {
+    behaviourReference = new ObjectReference<ActivityBehaviour>(descriptor);
+  }
+
+  /** sets the expression behaviour for this activity.  The evaluation of the 
+   * expression will replace the {@link ActivityBehaviour#execute(org.jbpm.pvm.Execution) Activity's execute method}.
+   * An object reference for the given descriptor is created. */ 
+  public void setBehaviour(String expression) {
+    behaviourReference = new ObjectReference<ActivityBehaviour>(expression);
+  }
+
+  public ObjectReference<ActivityBehaviour> getBehaviourReference() {
+    return behaviourReference;
+  }
+  
+  public void setBehaviourReference(ObjectReference<ActivityBehaviour> behaviourReference) {
+    this.behaviourReference = behaviourReference;
+  }
+
+  public ActivityBehaviour getBehaviour() {
+    ActivityBehaviour behaviour = ( behaviourReference!=null ? behaviourReference.get() : null);
+    if (behaviour==null) {
+      throw new JbpmException("no behaviour on "+this);
+    }
+    return behaviour;
+  }
+
+  // various helper methods ///////////////////////////////////////////////////
+  
+  private static Map<String, TransitionImpl> getTransitionsMap(List<TransitionImpl> transitions) {
+    Map<String, TransitionImpl> map = null;
+    if (transitions!=null) {
+      map = new HashMap<String, TransitionImpl>();
+      for (TransitionImpl transition: transitions) {
+        if (! map.containsKey(transition.getName())) {
+          map.put(transition.getName(), transition);
+        }
+      }
+    }
+    return map;
+  }
+  
+  static Map<String, ActivityImpl> getNodesMap(List<ActivityImpl> activities) {
+    Map<String, ActivityImpl> map = null;
+    if (activities!=null) {
+      map = new HashMap<String, ActivityImpl>();
+      for (ActivityImpl activity: activities) {
+        if (activity.getName()!=null) {
+          if (! map.containsKey(activity.getName())) {
+            map.put(activity.getName(), activity);
+          }
+        }
+      }
+    }
+    return map;
+  }
+
+  public String toString() { 
+    if (name!=null) return "activity("+name+")";
+    if (dbid!=0) return "activity("+dbid+")";
+    return "activity("+System.identityHashCode(this)+")"; 
+  }
+
+  /** collects the full stack of parent in a list.  This activity is the 
+   * first element in the chain.  The process definition will be the last element.
+   * the chain will never be null. */
+  public List<ObservableElementImpl> getParentChain() {
+    List<ObservableElementImpl> chain = new ArrayList<ObservableElementImpl>();
+    ObservableElementImpl processElement = this;
+    while (processElement!=null) {
+      chain.add(processElement);
+      processElement = processElement.getParent();
+    }
+    return chain;
+  }
+
+  // getters and setters //////////////////////////////////////////////////////
+  
+  public ObservableElementImpl getParent() {
+    return (parentNode!=null ? parentNode : processDefinition);
+  }
+  
+  public String getName() {
+    return name;
+  }
+  public void setName(String name) {
+    this.name = name;
+  }
+  public TransitionImpl getDefaultTransition() {
+    return defaultTransition;
+  }
+  public void setDefaultTransition(TransitionImpl defaultTransition) {
+    this.defaultTransition = defaultTransition;
+  }
+  public ActivityImpl getParentNode() {
+    return parentNode;
+  }
+  public void setParentNode(ActivityImpl parentNode) {
+    this.parentNode = parentNode;
+  }
+  public boolean isExecutionAsync() {
+    return isExecutionAsync;
+  }
+  public boolean isSignalAsync() {
+    return isSignalAsync;
+  }
+  public void setSignalAsync(boolean isSignalAsync) {
+    this.isSignalAsync = isSignalAsync;
+  }
+  public void setExecutionAsync(boolean isExecutionAsync) {
+    this.isExecutionAsync = isExecutionAsync;
+  }
+  public boolean isLeaveAsync() {
+    return isLeaveAsync;
+  }
+  public void setLeaveAsync(boolean isLeaveAsync) {
+    this.isLeaveAsync = isLeaveAsync;
+  }
+  public boolean isPreviousNeeded() {
+    return isPreviousNeeded;
+  }
+  public void setPreviousNeeded(boolean isPreviousNeeded) {
+    this.isPreviousNeeded = isPreviousNeeded;
+  }
+  public boolean isLocalScope() {
+    return isLocalScope;
+  }
+  public void setLocalScope(boolean isLocalScope) {
+    this.isLocalScope = isLocalScope;
+  }
+}


Property changes on: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + LF

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -26,7 +26,7 @@
 import java.util.Map;
 
 import org.jbpm.model.CompositeElement;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 
 /**
  * @author Tom Baeyens
@@ -35,89 +35,89 @@
 
   private static final long serialVersionUID = 1L;
   
-  protected List<NodeImpl> nodes;
-  transient protected Map<String, NodeImpl> nodesMap;
+  protected List<ActivityImpl> activities;
+  transient protected Map<String, ActivityImpl> activitiesMap;
 
-  // nested nodes /////////////////////////////////////////////////////////////
+  // nested activities /////////////////////////////////////////////////////////////
   
   /**
-   * creates a nested node. Also the nested node's parent pointer will be set 
+   * creates a nested activity. Also the nested activity's parent pointer will be set 
    * appropriatly. 
    */
-  public NodeImpl createNode() {
+  public ActivityImpl createNode() {
     return createNode(null);
   }
 
   /**
-   * creates a nested node with the given name. Also the nested node's parent pointer will be set 
+   * creates a nested activity with the given name. Also the nested activity's parent pointer will be set 
    * appropriatly. 
-   * @param nodeName may be null. 
+   * @param activityName may be null. 
    */
-  public NodeImpl createNode(String nodeName) {
-    NodeImpl node = new NodeImpl();
-    node.setName(nodeName);
-    addNode(node);
-    return node;
+  public ActivityImpl createNode(String activityName) {
+    ActivityImpl activity = new ActivityImpl();
+    activity.setName(activityName);
+    addNode(activity);
+    return activity;
   }
 
-  public Node addNode(NodeImpl node) {
-    node.setProcessDefinition(processDefinition);
-    if (nodes==null) {
-      nodes = new ArrayList<NodeImpl>();
+  public Activity addNode(ActivityImpl activity) {
+    activity.setProcessDefinition(processDefinition);
+    if (activities==null) {
+      activities = new ArrayList<ActivityImpl>();
     }
-    if (! nodes.contains(node)) {
-      nodes.add(node);
+    if (! activities.contains(activity)) {
+      activities.add(activity);
     }
-    nodesMap = null;
-    return node;
+    activitiesMap = null;
+    return activity;
   }
   
-  /** removes the given node from the nested activities.
-   * Also the node's parent will be nulled.
-   * This method will do nothing if the node is null or if 
-   * the node is not in the list of nested activities.
-   * If the node is actually removed from the list of 
-   * activities, the node's source will be nulled. 
-   * In case this is the node that was in the 
-   * activitiesMap and another node exists with the same
-   * name, that node (the first) will be put in the 
-   * activitiesMap as a replacement for the removed node.
+  /** removes the given activity from the nested activities.
+   * Also the activity's parent will be nulled.
+   * This method will do nothing if the activity is null or if 
+   * the activity is not in the list of nested activities.
+   * If the activity is actually removed from the list of 
+   * activities, the activity's source will be nulled. 
+   * In case this is the activity that was in the 
+   * activitiesMap and another activity exists with the same
+   * name, that activity (the first) will be put in the 
+   * activitiesMap as a replacement for the removed activity.
    */
-  public boolean removeNode(NodeImpl node) {
-    if ( (node!=null)
-         && (nodes!=null)
+  public boolean removeNode(ActivityImpl activity) {
+    if ( (activity!=null)
+         && (activities!=null)
        ) {
-      boolean isRemoved = nodes.remove(node);
+      boolean isRemoved = activities.remove(activity);
       if (isRemoved) {
-        node.setParentNode(null);
-        if (nodes.isEmpty()) {
-          nodes = null;
+        activity.setParentNode(null);
+        if (activities.isEmpty()) {
+          activities = null;
         }
-        nodesMap = null;
+        activitiesMap = null;
       }
       return isRemoved;
     }
     return false;
   }
 
-  /** the first nested node with the given name or null of no
-   * such node exists.
+  /** the first nested activity with the given name or null of no
+   * such activity exists.
    */
-  public NodeImpl getNode(String nodeName) {
-    return (getNodesMap()!=null ? nodesMap.get(nodeName) : null);
+  public ActivityImpl getActivity(String activityName) {
+    return (getActivitiesMap()!=null ? activitiesMap.get(activityName) : null);
   }
 
-  /** is this node present ? */
-  public boolean hasNode(String nodeName) {
-    return ((getNodesMap()!=null) && (nodesMap.containsKey(nodeName)));
+  /** is this activity present ? */
+  public boolean hasActivity(String activityName) {
+    return ((getActivitiesMap()!=null) && (activitiesMap.containsKey(activityName)));
   }
 
-  public Node findNode(String nodeName) {
-    if (nodes!=null) {
-      for(NodeImpl n : nodes) {
-        Node node = n.findNode(nodeName);
-        if (node!=null) {
-          return node;
+  public Activity findActivity(String activityName) {
+    if (activities!=null) {
+      for(ActivityImpl n : activities) {
+        Activity activity = n.findActivity(activityName);
+        if (activity!=null) {
+          return activity;
         }
       }
     }
@@ -127,27 +127,27 @@
   /** the list of nested activities.
    * Beware: the actual member is returned.  No copy is made. 
    */
-  public List<Node> getNodes() {
-    return (List) nodes;
+  public List<Activity> getActivities() {
+    return (List) activities;
   }
 
-  /** the nested activities, keyed by node name.  If a node with 
+  /** the nested activities, keyed by activity name.  If a activity with 
    * the same name occurs mutltiple times, the first in the list
    * is included in the map.
    * Activities with a null value for their name are not included 
    * in the map.
    * Beware: the actual member is returned.  No copy is made. 
    */
-  public Map<String, Node> getNodesMap() {
-    if(nodesMap == null){
-      this.nodesMap = NodeImpl.getNodesMap(nodes);
+  public Map<String, Activity> getActivitiesMap() {
+    if(activitiesMap == null){
+      this.activitiesMap = ActivityImpl.getNodesMap(activities);
     }
-    return (Map) nodesMap;
+    return (Map) activitiesMap;
   }
   
-  /** indicates if this processDefinition has nodes. */
-  public boolean hasNodes() {
-    return ((nodes!=null) && (!nodes.isEmpty()));
+  /** indicates if this processDefinition has activities. */
+  public boolean hasActivities() {
+    return ((activities!=null) && (!activities.isEmpty()));
   }
 
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -50,8 +50,8 @@
   protected boolean isTransactional;
   protected boolean isRethrowMasked;
   protected List<ObjectReference<EventListener>> eventListenerReferences;
-  protected String transitionName; // mutually exclusive with nodeName
-  protected String nodeName;       // mutually exclusive with transitionName
+  protected String transitionName; // mutually exclusive with activityName
+  protected String activityName;       // mutually exclusive with transitionName
   
   // construction methods /////////////////////////////////////////////////////
   
@@ -162,23 +162,23 @@
     }
     
     if (transitionName!=null) {
-      NodeImpl node = execution.getNode();
-      if (node==null) {
-        // If the execution is not positioned in a node, it must be 
+      ActivityImpl activity = execution.getNode();
+      if (activity==null) {
+        // If the execution is not positioned in a activity, it must be 
         // positioned in a transition.  In that case we check if the 
-        // transition is present on the enclosing node.
+        // transition is present on the enclosing activity.
         
-        // The weird way of getting checking and fetching the parent node
+        // The weird way of getting checking and fetching the parent activity
         // is because hibernate doesn't support instanceof.  The transition-->parent
         // relation is mapped as a ProcessElementImpl.  So we can't cast it to 
-        // a NodeImpl.  Ouch.
+        // a ActivityImpl.  Ouch.
         // The workaround is to check if the parent is equal to the 
         // process definition.  If that is not the case, we can be sure 
-        // that the parent is a node.  In that case we look up the node 
+        // that the parent is a activity.  In that case we look up the activity 
         // from the process definition by name.  OuchOuchSquare :-)
         
         TransitionImpl transition = execution.getTransition();
-        log.trace("no current node.  searching for transition from parent of "+transition);
+        log.trace("no current activity.  searching for transition from parent of "+transition);
         if (transition!=null) {
           OpenProcessDefinition processDefinition = transition.getProcessDefinition();
           ObservableElementImpl transitionParent = transition.getParent();
@@ -186,33 +186,33 @@
           if ( (transitionParent!=null)
                && (! transitionParent.equals(processDefinition))
              ) {
-            node = (NodeImpl) processDefinition.findNode(transitionParent.getName());
+            activity = (ActivityImpl) processDefinition.findActivity(transitionParent.getName());
           }
         }
       }
       
-      if (node!=null) {
-        TransitionImpl transition = node.findOutgoingTransition(transitionName);
+      if (activity!=null) {
+        TransitionImpl transition = activity.findOutgoingTransition(transitionName);
         if (transition!=null) {
           log.trace(toString()+" takes transition "+transitionName);
           execution.setTransition(transition);
           execution.performAtomicOperationSync(ExecutionImpl.TAKE_TRANSITION);
         } else {
-          log.info("WARNING: "+toString()+" couldn't find transition "+transitionName+" on "+node);
+          log.info("WARNING: "+toString()+" couldn't find transition "+transitionName+" on "+activity);
         }
       } else {
-        log.info("WARNING: "+toString()+" couldn't find current node to take transition "+transitionName);
+        log.info("WARNING: "+toString()+" couldn't find current activity to take transition "+transitionName);
       }
 
-    } else if (nodeName!=null) {
-      // execute child node
-      NodeImpl node = execution.getNode();
-      NodeImpl childNode = ( node!=null ? node.getNode(nodeName) : null );
+    } else if (activityName!=null) {
+      // execute child activity
+      ActivityImpl activity = execution.getNode();
+      ActivityImpl childNode = ( activity!=null ? activity.getActivity(activityName) : null );
       if (childNode!=null) {
         log.trace(toString()+" takes transition "+transitionName);
         execution.performAtomicOperationSync(new MoveToChildNode(childNode));
       } else {
-        log.info("WARNING: "+toString()+" couldn't find child node "+nodeName);
+        log.info("WARNING: "+toString()+" couldn't find child activity "+activityName);
       }
     }
   }
@@ -254,10 +254,10 @@
     this.transitionName = transitionName;
   }
   public String getNodeName() {
-    return nodeName;
+    return activityName;
   }
-  public void setNodeName(String nodeName) {
-    this.nodeName = nodeName;
+  public void setNodeName(String activityName) {
+    this.activityName = activityName;
   }
   public boolean isRethrowMasked() {
     return isRethrowMasked;

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -50,7 +50,7 @@
 import org.jbpm.model.Comment;
 import org.jbpm.model.Event;
 import org.jbpm.model.IdGenerator;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.ObservableElement;
 import org.jbpm.model.OpenExecution;
 import org.jbpm.model.Transition;
@@ -112,16 +112,16 @@
   
   // current position /////////////////////////////////////////////////////////
   
-  /** current node */
-  protected NodeImpl node;
+  /** current activity */
+  protected ActivityImpl activity;
   
   /** transition is not to be made persistable by default */
   protected TransitionImpl transition;
   
-  /** the node from which the transition was taken.  This can be different from 
-   * the transition source in case a transition of an eclosing node was taken.
+  /** the activity from which the transition was taken.  This can be different from 
+   * the transition source in case a transition of an eclosing activity was taken.
    * transitionOrigin is not to be made persistable by default */
-  protected NodeImpl transitionOrigin;
+  protected ActivityImpl transitionOrigin;
 
   protected EventImpl event;
   protected ObservableElementImpl eventSource;
@@ -169,7 +169,7 @@
   }
   protected Propagation propagation = null;
 
-  protected Node previousNode;
+  protected Activity previousNode;
   protected Transition previousTransition;
   protected Exception exception;
 
@@ -184,7 +184,7 @@
   
   public void initializeProcessInstance(ProcessDefinitionImpl processDefinition, String key) {
     this.processDefinition = processDefinition;
-    this.node = (NodeImpl) processDefinition.getInitial();
+    this.activity = (ActivityImpl) processDefinition.getInitial();
     this.processInstance = this;
     this.state = STATE_CREATED;
     this.key = key;
@@ -204,20 +204,20 @@
     this.state = STATE_ACTIVE;
     ExecutionImpl scopedExecution = initializeScopes();
     fire(Event.PROCESS_BEGIN, processDefinition);
-    if (node!=null) {
+    if (activity!=null) {
       scopedExecution.performAtomicOperation(EXECUTE_NODE);
     }
   }
 
   protected ExecutionImpl initializeScopes() {
-    LinkedList<NodeImpl> enteredNodes = new LinkedList<NodeImpl>();
+    LinkedList<ActivityImpl> enteredNodes = new LinkedList<ActivityImpl>();
 
-    NodeImpl initial = processDefinition.getInitial();
+    ActivityImpl initial = processDefinition.getInitial();
     ExecutionImpl scopedExecution = null;
     
     if (initial!=null) {
       enteredNodes.add(initial);
-      NodeImpl parentNode = initial.getParentNode();
+      ActivityImpl parentNode = initial.getParentNode();
       while (parentNode!=null) {
         enteredNodes.addFirst(parentNode);
         parentNode = parentNode.getParentNode();
@@ -228,14 +228,14 @@
       initializeVariables(processDefinition, this);
       initializeTimers(processDefinition);
       
-      for (NodeImpl enteredNode: enteredNodes) {
+      for (ActivityImpl enteredNode: enteredNodes) {
         if (enteredNode.isLocalScope()) {
-          scopedExecution.setNode(enteredNode);
+          scopedExecution.setActivity(enteredNode);
           scopedExecution = scopedExecution.createScope(enteredNode);
         }
       }
       
-      scopedExecution.setNode(initial);
+      scopedExecution.setActivity(initial);
     }
     return scopedExecution;
   }
@@ -244,7 +244,7 @@
     ExecutionImpl child = createExecution(scope.getName());
     
     // copy the current state from the child execution to the parent execution
-    child.setNode(getNode());
+    child.setActivity(getNode());
     child.setTransition(getTransition());
     child.setPropagation(getPropagation());
     child.setTransitionOrigin(getTransitionOrigin());
@@ -262,7 +262,7 @@
     destroyVariables(scope, parent);
     
     // copy the current state from the child execution to the parent execution
-    getParent().setNode(getNode());
+    getParent().setActivity(getNode());
     getParent().setTransition(getTransition());
     getParent().setPropagation(getPropagation());
     getParent().setTransitionOrigin(getTransitionOrigin());
@@ -389,12 +389,12 @@
 
   public void signal(String signal, Map<String, Object> parameters) {
     checkLock();
-    if (node!=null) {
-      performAtomicOperation(new Signal(signal, parameters, node));
+    if (activity!=null) {
+      performAtomicOperation(new Signal(signal, parameters, activity));
     } else if (transition!=null) {
       performAtomicOperation(ExecutionImpl.PROCEED_TO_DESTINATION);
     } else {
-      throw new JbpmException("execution is not in a node or in a transition");
+      throw new JbpmException("execution is not in a activity or in a transition");
     }
   }
   
@@ -418,21 +418,21 @@
   
   /** @see Execution#takeDefaultTransition() */
   public void takeDefaultTransition() {
-    TransitionImpl defaultTransition = node.getDefaultTransition();
+    TransitionImpl defaultTransition = activity.getDefaultTransition();
     if (defaultTransition==null) {
-      throw new JbpmException("there is no default transition in "+node);
+      throw new JbpmException("there is no default transition in "+activity);
     }
     take(defaultTransition);
   }
 
   /** @see Execution#take(String) */
   public void take(String transitionName) {
-    if (node==null) {
-      throw new JbpmException(toString()+" is not positioned in node");
+    if (activity==null) {
+      throw new JbpmException(toString()+" is not positioned in activity");
     }
     TransitionImpl transition = findTransition(transitionName);
     if (transition==null) {
-      throw new JbpmException("there is no transition "+transitionName+" in "+node);
+      throw new JbpmException("there is no transition "+transitionName+" in "+activity);
     }
     take(transition);
   }
@@ -443,8 +443,8 @@
 
     setPropagation(Propagation.EXPLICIT);
     setTransition((TransitionImpl) transition);
-    // copy the current node as the transition origin.  the origin can be different from 
-    // the transition source in case a transition is taken from an enclosing node
+    // copy the current activity as the transition origin.  the origin can be different from 
+    // the transition source in case a transition is taken from an enclosing activity
     setTransitionOrigin(getNode());
     setPreviousTransition(null);
 
@@ -458,26 +458,26 @@
   // execution method : execute ///////////////////////////////////////////////
 
   /** @see Execution#execute(String) */
-  public void execute(String nodeName) {
-    if (node==null) {
-      throw new JbpmException("node is null");
+  public void execute(String activityName) {
+    if (activity==null) {
+      throw new JbpmException("activity is null");
     }
-    Node nestedNode = node.getNode(nodeName);
+    Activity nestedNode = activity.getActivity(activityName);
     if (nestedNode==null) {
-      throw new JbpmException("node "+nodeName+" doesn't exist in "+node);
+      throw new JbpmException("activity "+activityName+" doesn't exist in "+activity);
     }
     execute(nestedNode);
   }
   
-  /** @see Execution#execute(Node) */
-  public void execute(Node node) {
-    if (node==null) {
-      throw new JbpmException("node is null");
+  /** @see Execution#execute(Activity) */
+  public void execute(Activity activity) {
+    if (activity==null) {
+      throw new JbpmException("activity is null");
     }
     checkLock();
     
     this.propagation = Propagation.EXPLICIT;
-    performAtomicOperation(new MoveToChildNode((NodeImpl) node));
+    performAtomicOperation(new MoveToChildNode((ActivityImpl) activity));
   }
   
   // execution method : waitForSignal /////////////////////////////////////////
@@ -499,11 +499,11 @@
       
     // in block structured processDefinition languages we assume that 
     // there is no default transition and that there is a 
-    // parent node of the current node
+    // parent activity of the current activity
     } else {
-      NodeImpl parentNode = node.getParentNode();
+      ActivityImpl parentNode = activity.getParentNode();
 
-      // if there is a parent node
+      // if there is a parent activity
       if (parentNode!=null) {
         // propagate to the parent
         performAtomicOperation(PROPAGATE_TO_PARENT);
@@ -518,18 +518,18 @@
     }
   }
 
-  public void setNode(Node destination, Execution execution) {
+  public void setNode(Activity destination, Execution execution) {
     ((ExecutionImpl)execution).setNode(destination);
   }
 
-  public void setNode(Node destination) {
-    setNode((NodeImpl) destination);
+  public void setNode(Activity destination) {
+    setActivity((ActivityImpl) destination);
   }
 
   // execution : internal methods /////////////////////////////////////////////
 
-  public void moveTo(NodeImpl destination) {
-    // if the parent node needs to know the previous node
+  public void moveTo(ActivityImpl destination) {
+    // if the parent activity needs to know the previous activity
     if (destination.isPreviousNeeded()) {
       setPreviousNode(getNode());
       setPreviousTransition(getTransition());
@@ -539,25 +539,25 @@
     }
 
     // move the execution to the destination
-    node = destination;
+    activity = destination;
     transition = null;
     transitionOrigin = null;
   }
 
-  public ExecutionImpl beginNode(NodeImpl node) {
+  public ExecutionImpl beginNode(ActivityImpl activity) {
     ExecutionImpl propagatingExecution = this;
-    if (node.isLocalScope()) {
-      propagatingExecution = createScope(node);
+    if (activity.isLocalScope()) {
+      propagatingExecution = createScope(activity);
     }
-    fire(Event.NODE_BEGIN, node);
+    fire(Event.NODE_BEGIN, activity);
     return propagatingExecution;
   }
 
-  public ExecutionImpl endNode(NodeImpl node) {
+  public ExecutionImpl endNode(ActivityImpl activity) {
     ExecutionImpl propagatingExecution = this;
-    fire(Event.NODE_END, node);
-    if (node.isLocalScope()) {
-      propagatingExecution = destroyScope(node);
+    fire(Event.NODE_END, activity);
+    if (activity.isLocalScope()) {
+      propagatingExecution = destroyScope(activity);
     }
     return propagatingExecution;
   }
@@ -782,7 +782,7 @@
     ExecutionImpl childExecution = newChildExecution();
     childExecution.processDefinition = this.processDefinition;
     childExecution.processInstance = this.processInstance;
-    childExecution.node = this.node;
+    childExecution.activity = this.activity;
     childExecution.state = STATE_ACTIVE;
     childExecution.name = name;
     log.debug("creating "+childExecution);
@@ -919,13 +919,13 @@
     }
   }
 
-  // node name ////////////////////////////////////////////////////////////////
+  // activity name ////////////////////////////////////////////////////////////////
   
-  public String getNodeName() {
-    if (node==null) {
+  public String getActivityName() {
+    if (activity==null) {
       return null;
     }
-    return node.getName();
+    return activity.getName();
   }
   
   ////////////////////////////////////////////////////////////////////////////////
@@ -958,16 +958,16 @@
 
   // overridable by process languages /////////////////////////////////////////
   
-  /** by default this will use {@link NodeImpl#findOutgoingTransition(String)} to 
+  /** by default this will use {@link ActivityImpl#findOutgoingTransition(String)} to 
    * search for the outgoing transition, which includes a search over the parent chain 
-   * of the current node.  This method allows process languages to overwrite this default 
+   * of the current activity.  This method allows process languages to overwrite this default 
    * implementation of the transition lookup by transitionName.*/
   protected TransitionImpl findTransition(String transitionName) {
-    return node.findOutgoingTransition(transitionName);
+    return activity.findOutgoingTransition(transitionName);
   }
 
   protected TransitionImpl findDefaultTransition() {
-    return node.findDefaultTransition();
+    return activity.findDefaultTransition();
   }
 
   
@@ -1036,7 +1036,7 @@
   public void setTransition(TransitionImpl transition) {
     this.transition = transition;
   }
-  public Node getPreviousNode() {
+  public Activity getPreviousNode() {
     return previousNode;
   }
   public Transition getPreviousTransition() {
@@ -1051,10 +1051,10 @@
   public void setComments(Set<CommentImpl> comments) {
     this.comments = comments;
   }
-  public NodeImpl getTransitionOrigin() {
+  public ActivityImpl getTransitionOrigin() {
     return transitionOrigin;
   }
-  public void setTransitionOrigin(NodeImpl transitionOrigin) {
+  public void setTransitionOrigin(ActivityImpl transitionOrigin) {
     this.transitionOrigin = transitionOrigin;
   }
   public Exception getException() {
@@ -1090,7 +1090,7 @@
   public void setParent(ExecutionImpl parent) {
     this.parent = parent;
   }
-  public void setPreviousNode(Node previousNode) {
+  public void setPreviousNode(Activity previousNode) {
     this.previousNode = previousNode;
   }
   public void setPreviousTransition(Transition previousTransition) {
@@ -1111,11 +1111,11 @@
   public void setSubProcessInstance(ExecutionImpl subProcessExecution) {
     this.subProcessInstance = subProcessExecution;
   }
-  public NodeImpl getNode() {
-    return node;
+  public ActivityImpl getNode() {
+    return activity;
   }
-  public void setNode(NodeImpl node) {
-    this.node = node;
+  public void setActivity(ActivityImpl activity) {
+    this.activity = activity;
   }
   public void setKey(String key) {
     this.key = key;

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/NodeImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/NodeImpl.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/NodeImpl.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -1,486 +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.pvm.internal.model;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jbpm.JbpmException;
-import org.jbpm.activity.Activity;
-import org.jbpm.model.Node;
-import org.jbpm.model.Transition;
-import org.jbpm.pvm.internal.wire.Descriptor;
-
-/**
- * @author Tom Baeyens
- */
-public class NodeImpl extends CompositeElementImpl implements Node {
-
-  private static final long serialVersionUID = 1L;
-  
-  protected ObjectReference<Activity> behaviourReference;
-  protected List<TransitionImpl> outgoingTransitions;
-  protected List<TransitionImpl> incomingTransitions;
-  protected TransitionImpl defaultTransition;
-  protected NodeImpl parentNode;
-
-  protected boolean isLocalScope;
-  protected boolean isExecutionAsync;
-  protected boolean isSignalAsync;
-  protected boolean isLeaveAsync;
-  protected boolean isPreviousNeeded;
-  
-  transient protected Map<String, TransitionImpl> outgoingTransitionsMap;
-  
-  /**
-   * Use {@link ProcessDefinitionImpl#createNode()} or {@link NodeImpl#createNode()} instead.
-   */
-  public NodeImpl() {
-    super();
-  }
-  
-  // specialized node containment methods /////////////////////////////////////
-  
-  public NodeImpl addNode(NodeImpl node) {
-    node.setParentNode(this);
-    super.addNode(node);
-    return node;
-  }
-  
-  public Node findNode(String nodeName) {
-    if (nodeName==null) {
-      if (name==null) {
-        return this;
-      }
-    } else if (nodeName.equals(name)) {
-      return this;
-    }
-    return super.findNode(nodeName);
-  }
-
-  // leaving transitions //////////////////////////////////////////////////////
-
-  /** creates an outgoing transition from this node. */
-  public TransitionImpl createOutgoingTransition() {
-    // create a new transition
-    TransitionImpl transition = new TransitionImpl();
-    
-    // wire it between the source and destination
-    addOutgoingTransition(transition);
-
-    // if there is no default transition yet
-    if (defaultTransition==null) {
-      // make this the default outgoing transition
-      defaultTransition = transition;
-    }
-    
-    return transition;
-  }
-  
-
-  // TODO remove
-  public Transition createOutgoingTransition(NodeImpl destination) {
-    return createOutgoingTransition(destination, null);
-  }
-
-  // TODO remove
-  public TransitionImpl createOutgoingTransition(NodeImpl destination, String transitionName) {
-    TransitionImpl transition = createOutgoingTransition(transitionName);
-    if (destination!=null) {
-      destination.addIncomingTransition(transition);
-    }
-    return transition;
-  }
-  
-  // TODO remove
-  public TransitionImpl createOutgoingTransition(String transitionName) {
-    // create a new transition
-    TransitionImpl transition = new TransitionImpl();
-    transition.setName(transitionName);
-    
-    // wire it between the source and destination
-    addOutgoingTransition(transition);
-
-    // if there is no default transition yet
-    if (defaultTransition==null) {
-      // make this the default outgoing transition
-      defaultTransition = transition;
-    }
-    
-    return transition;
-  }
-
-  /**
-   * adds the given transition as a leaving transition to this node.
-   * Also the source of the transition is set to this node.
-   * Adding a transition that is already contained in the leaving 
-   * transitions has no effect. 
-   * @return the added transition. 
-   * @throws NullPointerException if transition is null.
-   */
-  public Transition addOutgoingTransition(TransitionImpl transition) {
-    transition.setSource(this);
-    
-    if (outgoingTransitions==null) {
-      outgoingTransitions = new ArrayList<TransitionImpl>();
-    }
-    if (! outgoingTransitions.contains(transition)) {
-      outgoingTransitions.add(transition);
-    }
-    outgoingTransitionsMap = null;
-    return transition;
-  }
-  
-  /**
-   * removes the given transition from the leaving transitions.
-   * Also the transition's source will be nulled.
-   * This method will do nothing if the transition is null or if 
-   * the given transition is not in the list of this node's leaving 
-   * transitions.
-   * In case this is the transition that was in the 
-   * outgoingTransitionsMap and another transition exists with the same
-   * name, that transition (the first) will be put in the 
-   * outgoingTransitionsMap as a replacement for the removed transition.
-   * If the transition is actually removed from the list of 
-   * leaving transitions, the transition's source will be nulled. 
-   */
-  public boolean removeOutgoingTransition(TransitionImpl transition) {
-    if ( (transition!=null)
-         && (outgoingTransitions!=null)
-       ) {
-      boolean isRemoved = outgoingTransitions.remove(transition);
-      if (isRemoved) {
-        transition.setSource(null);
-        if (outgoingTransitions.isEmpty()) {
-          outgoingTransitions = null;
-        }
-        outgoingTransitionsMap = null;
-      }
-      return isRemoved;
-    }
-    return false;
-  }
-
-  /** the first leaving transition with the given name or null of no
-   * such leaving transition exists.
-   */
-  public TransitionImpl getOutgoingTransition(String transitionName) {
-    return (getOutgoingTransitionsMap()!=null ? outgoingTransitionsMap.get(transitionName) : null);
-  }
-  
-  /** searches for the given transitionName in this node and then up the 
-   * parent chain. Returns null if no such transition is found. */
-  public TransitionImpl findOutgoingTransition(String transitionName) {
-    TransitionImpl transition = getOutgoingTransition(transitionName);
-    if (transition!=null) {
-      return transition;
-    }
-    if (parentNode!=null) {
-      return parentNode.findOutgoingTransition(transitionName);
-    }
-    return null;
-  }
-  
-  /** searches for the default transition in this node and then up the 
-   * parent chain. Returns null if no such transition is found. */
-  public TransitionImpl findDefaultTransition() {
-    if (defaultTransition!=null) {
-      return defaultTransition;
-    }
-    if (parentNode!=null) {
-      return parentNode.findDefaultTransition();
-    }
-    return null;
-  }
-
-  
-  /** the list of leaving transitions.
-   * Beware: the actual member is returned.  No copy is made. 
-   */
-  public List<Transition> getOutgoingTransitions() {
-    return (List) outgoingTransitions;
-  }
-
-  /** indicates if a leaving transition with the given transitionName exists. */
-  public boolean hasOutgoingTransition(String transitionName) {
-    return (getOutgoingTransition(transitionName)!=null);
-  }
-
-  /** indicates if this node has leaving transitions */
-  public boolean hasOutgoingTransitions() {
-    return ((outgoingTransitions!=null) && (!outgoingTransitions.isEmpty()));
-  }
-
-  /** sets the outgoingTransitions to the given list of outgoingTransitions.
-   * A copy of the collection is made.  Also the outgoingTransitionsMap will 
-   * be updated and the source of all the transitions in the given list will 
-   * be set to this node.
-   * In case there was a leaving transitions list present, these transition's
-   * source will be nulled.
-   */
-  public void setOutgoingTransitions(List<TransitionImpl> outgoingTransitions) {
-    if (this.outgoingTransitions!=null) {
-      for (TransitionImpl removedTransition: this.outgoingTransitions) {
-        removedTransition.setSource(null);
-      }
-    }
-    if (outgoingTransitions!=null) {
-      this.outgoingTransitions = new ArrayList<TransitionImpl>(outgoingTransitions);
-      for (TransitionImpl addedTransition: outgoingTransitions) {
-        addedTransition.setSource(this);
-      }
-    } else {
-      this.outgoingTransitions = null;
-    }
-    this.outgoingTransitionsMap = null;
-  }
-
-  /** the leaving transitions, keyed by transition name.  If a transition with 
-   * the same name occurs mutltiple times, the first one is returned.
-   * Leaving transitions with a null value for their name are not included 
-   * in the map.
-   * Beware: the actual member is returned.  No copy is made. 
-   */
-  public Map<String, Transition> getOutgoingTransitionsMap() {
-    if(outgoingTransitionsMap == null){
-      this.outgoingTransitionsMap = getTransitionsMap(outgoingTransitions);
-    }
-    return (Map) outgoingTransitionsMap;
-  }
-
-  // arriving transitions /////////////////////////////////////////////////////
-  
-  /**
-   * adds the given transition as an arriving transition to this node.
-   * Also the source of the transition is set to this node. 
-   * @return the added transition. 
-   * @throws NullPointerException if transition is null.
-   */
-  public Transition addIncomingTransition(TransitionImpl transition) {
-    transition.setDestination(this);
-    if (incomingTransitions==null) {
-      incomingTransitions = new ArrayList<TransitionImpl>();
-    }
-    incomingTransitions.add(transition);
-    return transition;
-  }
-
-  /** removes the given transition if it is contained in the arriving
-   * transitions of this node.  If this transition was actually removed,
-   * its destination pointer is nulled.
-   * @return true if a transition was removed.
-   */
-  public boolean removeIncomingTransition(TransitionImpl transition) {
-    if ( (transition!=null)
-         && (incomingTransitions!=null)
-         && (incomingTransitions.remove(transition))
-       ) {
-      transition.setDestination(null);
-      if (incomingTransitions.isEmpty()) {
-        incomingTransitions = null;
-      }
-      return true;
-    }
-    return false;
-  }
-
-  /** the list of arriving transitions.
-   * Beware: the actual member is returned.  No copy is made.
-   */ 
-  public List<Transition> getIncomingTransitions() {
-    return (List) incomingTransitions;
-  }
-
-  /** indicates if this node has arriving transitions */
-  public boolean hasIncomingTransitions() {
-    return ((incomingTransitions!=null) && (!incomingTransitions.isEmpty()));
-  }
-
-
-  /** sets the incomingTransitions to the given list of incomingTransitions.
-   * A copy of the collection is made.  Also the destination of all the transitions 
-   * in the given list will be set to this node.
-   * In case there was an arriving transitions list present, these transition's
-   * destination will be nulled.
-   */
-  public void setIncomingTransitions(List<TransitionImpl> incomingTransitions) {
-    if (this.incomingTransitions!=null) {
-      for (TransitionImpl removedTransition: this.incomingTransitions) {
-        removedTransition.setDestination(null);
-      }
-    }
-    if (incomingTransitions!=null) {
-      this.incomingTransitions = new ArrayList<TransitionImpl>(incomingTransitions);
-      for (TransitionImpl addedTransition: incomingTransitions) {
-        addedTransition.setDestination(this);
-      }
-    } else {
-      this.incomingTransitions = null;
-    }
-  }
-
-
-  // behaviour ////////////////////////////////////////////////////////////////
-
-  /** sets the given activity as the behaviour for this node. 
-   * An object reference for the given activity is created. */ 
-  public void setBehaviour(Activity activity) {
-    behaviourReference = new ObjectReference<Activity>(activity);
-  }
-
-  /** sets the activity that can be created from the given descriptor as the 
-   * behaviour for this node.   It is assumed that the descriptor will 
-   * create an {@link Activity}
-   * An object reference for the given descriptor is created. */ 
-  public void setBehaviour(Descriptor descriptor) {
-    behaviourReference = new ObjectReference<Activity>(descriptor);
-  }
-
-  /** sets the expression behaviour for this node.  The evaluation of the 
-   * expression will replace the {@link Activity#execute(org.jbpm.pvm.Execution) Activity's execute method}.
-   * An object reference for the given descriptor is created. */ 
-  public void setBehaviour(String expression) {
-    behaviourReference = new ObjectReference<Activity>(expression);
-  }
-
-  public ObjectReference<Activity> getBehaviourReference() {
-    return behaviourReference;
-  }
-  
-  public void setBehaviourReference(ObjectReference<Activity> behaviourReference) {
-    this.behaviourReference = behaviourReference;
-  }
-
-  public Activity getBehaviour() {
-    Activity behaviour = ( behaviourReference!=null ? behaviourReference.get() : null);
-    if (behaviour==null) {
-      throw new JbpmException("no behaviour on "+this);
-    }
-    return behaviour;
-  }
-
-  // various helper methods ///////////////////////////////////////////////////
-  
-  private static Map<String, TransitionImpl> getTransitionsMap(List<TransitionImpl> transitions) {
-    Map<String, TransitionImpl> map = null;
-    if (transitions!=null) {
-      map = new HashMap<String, TransitionImpl>();
-      for (TransitionImpl transition: transitions) {
-        if (! map.containsKey(transition.getName())) {
-          map.put(transition.getName(), transition);
-        }
-      }
-    }
-    return map;
-  }
-  
-  static Map<String, NodeImpl> getNodesMap(List<NodeImpl> nodes) {
-    Map<String, NodeImpl> map = null;
-    if (nodes!=null) {
-      map = new HashMap<String, NodeImpl>();
-      for (NodeImpl node: nodes) {
-        if (node.getName()!=null) {
-          if (! map.containsKey(node.getName())) {
-            map.put(node.getName(), node);
-          }
-        }
-      }
-    }
-    return map;
-  }
-
-  public String toString() { 
-    if (name!=null) return "node("+name+")";
-    if (dbid!=0) return "node("+dbid+")";
-    return "node("+System.identityHashCode(this)+")"; 
-  }
-
-  /** collects the full stack of parent in a list.  This node is the 
-   * first element in the chain.  The process definition will be the last element.
-   * the chain will never be null. */
-  public List<ObservableElementImpl> getParentChain() {
-    List<ObservableElementImpl> chain = new ArrayList<ObservableElementImpl>();
-    ObservableElementImpl processElement = this;
-    while (processElement!=null) {
-      chain.add(processElement);
-      processElement = processElement.getParent();
-    }
-    return chain;
-  }
-
-  // getters and setters //////////////////////////////////////////////////////
-  
-  public ObservableElementImpl getParent() {
-    return (parentNode!=null ? parentNode : processDefinition);
-  }
-  
-  public String getName() {
-    return name;
-  }
-  public void setName(String name) {
-    this.name = name;
-  }
-  public TransitionImpl getDefaultTransition() {
-    return defaultTransition;
-  }
-  public void setDefaultTransition(TransitionImpl defaultTransition) {
-    this.defaultTransition = defaultTransition;
-  }
-  public NodeImpl getParentNode() {
-    return parentNode;
-  }
-  public void setParentNode(NodeImpl parentNode) {
-    this.parentNode = parentNode;
-  }
-  public boolean isExecutionAsync() {
-    return isExecutionAsync;
-  }
-  public boolean isSignalAsync() {
-    return isSignalAsync;
-  }
-  public void setSignalAsync(boolean isSignalAsync) {
-    this.isSignalAsync = isSignalAsync;
-  }
-  public void setExecutionAsync(boolean isExecutionAsync) {
-    this.isExecutionAsync = isExecutionAsync;
-  }
-  public boolean isLeaveAsync() {
-    return isLeaveAsync;
-  }
-  public void setLeaveAsync(boolean isLeaveAsync) {
-    this.isLeaveAsync = isLeaveAsync;
-  }
-  public boolean isPreviousNeeded() {
-    return isPreviousNeeded;
-  }
-  public void setPreviousNeeded(boolean isPreviousNeeded) {
-    this.isPreviousNeeded = isPreviousNeeded;
-  }
-  public boolean isLocalScope() {
-    return isLocalScope;
-  }
-  public void setLocalScope(boolean isLocalScope) {
-    this.isLocalScope = isLocalScope;
-  }
-}

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -66,8 +66,8 @@
   /** time this process was deployed */
   protected Date deploymentTime;
   
-  /** the node which is executed when the process starts */
-  protected NodeImpl initial;
+  /** the activity which is executed when the process starts */
+  protected ActivityImpl initial;
   
   /** the attachments 
    * TODO move the attachments to a separate DeploymentUnit type */
@@ -168,10 +168,10 @@
   
   // getters and setters //////////////////////////////////////////////////////
   
-  public NodeImpl getInitial() {
+  public ActivityImpl getInitial() {
     return initial;
   }
-  public void setInitial(NodeImpl initial) {
+  public void setInitial(ActivityImpl initial) {
     this.initial = initial;
   }
   public int getVersion() {

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessElementImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessElementImpl.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessElementImpl.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -32,7 +32,7 @@
 import org.jbpm.pvm.internal.wire.Descriptor;
 
 /** 
- * superclass for {@link NodeImpl}, {@link TransitionImpl} and {@link ProcessDefinitionImpl}.
+ * superclass for {@link ActivityImpl}, {@link TransitionImpl} and {@link ProcessDefinitionImpl}.
  * 
  * @author Tom Baeyens
  */

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,7 +24,7 @@
 import java.io.Serializable;
 import java.util.List;
 
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 
 
 /**
@@ -59,7 +59,7 @@
   protected List<AddedTransition> addedTransitions;
   protected List<TransitionImpl> removedTransitions;
   protected List<AddedNode> addedNodes;
-  protected List<NodeImpl> removedNodes;
+  protected List<ActivityImpl> removedNodes;
   
   // TODO : convert to top level types
   
@@ -73,7 +73,7 @@
     
   }
   
-  public static class AddedNode extends NodeImpl {
+  public static class AddedNode extends ActivityImpl {
     private static final long serialVersionUID = 1L;
   }
   
@@ -84,11 +84,11 @@
   // the process definition model conscientious through 
   // these merging methods
   
-  public TransitionImpl getOutgoingTransition(NodeImpl node, String transitionName) {
+  public TransitionImpl getOutgoingTransition(ActivityImpl activity, String transitionName) {
     // first check if the requested transition is in the added transition list
     if (addedTransitions!=null) {
       for (AddedTransition addedTransition : addedTransitions) {
-        if ( node.equals(addedTransition.getSource())
+        if ( activity.equals(addedTransition.getSource())
              && addedTransition.getName()!=null
              && addedTransition.getName().equals(transitionName)
            ) {
@@ -98,7 +98,7 @@
     }
     
     // now, check if it is in the normal transition list in the process definition
-    TransitionImpl transition = node.getOutgoingTransition(transitionName);
+    TransitionImpl transition = activity.getOutgoingTransition(transitionName);
     
     if ( (transition!=null) // if the transition exists
          && (removedTransitions!=null) // and if there are removed transitions
@@ -111,7 +111,7 @@
     return transition;
   }
 
-  // furhermore, action, node and transition creation methods 
+  // furhermore, action, activity and transition creation methods 
   // will have to be exposed through the user interface classes.
   // We have to make sure that the user is able to access and find 
   // all the input parameters for these creation methods from the 
@@ -119,7 +119,7 @@
   // classes.
   // for example:
   
-  public void addTransition(Node source, String name, Node destination) {
+  public void addTransition(Activity source, String name, Activity destination) {
     // TODO
   }
   

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -37,13 +37,13 @@
 
   private static final long serialVersionUID = 1L;
 
-  protected NodeImpl source;
-  protected NodeImpl destination;
+  protected ActivityImpl source;
+  protected ActivityImpl destination;
   protected Descriptor conditionDescriptor;
   protected Descriptor waitConditionDescriptor;
   protected boolean isTakeAsync;
   
-  /* Use one of the NodeImpl.createOutgoingTransition methods instead. */
+  /* Use one of the ActivityImpl.createOutgoingTransition methods instead. */
   TransitionImpl() {
     super();
   }
@@ -73,10 +73,10 @@
   
   // get parent ///////////////////////////////////////////////////////////////
   
-  /** the first common parent between the source and the destination node. The 
+  /** the first common parent between the source and the destination activity. The 
    * source and destination itself are included in the search except if 
    * source and destination are equal.  In that case (self-transition), then 
-   * it's the parent of the node. */
+   * it's the parent of the activity. */
   public ObservableElementImpl getParent() {
     // if one of the two ends is null
     if ( (source==null)
@@ -87,7 +87,7 @@
     }
     // if this is a self transition
     if (source.equals(destination)) {
-      // the parent of the node is returned
+      // the parent of the activity is returned
       return source.getParent();
     }
     // if none of the above, we search for the first common element in the parent chains 
@@ -107,13 +107,13 @@
   // getters and setters //////////////////////////////////////////////////////
   
   public void setName(String name) {
-    // if there is no source node associated with this transition
+    // if there is no source activity associated with this transition
     if (source==null) {
       // it s just a setter
       this.name = name;
 
     } else { // otherwise
-      // make sure the source node's leavingTransitionsMap remains up to date
+      // make sure the source activity's leavingTransitionsMap remains up to date
       if (this.name!=null) {
         source.removeOutgoingTransition(this);
       }
@@ -138,16 +138,16 @@
     return (Condition) WireContext.create(waitConditionDescriptor);
   }
 
-  public NodeImpl getSource() {
+  public ActivityImpl getSource() {
     return source;
   }
-  public void setSource(NodeImpl source) {
+  public void setSource(ActivityImpl source) {
     this.source = source;
   }
-  public NodeImpl getDestination() {
+  public ActivityImpl getDestination() {
     return destination;
   }
-  public void setDestination(NodeImpl destination) {
+  public void setDestination(ActivityImpl destination) {
     this.destination = destination;
   }
   /** see <a href="#conditions">Conditions</a> */

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNode.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNode.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNode.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,11 +21,11 @@
  */
 package org.jbpm.pvm.internal.model.op;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.log.Log;
 import org.jbpm.pvm.internal.job.MessageImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
 
 public class ExecuteNode implements AtomicOperation {
@@ -37,25 +37,25 @@
   }
 
   public void perform(ExecutionImpl execution) {
-    NodeImpl node = execution.getNode();
+    ActivityImpl activity = execution.getNode();
     
     if (log.isTraceEnabled()) {
       if (execution.getName()!=null) {
-        log.trace(execution.toString()+" executes "+node);
+        log.trace(execution.toString()+" executes "+activity);
       } else {
-        log.trace("executing "+node);
+        log.trace("executing "+activity);
       }
     }
     
-    Activity activity = node.getBehaviour();
+    ActivityBehaviour activityBehaviour = activity.getBehaviour();
     
     try {
       execution.setPropagation(Propagation.UNSPECIFIED);
       
-      activity.execute(execution);
+      activityBehaviour.execute(execution);
       
     } catch (Exception e) {
-      execution.handleException(node, null, null, e, execution.toString()+" couldn't execute "+activity+" for node "+node);
+      execution.handleException(activity, null, null, e, execution.toString()+" couldn't execute "+activityBehaviour+" for activity "+activity);
     }
     
     if (execution.getPropagation()==Propagation.UNSPECIFIED) {
@@ -64,7 +64,7 @@
   }
 
   public String toString() {
-    return "execute(node)";
+    return "execute(activity)";
   }
 
   public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNodeMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNodeMessage.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteNodeMessage.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -51,7 +51,7 @@
   }
 
   public String toString() {
-    return "execute-node-message["+dbid+"]";
+    return "execute-activity-message["+dbid+"]";
   }
 
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildNode.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildNode.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToChildNode.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -23,7 +23,7 @@
 
 import org.jbpm.pvm.internal.job.MessageImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 
 
 /**
@@ -31,15 +31,15 @@
  */
 public class MoveToChildNode implements AtomicOperation {
   
-  NodeImpl node;
+  ActivityImpl activity;
 
-  public MoveToChildNode(NodeImpl node) {
-    this.node = node;
+  public MoveToChildNode(ActivityImpl activity) {
+    this.activity = activity;
   }
 
   public void perform(ExecutionImpl execution) {
-    execution.moveTo(node);
-    ExecutionImpl propagatingExecution = execution.beginNode(node);
+    execution.moveTo(activity);
+    ExecutionImpl propagatingExecution = execution.beginNode(activity);
     propagatingExecution.performAtomicOperation(ExecutionImpl.EXECUTE_NODE);
   }
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/MoveToParentNode.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -23,7 +23,7 @@
 
 import org.jbpm.pvm.internal.job.MessageImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 
 /**
  * @author Tom Baeyens
@@ -31,13 +31,13 @@
 public class MoveToParentNode implements AtomicOperation {
 
   public void perform(ExecutionImpl execution) {
-    NodeImpl node = execution.getNode();
-    NodeImpl parentNode = node.getParentNode();
-    ExecutionImpl propagatingExecution = execution.endNode(node);
+    ActivityImpl activity = execution.getNode();
+    ActivityImpl parentNode = activity.getParentNode();
+    ExecutionImpl propagatingExecution = execution.endNode(activity);
     
-    // Restore original source node 
-    // (so that the call to moveTo updates the previous node) 
-    propagatingExecution.setNode(node);
+    // Restore original source activity 
+    // (so that the call to moveTo updates the previous activity) 
+    propagatingExecution.setActivity(activity);
     propagatingExecution.moveTo(parentNode);
     propagatingExecution.performAtomicOperation(new Signal(null, null, parentNode));
   }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ProceedToDestination.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ProceedToDestination.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ProceedToDestination.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -26,7 +26,7 @@
 
 import org.jbpm.pvm.internal.job.MessageImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ObservableElementImpl;
 
 /**
@@ -39,44 +39,44 @@
   }
 
   public void perform(ExecutionImpl execution) {
-    NodeImpl destination = execution.getTransition().getDestination();
-    execution.setNode(destination);
-    List<NodeImpl> enteredNodes = getNodesEntered(execution.getTransitionOrigin(), destination);
+    ActivityImpl destination = execution.getTransition().getDestination();
+    execution.setActivity(destination);
+    List<ActivityImpl> enteredNodes = getNodesEntered(execution.getTransitionOrigin(), destination);
     
     ExecutionImpl propagatingExecution = execution;
-    for (NodeImpl enteredNode : enteredNodes) {
+    for (ActivityImpl enteredNode : enteredNodes) {
       propagatingExecution = propagatingExecution.beginNode(enteredNode);
     }
     
-    // Restore original transition source node 
-    // (so that the call to moveTo updates the previous node) 
-    propagatingExecution.setNode(execution.getTransitionOrigin());
+    // Restore original transition source activity 
+    // (so that the call to moveTo updates the previous activity) 
+    propagatingExecution.setActivity(execution.getTransitionOrigin());
     propagatingExecution.moveTo(destination);
     
     propagatingExecution.performAtomicOperation(ExecutionImpl.EXECUTE_NODE);
   }
   
-  public List<NodeImpl> getNodesEntered(NodeImpl origin, NodeImpl destination) {
-    LinkedList<NodeImpl> nodesEntered = new LinkedList<NodeImpl>();
+  public List<ActivityImpl> getNodesEntered(ActivityImpl origin, ActivityImpl destination) {
+    LinkedList<ActivityImpl> activitiesEntered = new LinkedList<ActivityImpl>();
     
     if (origin.equals(destination)) {
-      nodesEntered.add(destination);
+      activitiesEntered.add(destination);
       
     } else {
       List<ObservableElementImpl> sourceChain = origin.getParentChain();
       
       if (!sourceChain.contains(destination)) {
-        NodeImpl destinationNode = destination;
+        ActivityImpl destinationNode = destination;
         while ( (destinationNode!=null)
                 && (!sourceChain.contains(destinationNode))
               ) {
-          nodesEntered.addFirst(destinationNode);
+          activitiesEntered.addFirst(destinationNode);
           destinationNode = destinationNode.getParentNode(); 
         }
       }
     }
 
-    return nodesEntered;
+    return activitiesEntered;
   }
 
   

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/Signal.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,11 +24,11 @@
 import java.util.Map;
 
 import org.jbpm.JbpmException;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.log.Log;
 import org.jbpm.pvm.internal.job.MessageImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl.Propagation;
 
 /**
@@ -40,12 +40,12 @@
 
   String signalName;
   Map<String, Object> parameters;
-  NodeImpl node;
+  ActivityImpl activity;
 
-  public Signal(String signalName, Map<String, Object> parameters, NodeImpl node) {
+  public Signal(String signalName, Map<String, Object> parameters, ActivityImpl activity) {
     this.signalName = signalName;
     this.parameters = parameters;
-    this.node = node;
+    this.activity = activity;
   }
 
   public boolean isAsync(ExecutionImpl execution) {
@@ -54,22 +54,22 @@
 
   public void perform(ExecutionImpl execution) {
     if (execution.getName()!=null) {
-      log.debug(execution.toString()+" signals "+node);
+      log.debug(execution.toString()+" signals "+activity);
     } else {
-      log.debug("signalling "+node+", signal="+signalName);
+      log.debug("signalling "+activity+", signal="+signalName);
     }
 
-    ExternalActivity externalActivity = (ExternalActivity) node.getBehaviour();
+    ExternalActivityBehaviour externalActivityBehaviour = (ExternalActivityBehaviour) activity.getBehaviour();
     
     try {
       execution.setPropagation(Propagation.UNSPECIFIED);
-      externalActivity.signal(execution, signalName, parameters);
+      externalActivityBehaviour.signal(execution, signalName, parameters);
 
     } catch (RuntimeException e) {
       throw e;
       
     } catch (Exception e) {
-      throw new JbpmException("couldn't signal "+node+": "+e.getMessage(), e);
+      throw new JbpmException("couldn't signal "+activity+": "+e.getMessage(), e);
     }
 
     if (execution.getPropagation() == Propagation.UNSPECIFIED) {
@@ -78,10 +78,10 @@
   }
   
   public String toString() {
-    return "signal(node)";
+    return "signal(activity)";
   }
 
   public MessageImpl<?> createAsyncMessage(ExecutionImpl execution) {
-    return new SignalMessage(execution, signalName, node);
+    return new SignalMessage(execution, signalName, activity);
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,7 +25,7 @@
 import org.jbpm.pvm.internal.job.MessageImpl;
 import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 
 /**
  * @author Tom Baeyens
@@ -35,21 +35,21 @@
   private static final long serialVersionUID = 1L;
   
   String signalName;
-  NodeImpl node;
+  ActivityImpl activity;
 
   public SignalMessage() {
   }
 
-  public SignalMessage(ExecutionImpl execution, String signalName, NodeImpl node) {
+  public SignalMessage(ExecutionImpl execution, String signalName, ActivityImpl activity) {
     super(execution);
     this.signalName = signalName;
-    this.node = node;
+    this.activity = activity;
   }
 
   public Object execute(Environment environment) throws Exception {
     unlockExecution();
     
-    Signal signal = new Signal(signalName, null, node);
+    Signal signal = new Signal(signalName, null, activity);
     execution.performAtomicOperationSync(signal);
     
     JobDbSession jobDbSession = environment.get(JobDbSession.class);

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TakeTransition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TakeTransition.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TakeTransition.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -29,7 +29,7 @@
 import org.jbpm.model.Event;
 import org.jbpm.pvm.internal.job.MessageImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ObservableElementImpl;
 import org.jbpm.pvm.internal.model.TransitionImpl;
 
@@ -51,13 +51,13 @@
       log.debug("taking "+transition);
     }
     
-    List<NodeImpl> leftNodes = getNodesLeft(execution.getNode(), transition.getDestination());
+    List<ActivityImpl> leftNodes = getNodesLeft(execution.getNode(), transition.getDestination());
     ExecutionImpl propagatingExecution = execution;
-    for (NodeImpl leftNode : leftNodes) {
+    for (ActivityImpl leftNode : leftNodes) {
       propagatingExecution = propagatingExecution.endNode(leftNode);
     }
     
-    propagatingExecution.setNode(null);
+    propagatingExecution.setActivity(null);
     propagatingExecution.fire(Event.TRANSITION_TAKE, transition);
     
     boolean wait = false;
@@ -72,26 +72,26 @@
     }
   }
 
-  List<NodeImpl> getNodesLeft(NodeImpl source, NodeImpl destination) {
-    List<NodeImpl> nodesLeft = new ArrayList<NodeImpl>();
+  List<ActivityImpl> getNodesLeft(ActivityImpl source, ActivityImpl destination) {
+    List<ActivityImpl> activitiesLeft = new ArrayList<ActivityImpl>();
     
     if (source.equals(destination)) {
-      nodesLeft.add(source);
+      activitiesLeft.add(source);
     } else {
       List<ObservableElementImpl> destinationChain = destination.getParentChain();
       
       if (!destinationChain.contains(source)) {
-        NodeImpl sourceNode = source;
+        ActivityImpl sourceNode = source;
         while ( (sourceNode!=null)
                 && (!destinationChain.contains(sourceNode))
               ) {
-          nodesLeft.add(sourceNode);
+          activitiesLeft.add(sourceNode);
           sourceNode = sourceNode.getParentNode(); 
         }
       }
     }
     
-    return nodesLeft;
+    return activitiesLeft;
   }
 
   public String toString() {

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/package.html
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/package.html	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/package.html	2009-01-20 09:19:05 UTC (rev 3682)
@@ -5,9 +5,9 @@
 <h3>Bidirectional relations</h3>
 <p>In this process model thoughout the pvm codebase, there are several bidirectional 
 relations.  By convention, the bidirectional relations are maintained on the many side.
-This means that when you call for example {@link org.jbpm.pvm.internal.model.ProcessDefinitionImpl#addNode(org.jbpm.pvm.internal.model.NodeImpl)}, that 
+This means that when you call for example {@link org.jbpm.pvm.internal.model.ProcessDefinitionImpl#addNode(org.jbpm.pvm.internal.model.ActivityImpl)}, that 
 method will also update the inverse pointer by invoking the 
-{@link org.jbpm.pvm.internal.model.NodeImpl#setProcessDefinition(org.jbpm.pvm.internal.model.ProcessDefinitionImpl)} setter.  Setter methods will be plain setter 
+{@link org.jbpm.pvm.internal.model.ActivityImpl#setProcessDefinition(org.jbpm.pvm.internal.model.ProcessDefinitionImpl)} setter.  Setter methods will be plain setter 
 methods and they will NOT update the inverse reference.  (that would cause 
 an infinite loop).
 </p>

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/XmlUtil.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -65,15 +65,15 @@
     if (element==null) {
       return Collections.emptyList();
     }
-    NodeList nodeList = element.getChildNodes();
-    if ( (nodeList == null)
-         || (nodeList.getLength()==0)
+    NodeList activityList = element.getChildNodes();
+    if ( (activityList == null)
+         || (activityList.getLength()==0)
        ) {
       return Collections.emptyList();
     }
     List<Element> elements = new ArrayList<Element>();
-    for (int i = 0; i < nodeList.getLength(); i++) {
-      Node child = nodeList.item(i);
+    for (int i = 0; i < activityList.getLength(); i++) {
+      Node child = activityList.item(i);
       if (Element.class.isAssignableFrom(child.getClass())) {
         Element childElement = (Element) child;
         String childTagName = getTagLocalName(childElement);
@@ -92,15 +92,15 @@
     if (element==null) {
       return Collections.emptyList();
     }
-    NodeList nodeList = element.getChildNodes();
-    if ( (nodeList == null)
-         || (nodeList.getLength()==0)
+    NodeList activityList = element.getChildNodes();
+    if ( (activityList == null)
+         || (activityList.getLength()==0)
        ) {
       return Collections.emptyList();
     }
     List<Element> elements = new ArrayList<Element>();
-    for (int i = 0; i < nodeList.getLength(); i++) {
-      Node child = nodeList.item(i);
+    for (int i = 0; i < activityList.getLength(); i++) {
+      Node child = activityList.item(i);
       if (Element.class.isAssignableFrom(child.getClass())) {
         Element childElement = (Element) child;
         String childTagName = getTagLocalName(childElement);
@@ -123,9 +123,9 @@
     if (element==null) {
       return null;
     }
-    NodeList nodeList = element.getChildNodes();
-    for (int i = 0; (i < nodeList.getLength()); i++) {
-      Node child = nodeList.item(i);
+    NodeList activityList = element.getChildNodes();
+    for (int i = 0; (i < activityList.getLength()); i++) {
+      Node child = activityList.item(i);
       if ((Element.class.isAssignableFrom(child.getClass())) && (getTagLocalName((Element) child)).equals(tagName)) {
         return (Element) child;
       }
@@ -142,19 +142,19 @@
     if (element==null) {
       return Collections.emptyList();
     }
-    NodeList nodeList = element.getChildNodes();
-    if ( (nodeList == null)
-         || (nodeList.getLength()==0)
+    NodeList activityList = element.getChildNodes();
+    if ( (activityList == null)
+         || (activityList.getLength()==0)
        ) {
       return Collections.emptyList();
     }
     List<Element> elements = new ArrayList<Element>();
-    if ((nodeList != null) && (nodeList.getLength() > 0)) {
+    if ((activityList != null) && (activityList.getLength() > 0)) {
       elements = new ArrayList<Element>();
-      for (int i = 0; i < nodeList.getLength(); i++) {
-        Node node = nodeList.item(i);
-        if (node instanceof Element) {
-          elements.add((Element) node);
+      for (int i = 0; i < activityList.getLength(); i++) {
+        Node activity = activityList.item(i);
+        if (activity instanceof Element) {
+          elements.add((Element) activity);
         }
       }
     }
@@ -165,9 +165,9 @@
     if (element==null) {
       return Collections.emptyList();
     }
-    NodeList nodeList = element.getChildNodes();
-    if ( (nodeList == null)
-         || (nodeList.getLength()==0)
+    NodeList activityList = element.getChildNodes();
+    if ( (activityList == null)
+         || (activityList.getLength()==0)
        ) {
       return Collections.emptyList();
     }
@@ -186,16 +186,16 @@
     if (element==null) {
       return Collections.emptyList();
     }
-    NodeList nodeList = element.getChildNodes();
-    if ( (nodeList == null)
-         || (nodeList.getLength()==0)
+    NodeList activityList = element.getChildNodes();
+    if ( (activityList == null)
+         || (activityList.getLength()==0)
        ) {
       return Collections.emptyList();
     }
     List<Element> elements = new ArrayList<Element>();
-    if (nodeList != null) {
-      for (int i = 0; i < nodeList.getLength(); i++) {
-        Node child = nodeList.item(i);
+    if (activityList != null) {
+      for (int i = 0; i < activityList.getLength(); i++) {
+        Node child = activityList.item(i);
         if (Element.class.isAssignableFrom(child.getClass())) {
           Element childElement = (Element) child;
           QName childElementQName = new QName(childElement.getNamespaceURI(), childElement.getLocalName());
@@ -247,11 +247,11 @@
 
   public static String getContentText(Element element) {
     StringBuffer buffer = new StringBuffer();
-    NodeList nodeList = element.getChildNodes();
-    for (int i = 0; i < nodeList.getLength(); i++) {
-      Node node = nodeList.item(i);
-      if (node instanceof CharacterData) {
-        CharacterData characterData = (CharacterData) node;
+    NodeList activityList = element.getChildNodes();
+    for (int i = 0; i < activityList.getLength(); i++) {
+      Node activity = activityList.item(i);
+      if (activity instanceof CharacterData) {
+        CharacterData characterData = (CharacterData) activity;
         buffer.append(characterData.getData());
       }
     }
@@ -260,9 +260,9 @@
 
   public static boolean isTextOnly(Element element) {
     boolean isTextOnly = true;
-    NodeList nodeList = element.getChildNodes();
-    for (int i = 0; ((i < nodeList.getLength()) && (isTextOnly)); i++) {
-      if (Element.class.isAssignableFrom(nodeList.item(i).getClass())) {
+    NodeList activityList = element.getChildNodes();
+    for (int i = 0; ((i < activityList.getLength()) && (isTextOnly)); i++) {
+      if (Element.class.isAssignableFrom(activityList.item(i).getClass())) {
         isTextOnly = false;
       }
     }
@@ -284,14 +284,14 @@
   }
 
   public static List<Node> contents(Element element) {
-    NodeList nodeList = element.getChildNodes();
-    if ((nodeList == null) || (nodeList.getLength() == 0)) {
+    NodeList activityList = element.getChildNodes();
+    if ((activityList == null) || (activityList.getLength() == 0)) {
       return Collections.emptyList();
     }
 
     List<Node> contents = new ArrayList<Node>();
-    for (int i = 0; i < nodeList.getLength(); i++) {
-      contents.add((Node) nodeList.item(i));
+    for (int i = 0; i < activityList.getLength(); i++) {
+      contents.add((Node) activityList.item(i));
     }
 
     return contents;

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -29,7 +29,7 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.env.Context;
 import org.jbpm.env.Environment;
 import org.jbpm.env.EnvironmentFactory;
@@ -73,7 +73,7 @@
  * </p>
  * 
  * <p>Another usage of the WireContext is construction and configuration of user 
- * code objects in a persistable way.  {@link Activity}s and {@link org.jbpm.activity.ExternalActivity}
+ * code objects in a persistable way.  {@link ActivityBehaviour}s and {@link org.jbpm.activity.ExternalActivityBehaviour}
  * and other user code can be instantiated with a WireContext.  That way, they can 
  * be persisted in a fixed schema.    
  * </p>

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -182,7 +182,7 @@
 
   /**
    * This method builds the WireDefinition from the DOM tree.
-   * This methods parses all child nodes of the documentElement that correspond to a Descriptor definition.
+   * This methods parses all child activities of the documentElement that correspond to a Descriptor definition.
    * @param documentElement the root element of the document
    * @param parse Parse object that contains all information for the current parse operation.
    * @return an instance of WireDefinition containing the resulting WireDefinition.

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/DomBuilder.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -45,19 +45,19 @@
   protected String lineAttributeName = "line";
   protected String columnAttributeName = null;
 
-  /** Current node */
+  /** Current activity */
   protected Node currentNode = null;
 
-  /** The root node */
+  /** The root activity */
   protected Node root = null;
 
-  /** The next sibling node */
+  /** The next sibling activity */
   protected Node nextSibling = null;
 
-  /** First node of document fragment or null if not a DocumentFragment */
+  /** First activity of document fragment or null if not a DocumentFragment */
   public DocumentFragment docFrag = null;
 
-  /** Vector of element nodes */
+  /** Vector of element activities */
   protected Stack elemStack = new Stack();
 
   /** Namespace support */
@@ -76,36 +76,36 @@
   }
 
   /**
-   * Get the root node of the DOM tree.
+   * Get the root activity of the DOM tree.
    */
   public Node getRootNode() {
     return this.root;
   }
 
   /**
-   * Get the node currently being processed.
+   * Get the activity currently being processed.
    * 
-   * @return the current node being processed
+   * @return the current activity being processed
    */
   public Node getCurrentNode() {
     return this.currentNode;
   }
 
   /**
-   * Set the next sibling node, which is where the result nodes should be
+   * Set the next sibling activity, which is where the result activities should be
    * inserted before.
    * 
    * @param nextSibling
-   *          the next sibling node.
+   *          the next sibling activity.
    */
   public void setNextSibling(Node nextSibling) {
     this.nextSibling = nextSibling;
   }
 
   /**
-   * Return the next sibling node.
+   * Return the next sibling activity.
    * 
-   * @return the next sibling node.
+   * @return the next sibling activity.
    */
   public Node getNextSibling() {
     return this.nextSibling;
@@ -121,10 +121,10 @@
   }
 
   /**
-   * Append a node to the current container.
+   * Append a activity to the current container.
    * 
    * @param newNode
-   *          New node to append
+   *          New activity to append
    */
   protected void append(Node newNode) throws org.xml.sax.SAXException {
 
@@ -253,7 +253,7 @@
    * 
    * 
    * @param ns
-   *          The namespace of the node
+   *          The namespace of the activity
    * @param localName
    *          The local part of the qualified name
    * @param name
@@ -268,7 +268,7 @@
     Element elem;
 
     // Note that the namespace-aware call must be used to correctly
-    // construct a Level 2 DOM, even for non-namespaced nodes.
+    // construct a Level 2 DOM, even for non-namespaced activities.
     if ((null == ns) || (ns.length() == 0))
       elem = this.document.createElementNS(null, name);
     else
@@ -336,7 +336,7 @@
 
 
       /*
-       * Adding namespace nodes to the DOM tree;
+       * Adding namespace activities to the DOM tree;
        */
       int nDecls = this.prefixMappings.size();
 
@@ -400,7 +400,7 @@
   }
 
   /**
-   * Set an ID string to node association in the ID table.
+   * Set an ID string to activity association in the ID table.
    * 
    * @param id
    *          The ID string.
@@ -466,7 +466,7 @@
 
   /**
    * If available, when the disable-output-escaping attribute is used, output
-   * raw text without escaping. A PI will be inserted in front of the node with
+   * raw text without escaping. A PI will be inserted in front of the activity with
    * the name "lotusxsl-next-is-raw" and a value of "formatter-to-dom".
    * 
    * @param ch
@@ -566,9 +566,9 @@
   }
 
   /**
-   * Tell if the current node is outside the document element.
+   * Tell if the current activity is outside the document element.
    * 
-   * @return true if the current node is outside the document element.
+   * @return true if the current activity is outside the document element.
    */
   private boolean isOutsideDocElem() {
     return (null == this.docFrag) && this.elemStack.size() == 0 && (null == this.currentNode || this.currentNode.getNodeType() == Node.DOCUMENT_NODE);

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/xml/Parser.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -130,12 +130,12 @@
  *
  * <p>A parser can be configured with a set of {@link Binding}s.  Each {@link Binding}
  * knows how to transform a dom element of a given tagName to the corresponding Java
- * object.  {@link Bindings} has a notion of binding categories.  For example, nodes
+ * object.  {@link Bindings} has a notion of binding categories.  For example, activities
  * and actions can be seen as different categories in jPDL.
  * </p>
  *
  * <p>The purpose of bindings is to make certain elements in the parsing configurable.
- * E.g. in jPDL, the main structure of the document is fixed.  But node types can be
+ * E.g. in jPDL, the main structure of the document is fixed.  But activity types can be
  * added dynamically.
  * </p>
  *
@@ -177,9 +177,9 @@
  *     parse.pushObject(myProcess);
  *     try {
  *
- *       for (Element nodeElement: elements) {
- *         // parse the child elements with the bindings in category "node"
- *         parseElement(nodeElement, parse, "node");
+ *       for (Element activityElement: elements) {
+ *         // parse the child elements with the bindings in category "activity"
+ *         parseElement(activityElement, parse, "activity");
  *       }
  *     } finally {
  *       // make sure my processDefinition is popped.
@@ -190,7 +190,7 @@
  * }
  * </pre>
  *
- * <p>Then, node bindings might access the processDefinition like this:
+ * <p>Then, activity bindings might access the processDefinition like this:
  * </p>
  *
  * <pre>public class MyNodeBinding implements Binding {
@@ -199,7 +199,7 @@
  *     <i>// instantiate the object for this binding</i>
  *     MyNode myNode = new MyNode();
  *
- *     <i>// add the node to the processDefinition</i>
+ *     <i>// add the activity to the processDefinition</i>
  *     MyProcess myProcess = parse.findObject(MyProcess.class);
  *     myProcess.addNode(myNode);
  *     myNode.setMyProcess(myProcess);

Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.cache.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.cache.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.cache.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -1,7 +1,7 @@
 <hibernate-cache>
 
   <class-cache class="org.jbpm.pvm.internal.model.ProcessDefinitionImpl" />
-	<class-cache class="org.jbpm.pvm.internal.model.NodeImpl" />
+	<class-cache class="org.jbpm.pvm.internal.model.ActivityImpl" />
 	<class-cache class="org.jbpm.pvm.internal.model.TransitionImpl" />
 	<class-cache class="org.jbpm.pvm.internal.model.EventImpl" />
 	<class-cache class="org.jbpm.pvm.internal.model.ExceptionHandlerImpl" />
@@ -12,17 +12,17 @@
 
 	<collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.exceptionHandlers" />
 	<collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.events" />
-	<collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.nodes" />
+	<collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.activities" />
 	<collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.variableDefinitions" />
 	<collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.timerDefinitions" />
 
-	<collection-cache collection="org.jbpm.pvm.internal.model.NodeImpl.exceptionHandlers" />
-	<collection-cache collection="org.jbpm.pvm.internal.model.NodeImpl.events" />
-	<collection-cache collection="org.jbpm.pvm.internal.model.NodeImpl.nodes" />
-	<collection-cache collection="org.jbpm.pvm.internal.model.NodeImpl.variableDefinitions" />
-	<collection-cache collection="org.jbpm.pvm.internal.model.NodeImpl.timerDefinitions" />
-	<collection-cache collection="org.jbpm.pvm.internal.model.NodeImpl.incomingTransitions" />
-	<collection-cache collection="org.jbpm.pvm.internal.model.NodeImpl.outgoingTransitions" />
+	<collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.exceptionHandlers" />
+	<collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.events" />
+	<collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.activities" />
+	<collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.variableDefinitions" />
+	<collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.timerDefinitions" />
+	<collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.incomingTransitions" />
+	<collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.outgoingTransitions" />
 
 	<collection-cache collection="org.jbpm.pvm.internal.model.TransitionImpl.exceptionHandlers" />
 	<collection-cache collection="org.jbpm.pvm.internal.model.TransitionImpl.events" />

Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.definition.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.definition.hbm.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.definition.hbm.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -36,12 +36,12 @@
     </map>
 
     <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-    <list name="nodes" cascade="all" inverse="false">
-      <key foreign-key="FK_NODES_PROCESS">
-        <column name="NODESPROCESS_" index="IDX_NODES_PROCESS"/>
+    <list name="activities" cascade="all" inverse="false">
+      <key foreign-key="FK_ACTS_PROCESS">
+        <column name="ACTSPROCESS_" index="IDX_ACTS_PROCESS"/>
       </key>
-      <list-index column="NODESPROCESS_IDX_" />
-      <one-to-many class="NodeImpl" />
+      <list-index column="ACTSPROCESS_IDX_" />
+      <one-to-many class="ActivityImpl" />
     </list>
     <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
     <list name="variableDefinitions" cascade="all">
@@ -68,7 +68,7 @@
     <property name="deploymentTime" column="DEPLOYED_" />
     <many-to-one name="initial" 
                  column="INITIAL_"
-                 class="NodeImpl"
+                 class="ActivityImpl"
                  cascade="all" 
                  foreign-key="FK_PROCDEF_INITIAL"
                  index="IDX_PROCDEF_INIT"
@@ -76,7 +76,7 @@
   </class>
 
   <!-- ### Node ############################################################## -->
-  <class name="NodeImpl" table="JBPM_NODE">
+  <class name="ActivityImpl" table="JBPM_ACTIVITY">
     <!-- ProcessElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
     <id name="dbid" column="DBID_">
       <generator class="native" />
@@ -85,19 +85,19 @@
     <many-to-one name="processDefinition"
                  class="ProcessDefinitionImpl" 
                  column="PROCESS_" 
-                 foreign-key="FK_NODE_PROCESS"
-                 index="IDX_NODE_PROCESS" />
+                 foreign-key="FK_ACT_PROCESS"
+                 index="IDX_ACT_PROCESS" />
     <many-to-one name="properties"
                  class="WireProperties" 
                  column="PROPS_" 
-                 foreign-key="FK_NODE_PROPS"
-                 index="IDX_NODE_PROPS"
+                 foreign-key="FK_ACT_PROPS"
+                 index="IDX_ACT_PROPS"
                  cascade="all" />
     <list name="exceptionHandlers" cascade="all">
-      <key foreign-key="FK_EXHDLR_NODE">
-        <column name="NODE_" index="IDX_EXHDLR_NODE"/>
+      <key foreign-key="FK_EXHDLR_ACT">
+        <column name="ACT_" index="IDX_EXHDLR_ACT"/>
       </key>
-      <index column="NODE_IDX_" />
+      <index column="ACT_IDX_" />
       <one-to-many class="ExceptionHandlerImpl" />
     </list>
 
@@ -105,36 +105,36 @@
     <property name="name" column="NAME_"/>
     <property name="description" column="DESCR_"/>
     <map name="events" cascade="all-delete-orphan">
-      <key foreign-key="FK_EVENT_NODE">
-        <column name="NODE_" index="IDX_EVENT_NODE" />
+      <key foreign-key="FK_EVENT_ACT">
+        <column name="ACT_" index="IDX_EVENT_ACT" />
       </key>
       <map-key type="string" column="NAME_" />
       <one-to-many class="org.jbpm.pvm.internal.model.EventImpl" />
     </map>
 
     <!-- CompositeElementImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-    <list name="nodes" cascade="all" inverse="false">
+    <list name="activities" cascade="all" inverse="false">
       <key column="PARENT_" foreign-key="none" />
       <list-index column="PARENT_IDX_" />
-      <one-to-many class="NodeImpl" />
+      <one-to-many class="ActivityImpl" />
     </list>
     <property name="hasVariableDefinitions" column="HAS_VAR_DEF_" />
     <list name="variableDefinitions" cascade="all">
-      <key foreign-key="FK_VARDEF_NODE">
-        <column name="NODE_" index="IDX_VARDEF_NODE"/>
+      <key foreign-key="FK_VARDEF_ACT">
+        <column name="ACT_" index="IDX_VARDEF_ACT"/>
       </key>
-      <index column="NODE_IDX_" />
+      <index column="ACT_IDX_" />
       <one-to-many class="VariableDefinitionImpl" />
     </list>
     <property name="hasTimerDefinitions" column="HAS_TIMER_DEF_" />
     <set name="timerDefinitions" cascade="all">
-      <key foreign-key="FK_TMRDEF_NODE">
-        <column name="NODE_" index="IDX_TMRDEF_NODE"/>
+      <key foreign-key="FK_TMRDEF_ACT">
+        <column name="ACT_" index="IDX_TMRDEF_ACT"/>
       </key>
       <one-to-many class="TimerDefinitionImpl" />
     </set>
 
-    <!-- NodeImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+    <!-- ActivityImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
     <property name="isLocalScope" column="LOCAL_SCOPE_" />
     <property name="isExecutionAsync" column="EXEC_ASYNC_" />
     <property name="isSignalAsync" column="SIGNAL_ASYNC_" />
@@ -142,17 +142,17 @@
 
     <many-to-one name="parentNode" 
                  column="PARENT_"
-                 class="NodeImpl"
+                 class="ActivityImpl"
                  cascade="all"
-                 foreign-key="FK_NODE_PARENT" 
-                 index="IDX_NODE_PARENT" />
+                 foreign-key="FK_ACT_PARENT" 
+                 index="IDX_ACT_PARENT" />
 
     <many-to-one name="defaultTransition"
                  column="DEFTRANS_" 
                  class="TransitionImpl"
                  fetch="select"
-                 foreign-key="FK_NODE_DEFTRANS" 
-                 index="IDX_NODE_DEFTRANS" />
+                 foreign-key="FK_ACT_DEFTRANS" 
+                 index="IDX_ACT_DEFTRANS" />
 
     <list name="incomingTransitions" inverse="false">
       <key column="DESTINATION_" />
@@ -222,14 +222,14 @@
     <!-- TransitionImpl part ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
     <many-to-one name="source"
                  column="SRC_" 
-                 class="NodeImpl" 
+                 class="ActivityImpl" 
                  fetch="select" 
                  foreign-key="FK_TRANS_SRC" 
                  index="IDX_TRANS_SRC" />
 
     <many-to-one name="destination"
                  column="DEST_" 
-                 class="NodeImpl" 
+                 class="ActivityImpl" 
                  fetch="select"
                  cascade="all"
                  foreign-key="FK_TRANS_DST" 
@@ -301,7 +301,7 @@
     <property name="isTransactional" column="TRANSACT_" />
     <property name="isRethrowMasked" column="RETHROW_MASKED_"/>
     <property name="transitionName" column="TRANSITIONNAME_" />
-    <property name="nodeName" column="NODENAME_" />
+    <property name="activityName" column="NODENAME_" />
     <list name="eventListenerReferences" 
           inverse="false"
           cascade="all-delete-orphan"

Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.execution.hbm.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -10,12 +10,12 @@
     </id>
     <version name="dbversion" column="DBVERSION_" />
     
-    <many-to-one name="node" 
-                 class="org.jbpm.pvm.internal.model.NodeImpl" 
-                 column="NODE_"
+    <many-to-one name="activity" 
+                 class="org.jbpm.pvm.internal.model.ActivityImpl" 
+                 column="ACT_"
                  lazy="false"
-                 foreign-key="FK_EXEC_NODE"
-                 index="IDX_EXEC_NODE" />
+                 foreign-key="FK_EXEC_ACT"
+                 index="IDX_EXEC_ACT" />
 
     <property name="hasVariables" column="HASVARS_" />
     <map name="variables"
@@ -56,7 +56,7 @@
     <many-to-one name="transition" column="TRANSITION_" class="TransitionImpl" />
 
     <many-to-one name="transitionOrigin" 
-                 class="org.jbpm.pvm.internal.model.NodeImpl" 
+                 class="org.jbpm.pvm.internal.model.ActivityImpl" 
                  column="TRANSORIG_"
                  foreign-key="FK_EXEC_TRANSORIG"
                  index="IDX_EXEC_TRANSORIG" />

Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.job.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.job.hbm.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.job.hbm.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -45,7 +45,7 @@
       <subclass name="org.jbpm.pvm.internal.model.op.ExecuteNodeMessage" discriminator-value="ExeNodeMsg" />
       <subclass name="org.jbpm.pvm.internal.model.op.SignalMessage" discriminator-value="SignalMsg">
         <property name="signalName" column="SIGNAL_" />
-        <many-to-one name="node"   
+        <many-to-one name="activity"   
                      column="NODE_" 
                      cascade="none"
                      foreign-key="FK_JOB_NODE"/>

Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.types.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.types.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.types.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -28,7 +28,7 @@
   <type name="serializable" class="serializable" converter="org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter" variable-class="org.jbpm.pvm.internal.type.variable.BlobVariable" />
 
   <!-- TODO: add ejb3 entity bean support -->
-  <!-- TODO: add JCR node support -->
+  <!-- TODO: add JCR activity support -->
   <!-- TODO: add collection support -->
   
 </types>

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/AutomaticActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/AutomaticActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/AutomaticActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,13 +21,13 @@
  */
 package org.jbpm.pvm.activities;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
 
 /**
  * @author Tom Baeyens
  */
-public class AutomaticActivity implements Activity {
+public class AutomaticActivity implements ActivityBehaviour {
 
   private static final long serialVersionUID = 1L;
 

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLn.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLn.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLn.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,13 +21,13 @@
  */
 package org.jbpm.pvm.activities;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
 import org.jbpm.listener.EventListener;
 import org.jbpm.listener.EventListenerExecution;
 import org.jbpm.model.OpenExecution;
 
-public class PrintLn implements Activity, EventListener {
+public class PrintLn implements ActivityBehaviour, EventListener {
 
   private static final long serialVersionUID = 1L;
 

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLnBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLnBuilder.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/PrintLnBuilder.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -34,7 +34,7 @@
   
   public PrintLnBuilder(ActivityBuilder activityBuilder) {
     super(activityBuilder);
-    node.setBehaviour(printLn);
+    activity.setBehaviour(printLn);
   }
   
   public PrintLnBuilder message(String message) {

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/WaitState.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/WaitState.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/WaitState.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,12 +24,12 @@
 import java.util.Map;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 
 /**
  * @author Tom Baeyens
  */
-public class WaitState implements ExternalActivity {
+public class WaitState implements ExternalActivityBehaviour {
 
   private static final long serialVersionUID = 1L;
 

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -27,7 +27,7 @@
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.model.Transition;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.test.JbpmTestCase;
 
 
@@ -58,7 +58,7 @@
       .endActivity()
     .endProcess();
  
-    NodeImpl start = (NodeImpl) processDefinition.getInitial();
+    ActivityImpl start = (ActivityImpl) processDefinition.getInitial();
     assertNotNull(start);
     assertEquals("start", start.getName());
   }
@@ -73,7 +73,7 @@
       .endActivity()
     .endProcess();
     
-    NodeImpl decisionNode = (NodeImpl) processDefinition.getNode("start");
+    ActivityImpl decisionNode = (ActivityImpl) processDefinition.getActivity("start");
     assertNotNull(decisionNode);
     assertEquals("start", decisionNode.getName());
 
@@ -101,7 +101,7 @@
       .endActivity()
     .endProcess();
 
-    NodeImpl decisionNode = (NodeImpl) processDefinition.getNode("x");
+    ActivityImpl decisionNode = (ActivityImpl) processDefinition.getActivity("x");
     assertNotNull(decisionNode);
     
     List<Transition> outgoingTransitions = decisionNode.getOutgoingTransitions();
@@ -128,7 +128,7 @@
     assertSame(toB, outgoingTransitionsMap.get("to b"));
     assertSame(toC, outgoingTransitionsMap.get("to c"));
     
-    NodeImpl b = (NodeImpl) processDefinition.getNode("b");
+    ActivityImpl b = (ActivityImpl) processDefinition.getActivity("b");
     List<Transition> incomingTransitions = b.getIncomingTransitions();
     assertNotNull(incomingTransitions);
     assertEquals("x", incomingTransitions.get(0).getSource().getName());
@@ -158,44 +158,44 @@
       .endActivity()
     .endProcess();
 
-    NodeImpl node1 = (NodeImpl) processDefinition.findNode("1");
-    NodeImpl node11 = (NodeImpl) processDefinition.findNode("1.1");
-    NodeImpl node12 = (NodeImpl) processDefinition.findNode("1.2");
-    NodeImpl node121 = (NodeImpl) processDefinition.findNode("1.2.1");
-    NodeImpl node122 = (NodeImpl) processDefinition.findNode("1.2.2");
-    NodeImpl node123 = (NodeImpl) processDefinition.findNode("1.2.3");
-    NodeImpl node13 = (NodeImpl) processDefinition.findNode("1.3");
+    ActivityImpl activity1 = (ActivityImpl) processDefinition.findActivity("1");
+    ActivityImpl activity11 = (ActivityImpl) processDefinition.findActivity("1.1");
+    ActivityImpl activity12 = (ActivityImpl) processDefinition.findActivity("1.2");
+    ActivityImpl activity121 = (ActivityImpl) processDefinition.findActivity("1.2.1");
+    ActivityImpl activity122 = (ActivityImpl) processDefinition.findActivity("1.2.2");
+    ActivityImpl activity123 = (ActivityImpl) processDefinition.findActivity("1.2.3");
+    ActivityImpl activity13 = (ActivityImpl) processDefinition.findActivity("1.3");
     
-    assertNotNull(node1);
-    assertNotNull(node11);
-    assertNotNull(node12);
-    assertNotNull(node121);
-    assertNotNull(node122);
-    assertNotNull(node123);
-    assertNotNull(node13);
+    assertNotNull(activity1);
+    assertNotNull(activity11);
+    assertNotNull(activity12);
+    assertNotNull(activity121);
+    assertNotNull(activity122);
+    assertNotNull(activity123);
+    assertNotNull(activity13);
 
-    assertSame(node1, processDefinition.getNodes().get(0));
-    assertEquals(1, processDefinition.getNodes().size());
+    assertSame(activity1, processDefinition.getActivities().get(0));
+    assertEquals(1, processDefinition.getActivities().size());
 
-    assertSame(node11, node1.getNodes().get(0));
-    assertSame(node12, node1.getNodes().get(1));
-    assertSame(node13, node1.getNodes().get(2));
-    assertEquals(3, node1.getNodes().size());
+    assertSame(activity11, activity1.getActivities().get(0));
+    assertSame(activity12, activity1.getActivities().get(1));
+    assertSame(activity13, activity1.getActivities().get(2));
+    assertEquals(3, activity1.getActivities().size());
 
-    assertSame(node121, node12.getNodes().get(0));
-    assertSame(node122, node12.getNodes().get(1));
-    assertSame(node123, node12.getNodes().get(2));
-    assertEquals(3, node12.getNodes().size());
+    assertSame(activity121, activity12.getActivities().get(0));
+    assertSame(activity122, activity12.getActivities().get(1));
+    assertSame(activity123, activity12.getActivities().get(2));
+    assertEquals(3, activity12.getActivities().size());
     
-    assertSame(processDefinition, node1.getParent());
-    assertSame(node1, node11.getParent());
-    assertSame(node1, node12.getParent());
-    assertSame(node12, node121.getParent());
-    assertSame(node12, node122.getParent());
-    assertSame(node12, node123.getParent());
-    assertSame(node1, node13.getParent());
+    assertSame(processDefinition, activity1.getParent());
+    assertSame(activity1, activity11.getParent());
+    assertSame(activity1, activity12.getParent());
+    assertSame(activity12, activity121.getParent());
+    assertSame(activity12, activity122.getParent());
+    assertSame(activity12, activity123.getParent());
+    assertSame(activity1, activity13.getParent());
     
-    assertSame(node1, node122.getOutgoingTransition("to one").getDestination());
-    assertSame(node121, node11.getOutgoingTransition("to onedottwodotone").getDestination());
+    assertSame(activity1, activity122.getOutgoingTransition("to one").getDestination());
+    assertSame(activity121, activity11.getOutgoingTransition("to onedottwodotone").getDestination());
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,14 +21,14 @@
  */
 package org.jbpm.pvm.builder;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
 
 
 /**
  * @author Tom Baeyens
  */
-public class TestActivity implements Activity {
+public class TestActivity implements ActivityBehaviour {
   
   private static final long serialVersionUID = 1L;
 

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestBehaviourBuilder.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestBehaviourBuilder.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/TestBehaviourBuilder.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -34,7 +34,7 @@
 
   public TestBehaviourBuilder(ActivityBuilder activityBuilder) {
     super(activityBuilder);
-    node.setBehaviour(testActivity);
+    activity.setBehaviour(testActivity);
   }
 
   public TestBehaviourBuilder testActivityProperty(String testActivityProperty) {

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -73,13 +73,13 @@
     
     execution.signal();
     
-    expectedLines.add("leaving node(a)");
+    expectedLines.add("leaving activity(a)");
     assertEquals(expectedLines, testConsole.lines);
     
     execution.signal();
 
-    expectedLines.add("leaving node(b)");
-    expectedLines.add("leaving node(composite)");
+    expectedLines.add("leaving activity(b)");
+    expectedLines.add("leaving activity(composite)");
     assertEquals(expectedLines, testConsole.lines);
   }
   
@@ -113,7 +113,7 @@
     
     execution.signal();
 
-    expectedLines.add("leaving node(composite)");
+    expectedLines.add("leaving activity(composite)");
     assertEquals(expectedLines, testConsole.lines);
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/AutomaticActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/AutomaticActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/AutomaticActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,15 +21,15 @@
  */
 package org.jbpm.pvm.executionmode.embedded;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
 
-/** a node behaviour implementation that records its execution and then 
+/** a activity behaviour implementation that records its execution and then 
  * just proceeds.
  *  
  * @author Tom Baeyens
  */
-public class AutomaticActivity implements Activity {
+public class AutomaticActivity implements ActivityBehaviour {
 
   private static final long serialVersionUID = 1L;
   

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -91,7 +91,7 @@
   }
 
   public String getState() {
-    return execution.getNodeName();
+    return execution.getActivityName();
   }
   
   // getters //////////////////////////////////////////////////////////////////

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/WaitState.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/WaitState.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/WaitState.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,12 +24,12 @@
 import java.util.Map;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 
 /**
  * @author Tom Baeyens
  */
-public class WaitState implements ExternalActivity {
+public class WaitState implements ExternalActivityBehaviour {
 
   private static final long serialVersionUID = 1L;
   

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -55,11 +55,11 @@
     
     ClientExecution execution = processDefinition.startProcessInstance();
     
-    assertEquals("evaluate", execution.getNodeName());
+    assertEquals("evaluate", execution.getActivityName());
     
     execution.signal("approve");
     
     execution.signal();
-    assertEquals("end", execution.getNodeName());
+    assertEquals("end", execution.getActivityName());
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessCacheDbTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -17,11 +17,11 @@
 
 import org.hibernate.Session;
 import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.OpenProcessDefinition;
 import org.jbpm.model.Transition;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.session.DbSession;
 import org.jbpm.session.PvmDbSession;
@@ -34,7 +34,7 @@
 public class ProcessCacheDbTest extends EnvironmentDbTestCase {
 
   /**
-   * Defines a simple process: only nodes. persists it.
+   * Defines a simple process: only activities. persists it.
    */
   public void testCacheProcessDefinitionNodes() {
     OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
@@ -61,22 +61,22 @@
     pvmDbSession = environment.get(PvmDbSession.class);
     processDefinition = pvmDbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
     assertNotNull(processDefinition);
-    List<Node> nodes = processDefinition.getNodes();
-    assertNotNull(nodes);
+    List<Activity> activities = processDefinition.getActivities();
+    assertNotNull(activities);
 
-    Node a = nodes.get(0);
+    Activity a = activities.get(0);
     assertEquals("a", a.getName());
-    assertTrue(a.getNodes().isEmpty());
+    assertTrue(a.getActivities().isEmpty());
 
-    Node b = nodes.get(1);
+    Activity b = activities.get(1);
     assertEquals("b", b.getName());
-    assertTrue(b.getNodes().isEmpty());
+    assertTrue(b.getActivities().isEmpty());
 
-    Node c = nodes.get(2);
+    Activity c = activities.get(2);
     assertEquals("c", c.getName());
-    assertTrue(c.getNodes().isEmpty());
+    assertTrue(c.getActivities().isEmpty());
 
-    assertEquals(3, nodes.size());
+    assertEquals(3, activities.size());
 
     newTransaction(); // ///////////////////////////////////////////////////////
 
@@ -87,28 +87,28 @@
     pvmDbSession = environment.get(PvmDbSession.class);
     processDefinition = pvmDbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
     assertNotNull(processDefinition);
-    nodes = processDefinition.getNodes();
-    assertNotNull(nodes);
+    activities = processDefinition.getActivities();
+    assertNotNull(activities);
 
-    a = nodes.get(0);
+    a = activities.get(0);
     assertEquals("a", a.getName());
-    assertTrue(a.getNodes().isEmpty());
+    assertTrue(a.getActivities().isEmpty());
 
-    b = nodes.get(1);
+    b = activities.get(1);
     assertEquals("b", b.getName());
-    assertTrue(b.getNodes().isEmpty());
+    assertTrue(b.getActivities().isEmpty());
 
-    c = nodes.get(2);
+    c = activities.get(2);
     assertEquals("c", c.getName());
-    assertTrue(c.getNodes().isEmpty());
+    assertTrue(c.getActivities().isEmpty());
 
-    assertEquals(3, nodes.size());
+    assertEquals(3, activities.size());
 
     endCacheTest(); // ///////////
   }
 
   /**
-   * Defines a simple process: only nodes. persists it.
+   * Defines a simple process: only activities. persists it.
    */
   public void testCacheProcessDefinitionNodeOrder() {
     OpenProcessDefinition processDefinition = ProcessDefinitionBuilder
@@ -133,21 +133,21 @@
     dbSession = environment.get(DbSession.class);
     processDefinition = dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
     assertNotNull(processDefinition);
-    List<Node> nodes = processDefinition.getNodes();
-    assertNotNull(nodes);
-    assertEquals(3, nodes.size());
+    List<Activity> activities = processDefinition.getActivities();
+    assertNotNull(activities);
+    assertEquals(3, activities.size());
 
-    Node a = nodes.get(0);
+    Activity a = activities.get(0);
     assertEquals("a", a.getName());
-    assertEquals(0, a.getNodes().size());
+    assertEquals(0, a.getActivities().size());
 
-    Node b = nodes.get(1);
+    Activity b = activities.get(1);
     assertEquals("b", b.getName());
-    assertEquals(0, b.getNodes().size());
+    assertEquals(0, b.getActivities().size());
 
-    Node c = nodes.get(2);
+    Activity c = activities.get(2);
     assertEquals("c", c.getName());
-    assertEquals(0, c.getNodes().size());
+    assertEquals(0, c.getActivities().size());
 
     newTransaction(); // ///////////////////////////////////////////////////////
 
@@ -155,45 +155,45 @@
     processDefinition = dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
     assertNotNull(processDefinition);
 
-    nodes = processDefinition.getNodes();
-    assertNotNull(nodes);
+    activities = processDefinition.getActivities();
+    assertNotNull(activities);
 
-    // Pass a to the end -> node order is "b,c,a"
-    nodes.add(nodes.remove(0));
+    // Pass a to the end -> activity order is "b,c,a"
+    activities.add(activities.remove(0));
 
-    nodes = processDefinition.getNodes();
-    b = nodes.get(0);
+    activities = processDefinition.getActivities();
+    b = activities.get(0);
     assertEquals("b", b.getName());
-    assertEquals(0, b.getNodes().size());
+    assertEquals(0, b.getActivities().size());
 
-    c = nodes.get(1);
+    c = activities.get(1);
     assertEquals("c", c.getName());
-    assertEquals(0, c.getNodes().size());
+    assertEquals(0, c.getActivities().size());
 
-    a = nodes.get(2);
+    a = activities.get(2);
     assertEquals("a", a.getName());
-    assertEquals(0, a.getNodes().size());
+    assertEquals(0, a.getActivities().size());
 
     newTransaction(); // ///////////////////////////////////////////////////////
 
     dbSession = environment.get(DbSession.class);
     processDefinition = dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
     assertNotNull(processDefinition);
-    nodes = processDefinition.getNodes();
-    assertNotNull(nodes);
-    assertEquals(3, nodes.size());
+    activities = processDefinition.getActivities();
+    assertNotNull(activities);
+    assertEquals(3, activities.size());
 
-    b = nodes.get(0);
+    b = activities.get(0);
     assertEquals("b", b.getName());
-    assertEquals(0, b.getNodes().size());
+    assertEquals(0, b.getActivities().size());
 
-    c = nodes.get(1);
+    c = activities.get(1);
     assertEquals("c", c.getName());
-    assertEquals(0, c.getNodes().size());
+    assertEquals(0, c.getActivities().size());
 
-    a = nodes.get(2);
+    a = activities.get(2);
     assertEquals("a", a.getName());
-    assertEquals(0, a.getNodes().size());
+    assertEquals(0, a.getActivities().size());
 
     newTransaction(); // ///////////////////////////////////////////////////////
     beginCacheTest(); // /////////
@@ -201,35 +201,35 @@
     dbSession = environment.get(DbSession.class);
     processDefinition = dbSession.get(ProcessDefinitionImpl.class, processDefinition.getDbid());
     assertNotNull(processDefinition);
-    nodes = processDefinition.getNodes();
-    assertNotNull(nodes);
-    assertEquals(3, nodes.size());
+    activities = processDefinition.getActivities();
+    assertNotNull(activities);
+    assertEquals(3, activities.size());
 
-    b = nodes.get(0);
+    b = activities.get(0);
     assertEquals("b", b.getName());
-    assertEquals(0, b.getNodes().size());
+    assertEquals(0, b.getActivities().size());
 
-    c = nodes.get(1);
+    c = activities.get(1);
     assertEquals("c", c.getName());
-    assertEquals(0, c.getNodes().size());
+    assertEquals(0, c.getActivities().size());
 
-    a = nodes.get(2);
+    a = activities.get(2);
     assertEquals("a", a.getName());
-    assertEquals(0, a.getNodes().size());
+    assertEquals(0, a.getActivities().size());
 
     endCacheTest(); // //////////////
   }
 
   /**
-   * Test processDefinition initial node
+   * Test processDefinition initial activity
    */
   public void testCacheProcessDefinitionInitialNode() {
     ProcessDefinitionImpl processDefinition = new ProcessDefinitionImpl();
-    NodeImpl node = (NodeImpl) processDefinition.createNode();
-    node.setName("initial node");
-    node.setDescription("very important node");
+    ActivityImpl activity = (ActivityImpl) processDefinition.createNode();
+    activity.setName("initial activity");
+    activity.setDescription("very important activity");
 
-    processDefinition.setInitial(node);
+    processDefinition.setInitial(activity);
 
     environment.get(DbSession.class).save(processDefinition);
 
@@ -238,11 +238,11 @@
     ProcessDefinitionImpl p = environment.get(DbSession.class).get(ProcessDefinitionImpl.class, processDefinition.getDbid());
     assertNotNull(p);
 
-    NodeImpl n = p.getInitial();
+    ActivityImpl n = p.getInitial();
 
     assertNotNull(n);
-    assertEquals(node.getName(), n.getName());
-    assertEquals(node.getDescription(), n.getDescription());
+    assertEquals(activity.getName(), n.getName());
+    assertEquals(activity.getDescription(), n.getDescription());
 
     newTransaction(); // /////////////////////////////////////////////////////
     beginCacheTest(); // //////////
@@ -253,15 +253,15 @@
     n = p.getInitial();
 
     assertNotNull(n);
-    assertEquals(node.getName(), n.getName());
-    assertEquals(node.getDescription(), n.getDescription());
+    assertEquals(activity.getName(), n.getName());
+    assertEquals(activity.getDescription(), n.getDescription());
 
     endCacheTest(); // ///////////
   }
 
   /**
-   * Defines a simple process: only nested nodes. persists it, reloads it and
-   * tries to access the nested nodes
+   * Defines a simple process: only nested activities. persists it, reloads it and
+   * tries to access the nested activities
    */
   public void testCacheProcessDefinitionNestedNodes() {
     DbSession persistenceSession = (DbSession) environment.get(DbSession.class);
@@ -290,11 +290,11 @@
     assertNotNull(p);
 
     assertNotSame(processDefinition, p);
-    p.getNodes();
+    p.getActivities();
     assertNotNull(p.getInitial());
-    assertNotNull(p.getInitial().getNode("a"));
-    assertNotNull(p.getInitial().getNode("b"));
-    assertNotNull(p.getInitial().getNode("c"));
+    assertNotNull(p.getInitial().getActivity("a"));
+    assertNotNull(p.getInitial().getActivity("b"));
+    assertNotNull(p.getInitial().getActivity("c"));
 
     newTransaction(); // /////////////////////////////////////////////////////
     beginCacheTest(); // /////////
@@ -305,18 +305,18 @@
     assertNotNull(p);
 
     assertNotSame(processDefinition, p);
-    p.getNodes();
+    p.getActivities();
     assertNotNull(p.getInitial());
-    assertNotNull(p.getInitial().getNode("a"));
-    assertNotNull(p.getInitial().getNode("b"));
-    assertNotNull(p.getInitial().getNode("c"));
+    assertNotNull(p.getInitial().getActivity("a"));
+    assertNotNull(p.getInitial().getActivity("b"));
+    assertNotNull(p.getInitial().getActivity("c"));
 
     endCacheTest(); // ////////
   }
 
   /**
-   * Defines a process with nested nodes with nested nodes. persists it, reloads
-   * it and tries to access the nested nodes
+   * Defines a process with nested activities with nested activities. persists it, reloads
+   * it and tries to access the nested activities
    */
   public void testCacheProcessDefinitionNestedNestedNodes() {
     DbSession persistenceSession = (DbSession) environment.get(DbSession.class);
@@ -363,27 +363,27 @@
     assertNotNull(p);
 
     assertNotSame(processDefinition, p);
-    p.getNodes();
+    p.getActivities();
     assertNotNull(p.getInitial());
-    Node n = p.getInitial().getNode("a");
+    Activity n = p.getInitial().getActivity("a");
     assertNotNull(n);
-    List<Node> l = n.getNodes();
+    List<Activity> l = n.getActivities();
     assertEquals(3, l.size());
     assertEquals("aa", l.get(0).getName());
     assertEquals("ab", l.get(1).getName());
     assertEquals("ac", l.get(2).getName());
 
-    n = p.getInitial().getNode("b");
+    n = p.getInitial().getActivity("b");
     assertNotNull(n);
-    l = n.getNodes();
+    l = n.getActivities();
     assertEquals(3, l.size());
     assertEquals("ba", l.get(0).getName());
     assertEquals("bb", l.get(1).getName());
     assertEquals("bc", l.get(2).getName());
 
-    n = p.getInitial().getNode("c");
+    n = p.getInitial().getActivity("c");
     assertNotNull(n);
-    l = n.getNodes();
+    l = n.getActivities();
     assertEquals(3, l.size());
     assertEquals("ca", l.get(0).getName());
     assertEquals("cb", l.get(1).getName());
@@ -398,27 +398,27 @@
     assertNotNull(p);
 
     assertNotSame(processDefinition, p);
-    p.getNodes();
+    p.getActivities();
     assertNotNull(p.getInitial());
-    n = p.getInitial().getNode("a");
+    n = p.getInitial().getActivity("a");
     assertNotNull(n);
-    l = n.getNodes();
+    l = n.getActivities();
     assertEquals(3, l.size());
     assertEquals("aa", l.get(0).getName());
     assertEquals("ab", l.get(1).getName());
     assertEquals("ac", l.get(2).getName());
 
-    n = p.getInitial().getNode("b");
+    n = p.getInitial().getActivity("b");
     assertNotNull(n);
-    l = n.getNodes();
+    l = n.getActivities();
     assertEquals(3, l.size());
     assertEquals("ba", l.get(0).getName());
     assertEquals("bb", l.get(1).getName());
     assertEquals("bc", l.get(2).getName());
 
-    n = p.getInitial().getNode("c");
+    n = p.getInitial().getActivity("c");
     assertNotNull(n);
-    l = n.getNodes();
+    l = n.getActivities();
     assertEquals(3, l.size());
     assertEquals("ca", l.get(0).getName());
     assertEquals("cb", l.get(1).getName());
@@ -428,7 +428,7 @@
   }
 
   /**
-   * Defines a simple process: only nodes and default transitions. persists it,
+   * Defines a simple process: only activities and default transitions. persists it,
    * reloads and navigates through the transitions.
    */
   public void testCacheDefaultTransition() {
@@ -461,25 +461,25 @@
     assertNotNull(p);
     assertNotSame(processDefinition, p);
 
-    Node node = p.getInitial();
-    assertNotNull(node.getDefaultTransition());
-    assertEquals(node, node.getDefaultTransition().getSource());
+    Activity activity = p.getInitial();
+    assertNotNull(activity.getDefaultTransition());
+    assertEquals(activity, activity.getDefaultTransition().getSource());
 
-    node = node.getDefaultTransition().getDestination();
+    activity = activity.getDefaultTransition().getDestination();
 
-    assertEquals(p.getNode("a"), node);
-    assertNotNull(node.getDefaultTransition());
-    assertEquals(node, node.getDefaultTransition().getSource());
+    assertEquals(p.getActivity("a"), activity);
+    assertNotNull(activity.getDefaultTransition());
+    assertEquals(activity, activity.getDefaultTransition().getSource());
 
-    node = node.getDefaultTransition().getDestination();
+    activity = activity.getDefaultTransition().getDestination();
 
-    assertEquals(p.getNode("b"), node);
-    assertNotNull(node.getDefaultTransition());
-    assertEquals(node, node.getDefaultTransition().getSource());
+    assertEquals(p.getActivity("b"), activity);
+    assertNotNull(activity.getDefaultTransition());
+    assertEquals(activity, activity.getDefaultTransition().getSource());
 
-    node = node.getDefaultTransition().getDestination();
-    assertEquals(p.getNode("c"), node);
-    assertNull(node.getDefaultTransition());
+    activity = activity.getDefaultTransition().getDestination();
+    assertEquals(p.getActivity("c"), activity);
+    assertNull(activity.getDefaultTransition());
 
     newTransaction(); // /////////////////////////////////////////////////////
     beginCacheTest(); // //////////
@@ -491,31 +491,31 @@
     assertNotNull(p);
     assertNotSame(processDefinition, p);
 
-    node = p.getInitial();
-    assertNotNull(node.getDefaultTransition());
-    assertEquals(node, node.getDefaultTransition().getSource());
+    activity = p.getInitial();
+    assertNotNull(activity.getDefaultTransition());
+    assertEquals(activity, activity.getDefaultTransition().getSource());
 
-    node = node.getDefaultTransition().getDestination();
+    activity = activity.getDefaultTransition().getDestination();
 
-    assertEquals(p.getNode("a"), node);
-    assertNotNull(node.getDefaultTransition());
-    assertEquals(node, node.getDefaultTransition().getSource());
+    assertEquals(p.getActivity("a"), activity);
+    assertNotNull(activity.getDefaultTransition());
+    assertEquals(activity, activity.getDefaultTransition().getSource());
 
-    node = node.getDefaultTransition().getDestination();
+    activity = activity.getDefaultTransition().getDestination();
 
-    assertEquals(p.getNode("b"), node);
-    assertNotNull(node.getDefaultTransition());
-    assertEquals(node, node.getDefaultTransition().getSource());
+    assertEquals(p.getActivity("b"), activity);
+    assertNotNull(activity.getDefaultTransition());
+    assertEquals(activity, activity.getDefaultTransition().getSource());
 
-    node = node.getDefaultTransition().getDestination();
-    assertEquals(p.getNode("c"), node);
-    assertNull(node.getDefaultTransition());
+    activity = activity.getDefaultTransition().getDestination();
+    assertEquals(p.getActivity("c"), activity);
+    assertNull(activity.getDefaultTransition());
 
     endCacheTest(); // //////////
   }
 
   /**
-   * Defines a simple process: only nodes and transitions. persists it, reloads
+   * Defines a simple process: only activities and transitions. persists it, reloads
    * and navigates through the transitions.
    */
   public void testCacheTwoTransitions() {
@@ -545,19 +545,19 @@
     assertNotNull(p);
     assertNotSame(processDefinition, p);
 
-    Node node = p.getInitial();
-    List<Transition> l = node.getOutgoingTransitions();
+    Activity activity = p.getInitial();
+    List<Transition> l = activity.getOutgoingTransitions();
     assertNotNull(l);
     assertEquals(2, l.size());
 
-    Node a = p.getNode("a");
+    Activity a = p.getActivity("a");
     assertNotNull(a);
 
-    Node b = p.getNode("b");
+    Activity b = p.getActivity("b");
     assertNotNull(b);
 
-    assertEquals(node, l.get(0).getSource());
-    assertEquals(node, l.get(1).getSource());
+    assertEquals(activity, l.get(0).getSource());
+    assertEquals(activity, l.get(1).getSource());
 
     assertEquals(a, l.get(0).getDestination());
     assertEquals(b, l.get(1).getDestination());
@@ -582,19 +582,19 @@
     assertNotNull(p);
     assertNotSame(processDefinition, p);
 
-    node = p.getInitial();
-    l = node.getOutgoingTransitions();
+    activity = p.getInitial();
+    l = activity.getOutgoingTransitions();
     assertNotNull(l);
     assertEquals(2, l.size());
 
-    a = p.getNode("a");
+    a = p.getActivity("a");
     assertNotNull(a);
 
-    b = p.getNode("b");
+    b = p.getActivity("b");
     assertNotNull(b);
 
-    assertEquals(node, l.get(0).getSource());
-    assertEquals(node, l.get(1).getSource());
+    assertEquals(activity, l.get(0).getSource());
+    assertEquals(activity, l.get(1).getSource());
 
     assertEquals(a, l.get(0).getDestination());
     assertEquals(b, l.get(1).getDestination());

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/model/ProcessDefinitionDbTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -17,7 +17,7 @@
 import java.util.List;
 
 import org.jbpm.model.Event;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.OpenProcessDefinition;
 import org.jbpm.model.Transition;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
@@ -66,22 +66,22 @@
     processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
 
     assertNotNull(processDefinition);
-    List<Node> nodes = processDefinition.getNodes();
-    assertNotNull(nodes);
+    List<Activity> activities = processDefinition.getActivities();
+    assertNotNull(activities);
 
-    Node a = nodes.get(0);
+    Activity a = activities.get(0);
     assertEquals("a", a.getName());
-    assertTrue(a.getNodes().isEmpty());
+    assertTrue(a.getActivities().isEmpty());
 
-    Node b = nodes.get(1);
+    Activity b = activities.get(1);
     assertEquals("b", b.getName());
-    assertTrue(b.getNodes().isEmpty());
+    assertTrue(b.getActivities().isEmpty());
 
-    Node c = nodes.get(2);
+    Activity c = activities.get(2);
     assertEquals("c", c.getName());
-    assertTrue(c.getNodes().isEmpty());
+    assertTrue(c.getActivities().isEmpty());
 
-    assertEquals(3, nodes.size());
+    assertEquals(3, activities.size());
   }
 
   public void testInitialNode() {
@@ -98,13 +98,13 @@
 
     processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
 
-    Node initial = processDefinition.getInitial();
+    Activity initial = processDefinition.getInitial();
     assertNotNull(initial);
 
-    // check that the initial node is still in the list of nodes
-    assertSame(processDefinition.getNode("a"), initial);
-    // check that the initial node is not two times in the list of nodes
-    assertEquals(3, processDefinition.getNodes().size());
+    // check that the initial activity is still in the list of activities
+    assertSame(processDefinition.getActivity("a"), initial);
+    // check that the initial activity is not two times in the list of activities
+    assertEquals(3, processDefinition.getActivities().size());
   }
 
   public void testProcessDefinitionNestedNodes() {
@@ -133,38 +133,38 @@
     processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
 
     assertNotNull(processDefinition);
-    Node initial = processDefinition.getInitial();
+    Activity initial = processDefinition.getInitial();
     assertNotNull(initial);
-    assertEquals(initial, processDefinition.getNode("top"));
+    assertEquals(initial, processDefinition.getActivity("top"));
 
     processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
 
-    List<Node> nodes = processDefinition.getNodes();
-    assertNotNull(nodes);
-    assertEquals("expected size 1.  node list was: " + nodes.toString(), 1, nodes.size());
-    Node top = nodes.get(0);
+    List<Activity> activities = processDefinition.getActivities();
+    assertNotNull(activities);
+    assertEquals("expected size 1.  activity list was: " + activities.toString(), 1, activities.size());
+    Activity top = activities.get(0);
     assertNotNull(top);
 
-    nodes = top.getNodes();
-    assertNotNull(nodes);
-    assertEquals("expected size 3.  node list was: " + nodes.toString(), 3, nodes.size());
-    assertEquals("a", nodes.get(0).getName());
-    assertEquals("b", nodes.get(1).getName());
-    assertEquals("c", nodes.get(2).getName());
+    activities = top.getActivities();
+    assertNotNull(activities);
+    assertEquals("expected size 3.  activity list was: " + activities.toString(), 3, activities.size());
+    assertEquals("a", activities.get(0).getName());
+    assertEquals("b", activities.get(1).getName());
+    assertEquals("c", activities.get(2).getName());
 
-    nodes = processDefinition.getNode("top").getNode("b").getNodes();
-    assertNotNull(nodes);
-    assertEquals("expected size 3.  node list was: " + nodes.toString(), 3, nodes.size());
-    assertEquals("b1", nodes.get(0).getName());
-    assertEquals("b2", nodes.get(1).getName());
-    assertEquals("b3", nodes.get(2).getName());
+    activities = processDefinition.getActivity("top").getActivity("b").getActivities();
+    assertNotNull(activities);
+    assertEquals("expected size 3.  activity list was: " + activities.toString(), 3, activities.size());
+    assertEquals("b1", activities.get(0).getName());
+    assertEquals("b2", activities.get(1).getName());
+    assertEquals("b3", activities.get(2).getName());
 
     processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
 
-    Node node = processDefinition.findNode("b2");
-    assertNotNull(node);
-    assertEquals("b", node.getParent().getName());
-    assertEquals("top", node.getParent().getParent().getName());
+    Activity activity = processDefinition.findActivity("b2");
+    assertNotNull(activity);
+    assertEquals("b", activity.getParent().getName());
+    assertEquals("top", activity.getParent().getParent().getName());
   }
 
   public void testDefaultTransition() {
@@ -192,10 +192,10 @@
 
     processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
 
-    assertEquals("a", processDefinition.getNode("a").getDefaultTransition().getDestination().getName());
-    assertEquals("a", processDefinition.getNode("b").getDefaultTransition().getDestination().getName());
-    assertEquals("c", processDefinition.getNode("c").getDefaultTransition().getDestination().getName());
-    assertNull(processDefinition.getNode("d").getDefaultTransition());
+    assertEquals("a", processDefinition.getActivity("a").getDefaultTransition().getDestination().getName());
+    assertEquals("a", processDefinition.getActivity("b").getDefaultTransition().getDestination().getName());
+    assertEquals("c", processDefinition.getActivity("c").getDefaultTransition().getDestination().getName());
+    assertNull(processDefinition.getActivity("d").getDefaultTransition());
   }
 
   public void testTwoTransitionsWithoutAName() {
@@ -217,19 +217,19 @@
     processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
 
     assertNotNull(processDefinition);
-    Node node = processDefinition.getInitial();
-    List<Transition> l = node.getOutgoingTransitions();
+    Activity activity = processDefinition.getInitial();
+    List<Transition> l = activity.getOutgoingTransitions();
     assertNotNull(l);
     assertEquals(2, l.size());
 
-    Node a = processDefinition.getNode("a");
+    Activity a = processDefinition.getActivity("a");
     assertNotNull(a);
 
-    Node b = processDefinition.getNode("b");
+    Activity b = processDefinition.getActivity("b");
     assertNotNull(b);
 
-    assertEquals(node, l.get(0).getSource());
-    assertEquals(node, l.get(1).getSource());
+    assertEquals(activity, l.get(0).getSource());
+    assertEquals(activity, l.get(1).getSource());
 
     assertEquals(a, l.get(0).getDestination());
     assertEquals(b, l.get(1).getDestination());
@@ -292,12 +292,12 @@
 
     processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
 
-    EventImpl event = processDefinition.getNode("a").getEvent(Event.NODE_BEGIN);
+    EventImpl event = processDefinition.getActivity("a").getEvent(Event.NODE_BEGIN);
     List<EventListenerReference> listenerReferences = event.getListenerReferences();
     assertEquals("one", listenerReferences.get(0).getExpression());
     assertEquals("two", listenerReferences.get(1).getExpression());
 
-    event = processDefinition.getNode("a").getEvent(Event.NODE_END);
+    event = processDefinition.getActivity("a").getEvent(Event.NODE_END);
     listenerReferences = event.getListenerReferences();
     assertEquals("three", listenerReferences.get(0).getExpression());
     assertEquals("four", listenerReferences.get(1).getExpression());
@@ -319,7 +319,7 @@
 
     processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
 
-    EventImpl event = processDefinition.getNode("a").getDefaultTransition().getEvent();
+    EventImpl event = processDefinition.getActivity("a").getDefaultTransition().getEvent();
     List<EventListenerReference> listenerReferences = event.getListenerReferences();
     assertEquals("one", listenerReferences.get(0).getExpression());
     assertEquals("two", listenerReferences.get(1).getExpression());
@@ -374,7 +374,7 @@
 
     processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
 
-    List<ExceptionHandlerImpl> exceptionHandlers = processDefinition.getNode("a").getExceptionHandlers();
+    List<ExceptionHandlerImpl> exceptionHandlers = processDefinition.getActivity("a").getExceptionHandlers();
 
     ExceptionHandlerImpl exceptionHandler = exceptionHandlers.get(0);
     assertEquals(IllegalArgumentException.class.getName(), exceptionHandler.getExceptionClassName());
@@ -415,9 +415,9 @@
 
     processDefinition = reload(processDefinition, ProcessDefinitionImpl.class);
 
-    Node node = processDefinition.getInitial();
-    assertEquals("val1", node.getProperty("key1"));
-    assertEquals("val2", node.getProperty("key2"));
+    Activity activity = processDefinition.getInitial();
+    assertEquals("val1", activity.getProperty("key1"));
+    assertEquals("val2", activity.getProperty("key2"));
   }
 
   public void testTransitionDynamicProperties() {

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,15 +21,15 @@
  */
 package org.jbpm.pvm.internal.jobexecutor;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
 
-/** a node behaviour implementation that records its execution and then 
+/** a activity behaviour implementation that records its execution and then 
  * just proceeds.
  *  
  * @author Tom Baeyens
  */
-public class AutomaticActivity implements Activity {
+public class AutomaticActivity implements ActivityBehaviour {
 
   private static final long serialVersionUID = 1L;
   

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveMessagesTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveMessagesTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ExclusiveMessagesTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -28,7 +28,7 @@
 import org.hibernate.Session;
 import org.jbpm.Execution;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.cmd.Command;
 import org.jbpm.env.Environment;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
@@ -84,7 +84,7 @@
     });
   }
 
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
 
     private static final long serialVersionUID = 1L;
 

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,12 +24,12 @@
 import java.util.Map;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 
 /**
  * @author Tom Baeyens
  */
-public class WaitState implements ExternalActivity {
+public class WaitState implements ExternalActivityBehaviour {
 
   private static final long serialVersionUID = 1L;
   

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/spring/SpringTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/spring/SpringTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/spring/SpringTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -63,15 +63,15 @@
     ProcessService processService = environmentFactory.get(ProcessService.class);
 
     ProcessDefinition processDefinition = ProcessFactory.build("basic")
-      .node("a").initial().behaviour(WaitState.class)
+      .activity("a").initial().behaviour(WaitState.class)
         .transition().to("b")
-      .node("b").behaviour(WaitState.class)
+      .activity("b").behaviour(WaitState.class)
         .transition().to("c")
-      .node("c").behaviour(AutomaticActivity.class)
+      .activity("c").behaviour(AutomaticActivity.class)
         .transition().to("d")
-      .node("d").behaviour(AutomaticActivity.class)
+      .activity("d").behaviour(AutomaticActivity.class)
         .transition().to("e")
-      .node("e").behaviour(WaitState.class)
+      .activity("e").behaviour(WaitState.class)
     .done();
   
     processService.deploy(processDefinition);

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/TaskDefinition.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/TaskDefinition.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/TaskDefinition.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -51,7 +51,7 @@
   boolean isBlocking();
 
   /** indicates if completion of this task causes a signal on the related execution.
-   * This is to support n-out-of-m.  Whenever an execution leaves a task node, all the 
+   * This is to support n-out-of-m.  Whenever an execution leaves a task activity, all the 
    * tasks that are not completed, related to that execution should loose their 
    * signalling power. */
   boolean isSignalling();

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycle.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycle.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycle.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -26,9 +26,9 @@
 
 import org.jbpm.client.ClientProcessInstance;
 import org.jbpm.model.IdGenerator;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.task.TaskException;
 
@@ -80,8 +80,8 @@
     ProcessDefinitionImpl lifeCycleProcess = getLifeCycle(task);
     lifeCycleExecution.setProcessDefinition(lifeCycleProcess);
     String state = task.getState();
-    Node node = lifeCycleProcess.getNode(state);
-    lifeCycleExecution.setNode((NodeImpl) node);
+    Activity activity = lifeCycleProcess.getActivity(state);
+    lifeCycleExecution.setActivity((ActivityImpl) activity);
     lifeCycleExecution.signal(eventName);
     task.state = lifeCycleExecution.getNode().getName();
   }

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleParser.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -23,7 +23,7 @@
 
 import java.util.List;
 
-import org.jbpm.pvm.internal.model.NodeImpl;
+import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.xml.Parse;
@@ -49,7 +49,7 @@
     String initialStateName = null;
     if (element.hasAttribute("initial")) {
       initialStateName = element.getAttribute("initial");
-      NodeImpl initial = (NodeImpl) lifeCycleProcess.getNode(initialStateName);
+      ActivityImpl initial = (ActivityImpl) lifeCycleProcess.getActivity(initialStateName);
       if (initial!=null) {
         lifeCycleProcess.setInitial(initial);
       } else {
@@ -66,7 +66,7 @@
       return;
     }
     String stateName = element.getAttribute("name");
-    NodeImpl state = (NodeImpl) lifeCycleProcess.getNode(stateName);
+    ActivityImpl state = (ActivityImpl) lifeCycleProcess.getActivity(stateName);
     
     List<Element> transitionElements = XmlUtil.elements(element, "transition");
     for (Element transitionElement: transitionElements) {
@@ -74,7 +74,7 @@
     }
   }
 
-  public void parseTransition(Element element, NodeImpl state, Parse parse) {
+  public void parseTransition(Element element, ActivityImpl state, Parse parse) {
     if (! element.hasAttribute("name")) {
       parse.addProblem("transition doesn't have a name: "+XmlUtil.toString(element));
       return;
@@ -85,7 +85,7 @@
       return;
     }
     String destinationName = element.getAttribute("to");
-    NodeImpl destination = (NodeImpl) state.getProcessDefinition().getNode(destinationName);
+    ActivityImpl destination = (ActivityImpl) state.getProcessDefinition().getActivity(destinationName);
     if (destination!=null) {
       state.createOutgoingTransition(destination, transitionName);
     } else {
@@ -99,7 +99,7 @@
       return;
     }
     String stateName = element.getAttribute("name");
-    NodeImpl state = lifeCycleProcess.createNode(stateName);
+    ActivityImpl state = lifeCycleProcess.createNode(stateName);
     state.setBehaviour(new LifeCycleState());
   }
 }

Modified: jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleState.java
===================================================================
--- jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleState.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/task/src/main/java/org/jbpm/task/internal/model/LifeCycleState.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,12 +24,12 @@
 import java.util.Map;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 
 /**
  * @author Tom Baeyens
  */
-public class LifeCycleState implements ExternalActivity {
+public class LifeCycleState implements ExternalActivityBehaviour {
 
   private static final long serialVersionUID = 1L;
 

Modified: jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java
===================================================================
--- jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/task/src/test/java/org/jbpm/task/internal/model/TaskActivityScenarioTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -33,7 +33,7 @@
 public class TaskActivityScenarioTest extends DbTestCase {
 
   public void testDefaultScenario() {
-    // execution arrives in task node
+    // execution arrives in task activity
     // the task id is generated from the executionId and the task name
     Task task = taskService.newTask();
     task.setName("do laundry");

Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -151,23 +151,23 @@
   }
 
   public HashSet<String> getNodeNames(String processInstanceId) {
-    HashSet<String> nodeNames = new HashSet<String>();
+    HashSet<String> activityNames = new HashSet<String>();
     
     List<Execution> executions = executionService.findExecutions(processInstanceId);
     for (Execution execution: executions) {
-      String nodeName = execution.getNodeName();
-      if (nodeName!=null) {
-        nodeNames.add(nodeName);
+      String activityName = execution.getActivityName();
+      if (activityName!=null) {
+        activityNames.add(activityName);
       }
     }
     
-    return nodeNames;
+    return activityNames;
   }
 
-  public Execution findExecution(String processInstanceId, String nodeName) {
+  public Execution findExecution(String processInstanceId, String activityName) {
     List<Execution> executions = executionService.findExecutions(processInstanceId);
     for (Execution execution: executions) {
-      if (nodeName.equals(execution.getNodeName())) {
+      if (activityName.equals(execution.getActivityName())) {
         return execution;
       }
     }

Modified: jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/activities/ExclusiveTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/activities/ExclusiveTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/activities/ExclusiveTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -51,11 +51,11 @@
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("distance", "far");
     Execution execution = executionService.startExecutionByKey("Poolcar", variables);
-    assertEquals("Big car", execution.getNodeName());
+    assertEquals("Big car", execution.getActivityName());
 
     variables.put("distance", "nearby");
     execution = executionService.startExecutionByKey("Poolcar", variables);
-    assertEquals("Small car", execution.getNodeName());
+    assertEquals("Small car", execution.getActivityName());
   }
 
   public void testExclusiveWithConditions() {
@@ -82,15 +82,15 @@
     Map<String, Object> variables = new HashMap<String, Object>();
     variables.put("distance", new Integer(69));
     Execution execution = executionService.startExecutionByKey("Poolcar", variables);
-    assertEquals("Big car", execution.getNodeName());
+    assertEquals("Big car", execution.getActivityName());
 
     variables.put("distance", new Integer(6));
     execution = executionService.startExecutionByKey("Poolcar", variables);
-    assertEquals("Small car", execution.getNodeName());
+    assertEquals("Small car", execution.getActivityName());
 
     variables.put("distance", new Integer(2));
     execution = executionService.startExecutionByKey("Poolcar", variables);
-    assertEquals("No car", execution.getNodeName());
+    assertEquals("No car", execution.getActivityName());
   }
 
 }

Modified: jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/activities/StateTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/activities/StateTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/activities/StateTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -47,14 +47,14 @@
     );
     
     Execution execution = executionService.startExecutionById("ThreeStates:1");
-    assertEquals("b", execution.getNodeName());
+    assertEquals("b", execution.getActivityName());
 
     String executionId = execution.getId();
     execution = executionService.signalExecutionById(executionId);
-    assertEquals("c", execution.getNodeName());
+    assertEquals("c", execution.getActivityName());
 
     execution = executionService.signalExecutionById(executionId);
-    assertEquals("d", execution.getNodeName());
+    assertEquals("d", execution.getActivityName());
     assertTrue(execution.isEnded());
   }
 
@@ -76,17 +76,17 @@
     );
 
     Execution execution = executionService.startExecutionByKey("p", "one");
-    assertEquals("ed", execution.getNodeName());
+    assertEquals("ed", execution.getActivityName());
     execution = executionService.signalExecutionById("p/one", "left");
-    assertEquals("b", execution.getNodeName());
+    assertEquals("b", execution.getActivityName());
 
     executionService.startExecutionById("p:1", "two");
     execution = executionService.signalExecutionById("p/two", "middle");
-    assertEquals("c", execution.getNodeName());
+    assertEquals("c", execution.getActivityName());
 
     executionService.startExecutionById("p:1", "three");
     execution = executionService.signalExecutionById("p/three", "right");
-    assertEquals("d", execution.getNodeName());
+    assertEquals("d", execution.getActivityName());
   }
 
   public void testDefaultSignalWithNamedTransitions() {
@@ -133,7 +133,7 @@
 
     executionService.startExecutionByKey("p", "one");
     Execution execution = executionService.signalExecutionById("p/one", "up");
-    assertEquals("a", execution.getNodeName());
+    assertEquals("a", execution.getActivityName());
   }
 
   public void testDefaultSignalWithoutTransitions() {
@@ -148,6 +148,6 @@
 
     executionService.startExecutionByKey("p", "one");
     Execution execution = executionService.signalExecutionById("p/one");
-    assertEquals("a", execution.getNodeName());
+    assertEquals("a", execution.getActivityName());
   }
 }

Modified: jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/svc/ExecutionServiceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/svc/ExecutionServiceTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/svc/ExecutionServiceTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -50,7 +50,7 @@
     Execution execution = executionService.startExecutionByKey("ICL");
 
     assertNotNull(execution);
-    assertEquals("a", execution.getNodeName());
+    assertEquals("a", execution.getActivityName());
   }
 
   public void testAutoSwitchToNewVersion() {
@@ -66,7 +66,7 @@
     Execution execution = executionService.startExecutionByKey("ICL");
 
     assertNotNull(execution);
-    assertEquals("a", execution.getNodeName());
+    assertEquals("a", execution.getActivityName());
 
     deployJpdlXmlString(
       "<process name='Insurance claim' key='ICL'>" +
@@ -80,7 +80,7 @@
     execution = executionService.startExecutionByKey("ICL");
 
     assertNotNull(execution);
-    assertEquals("b", execution.getNodeName());
+    assertEquals("b", execution.getActivityName());
   }
 
   public void testStartNewProcessInstanceWithAKey() {
@@ -149,15 +149,15 @@
 
     Execution execution = executionService.startExecutionByKey("ICL", "82436");
     
-    assertEquals("a", execution.getNodeName());
+    assertEquals("a", execution.getActivityName());
     
     execution = executionService.signalExecutionByKey("ICL", "82436");
 
-    assertEquals("b", execution.getNodeName());
+    assertEquals("b", execution.getActivityName());
 
     execution = executionService.signalExecutionByKey("ICL", "82436");
 
-    assertEquals("c", execution.getNodeName());
+    assertEquals("c", execution.getActivityName());
   }
 
   public void testSignalExecutionById() {
@@ -178,15 +178,15 @@
 
     Execution execution = executionService.startExecutionByKey("ICL", "82436");
     
-    assertEquals("a", execution.getNodeName());
+    assertEquals("a", execution.getActivityName());
     
     execution = executionService.signalExecutionById("ICL/82436");
 
-    assertEquals("b", execution.getNodeName());
+    assertEquals("b", execution.getActivityName());
 
     execution = executionService.signalExecutionById("ICL/82436");
 
-    assertEquals("c", execution.getNodeName());
+    assertEquals("c", execution.getActivityName());
   }
 
   public void testSignalExecutionWithVariables() {
@@ -213,7 +213,7 @@
 
     assertNotNull(execution);
     String executionId = execution.getId();
-    assertEquals("b", execution.getNodeName());
+    assertEquals("b", execution.getActivityName());
     
     Map<String,Object> expectedVariables = new HashMap<String, Object>(variables); 
     Set<String> expectedVariableNames = new HashSet<String>(expectedVariables.keySet());
@@ -250,7 +250,7 @@
     ClientProcessDefinition processDefinition = ProcessFactory.build("nuclear fusion")
         .version(1)
         .key("NCLFU")
-        .node("initial").initial()
+        .activity("initial").initial()
           .behaviour(WaitState.class)
     .done();
 
@@ -281,7 +281,7 @@
     ProcessService processService = getEnvironmentFactory().get(ProcessService.class);
 
     // deploy the same process with a given key and version
-    ClientProcessDefinition processDefinition = ProcessFactory.build("nuclear fusion").version(1).key("NCLFU").node("initial").initial()
+    ClientProcessDefinition processDefinition = ProcessFactory.build("nuclear fusion").version(1).key("NCLFU").activity("initial").initial()
         .behaviour(WaitState.class).done();
 
     DeploymentImpl deploymentImpl = new DeploymentImpl(processDefinition);
@@ -307,7 +307,7 @@
   {
     ProcessService processService = getEnvironmentFactory().get(ProcessService.class);
 
-    ClientProcessDefinition processDefinition = ProcessFactory.build("nuclear fusion").version(1).key("NCLFU").node("initial").initial()
+    ClientProcessDefinition processDefinition = ProcessFactory.build("nuclear fusion").version(1).key("NCLFU").activity("initial").initial()
         .behaviour(WaitState.class).done();
 
     processService.deploy(new DeploymentImpl(processDefinition));
@@ -473,28 +473,28 @@
   {
     ProcessService processService = getEnvironmentFactory().get(ProcessService.class);
 
-    ProcessDefinition processDefinition = ProcessFactory.build("nuclear fusion").key("NFU").node("initial").initial().behaviour(
+    ProcessDefinition processDefinition = ProcessFactory.build("nuclear fusion").key("NFU").activity("initial").initial().behaviour(
         WaitState.class).done();
     DeploymentImpl deploymentImpl = new DeploymentImpl(processDefinition);
     processService.deploy(deploymentImpl);
 
-    processDefinition = ProcessFactory.build("ultimate seduction").key("USD").node("initial").initial().behaviour(WaitState.class).done();
+    processDefinition = ProcessFactory.build("ultimate seduction").key("USD").activity("initial").initial().behaviour(WaitState.class).done();
     deploymentImpl = new DeploymentImpl(processDefinition);
     processService.deploy(deploymentImpl);
 
-    processDefinition = ProcessFactory.build("ultimate seduction").key("USD").node("initial").initial().behaviour(WaitState.class).done();
+    processDefinition = ProcessFactory.build("ultimate seduction").key("USD").activity("initial").initial().behaviour(WaitState.class).done();
     deploymentImpl = new DeploymentImpl(processDefinition);
     processService.deploy(deploymentImpl);
 
-    processDefinition = ProcessFactory.build("nuclear fusion").key("NFU").node("initial").initial().behaviour(WaitState.class).done();
+    processDefinition = ProcessFactory.build("nuclear fusion").key("NFU").activity("initial").initial().behaviour(WaitState.class).done();
     deploymentImpl = new DeploymentImpl(processDefinition);
     processService.deploy(deploymentImpl);
 
-    processDefinition = ProcessFactory.build("publish book").key("PBO").node("initial").initial().behaviour(WaitState.class).done();
+    processDefinition = ProcessFactory.build("publish book").key("PBO").activity("initial").initial().behaviour(WaitState.class).done();
     deploymentImpl = new DeploymentImpl(processDefinition);
     processService.deploy(deploymentImpl);
 
-    processDefinition = ProcessFactory.build("nuclear fusion").key("NFU").node("initial").initial().behaviour(WaitState.class).done();
+    processDefinition = ProcessFactory.build("nuclear fusion").key("NFU").activity("initial").initial().behaviour(WaitState.class).done();
     deploymentImpl = new DeploymentImpl(processDefinition);
     processService.deploy(deploymentImpl);
   }
@@ -503,7 +503,7 @@
   {
     ProcessService processService = getEnvironmentFactory().get(ProcessService.class);
 
-    ProcessDefinition processDefinition = ProcessFactory.build("nuclear fusion").node("initial").initial().behaviour(WaitState.class)
+    ProcessDefinition processDefinition = ProcessFactory.build("nuclear fusion").activity("initial").initial().behaviour(WaitState.class)
         .done();
     DeploymentImpl deploymentImpl = new DeploymentImpl(processDefinition);
     processService.deploy(deploymentImpl);

Modified: jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/svc/ProcessServiceTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/svc/ProcessServiceTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/svc/ProcessServiceTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -337,7 +337,7 @@
     
     Execution execution = executionService.startExecutionByKey("minimal");
     
-    assertEquals("end", execution.getNodeName());
+    assertEquals("end", execution.getActivityName());
     assertTrue(execution.isEnded());
     assertFalse(execution.isActive());
   }

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/ProcessExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/ProcessExecutionTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/ProcessExecutionTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -99,7 +99,7 @@
     }
     public void executeProcess() {
       Execution execution = executionService.startExecutionByKey("Process");
-      assertEquals("c", execution.getNodeName());
+      assertEquals("c", execution.getActivityName());
       String executionId = execution.getId();
       execution = executionService.signalExecutionById(executionId);
       assertTrue(execution.isEnded());

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/AutomaticActivity.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/AutomaticActivity.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/AutomaticActivity.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -21,13 +21,13 @@
  */
 package org.jbpm.test.activities;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
 
 /**
  * @author Tom Baeyens
  */
-public class AutomaticActivity implements Activity {
+public class AutomaticActivity implements ActivityBehaviour {
 
   private static final long serialVersionUID = 1L;
 

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/AutomaticDecisionTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/AutomaticDecisionTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/AutomaticDecisionTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -23,9 +23,9 @@
 
 import java.util.Map;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.client.ClientProcessInstance;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
@@ -38,7 +38,7 @@
  */
 public class AutomaticDecisionTest extends JbpmTestCase {
 
-  public static class AutomaticCreditRating implements Activity {
+  public static class AutomaticCreditRating implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       int creditRate = (Integer) execution.getVariable("creditRate");
@@ -55,7 +55,7 @@
     }
   }
   
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/BasicExecutionFlowTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/BasicExecutionFlowTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/BasicExecutionFlowTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,9 +25,9 @@
 import java.util.List;
 import java.util.Map;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.client.ClientProcessInstance;
@@ -43,29 +43,29 @@
   
   // automatic activity will log an event in a given list
   
-  public static class AutomaticActivity implements Activity {
+  public static class AutomaticActivity implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     List<String> events;
     public AutomaticActivity(List<String> events) {
       this.events = events;
     }
     public void execute(ActivityExecution execution) {
-      events.add("execute["+execution.getNodeName()+"]");
+      events.add("execute["+execution.getActivityName()+"]");
     }
   }
 
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     List<String> events;
     public WaitState(List<String> events) {
       this.events = events;
     }
     public void execute(ActivityExecution execution) {
-      events.add("execute["+execution.getNodeName()+"]");
+      events.add("execute["+execution.getActivityName()+"]");
       execution.waitForSignal();
     }
     public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception {
-      events.add("signal["+execution.getNodeName()+"]");
+      events.add("signal["+execution.getActivityName()+"]");
       execution.take(signalName);
     }
   }
@@ -102,7 +102,7 @@
     expectedEvents.add("execute[submit loan request]");
     expectedEvents.add("execute[evaluate]");
 
-    assertEquals("evaluate", execution.getNodeName());
+    assertEquals("evaluate", execution.getActivityName());
     assertEquals(expectedEvents, recordedEvents);
 
     execution.signal("approve");
@@ -111,7 +111,7 @@
     expectedEvents.add("execute[wire money]");
     expectedEvents.add("execute[archive]");
 
-    assertEquals("archive", execution.getNodeName());
+    assertEquals("archive", execution.getActivityName());
     assertEquals(expectedEvents, recordedEvents);
 
     execution.signal();
@@ -119,7 +119,7 @@
     expectedEvents.add("signal[archive]");
     expectedEvents.add("execute[end]");
 
-    assertEquals("end", execution.getNodeName());
+    assertEquals("end", execution.getActivityName());
     assertEquals(expectedEvents, recordedEvents);
   }
   
@@ -163,7 +163,7 @@
     expectedEvents.add("execute[submit loan request]");
     expectedEvents.add("execute[evaluate]");
 
-    assertEquals("evaluate", processInstance.getNodeName());
+    assertEquals("evaluate", processInstance.getActivityName());
     assertEquals(expectedEvents, recordedEvents);
   }
 }

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventPropagationTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventPropagationTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventPropagationTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,15 +25,15 @@
 import java.util.List;
 import java.util.Map;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.listener.EventListener;
 import org.jbpm.listener.EventListenerExecution;
 import org.jbpm.model.Event;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.ObservableElement;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.test.JbpmTestCase;
@@ -53,7 +53,7 @@
     }
   }
   
-  public static class FireableState implements ExternalActivity {
+  public static class FireableState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();
@@ -63,13 +63,13 @@
     }
   }
 
-  public static class AutomaticActivity implements Activity {
+  public static class AutomaticActivity implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
     }
   }
   
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();
@@ -97,7 +97,7 @@
     ClientExecution execution = processDefinition.startProcessInstance();
     execution.signal();
     
-    assertEquals("event(node-end) on initial", recorder.events.get(0));
+    assertEquals("event(activity-end) on initial", recorder.events.get(0));
     assertEquals(1, recorder.events.size());
   }
 
@@ -120,7 +120,7 @@
     ClientExecution execution = processDefinition.startProcessInstance();
     execution.signal();
     
-    assertEquals("event(node-begin) on end", recorder.events.get(0));
+    assertEquals("event(activity-begin) on end", recorder.events.get(0));
     assertEquals(1, recorder.events.size());
   }
 
@@ -147,25 +147,25 @@
     assertEquals(1, recorder.events.size());
   }
 
-  // propagation of process elements in composite nodes ///////////////////////
+  // propagation of process elements in composite activities ///////////////////////
   
-  public static class Sequence implements ExternalActivity {
+  public static class Sequence implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
-      List<Node> nodes = execution.getNode().getNodes();
-      if ( (nodes!=null)
-           && (!nodes.isEmpty())
+      List<Activity> activities = execution.getNode().getActivities();
+      if ( (activities!=null)
+           && (!activities.isEmpty())
          ) {
-        execution.execute(nodes.get(0));
+        execution.execute(activities.get(0));
       }
     }
     public void signal(ActivityExecution execution, String signal, Map<String, Object> parameters) {
-      Node previous = execution.getPreviousNode();
-      List<Node> nodes = execution.getNode().getNodes();
-      int index = nodes.indexOf(previous);
+      Activity previous = execution.getPreviousNode();
+      List<Activity> activities = execution.getNode().getActivities();
+      int index = activities.indexOf(previous);
       index++;
-      if (index < nodes.size()) {
-        Node next = nodes.get(index);
+      if (index < activities.size()) {
+        Activity next = activities.get(index);
         execution.execute(next);
       }
     }
@@ -197,13 +197,13 @@
     ClientExecution execution = processDefinition.startProcessInstance();
     assertEquals(0, recorder.events.size());
     execution.signal();
-    assertEquals("event(node-end) on one", recorder.events.get(0));
+    assertEquals("event(activity-end) on one", recorder.events.get(0));
     assertEquals(1, recorder.events.size());
     execution.signal();
-    assertEquals("event(node-end) on two", recorder.events.get(1));
+    assertEquals("event(activity-end) on two", recorder.events.get(1));
     assertEquals(2, recorder.events.size());
     execution.signal();
-    assertEquals("event(node-end) on three", recorder.events.get(2));
+    assertEquals("event(activity-end) on three", recorder.events.get(2));
     assertEquals(3, recorder.events.size());
   }
 
@@ -231,10 +231,10 @@
 
     assertEquals(0, recorder.events.size());
     execution.signal();
-    assertEquals("event(node-end) on one", recorder.events.get(0));
+    assertEquals("event(activity-end) on one", recorder.events.get(0));
     assertEquals(1, recorder.events.size());
     execution.signal();
-    assertEquals("event(node-end) on two", recorder.events.get(1));
+    assertEquals("event(activity-end) on two", recorder.events.get(1));
     assertEquals(2, recorder.events.size());
   }
 
@@ -262,13 +262,13 @@
     .endProcess();
     
     ClientExecution execution = processDefinition.startProcessInstance();
-    assertEquals("event(node-begin) on one", recorder.events.get(0));
+    assertEquals("event(activity-begin) on one", recorder.events.get(0));
     assertEquals(1, recorder.events.size());
     execution.signal();
-    assertEquals("event(node-begin) on two", recorder.events.get(1));
+    assertEquals("event(activity-begin) on two", recorder.events.get(1));
     assertEquals(2, recorder.events.size());
     execution.signal();
-    assertEquals("event(node-begin) on three", recorder.events.get(2));
+    assertEquals("event(activity-begin) on three", recorder.events.get(2));
     assertEquals(3, recorder.events.size());
   }
 

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,15 +25,15 @@
 import java.util.List;
 import java.util.Map;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.listener.EventListener;
 import org.jbpm.listener.EventListenerExecution;
 import org.jbpm.model.Event;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.ObservableElement;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -42,9 +42,9 @@
 
 /** shows how actions are listeners to following processDefinition events:
  * <ul>
- *   <li>node-leave</li>
+ *   <li>activity-leave</li>
  *   <li>transition</li>
- *   <li>node-enter</li>
+ *   <li>activity-enter</li>
  *   <li>custom event</li>
  * </ul>
  *
@@ -52,13 +52,13 @@
  */
 public class EventTest extends JbpmTestCase {
   
-  public static class AutomaticActivity implements Activity {
+  public static class AutomaticActivity implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
     }
   }
   
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();
@@ -69,7 +69,7 @@
   }
 
   
-  // node leave action ////////////////////////////////////////////////////////
+  // activity leave action ////////////////////////////////////////////////////////
   
   public static class NodeLeaveAction implements EventListener {
     private static final long serialVersionUID = 1L;
@@ -78,21 +78,21 @@
 
       assertEquals("initial", execution.getNode().getName());
       assertEquals("initial", execution.getEventSource().getName());
-      assertEquals("leave node action test", execution.getProcessDefinition().getName());
+      assertEquals("leave activity action test", execution.getProcessDefinition().getName());
       assertEquals("end", execution.getTransition().getDestination().getName());
     }
   }
   
   public void testEventListenerOnNodeEnd() {
-    NodeLeaveAction nodeLeaveAction = new NodeLeaveAction();
+    NodeLeaveAction activityLeaveAction = new NodeLeaveAction();
     
     ClientProcessDefinition processDefinition = ProcessDefinitionBuilder
-    .startProcess("leave node action test")
+    .startProcess("leave activity action test")
       .startActivity("initial", new WaitState())
         .initial()
         .flow("end")
         .startEvent(Event.NODE_END)
-          .listener(nodeLeaveAction)
+          .listener(activityLeaveAction)
         .endEvent()
       .endActivity()
       .startActivity("end", new WaitState())
@@ -143,7 +143,7 @@
     assertEquals("Kilroy was here", execution.getVariable("msg"));
   }
 
-  // node enter action ////////////////////////////////////////////////////////
+  // activity enter action ////////////////////////////////////////////////////////
 
   public static class NodeBeginAction implements EventListener {
     private static final long serialVersionUID = 1L;
@@ -152,23 +152,23 @@
       
       assertEquals("end", execution.getNode().getName());
       assertEquals("end", execution.getEventSource().getName());
-      assertEquals("enter node action test", execution.getProcessDefinition().getName());
+      assertEquals("enter activity action test", execution.getProcessDefinition().getName());
       assertEquals("end", execution.getTransition().getDestination().getName());
     }
   }
   
   public void testEventListenerOnNodeBegin() {
-    NodeBeginAction nodeBeginAction = new NodeBeginAction();
+    NodeBeginAction activityBeginAction = new NodeBeginAction();
     
     ClientProcessDefinition processDefinition = ProcessDefinitionBuilder
-    .startProcess("enter node action test")
+    .startProcess("enter activity action test")
       .startActivity("initial", new WaitState())
         .initial()
         .flow("end")
       .endActivity()
       .startActivity("end", new WaitState())
         .startEvent(Event.NODE_BEGIN)
-          .listener(nodeBeginAction)
+          .listener(activityBeginAction)
         .endEvent()
       .endActivity()
     .endProcess();
@@ -182,18 +182,18 @@
 
   // custom event ////////////////////////////////////////////////////////////
   
-  public static class WaitStateWithCustomEvent implements ExternalActivity {
+  public static class WaitStateWithCustomEvent implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) throws Exception {
       execution.waitForSignal();
     }
     public void signal(ActivityExecution execution, String signal, Map<String, Object> parameters) throws Exception {
-      Node node = execution.getNode();
+      Activity activity = execution.getNode();
       if ( (signal!=null)
-           && (node!=null)
-           && (node.hasEvent(signal))
+           && (activity!=null)
+           && (activity.hasEvent(signal))
          ) {
-        execution.fire(signal, node);
+        execution.fire(signal, activity);
         execution.waitForSignal();
       }
     }
@@ -206,7 +206,7 @@
       
       assertEquals("initial", execution.getNode().getName());
       assertEquals("initial", execution.getEventSource().getName());
-      assertEquals("custom node action test", execution.getProcessDefinition().getName());
+      assertEquals("custom activity action test", execution.getProcessDefinition().getName());
       assertNull(execution.getTransition());
     }
   }
@@ -215,7 +215,7 @@
     CheckRivetsAction checkRivetsAction = new CheckRivetsAction();
     
     ClientProcessDefinition processDefinition = ProcessDefinitionBuilder
-    .startProcess("custom node action test")
+    .startProcess("custom activity action test")
       .startActivity("initial", new WaitStateWithCustomEvent())
         .initial()
         .flow("end")
@@ -242,7 +242,7 @@
     assertEquals("end", execution.getNode().getName());
   }
 
-  public static class EndState implements Activity {
+  public static class EndState implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) throws Exception {
       execution.end();
@@ -280,11 +280,11 @@
     int index = 0;
     assertEquals("process-begin on processDefinition(basic)", execution.events.get(index));
     index++;
-    assertEquals("node-end on node(initial)", execution.events.get(index));
+    assertEquals("activity-end on activity(initial)", execution.events.get(index));
     index++;
     assertEquals("transition-take on (initial)-->(end)", execution.events.get(index));
     index++;
-    assertEquals("node-begin on node(end)", execution.events.get(index));
+    assertEquals("activity-begin on activity(end)", execution.events.get(index));
     index++;
     assertEquals("process-end on processDefinition(basic)", execution.events.get(index));
   }

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExceptionHandlerTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExceptionHandlerTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExceptionHandlerTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,7 +24,7 @@
 import java.util.Map;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.listener.EventListener;
@@ -39,7 +39,7 @@
 public class ExceptionHandlerTest extends JbpmTestCase
 {
   
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExecutionStateTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExecutionStateTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExecutionStateTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,9 +25,9 @@
 
 import org.jbpm.Execution;
 import org.jbpm.JbpmException;
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.client.ClientProcessInstance;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
@@ -57,14 +57,14 @@
  */
 public class ExecutionStateTest extends JbpmTestCase {
 
-  public static class AutomaticActivity implements Activity {
+  public static class AutomaticActivity implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       assertEquals(Execution.STATE_ACTIVE, execution.getState());
     }
   }
 
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       assertEquals(Execution.STATE_ACTIVE, execution.getState());

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExternalDecisionTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExternalDecisionTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ExternalDecisionTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -26,7 +26,7 @@
 import junit.framework.TestCase;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
@@ -37,7 +37,7 @@
  */
 public class ExternalDecisionTest extends TestCase {
   
-  public static class ExternalDecision implements ExternalActivity {
+  public static class ExternalDecision implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) throws Exception {
       execution.waitForSignal();
@@ -47,7 +47,7 @@
     }
   }
   
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,34 +25,34 @@
 import java.util.List;
 import java.util.Map;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.client.ClientProcessInstance;
 import org.jbpm.listener.EventListener;
 import org.jbpm.listener.EventListenerExecution;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.OpenExecution;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.test.JbpmTestCase;
 
 
-/** shows how functional nodes (nodes that have a specific function 
+/** shows how functional activities (activities that have a specific function 
  * not related to control flow) can be implemented.
  * 
- * Examples of functional nodes could be sending an email, doing a 
+ * Examples of functional activities could be sending an email, doing a 
  * SQL update on a database, generating a file and so on.
  * 
- * Functional nodes can be used as node behaviour in a transition based 
- * process, event listener and as node behaviour in nested node 
+ * Functional activities can be used as activity behaviour in a transition based 
+ * process, event listener and as activity behaviour in nested activity 
  * execution.
  * 
  * @author Tom Baeyens
  */
 public class FunctionalActivityTest extends JbpmTestCase {
 
-  public static class FunctionalActivity implements Activity, EventListener {
+  public static class FunctionalActivity implements ActivityBehaviour, EventListener {
     private static final long serialVersionUID = 1L;
     List<String> events;
     public FunctionalActivity(List<String> events) {
@@ -90,7 +90,7 @@
     
     List<String> expectedEvents = new ArrayList<String>();
     
-    assertEquals("a", processInstance.getNodeName());
+    assertEquals("a", processInstance.getActivityName());
     assertFalse(processInstance.isEnded());
     assertEquals(expectedEvents, recordedEvents);
     
@@ -104,7 +104,7 @@
   }
 
   
-  public static class AutomaticActivity implements Activity {
+  public static class AutomaticActivity implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
     }
@@ -135,10 +135,10 @@
     assertEquals(expectedEvents, recordedEvents);
   }
 
-  public static class Composite implements ExternalActivity {
+  public static class Composite implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
-      Node nestedNode = execution.getNode().getNodes().get(0);
+      Activity nestedNode = execution.getNode().getActivities().get(0);
       execution.execute(nestedNode);
     }
     public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) {

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/LoopingTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/LoopingTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/LoopingTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -4,9 +4,9 @@
 import java.util.List;
 import java.util.Map;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
@@ -14,7 +14,7 @@
 
 public class LoopingTest extends JbpmTestCase {
   
-  public static class For implements ExternalActivity {
+  public static class For implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
 
     int startIndex = 0;
@@ -65,14 +65,14 @@
 
   static List<Object> recordedIndexes = new ArrayList<Object>();
   
-  public static class Recorder implements Activity {
+  public static class Recorder implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) throws Exception {
       recordedIndexes.add(execution.getVariable("index"));
     }
   }
 
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeStateTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeStateTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeStateTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,9 +24,9 @@
 import java.util.Map;
 
 import org.jbpm.Execution;
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.client.ClientProcessInstance;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
@@ -38,14 +38,14 @@
 public class ScopeStateTest extends JbpmTestCase
 {
 
-  public static class AutomaticActivity implements Activity {
+  public static class AutomaticActivity implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       assertEquals(Execution.STATE_ACTIVE, execution.getState());
     }
   }
 
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       assertEquals(Execution.STATE_ACTIVE, execution.getState());

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,10 +25,10 @@
 import java.util.Map;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.OpenExecution;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
@@ -40,7 +40,7 @@
  */
 public class ScopeVariableDeclarationTest extends JbpmTestCase {
 
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();
@@ -50,10 +50,10 @@
     }
   }
   
-  public static class Composite implements ExternalActivity {
+  public static class Composite implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
-      Node child = execution.getNode().getNodes().get(0);
+      Activity child = execution.getNode().getActivities().get(0);
       execution.execute(child);
     }
     public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) {

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -25,7 +25,7 @@
 
 import org.jbpm.JbpmException;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.model.OpenExecution;
@@ -45,7 +45,7 @@
 public class ScopeVariableTest extends JbpmTestCase
 {
 
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/SubProcessTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -23,9 +23,9 @@
 
 import java.util.Map;
 
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
@@ -37,7 +37,7 @@
 public class SubProcessTest extends JbpmTestCase
 {
 
-  public static class SubProcess implements ExternalActivity {
+  public static class SubProcess implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     ClientProcessDefinition subProcess;
     public SubProcess(ClientProcessDefinition subProcess) {
@@ -53,13 +53,13 @@
     }
   }
   
-  public static class AutomaticActivity implements Activity {
+  public static class AutomaticActivity implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
     }
   }
   
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();
@@ -68,7 +68,7 @@
     }
   }
 
-  public static class EndState implements Activity {
+  public static class EndState implements ActivityBehaviour {
     public void execute(ActivityExecution execution) throws Exception {
       execution.end();
     }

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionBasedConcurrencyTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -6,12 +6,12 @@
 import java.util.Map;
 
 import org.jbpm.Execution;
-import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityBehaviour;
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.model.Node;
+import org.jbpm.model.Activity;
 import org.jbpm.model.OpenExecution;
 import org.jbpm.model.Transition;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
@@ -25,13 +25,13 @@
  */
 public class TransitionBasedConcurrencyTest extends JbpmTestCase {
   
-  public static class Fork implements Activity {
+  public static class Fork implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       OpenExecution processInstance = execution.getProcessInstance();
 
-      Node node = execution.getNode();
-      List<Transition> outgoingTransitions = node.getOutgoingTransitions();
+      Activity activity = execution.getNode();
+      List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
 
       // for each outgoing transition
       for (Transition outgoingTransition: outgoingTransitions) {
@@ -49,7 +49,7 @@
     }
   }
 
-  public static class Join implements Activity {
+  public static class Join implements ActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) throws Exception {
       // end the child execution execution
@@ -57,7 +57,7 @@
       execution.setState(Execution.STATE_INACTIVE);
       execution.waitForSignal();
       
-      Node join = execution.getNode();
+      Activity join = execution.getNode();
       List<OpenExecution> joinedExecutions = findJoinedExecutions(execution, join);
       
       if (isComplete(joinedExecutions, join)) {
@@ -80,13 +80,13 @@
       }
     }
     
-    List<OpenExecution> findJoinedExecutions(OpenExecution execution, Node join) {
+    List<OpenExecution> findJoinedExecutions(OpenExecution execution, Activity join) {
       List<OpenExecution> joinedExecutions = new ArrayList<OpenExecution>();
       scanRecursive(execution.getProcessInstance(), join, joinedExecutions);
       return joinedExecutions;
     }
 
-    void scanRecursive(OpenExecution execution, Node join, List<OpenExecution> joinedExecutions) {
+    void scanRecursive(OpenExecution execution, Activity join, List<OpenExecution> joinedExecutions) {
       // if the execution is positioned in the join
       if (join.equals(execution.getNode())) {
         joinedExecutions.add(execution);
@@ -99,7 +99,7 @@
       }
     }
 
-    boolean isComplete(List<OpenExecution> joinedExecutions, Node join) {
+    boolean isComplete(List<OpenExecution> joinedExecutions, Activity join) {
       int executionsToJoin = join.getIncomingTransitions().size();
       return (executionsToJoin==joinedExecutions.size());
     }
@@ -111,7 +111,7 @@
     }
   }
 
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();
@@ -150,22 +150,22 @@
     
     Execution billing = main.getExecution("billing");
     assertNotNull(billing);
-    assertEquals("bill", billing.getNodeName());
+    assertEquals("bill", billing.getActivityName());
     assertFalse(billing.isEnded());
     
     Execution shipping = main.getExecution("shipping");
     
     assertNotNull(shipping);
-    assertEquals("ship", shipping.getNodeName());
+    assertEquals("ship", shipping.getActivityName());
     assertFalse(shipping.isEnded());
     assertTrue(main.getExecutions().contains(billing));
     assertTrue(main.getExecutions().contains(shipping));
 
     main.signal(billing);
     
-    assertNull(main.getNodeName());
-    assertEquals("join", billing.getNodeName());
-    assertEquals("ship", shipping.getNodeName());
+    assertNull(main.getActivityName());
+    assertEquals("join", billing.getActivityName());
+    assertEquals("ship", shipping.getActivityName());
     assertEquals(Execution.STATE_ACTIVE, shipping.getState());
     assertEquals(Execution.STATE_INACTIVE, billing.getState());
     assertEquals(Execution.STATE_INACTIVE, main.getState());
@@ -173,10 +173,10 @@
     main.signal(shipping);
     
     assertEquals(Execution.STATE_ACTIVE, main.getState());
-    assertEquals("end", main.getNodeName());
-    assertEquals("join", billing.getNodeName());
+    assertEquals("end", main.getActivityName());
+    assertEquals("join", billing.getActivityName());
     assertTrue(billing.isEnded());
-    assertEquals("join", shipping.getNodeName());
+    assertEquals("join", shipping.getActivityName());
     assertTrue(shipping.isEnded());
     assertFalse(main.getExecutions().contains(billing));
     assertFalse(main.getExecutions().contains(shipping));

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -26,7 +26,7 @@
 import java.util.Map;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.listener.EventListener;
@@ -41,7 +41,7 @@
 public class TransitionEventsTest extends JbpmTestCase
 {
   
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();
@@ -133,20 +133,20 @@
 
     execution.signal();
     
-    assertEquals("[event(node-end) on node(inside), " +
-                  "event(node-end) on node(composite), " +
+    assertEquals("[event(activity-end) on activity(inside), " +
+                  "event(activity-end) on activity(composite), " +
                   "event(transition-take) on (inside)-->(outside), " +
-                  "event(node-begin) on node(outside)]", 
+                  "event(activity-begin) on activity(outside)]", 
                  processListener.events.toString());
     
-    assertEquals("[event(node-begin) on node(outside)]",
+    assertEquals("[event(activity-begin) on activity(outside)]",
                  outsideListener.events.toString());
     
-    assertEquals("[event(node-end) on node(inside), " +
-                  "event(node-end) on node(composite)]",
+    assertEquals("[event(activity-end) on activity(inside), " +
+                  "event(activity-end) on activity(composite)]",
                  compositeListener.events.toString());
     
-    assertEquals("[event(node-end) on node(inside)]",
+    assertEquals("[event(activity-end) on activity(inside)]",
                  insideListener.events.toString());
   }
 
@@ -222,20 +222,20 @@
 
     execution.signal();
     
-    assertEquals("[event(node-end) on node(outside), " +
+    assertEquals("[event(activity-end) on activity(outside), " +
     		          "event(transition-take) on (outside)-->(inside), " +
-    		          "event(node-begin) on node(composite), " +
-    		          "event(node-begin) on node(inside)]", 
+    		          "event(activity-begin) on activity(composite), " +
+    		          "event(activity-begin) on activity(inside)]", 
                  processListener.events.toString());
     
-    assertEquals("[event(node-end) on node(outside)]",
+    assertEquals("[event(activity-end) on activity(outside)]",
                  outsideListener.events.toString());
     
-    assertEquals("[event(node-begin) on node(composite), " +
-    		           "event(node-begin) on node(inside)]",
+    assertEquals("[event(activity-begin) on activity(composite), " +
+    		           "event(activity-begin) on activity(inside)]",
     		         compositeListener.events.toString());
     
-    assertEquals("[event(node-begin) on node(inside)]",
+    assertEquals("[event(activity-begin) on activity(inside)]",
                  insideListener.events.toString());
   }
 
@@ -302,18 +302,18 @@
 
     execution.signal();
     
-    assertEquals("[event(node-end) on node(inside), " +
+    assertEquals("[event(activity-end) on activity(inside), " +
                   "event(transition-take) on (inside)-->(inside), " +
-                  "event(node-begin) on node(inside)]", 
+                  "event(activity-begin) on activity(inside)]", 
                  processListener.events.toString());
     
-    assertEquals("[event(node-end) on node(inside), " +
+    assertEquals("[event(activity-end) on activity(inside), " +
                  "event(transition-take) on (inside)-->(inside), " +
-                 "event(node-begin) on node(inside)]",
+                 "event(activity-begin) on activity(inside)]",
                  compositeListener.events.toString());
     
-    assertEquals("[event(node-end) on node(inside), " +
-    		          "event(node-begin) on node(inside)]",
+    assertEquals("[event(activity-end) on activity(inside), " +
+    		          "event(activity-begin) on activity(inside)]",
                  insideListener.events.toString());
   }
 
@@ -392,20 +392,20 @@
 
     execution.signal();
     
-    assertEquals("[event(node-end) on node(inside), " +
-                  "event(node-end) on node(composite), " +
+    assertEquals("[event(activity-end) on activity(inside), " +
+                  "event(activity-end) on activity(composite), " +
                   "event(transition-take) on (composite)-->(outside), " +
-                  "event(node-begin) on node(outside)]", 
+                  "event(activity-begin) on activity(outside)]", 
                  processListener.events.toString());
     
-    assertEquals("[event(node-begin) on node(outside)]",
+    assertEquals("[event(activity-begin) on activity(outside)]",
                  outsideListener.events.toString());
     
-    assertEquals("[event(node-end) on node(inside), " +
-                  "event(node-end) on node(composite)]",
+    assertEquals("[event(activity-end) on activity(inside), " +
+                  "event(activity-end) on activity(composite)]",
                  compositeListener.events.toString());
     
-    assertEquals("[event(node-end) on node(inside)]",
+    assertEquals("[event(activity-end) on activity(inside)]",
                  insideListener.events.toString());
   }
 
@@ -506,31 +506,31 @@
 
     execution.signal();
     
-    assertEquals("[event(node-end) on node(source inside), " +
-                  "event(node-end) on node(source middle), " +
-                  "event(node-end) on node(source outside), " +
+    assertEquals("[event(activity-end) on activity(source inside), " +
+                  "event(activity-end) on activity(source middle), " +
+                  "event(activity-end) on activity(source outside), " +
                   "event(transition-take) on (source middle)-->(destination inside), " +
-                  "event(node-begin) on node(destination outside), " +
-                  "event(node-begin) on node(destination inside)]", 
+                  "event(activity-begin) on activity(destination outside), " +
+                  "event(activity-begin) on activity(destination inside)]", 
                  processListener.events.toString());
     
-    assertEquals("[event(node-end) on node(source inside), " +
-                  "event(node-end) on node(source middle), " +
-                  "event(node-end) on node(source outside)]", 
+    assertEquals("[event(activity-end) on activity(source inside), " +
+                  "event(activity-end) on activity(source middle), " +
+                  "event(activity-end) on activity(source outside)]", 
                  sourceOutsideListener.events.toString());
     
-    assertEquals("[event(node-end) on node(source inside), " +
-                  "event(node-end) on node(source middle)]", 
+    assertEquals("[event(activity-end) on activity(source inside), " +
+                  "event(activity-end) on activity(source middle)]", 
                  sourceMiddleListener.events.toString());
 
-    assertEquals("[event(node-end) on node(source inside)]", 
+    assertEquals("[event(activity-end) on activity(source inside)]", 
                  sourceInsideListener.events.toString());
 
-    assertEquals("[event(node-begin) on node(destination outside), " +
-                  "event(node-begin) on node(destination inside)]", 
+    assertEquals("[event(activity-begin) on activity(destination outside), " +
+                  "event(activity-begin) on activity(destination inside)]", 
                  destinationOutsideListener.events.toString());
 
-    assertEquals("[event(node-begin) on node(destination inside)]", 
+    assertEquals("[event(activity-begin) on activity(destination inside)]", 
                  destinationInsideListener.events.toString());
   }
 }

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/VariableTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/VariableTest.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/VariableTest.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -27,7 +27,7 @@
 import java.util.Set;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 import org.jbpm.client.ClientExecution;
 import org.jbpm.client.ClientProcessDefinition;
 import org.jbpm.client.ClientProcessInstance;
@@ -39,7 +39,7 @@
  */
 public class VariableTest extends JbpmTestCase {
   
-  public static class WaitState implements ExternalActivity {
+  public static class WaitState implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       execution.waitForSignal();
@@ -188,7 +188,7 @@
     assertNull(processInstance.getVariable("answer to life, the universe and everything"));
   }
 
-  public static class VariableActivity implements ExternalActivity {
+  public static class VariableActivity implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
       assertEquals("coca-cola", execution.getVariable("customer"));

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/WaitState.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/WaitState.java	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/WaitState.java	2009-01-20 09:19:05 UTC (rev 3682)
@@ -24,12 +24,12 @@
 import java.util.Map;
 
 import org.jbpm.activity.ActivityExecution;
-import org.jbpm.activity.ExternalActivity;
+import org.jbpm.activity.ExternalActivityBehaviour;
 
 /**
  * @author Tom Baeyens
  */
-public class WaitState implements ExternalActivity {
+public class WaitState implements ExternalActivityBehaviour {
 
   private static final long serialVersionUID = 1L;
 

Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch01-Introduction.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -74,7 +74,7 @@
     is represented in one process instance of the loan process definition.
     </para>
     <para>A process instance contains all the runtime state.  The 
-    most prominent property is the pointer that keeps track of the current node.
+    most prominent property is the pointer that keeps track of the current activity.
     </para>
     <figure id="loan.process.instance.example">
       <title>The loan process instance example</title>

Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -599,7 +599,7 @@
         <programlisting>Map&lt;String, Object&gt; variables = new HashMap&lt;String, Object&gt;();
 variables.put("distance", "far");
 Execution execution = executionService.startExecutionByKey(&quot;Poolcar&quot;, variables);</programlisting>
-        <para>then the new execution will go to node <literal>Big car</literal>.</para>
+        <para>then the new execution will go to activity <literal>Big car</literal>.</para>
       </section>
 
       <section id="exclusivehandler">
@@ -675,7 +675,7 @@
         <para>Now, when we start a process instance and supply value
         <literal>you're great</literal> for variable content, then the 
         ContentEvaluation will return String <literal>good</literal> and 
-        the process instance will arrive in node <literal>Submit document</literal>. 
+        the process instance will arrive in activity <literal>Submit document</literal>. 
         </para>
       </section>
       

Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml	2009-01-20 08:02:27 UTC (rev 3681)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml	2009-01-20 09:19:05 UTC (rev 3682)
@@ -390,7 +390,7 @@
         <programlisting>Map&lt;String, Object&gt; variables = new HashMap&lt;String, Object&gt;();
 variables.put("distance", "far");
 Execution execution = executionService.startExecutionByKey(&quot;Poolcar&quot;, variables);</programlisting>
-        <para>then the new execution will go to node <literal>Big car</literal>.</para>
+        <para>then the new execution will go to activity <literal>Big car</literal>.</para>
       </section>
 
       <section id="exclusivehandler">
@@ -468,7 +468,7 @@
         <para>Now, when we start a process instance and supply value
         <literal>you're great</literal> for variable content, then the 
         ContentEvaluation will return String <literal>good</literal> and 
-        the process instance will arrive in node <literal>Submit document</literal>. 
+        the process instance will arrive in activity <literal>Submit document</literal>. 
         </para>
       </section>
       
@@ -1226,24 +1226,24 @@
   &lt;/start&gt;
 
   <emphasis role="bold">&lt;hql name=&quot;get process names&quot;
-       var=&quot;nodes with o&quot;&gt;
+       var=&quot;activities with o&quot;&gt;
     &lt;query&gt;
-      select node.name
-      from org.jbpm.pvm.internal.model.NodeImpl as node
-      where node.name like :nodeName
+      select activity.name
+      from org.jbpm.pvm.internal.model.ActivityImpl as activity
+      where activity.name like :activityName
     &lt;/query&gt;
     &lt;parameters&gt;
-      &lt;string name=&quot;nodeName&quot; value=&quot;%o%&quot; /&gt;
+      &lt;string name=&quot;activityName&quot; value=&quot;%o%&quot; /&gt;
     &lt;/parameters&gt;</emphasis>
-    &lt;flow to=&quot;count nodes&quot; /&gt;
+    &lt;flow to=&quot;count activities&quot; /&gt;
   <emphasis role="bold">&lt;/hql&gt;
   
-  &lt;hql name=&quot;count nodes&quot;
-       var=&quot;nodes&quot;
+  &lt;hql name=&quot;count activities&quot;
+       var=&quot;activities&quot;
        unique=&quot;true&quot;&gt;
     &lt;query&gt;
       select count(*)
-      from org.jbpm.pvm.internal.model.NodeImpl
+      from org.jbpm.pvm.internal.model.ActivityImpl
     &lt;/query&gt;</emphasis>
     &lt;flow to=&quot;wait&quot; /&gt;
   <emphasis role="bold">&lt;/hql&gt;</emphasis>




More information about the jbpm-commits mailing list