[jbpm-commits] JBoss JBPM SVN: r2765 - in projects/spec/branches/tdiesler/modules: api/src/main/java/org/jbpm/api/client and 38 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Nov 6 02:29:46 EST 2008


Author: thomas.diesler at jboss.com
Date: 2008-11-06 02:29:45 -0500 (Thu, 06 Nov 2008)
New Revision: 2765

Added:
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/MicrocontainerConfiguration.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/MessageListener.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/SignalListener.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/UserTaskCallback.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Execution.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/BasicExecutionContext.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/BasicNodeHandler.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/ExecutionContext.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/ExecutionHandler.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/FlowHandler.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/NodeHandler.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/SignalHandler.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/TokenExecutor.java
Removed:
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicNodeHandler.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/NodeHandler.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java
Modified:
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/UserTask.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/MessageService.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/SignalService.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
   projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext/ExecutionContextTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeInputSetTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeOutputSetTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodePropertyTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalMultithreadTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/transaction/TxRequiredTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java
   projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java
   projects/spec/branches/tdiesler/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java
   projects/spec/branches/tdiesler/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java
   projects/spec/branches/tdiesler/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/ProcessDefinitionAdapter.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
   projects/spec/branches/tdiesler/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java
   projects/spec/branches/tdiesler/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java
   projects/spec/branches/tdiesler/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java
   projects/spec/branches/tdiesler/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
Log:
recreate userbranch

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/config/Configuration.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,47 @@
+/*
+ * 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.api.client;
+
+
+// $Id$
+
+/**
+ * The Configuration provides a ProcessEngine through a given 
+ * configuration method
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public interface Configuration
+{
+  /**
+   * Create a new instance of ProcessEngine for this configuration
+   * @return The configured instance of a process engine
+   */
+  ProcessEngine getProcessEngine();
+  
+  /**
+   * Get a ProcessEngine with a given name from this configuration
+   * @return The configured instance of a process engine
+   */
+  ProcessEngine getProcessEngine(String engineName);
+}
\ No newline at end of file

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -1,47 +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.api.client;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.model.Message;
-
-//$Id$
-
-/**
- * A MessageListener that can be registered with the ProcessEngine
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface MessageListener
-{
-  /**
-   * Get the id for this listener
-   */
-  ObjectName getKey();
-  
-  /** 
-   * Catch a message from the process that this listener is registered with 
-   */
-  void catchMessage(Message message);
-}
\ No newline at end of file

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -29,8 +29,7 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import org.jbpm.api.config.Configuration;
-import org.jbpm.api.config.MicrocontainerConfiguration;
+import org.jbpm.api.client.internal.MicrocontainerConfiguration;
 import org.jbpm.api.service.ProcessEngineRegistry;
 import org.jbpm.api.service.Service;
 import org.slf4j.Logger;

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -1,46 +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.api.client;
-
-//$Id$
-
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.service.SignalService;
-
-/**
- * A signal listener that can be registered with the {@link SignalService}
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface SignalListener
-{
-  /**
-   * Returns true if the listener accepts a given signal  
-   */
-  boolean acceptSignal(Signal signal);
-  
-  /** 
-   * Catch a previously accepted signal 
-   */
-  void catchSignal(Signal signal);
-}
\ No newline at end of file

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -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.api.client;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.UserTask;
-import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.model.builder.ObjectNameFactory;
-import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.BasicAttachments;
-import org.jbpm.api.service.MessageBuilderService;
-import org.jbpm.api.service.MessageService;
-
-/**
- * A callback that can be attached to a {@link UserTask} to facilitate message handling; 
- * 
- * The callback registers a {@link MessageListener}, extracts the data from the received message 
- * and calls the user provided 'callback' method. The response message is then constructed from 
- * the user provided data and automatically sent back to the {@link UserTask}.
- *  
- * @author thomas.diesler at jboss.com
- * @since 08-Oct-2008
- */
-public abstract class UserTaskCallback
-{
-  private MessageListener messageListener;
-
-  /**
-   * Get the associated MessageListener
-   */
-  public MessageListener getMessageListener()
-  {
-    return messageListener;
-  }
-
-  /**
-   * Attached this callback to the user task
-   */
-  public void attach(UserTask userTask)
-  {
-    userTask.setUserTaskCallback(this);
-    
-    messageListener = new CallbackMessageListener(userTask);
-    
-    MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
-    msgService.addMessageListener(messageListener);
-  }
-
-  /**
-   * Detach this callback from the user task
-   */
-  public void detach(UserTask userTask)
-  {
-    MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
-    msgService.removeMessageListener(messageListener.getKey());
-  }
-  
-  public abstract void callback(Attachments att);
-
-  class CallbackMessageListener implements MessageListener
-  {
-    private UserTask userTask;
-    
-    public CallbackMessageListener(UserTask userTask)
-    {
-      this.userTask = userTask;
-    }
-
-    @Override
-    public void catchMessage(Message msg)
-    {
-      // Get the message data
-      Attachments att = new BasicAttachments();
-      for (String propName : msg.getPropertyNames())
-      {
-        String value = msg.getProperty(propName).getValue();
-        att.addAttachment(propName, value);
-      }
-        
-      // Call the user callback
-      callback(att);
-
-      // Build the response message
-      Message msgRef = userTask.getInMessageRef();
-      MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
-      msgBuilder.newMessage(msgRef.getName());
-      for (String propName : msgRef.getPropertyNames())
-      {
-        Object value = att.getAttachment(propName);
-        if (value == null)
-          throw new IllegalStateException("Cannot obtain required property: " + propName);
-        msgBuilder.addProperty(propName, value);
-      }
-      Message resMessage = msgBuilder.getMessage();
-      
-      MessageService msgService = MessageService.locateMessageService();
-      
-      ObjectName procID = userTask.getProcess().getKey();
-      msgService.sendMessage(procID, userTask.getName(), resMessage);
-    }
-
-    @Override
-    public ObjectName getKey()
-    {
-      String oname = userTask.getKey().getCanonicalName();
-      return ObjectNameFactory.create(oname + ",msgListener=UserTaskCallback");
-    }
-  }
-}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client.internal;
+
+// $Id$
+
+import java.net.URL;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
+import org.jboss.kernel.plugins.util.KernelLocator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Boostrap the Microcontainer
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 27-Jun-2008
+ */
+public class EmbeddedBeansDeployer extends BasicBootstrap
+{
+  // Provide logging
+  final Logger log = LoggerFactory.getLogger(EmbeddedBeansDeployer.class);
+
+  private Kernel kernel;
+  private BasicXMLDeployer deployer;
+
+  public EmbeddedBeansDeployer()
+  {
+    // Get or bootstrap the kernel
+    kernel = KernelLocator.getKernel();
+    if (kernel == null)
+    {
+      try
+      {
+        super.bootstrap();
+        kernel = super.getKernel();
+        log.debug("bootstrap kernel: " + kernel);
+      }
+      catch (Throwable e)
+      {
+        throw new IllegalStateException("Cannot bootstrap kernel", e);
+      }
+    }
+    deployer = new BasicXMLDeployer(kernel);
+  }
+
+  /**
+   * Deploy MC beans from URL
+   */
+  public void deploy(URL url)
+  {
+    log.debug("deploy: " + url);
+    try
+    {
+      deployer.deploy(url);
+      deployer.validate();
+
+      // The KernelLocator is expected to get deployed as a bean
+      if (KernelLocator.getKernel() == null)
+        throw new IllegalStateException("KernelLocator not deployed as MC bean");
+
+    }
+    catch (Throwable e)
+    {
+      throw new IllegalStateException("Cannot deploy beans from: " + url, e);
+    }
+  }
+
+  /**
+   * Undeploy MC beans from URL
+   */
+  public void undeploy(URL url)
+  {
+    log.debug("undeploy: " + url);
+    try
+    {
+      deployer.undeploy(url);
+    }
+    catch (Throwable e)
+    {
+      throw new IllegalStateException("Cannot undeploy beans from: " + url, e);
+    }
+  }
+}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/MicrocontainerConfiguration.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/config/MicrocontainerConfiguration.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/MicrocontainerConfiguration.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/MicrocontainerConfiguration.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,109 @@
+/*
+ * 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.api.client.internal;
+
+//$Id$
+
+import java.net.URL;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.util.KernelLocator;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jbpm.api.client.Configuration;
+import org.jbpm.api.client.ProcessEngine;
+
+/**
+ * The ProcessEngineProvider provides a ProcessEngine through a given configuration method
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class MicrocontainerConfiguration implements Configuration
+{
+  /** The process engine bean name - jBPMEngine */
+  public static final String BEAN_NAME = "jBPMProcessEngine";
+  /** The default bean config: jbpm-cfg-beans.xml */
+  public static final String JBPM_ENGINE_CONFIG = "jbpm-cfg-beans.xml";
+
+  // Everything gets deployed through one deployer
+  private static EmbeddedBeansDeployer beansDeployer = new EmbeddedBeansDeployer();
+
+  public Configuration deployDefaultConfig()
+  {
+    URL cfgURL = getDefaultConfigURL();
+    beansDeployer.deploy(cfgURL);
+    return this;
+  }
+
+  public void undeployDefaultConfig()
+  {
+    URL cfgURL = getDefaultConfigURL();
+    beansDeployer.undeploy(cfgURL);
+  }
+
+  public Configuration deployBeansConfig(URL cfgURL)
+  {
+    beansDeployer.deploy(cfgURL);
+    return this;
+  }
+
+  public void undeployBeansConfig(URL cfgURL)
+  {
+    beansDeployer.undeploy(cfgURL);
+  }
+
+  /**
+   * Get the default ProcessEngine from this configuration
+   * @return The configured instance of a process engine
+   */
+  public ProcessEngine getProcessEngine()
+  {
+    return getProcessEngine(BEAN_NAME);
+  }
+  
+  /**
+   * Get a ProcessEngine with a given name from this configuration
+   * @return The configured instance of a process engine
+   */
+  @SuppressWarnings("deprecation")
+  public ProcessEngine getProcessEngine(String beanName)
+  {
+    Kernel kernel = KernelLocator.getKernel();
+    if (kernel == null)
+    {
+      deployDefaultConfig();
+      kernel = KernelLocator.getKernel();
+    }
+    
+    KernelRegistryEntry entry = kernel.getRegistry().getEntry(beanName);
+    ProcessEngine engine = (ProcessEngine)entry.getTarget();
+    return engine;
+  }
+  
+  private URL getDefaultConfigURL()
+  {
+    URL cfgURL = Thread.currentThread().getContextClassLoader().getResource(JBPM_ENGINE_CONFIG);
+    if (cfgURL == null)
+      throw new IllegalStateException("Cannot find resource: " + JBPM_ENGINE_CONFIG);
+    return cfgURL;
+  }
+}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/MessageListener.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/MessageListener.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/MessageListener.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,47 @@
+/*
+ * 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.api.client.preliminary;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.Message;
+
+//$Id$
+
+/**
+ * A MessageListener that can be registered with the ProcessEngine
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MessageListener
+{
+  /**
+   * Get the id for this listener
+   */
+  ObjectName getKey();
+  
+  /** 
+   * Catch a message from the process that this listener is registered with 
+   */
+  void catchMessage(Message message);
+}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/SignalListener.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/SignalListener.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/SignalListener.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,46 @@
+/*
+ * 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.api.client.preliminary;
+
+//$Id$
+
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.service.SignalService;
+
+/**
+ * A signal listener that can be registered with the {@link SignalService}
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalListener
+{
+  /**
+   * Returns true if the listener accepts a given signal  
+   */
+  boolean acceptSignal(Signal signal);
+  
+  /** 
+   * Catch a previously accepted signal 
+   */
+  void catchSignal(Signal signal);
+}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/UserTaskCallback.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/UserTaskCallback.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/preliminary/UserTaskCallback.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -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.api.client.preliminary;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.UserTask;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.MessageBuilderService;
+import org.jbpm.api.service.MessageService;
+
+/**
+ * A callback that can be attached to a {@link UserTask} to facilitate message handling; 
+ * 
+ * The callback registers a {@link MessageListener}, extracts the data from the received message 
+ * and calls the user provided 'callback' method. The response message is then constructed from 
+ * the user provided data and automatically sent back to the {@link UserTask}.
+ *  
+ * @author thomas.diesler at jboss.com
+ * @since 08-Oct-2008
+ */
+public abstract class UserTaskCallback
+{
+  private MessageListener messageListener;
+
+  /**
+   * Get the associated MessageListener
+   */
+  public MessageListener getMessageListener()
+  {
+    return messageListener;
+  }
+
+  /**
+   * Attached this callback to the user task
+   */
+  public void attach(UserTask userTask)
+  {
+    userTask.setUserTaskCallback(this);
+    
+    messageListener = new CallbackMessageListener(userTask);
+    
+    MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
+    msgService.addMessageListener(messageListener);
+  }
+
+  /**
+   * Detach this callback from the user task
+   */
+  public void detach(UserTask userTask)
+  {
+    MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
+    msgService.removeMessageListener(messageListener.getKey());
+  }
+  
+  public abstract void callback(Attachments att);
+
+  class CallbackMessageListener implements MessageListener
+  {
+    private UserTask userTask;
+    
+    public CallbackMessageListener(UserTask userTask)
+    {
+      this.userTask = userTask;
+    }
+
+    @Override
+    public void catchMessage(Message msg)
+    {
+      // Get the message data
+      Attachments att = new BasicAttachments();
+      for (String propName : msg.getPropertyNames())
+      {
+        String value = msg.getProperty(propName).getValue();
+        att.addAttachment(propName, value);
+      }
+        
+      // Call the user callback
+      callback(att);
+
+      // Build the response message
+      Message msgRef = userTask.getInMessageRef();
+      MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
+      msgBuilder.newMessage(msgRef.getName());
+      for (String propName : msgRef.getPropertyNames())
+      {
+        Object value = att.getAttachment(propName);
+        if (value == null)
+          throw new IllegalStateException("Cannot obtain required property: " + propName);
+        msgBuilder.addProperty(propName, value);
+      }
+      Message resMessage = msgBuilder.getMessage();
+      
+      MessageService msgService = MessageService.locateMessageService();
+      
+      ObjectName procID = userTask.getProcess().getKey();
+      msgService.sendMessage(procID, userTask.getName(), resMessage);
+    }
+
+    @Override
+    public ObjectName getKey()
+    {
+      String oname = userTask.getKey().getCanonicalName();
+      return ObjectNameFactory.create(oname + ",msgListener=UserTaskCallback");
+    }
+  }
+}
\ No newline at end of file

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -27,9 +27,9 @@
 
 import org.jbpm.api.model.internal.AbstractElement;
 import org.jbpm.api.model.internal.PropertySupport;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.SignalHandler;
 
 /**
  * A Node is an abstract element with a name and an associated process
@@ -47,7 +47,7 @@
   /**
    * Get the associated process 
    */
-  Process getProcess();
+  ProcessInstance getProcess();
 
   /** 
    * Get the unique name. 

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -1,80 +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.api.model;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.Attachments;
-
-/**
- * A Process is any Activity performed within a company or organization.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface Process extends ProcessStructure
-{
-  /**
-   * Defines the status a {@link Process} can be in
-   */
-  public enum ProcessStatus
-  {
-    None, Ready, Active, Cancelled, Aborting, Aborted, Completing, Completed
-  }
-
-  /**
-   * Get the associated ProcessDefinition
-   */
-  ProcessDefinition getProcessDefinition();
-  
-  /**
-   * Get the process state
-   */
-  ProcessStatus getProcessStatus();
-
-  /**
-   * Start the process
-   */
-  ObjectName startProcess();
-
-  /**
-   * Start the process, with a given execution context
-   */
-  ObjectName startProcess(Attachments att);
-
-  /**
-   * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
-   * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends without
-   * timeout.
-   */
-  ProcessStatus waitForEnd();
-
-  /**
-   * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
-   * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends with a
-   * given timeout.
-   */
-  ProcessStatus waitForEnd(long timeout);
-}
\ No newline at end of file

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -36,6 +36,6 @@
   /**
    * Create a new instance of this process definition
    */
-  Process newInstance();
+  ProcessInstance newInstance();
 
 }
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,80 @@
+/*
+ * 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.api.model;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.runtime.Attachments;
+
+/**
+ * A Process is any Activity performed within a company or organization.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ProcessInstance extends ProcessStructure
+{
+  /**
+   * Defines the status a {@link ProcessInstance} can be in
+   */
+  public enum ProcessStatus
+  {
+    None, Ready, Active, Cancelled, Aborting, Aborted, Completing, Completed
+  }
+
+  /**
+   * Get the associated ProcessDefinition
+   */
+  ProcessDefinition getProcessDefinition();
+  
+  /**
+   * Get the process state
+   */
+  ProcessStatus getProcessStatus();
+
+  /**
+   * Start the process
+   */
+  ObjectName startProcess();
+
+  /**
+   * Start the process, with a given execution context
+   */
+  ObjectName startProcess(Attachments att);
+
+  /**
+   * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
+   * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends without
+   * timeout.
+   */
+  ProcessStatus waitForEnd();
+
+  /**
+   * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
+   * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends with a
+   * given timeout.
+   */
+  ProcessStatus waitForEnd(long timeout);
+}
\ No newline at end of file

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/UserTask.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/UserTask.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/UserTask.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -21,7 +21,7 @@
  */
 package org.jbpm.api.model;
 
-import org.jbpm.api.client.UserTaskCallback;
+import org.jbpm.api.client.preliminary.UserTaskCallback;
 
 //$Id$
 

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -25,7 +25,7 @@
 
 import org.jbpm.api.model.Message;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Property;
 import org.jbpm.api.model.Assignment.AssignTime;
@@ -34,12 +34,12 @@
 import org.jbpm.api.model.Gateway.GatewayType;
 import org.jbpm.api.model.Group.GroupType;
 import org.jbpm.api.model.Task.TaskType;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.SignalHandler;
 
 /**
- * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ * The ProcessBuilder can be used to build a {@link ProcessInstance} dynamically.
  * 
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008
@@ -47,7 +47,7 @@
 public interface ProcessBuilder
 {
   /**
-   * Add a {@link Process} with a given name
+   * Add a {@link ProcessInstance} with a given name
    */
   ProcessBuilder addProcess(String name);
 

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -1,42 +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.api.runtime;
-
-//$Id$
-
-/**
- * A basic ExecutionContext.
- * 
- * @author Thomas.Diesler at jboss.com
- * @since 15-Aug-2008
- */
-public class BasicExecutionContext extends BasicAttachments implements ExecutionContext
-{
-  public BasicExecutionContext()
-  {
-  }
-  
-  public BasicExecutionContext(Attachments att)
-  {
-    super(att);
-  }
-}
\ No newline at end of file

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicNodeHandler.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicNodeHandler.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicNodeHandler.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -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.api.runtime;
-
-import org.jbpm.api.model.Node;
-
-/**
- * A handler that is associated with a node
- * 
- * @author thomas.diesler at jboss.com
- * @since 30-Sep-2008
- */
-public abstract class BasicNodeHandler implements NodeHandler
-{
-  private static final long serialVersionUID = 1L;
-  
-  private Node node;
-
-  @Override
-  public Node getNode()
-  {
-    return node;
-  }
-
-  @Override
-  public void setNode(Node node)
-  {
-    this.node = node;
-  }
-}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Execution.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Execution.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Execution.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -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.api.runtime;
+
+// $Id$
+
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.model.SequenceFlow;
+
+/**
+ * A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
+ * 
+ * By tracking how the Token traverses the Flow Objects, gets diverted through alternative paths, and gets split into
+ * parallel paths, the normal Sequence Flow should be completely definable.
+ * 
+ * A Token will have a unique identity that can be used to separate multiple Tokens that may exist because of concurrent
+ * process instances or the splitting of the Token for parallel processing within a single process instance.
+ * 
+ * @author Thomas.Diesler at jboss.com
+ * @since 20-Apr-2007
+ */
+public interface Execution extends Attachments
+{
+  public enum ExecutionStatus
+  {
+    Created, Started, Stoped, Destroyed, Suspended
+  }
+
+  /**
+   * Get the unique token identity
+   */
+  String getID();
+
+  /**
+   * Get the token status
+   */
+  ExecutionStatus getStatus();
+
+  /**
+   * Get the associated {@link ProcessInstance}
+   */
+  ProcessInstance getProcessInstance();
+  
+  /**
+   * Get the current {@link SequenceFlow}
+   */
+  Node getCurrentNode();
+}
\ No newline at end of file

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -1,35 +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.api.runtime;
-
-// $Id$
-
-
-/**
- * An execution context that can take attachments.
- * 
- * @author Thomas.Diesler at jboss.com
- * @since 20-Apr-2007
- */
-public interface ExecutionContext extends Attachments
-{
-}
\ No newline at end of file

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -1,42 +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.api.runtime;
-
-//$Id$
-
-import org.jbpm.api.model.Node;
-
-/**
- * The ProcessEngine invokes the ExecutionHandler on a 
- * {@link Node} to execute user provided business logic.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface ExecutionHandler extends NodeHandler
-{
-  /**
-   * Execute the associated business logic.
-   */
-  void execute(Token token);
-
-}
\ No newline at end of file

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -1,46 +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.api.runtime;
-
-// $Id$
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Node;
-
-/**
- * The {@link ProcessEngine} invokes the FlowHandler on a {@link Node} 
- * to move the {@link Token} to the next {@link Node}.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface FlowHandler extends NodeHandler
-{
-  /**
-   * Execute the FlowHandler.
-   * <p/>
-   * The FlowHandler typically invoves one of the {@link TokenExecutor} 
-   * methods to move the {@link Token} to the next {@link Node}.    
-   */
-  void execute(TokenExecutor tokenExecutor, Token token);
-
-}
\ No newline at end of file

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/NodeHandler.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/NodeHandler.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/NodeHandler.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -1,47 +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.api.runtime;
-
-import java.io.Serializable;
-
-//$Id$
-
-import org.jbpm.api.model.Node;
-
-/**
- * A handler that is associated with a node 
- * 
- * @author thomas.diesler at jboss.com
- * @since 30-Sep-2008
- */
-public interface NodeHandler extends Serializable
-{
-  /**
-   * Get the associated node.
-   */
-  Node getNode();
-  
-  /**
-   * Set the associated node.
-   */
-  void setNode(Node node);
-}
\ No newline at end of file

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -1,48 +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.api.runtime;
-
-// $Id$
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Signal;
-
-/**
- * The {@link ProcessEngine} invokes the SignalHandler on a {@link Node} 
- * to send {@link Signal}s.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface SignalHandler extends NodeHandler
-{
-  /** 
-   * Get signal for enter 
-   */
-  void throwEnterSignal(Token token);
-
-  /** 
-   * Get signal for exit 
-   */
-  void throwExitSignal(Token token);
-}
\ No newline at end of file

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -1,78 +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.api.runtime;
-
-// $Id$
-
-import org.hibernate.Session;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.SequenceFlow;
-
-/**
- * A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
- * 
- * By tracking how the Token traverses the Flow Objects, gets diverted through alternative paths, and gets split into
- * parallel paths, the normal Sequence Flow should be completely definable.
- * 
- * A Token will have a unique identity that can be used to separate multiple Tokens that may exist because of concurrent
- * process instances or the splitting of the Token for parallel processing within a single process instance.
- * 
- * @author Thomas.Diesler at jboss.com
- * @since 20-Apr-2007
- */
-public interface Token
-{
-  public enum TokenStatus
-  {
-    Created, Started, Stoped, Destroyed, Suspended
-  }
-
-  /**
-   * Get the unique token identity
-   */
-  String getTokenID();
-
-  /**
-   * Get the token status
-   */
-  TokenStatus getTokenStatus();
-
-  /**
-   * Get the associated {@link Process}
-   */
-  Process getProcess();
-  
-  /**
-   * Get the associated {@link ExecutionContext}
-   */
-  ExecutionContext getExecutionContext();
-
-  /**
-   * Get the current {@link SequenceFlow}
-   */
-  SequenceFlow getSequenceFlow();
-  
-  /**
-   * Get the associated persistence session
-   */
-  Session getSession();
-}
\ No newline at end of file

Deleted: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -1,83 +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.api.runtime;
-
-//$Id$
-
-import java.util.Set;
-
-import org.jbpm.api.model.SequenceFlow;
-
-/**
- * The {@link FlowHandler} invokes the TokenExecutor to move {@link Token}s
- * along the {@link SequenceFlow}s in the {@link Process}.
- * 
- * @author thomas.diesler at jboss.com
- * @since 08-Jul-2008
- */
-public interface TokenExecutor
-{
-  /**
-   * Get the set of active tokens
-   */
-  Set<Token> getRunnableTokens();
-  
-  /**
-   * True if there are active tokens
-   */
-  boolean hasRunnableTokens();
-  
-  /**
-   * Create a {@link Token} with an initial flow
-   */
-  void create(Token token, SequenceFlow flow);
-  
-  /**
-   * Start a {@link Token}
-   */
-  void start(Token token);
-  
-  /**
-   * Stop a {@link Token}
-   */
-  void stop(Token token);
-  
-  /**
-   * Destroy a {@link Token}
-   */
-  void destroy(Token token);
-  
-  /**
-   * Suspend a {@link Token}
-   */
-  String suspend(Token token);
-  
-  /**
-   * Activate a {@link Token}
-   */
-  Token activate(String tokenID);
-  
-  /**
-   * Move a given {@link Token} along a given flow.
-   */
-  void move(Token token, SequenceFlow flow);
-}

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/BasicExecutionContext.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/BasicExecutionContext.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/BasicExecutionContext.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,45 @@
+/*
+ * 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.api.runtime.internal;
+
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.BasicAttachments;
+
+//$Id$
+
+/**
+ * A basic ExecutionContext.
+ * 
+ * @author Thomas.Diesler at jboss.com
+ * @since 15-Aug-2008
+ */
+public class BasicExecutionContext extends BasicAttachments implements ExecutionContext
+{
+  public BasicExecutionContext()
+  {
+  }
+  
+  public BasicExecutionContext(Attachments att)
+  {
+    super(att);
+  }
+}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/BasicNodeHandler.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicNodeHandler.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/BasicNodeHandler.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/BasicNodeHandler.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -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.api.runtime.internal;
+
+import org.jbpm.api.model.Node;
+
+/**
+ * A handler that is associated with a node
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 30-Sep-2008
+ */
+public abstract class BasicNodeHandler implements NodeHandler
+{
+  private static final long serialVersionUID = 1L;
+  
+  private Node node;
+
+  @Override
+  public Node getNode()
+  {
+    return node;
+  }
+
+  @Override
+  public void setNode(Node node)
+  {
+    this.node = node;
+  }
+}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/ExecutionContext.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/ExecutionContext.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/ExecutionContext.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,37 @@
+/*
+ * 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.api.runtime.internal;
+
+import org.jbpm.api.runtime.Attachments;
+
+// $Id$
+
+
+/**
+ * An execution context that can take attachments.
+ * 
+ * @author Thomas.Diesler at jboss.com
+ * @since 20-Apr-2007
+ */
+public interface ExecutionContext extends Attachments
+{
+}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/ExecutionHandler.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/ExecutionHandler.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/ExecutionHandler.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,43 @@
+/*
+ * 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.api.runtime.internal;
+
+//$Id$
+
+import org.jbpm.api.model.Node;
+import org.jbpm.api.runtime.Execution;
+
+/**
+ * The ProcessEngine invokes the ExecutionHandler on a 
+ * {@link Node} to execute user provided business logic.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ExecutionHandler extends NodeHandler
+{
+  /**
+   * Execute the associated business logic.
+   */
+  void execute(Execution token);
+
+}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/FlowHandler.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/FlowHandler.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/FlowHandler.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,47 @@
+/*
+ * 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.api.runtime.internal;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.runtime.Execution;
+
+/**
+ * The {@link ProcessEngine} invokes the FlowHandler on a {@link Node} 
+ * to move the {@link Execution} to the next {@link Node}.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface FlowHandler extends NodeHandler
+{
+  /**
+   * Execute the FlowHandler.
+   * <p/>
+   * The FlowHandler typically invoves one of the {@link TokenExecutor} 
+   * methods to move the {@link Execution} to the next {@link Node}.    
+   */
+  void execute(TokenExecutor tokenExecutor, Execution token);
+
+}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/NodeHandler.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/NodeHandler.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/NodeHandler.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/NodeHandler.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,47 @@
+/*
+ * 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.api.runtime.internal;
+
+import java.io.Serializable;
+
+//$Id$
+
+import org.jbpm.api.model.Node;
+
+/**
+ * A handler that is associated with a node 
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 30-Sep-2008
+ */
+public interface NodeHandler extends Serializable
+{
+  /**
+   * Get the associated node.
+   */
+  Node getNode();
+  
+  /**
+   * Set the associated node.
+   */
+  void setNode(Node node);
+}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/SignalHandler.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/SignalHandler.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/SignalHandler.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -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.api.runtime.internal;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.runtime.Execution;
+
+/**
+ * The {@link ProcessEngine} invokes the SignalHandler on a {@link Node} 
+ * to send {@link Signal}s.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalHandler extends NodeHandler
+{
+  /** 
+   * Get signal for enter 
+   */
+  void throwEnterSignal(Execution token);
+
+  /** 
+   * Get signal for exit 
+   */
+  void throwExitSignal(Execution token);
+}
\ No newline at end of file

Copied: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/TokenExecutor.java (from rev 2754, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java)
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/TokenExecutor.java	                        (rev 0)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/internal/TokenExecutor.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -0,0 +1,84 @@
+/*
+ * 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.api.runtime.internal;
+
+//$Id$
+
+import java.util.Set;
+
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.runtime.Execution;
+
+/**
+ * The {@link FlowHandler} invokes the TokenExecutor to move {@link Execution}s
+ * along the {@link SequenceFlow}s in the {@link Process}.
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 08-Jul-2008
+ */
+public interface TokenExecutor
+{
+  /**
+   * Get the set of active tokens
+   */
+  Set<Execution> getRunnableTokens();
+  
+  /**
+   * True if there are active tokens
+   */
+  boolean hasRunnableTokens();
+  
+  /**
+   * Create a {@link Execution} with an initial flow
+   */
+  void create(Execution token, SequenceFlow flow);
+  
+  /**
+   * Start a {@link Execution}
+   */
+  void start(Execution token);
+  
+  /**
+   * Stop a {@link Execution}
+   */
+  void stop(Execution token);
+  
+  /**
+   * Destroy a {@link Execution}
+   */
+  void destroy(Execution token);
+  
+  /**
+   * Suspend a {@link Execution}
+   */
+  String suspend(Execution token);
+  
+  /**
+   * Activate a {@link Execution}
+   */
+  Execution activate(String tokenID);
+  
+  /**
+   * Move a given {@link Execution} along a given flow.
+   */
+  void move(Execution token, SequenceFlow flow);
+}

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,9 +26,9 @@
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
 import org.jbpm.api.runtime.Attachments;
 
 /**
@@ -60,7 +60,7 @@
    * @param proc The Process to start
    * @param att The Attachments in the ExecutionContext
    */
-  public abstract void startProcess(Process proc, Attachments att);
+  public abstract void startProcess(ProcessInstance proc, Attachments att);
 
   /**
    * Start the Process from a given start event
@@ -68,19 +68,19 @@
    * @param start The StartEvent that triggers the process
    * @param att The Attachments in the ExecutionContext
    */
-  public abstract void startProcess(Process proc, StartEvent start, Attachments att);
+  public abstract void startProcess(ProcessInstance proc, StartEvent start, Attachments att);
 
   /**
    * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
    * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends without
    * timeout.
    */
-  public abstract ProcessStatus waitForEnd(Process proc);
+  public abstract ProcessStatus waitForEnd(ProcessInstance proc);
 
   /**
    * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
    * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends with a
    * given timeout.
    */
-  public abstract ProcessStatus waitForEnd(Process proc, long timeout);
+  public abstract ProcessStatus waitForEnd(ProcessInstance proc, long timeout);
 }

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/MessageService.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/MessageService.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/MessageService.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -31,13 +31,13 @@
 
 import javax.management.ObjectName;
 
-import org.jbpm.api.client.MessageListener;
 import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.preliminary.MessageListener;
 import org.jbpm.api.model.Event;
 import org.jbpm.api.model.Message;
 import org.jbpm.api.model.Node;
 import org.jbpm.api.model.Participant;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.Task;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -134,7 +134,7 @@
   public void sendMessage(ObjectName procID, String targetName, Message msg)
   {
     ProcessService procService = ProcessService.locateProcessService();
-    Process proc = procService.getProcess(procID);
+    ProcessInstance proc = procService.getProcess(procID);
     if (proc == null)
       throw new IllegalStateException("Cannot obtain registered process: " + procID);
 

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -29,7 +29,7 @@
 import org.jbpm.api.client.ProcessEngine;
 import org.jbpm.api.model.Node;
 import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 
 /**
  * The persistence service.
@@ -71,17 +71,17 @@
   /**
    * Save the Process to persistent storage
    */
-  public abstract ObjectName saveProcess(Process proc);
+  public abstract ObjectName saveProcess(ProcessInstance proc);
 
   /**
    * Load the Process from persistent storage
    */
-  public abstract Process loadProcess(ObjectName procID);
+  public abstract ProcessInstance loadProcess(ObjectName procID);
 
   /**
    * Delete the Process from persistent storage
    */
-  public abstract void deleteProcess(Process proc);
+  public abstract void deleteProcess(ProcessInstance proc);
 
   /**
    * Save the Node to persistent storage

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -24,11 +24,11 @@
 //$Id$
 
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.builder.ProcessBuilder;
 
 /**
- * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ * The ProcessBuilder can be used to build a {@link ProcessInstance} dynamically.
  * 
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -32,9 +32,9 @@
 import javax.management.ObjectName;
 
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -50,7 +50,7 @@
   final static Logger log = LoggerFactory.getLogger(ProcessService.class);
 
   // The set of registered processes
-  private Map<ObjectName, Process> registeredProcs = new HashMap<ObjectName, Process>();
+  private Map<ObjectName, ProcessInstance> registeredProcs = new HashMap<ObjectName, ProcessInstance>();
 
   // Hide public constructor
   protected ProcessService()
@@ -69,7 +69,7 @@
   /**
    * Register a Process.
    */
-  public ObjectName registerProcess(Process proc)
+  public ObjectName registerProcess(ProcessInstance proc)
   {
     log.debug("registerProcess: " + proc);
 
@@ -101,7 +101,7 @@
   public boolean unregisterProcess(ObjectName procID)
   {
     boolean removed = false;
-    Process proc = registeredProcs.get(procID);
+    ProcessInstance proc = registeredProcs.get(procID);
     if (proc != null)
     {
       log.debug("unregisterProcess: " + proc);
@@ -118,9 +118,9 @@
   /**
    * Get a Process for a given id
    */
-  public Process getProcess(ObjectName procID)
+  public ProcessInstance getProcess(ObjectName procID)
   {
-    Process proc = registeredProcs.get(procID);
+    ProcessInstance proc = registeredProcs.get(procID);
     return proc;
   }
 
@@ -142,7 +142,7 @@
   public Set<ObjectName> getProcesses(String name, ProcessStatus status)
   {
     Set<ObjectName> procSet = new HashSet<ObjectName>();
-    for (Process auxProc : registeredProcs.values())
+    for (ProcessInstance auxProc : registeredProcs.values())
     {
       if (auxProc.getName().equals(name))
       {

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/SignalService.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/SignalService.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/SignalService.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -28,7 +28,7 @@
 import java.util.Set;
 
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.client.preliminary.SignalListener;
 import org.jbpm.api.model.Signal;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -35,9 +35,9 @@
 import javax.management.ObjectName;
 
 import org.jbpm.api.BPMException;
-import org.jbpm.api.client.MessageListener;
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.client.preliminary.MessageListener;
+import org.jbpm.api.client.preliminary.SignalListener;
 import org.jbpm.api.model.Message;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;

Modified: projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
===================================================================
--- projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -24,7 +24,7 @@
 import java.net.URL;
 
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.config.MicrocontainerConfiguration;
+import org.jbpm.api.client.internal.MicrocontainerConfiguration;
 import org.jbpm.api.service.ProcessEngineRegistry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Event.EventDetailType;
 import org.jbpm.api.model.builder.MessageBuilder;
@@ -46,7 +46,7 @@
   public void testStart() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     // Start the process
     BasicAttachments att = new BasicAttachments();

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext/ExecutionContextTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext/ExecutionContextTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext/ExecutionContextTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -23,8 +23,8 @@
 
 // $Id$
 
-import org.jbpm.api.runtime.BasicExecutionContext;
-import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.runtime.internal.BasicExecutionContext;
+import org.jbpm.api.runtime.internal.ExecutionContext;
 import org.jbpm.api.test.CTSTestCase;
 
 /**

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Gateway.GatewayType;
@@ -47,7 +47,7 @@
   public void testMerge() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     // Start the process
     proc.startProcess();

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Expression.ExpressionLanguage;
@@ -49,7 +49,7 @@
   public void testGateA() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("foo", "5");
@@ -64,7 +64,7 @@
   public void testGateB() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("foo", "15");
@@ -79,7 +79,7 @@
   public void testInvalidGate() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("foo", "10");

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Gateway.GatewayType;
@@ -46,7 +46,7 @@
   public void testSimpleMerge() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     // Start the process
     proc.startProcess();

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Expression.ExpressionLanguage;
@@ -49,7 +49,7 @@
   public void testGateA() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("foo", "5");
@@ -63,7 +63,7 @@
   public void testGateB() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("foo", "15");

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Assignment.AssignTime;
 import org.jbpm.api.model.Event.EventDetailType;
@@ -50,7 +50,7 @@
   public void testParallelMerge() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     // Start the process
     proc.startProcess();

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -28,7 +28,7 @@
 
 import javax.management.ObjectName;
 
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Gateway.GatewayType;
@@ -49,7 +49,7 @@
   public void testParallelSplit() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     proc.startProcess();
     proc.waitForEnd(5000);

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeInputSetTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeInputSetTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeInputSetTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Event.EventDetailType;
 import org.jbpm.api.model.builder.MessageBuilder;
@@ -51,7 +51,7 @@
   public void testValidProps() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("frog", "kermit");
@@ -66,7 +66,7 @@
   public void testInvalidProps() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("pig", "piggy");

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeOutputSetTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeOutputSetTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeOutputSetTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Event.EventDetailType;
 import org.jbpm.api.model.builder.MessageBuilder;
@@ -51,7 +51,7 @@
   public void testValidProps() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     proc.startProcess();
     proc.waitForEnd(5000);

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodePropertyTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodePropertyTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/node/NodePropertyTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Assignment.AssignTime;
 import org.jbpm.api.model.Event.EventDetailType;
@@ -52,7 +52,7 @@
   public void testActivityPropertyRead() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     proc.startProcess();
     proc.waitForEnd(5000);

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Assignment.AssignTime;
 import org.jbpm.api.model.Event.EventDetailType;
@@ -57,7 +57,7 @@
   public void testProcessProperties() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     proc.startProcess();
     proc.waitForEnd(5000);

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.net.URL;
 
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.config.MicrocontainerConfiguration;
+import org.jbpm.api.client.internal.MicrocontainerConfiguration;
 import org.jbpm.api.service.ProcessEngineRegistry;
 import org.jbpm.api.test.CTSTestCase;
 

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -28,7 +28,7 @@
 import javax.management.ObjectName;
 
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.service.ProcessDefinitionService;
 import org.jbpm.api.service.ProcessService;
@@ -66,7 +66,7 @@
     ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
     ProcessService procService = engine.getService(ProcessService.class);
 
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     assertNotNull("Process not null", proc);
     assertNull("Process not automatically registered", procService.getProcess(proc.getKey()));
     assertNull("ProcessDefinition not automatically registered", procDefService.getProcessDefinition(procDef.getKey()));

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -25,8 +25,8 @@
 
 import javax.management.ObjectName;
 
-import org.jbpm.api.client.SignalListener;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.client.preliminary.SignalListener;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Signal.SignalType;
@@ -51,7 +51,7 @@
     ProcessService procService = ProcessService.locateProcessService();
     
     ProcessDefinition procDef = getProcessDefinition();
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     assertNull("ProcessDefinition not registered automatically", procDefService.getProcessDefinition(procDef.getKey()));
     assertNull("Process not registered automatically", procService.getProcess(proc.getKey()));
@@ -77,7 +77,7 @@
     final ProcessService procService = ProcessService.locateProcessService();
     
     final ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    final Process proc = procDef.newInstance();
+    final ProcessInstance proc = procDef.newInstance();
     assertNull("Process not registered automatically", procService.getProcess(proc.getKey()));
 
     SignalListener sigListener = new SignalListener()

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalMultithreadTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalMultithreadTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalMultithreadTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -23,7 +23,7 @@
 
 // $Id$
 
-import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.client.preliminary.SignalListener;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Signal.SignalType;
 import org.jbpm.api.service.SignalService;

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -28,9 +28,9 @@
 
 import javax.management.ObjectName;
 
-import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.client.preliminary.SignalListener;
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Assignment.AssignTime;
@@ -63,7 +63,7 @@
     ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
     procDefService.registerProcessDefinition(procDef);
 
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     try
     {
       proc.startProcess();

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -28,9 +28,9 @@
 import javax.management.ObjectName;
 
 import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.client.preliminary.SignalListener;
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Event.EventDetailType;
@@ -74,7 +74,7 @@
   public void testUnregisteredProcess() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     MessageService msgService = MessageService.locateMessageService();
     try
@@ -94,7 +94,7 @@
     ProcessService procService = ProcessService.locateProcessService();
     
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     ObjectName procID = procService.registerProcess(proc);
     try
@@ -119,7 +119,7 @@
   public void testSuspendedToken() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    final Process proc = procDef.newInstance();
+    final ProcessInstance proc = procDef.newInstance();
     SignalListener sigListener = new SignalListener()
     {
       private boolean sendMessage = true;

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -28,7 +28,7 @@
 
 import org.jbpm.api.InvalidProcessException;
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Task.TaskType;
 import org.jbpm.api.model.builder.MessageBuilder;
@@ -48,7 +48,7 @@
   public void testSendTask() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("foo", "bar");

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -25,16 +25,16 @@
 
 import java.io.IOException;
 
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Assignment.AssignTime;
 import org.jbpm.api.model.Expression.ExpressionLanguage;
 import org.jbpm.api.model.builder.ProcessBuilder;
 import org.jbpm.api.model.builder.TaskBuilder;
-import org.jbpm.api.runtime.BasicNodeHandler;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.BasicNodeHandler;
+import org.jbpm.api.runtime.internal.ExecutionContext;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
 import org.jbpm.api.service.ProcessBuilderService;
 import org.jbpm.api.test.CTSTestCase;
 
@@ -49,7 +49,7 @@
   public void testExecutionHandler() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     proc.startProcess();
     proc.waitForEnd(5000);
@@ -89,7 +89,7 @@
      * - The result of start time activity assignments
      */
     @Override
-    public void execute(Token token)
+    public void execute(Execution token)
     {
       ExecutionContext exContext = token.getExecutionContext();
       procProp = (String)exContext.getAttachment("TaskExecutionHandlerTest.procProp");

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,9 +26,9 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.jbpm.api.client.UserTaskCallback;
+import org.jbpm.api.client.preliminary.UserTaskCallback;
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.UserTask;
 import org.jbpm.api.model.Event.EventDetailType;
@@ -50,7 +50,7 @@
   public void testUserTask() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     // Attach the callback to the UserTask
     UserTask userTask = proc.getNode(UserTask.class, "UserTask");

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -29,9 +29,9 @@
 import javax.management.ObjectName;
 
 import org.jbpm.api.Constants;
-import org.jbpm.api.client.MessageListener;
+import org.jbpm.api.client.preliminary.MessageListener;
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Event.EventDetailType;
 import org.jbpm.api.model.Task.TaskType;
@@ -58,7 +58,7 @@
   public void testUserTask() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     // Register the process - this assigns the procID
     ProcessService procService = ProcessService.locateProcessService();

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/transaction/TxRequiredTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/transaction/TxRequiredTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/transaction/TxRequiredTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -32,14 +32,14 @@
 import org.jbpm.api.model.Group;
 import org.jbpm.api.model.Message;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Group.GroupType;
 import org.jbpm.api.model.Task.TaskType;
 import org.jbpm.api.model.builder.ProcessBuilder;
 import org.jbpm.api.runtime.BasicAttachments;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
 import org.jbpm.api.service.ProcessBuilderService;
 import org.jbpm.api.test.CTSTestCase;
 import org.jbpm.ri.runtime.TransactionAssociation;
@@ -66,7 +66,7 @@
     assertSame("Group same", group, groupA);
     assertSame("Group same", group, groupB);
 
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     proc.startProcess();
     proc.waitForEnd();
@@ -78,7 +78,7 @@
   public void testRollback() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment(Boolean.class, "rollback", Boolean.TRUE);
@@ -110,7 +110,7 @@
     private Node node;
 
     @Override
-    public void execute(Token token)
+    public void execute(Execution token)
     {
       Transaction tx = TransactionAssociation.getTransaction();
       Boolean doRollback = token.getExecutionContext().getAttachment(Boolean.class, "rollback");

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -27,7 +27,7 @@
 import java.util.List;
 
 import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Expression.ExpressionLanguage;
@@ -49,7 +49,7 @@
   public void testGateA() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("foo", "5");
@@ -64,7 +64,7 @@
   public void testGateB() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("foo", "15");
@@ -79,7 +79,7 @@
   public void testInvalidGate() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("foo", "10");

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -27,7 +27,7 @@
 import java.util.List;
 
 import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Expression.ExpressionLanguage;
@@ -49,7 +49,7 @@
   public void testGateA() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("foo", "5");
@@ -63,7 +63,7 @@
   public void testGateB() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     BasicAttachments att = new BasicAttachments();
     att.addAttachment("foo", "15");

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -29,7 +29,7 @@
 import javax.management.ObjectName;
 
 import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Signal.SignalType;
@@ -49,7 +49,7 @@
   public void testParallelSplit() throws Exception 
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     proc.startProcess();
     proc.waitForEnd();

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Signal.SignalType;
@@ -46,7 +46,7 @@
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
 
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     // Start the Process
     proc.startProcess();

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 import java.util.List;
 
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.Gateway.GatewayType;
@@ -46,7 +46,7 @@
   public void testSimpleMerge() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
 
     // Start the process
     proc.startProcess();

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Assignment.AssignTime;
 import org.jbpm.api.model.Event.EventDetailType;
@@ -50,7 +50,7 @@
   public void testParallelMerge() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     // Start the process
     proc.startProcess();

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Assignment.AssignTime;
 import org.jbpm.api.model.Event.EventDetailType;
@@ -50,7 +50,7 @@
   public void testCaseProperties() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     proc.startProcess();
     proc.waitForEnd();

Modified: projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import java.io.IOException;
 
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Assignment.AssignTime;
 import org.jbpm.api.model.Event.EventDetailType;
@@ -51,7 +51,7 @@
   public void testTaskDataRead() throws Exception
   {
     ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     
     proc.startProcess();
     proc.waitForEnd();

Modified: projects/spec/branches/tdiesler/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java
===================================================================
--- projects/spec/branches/tdiesler/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -56,9 +56,9 @@
 import org.jbpm.api.model.Task;
 import org.jbpm.api.model.Event.EventDetailType;
 import org.jbpm.api.model.SequenceFlow.ConditionType;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.SignalHandler;
 import org.jbpm.dialect.api10.model.JAXBAssignment;
 import org.jbpm.dialect.api10.model.JAXBComplexGateway;
 import org.jbpm.dialect.api10.model.JAXBEndEvent;

Modified: projects/spec/branches/tdiesler/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java
===================================================================
--- projects/spec/branches/tdiesler/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -43,10 +43,10 @@
 import org.jbpm.api.model.builder.ObjectNameFactory;
 import org.jbpm.api.model.builder.ProcessBuilder;
 import org.jbpm.api.model.builder.TaskBuilder;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.NodeHandler;
-import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.NodeHandler;
+import org.jbpm.api.runtime.internal.SignalHandler;
 import org.jbpm.api.service.ProcessBuilderService;
 import org.jbpm.dialect.api10.model.JAXBAssignment;
 import org.jbpm.dialect.api10.model.JAXBCancelEventDetail;

Modified: projects/spec/branches/tdiesler/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/ProcessDefinitionAdapter.java
===================================================================
--- projects/spec/branches/tdiesler/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/ProcessDefinitionAdapter.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/ProcessDefinitionAdapter.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -30,7 +30,7 @@
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Task;
 import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.runtime.ExecutionHandler;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
 import org.jbpm.api.service.ProcessBuilderService;
 import org.jbpm.dialect.jpdl32.model.JPDL32Action;
 import org.jbpm.dialect.jpdl32.model.JPDL32EndState;

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -32,7 +32,7 @@
 import org.hibernate.Session;
 import org.jbpm.api.InvalidProcessException;
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.internal.AbstractElement;
 
@@ -105,22 +105,22 @@
     // nothing to do
   }
   
-  protected void create(Process proc)
+  protected void create(ProcessInstance proc)
   {
     // nothing to do
   }
   
-  protected void register(Process proc)
+  protected void register(ProcessInstance proc)
   {
     // nothing to do
   }
   
-  protected void unregister(Process proc)
+  protected void unregister(ProcessInstance proc)
   {
     // nothing to do
   }
   
-  protected void destroy(Process proc)
+  protected void destroy(ProcessInstance proc)
   {
     // nothing to do
   }

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -35,11 +35,11 @@
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.builder.ObjectNameFactory;
 import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionContext;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.SignalHandler;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 import org.jbpm.api.service.SignalService;
 import org.jbpm.ri.model.builder.SingleInFlowSupport;
 import org.slf4j.Logger;
@@ -117,13 +117,13 @@
       
       ProcessEngine engine = getProcessDefinition().getProcessEngine();
       SignalService sigService = engine.getService(SignalService.class);
-      public void throwEnterSignal(Token token)
+      public void throwEnterSignal(Execution token)
       {
         Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_END_EVENT_ENTER, getKey());
         sigService.throwSignal(signal);
       }
 
-      public void throwExitSignal(Token token)
+      public void throwExitSignal(Execution token)
       {
         Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_END_EVENT_EXIT, getKey());
         sigService.throwSignal(signal);
@@ -155,7 +155,7 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(TokenExecutor tokenExecutor, Token token)
+      public void execute(TokenExecutor tokenExecutor, Execution token)
       {
         log.debug("End reached in: " + getName());
         ExecutionContext exContext = token.getExecutionContext();
@@ -186,7 +186,7 @@
       this.tokenExecutor = tokenExecutor;
     }
 
-    void destroyToken(Token token)
+    void destroyToken(Execution token)
     {
       tokenExecutor.destroy(token);
     }

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -36,14 +36,14 @@
 import org.jbpm.api.model.Event;
 import org.jbpm.api.model.Message;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.builder.ObjectNameFactory;
 import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.SignalHandler;
 import org.jbpm.api.service.SignalService;
 import org.jbpm.ri.runtime.MessageSender;
 
@@ -133,7 +133,7 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(Token token)
+      public void execute(Execution token)
       {
         if (detailType == EventDetailType.Message && getMessageRef() != null)
         {
@@ -166,13 +166,13 @@
       ProcessEngine engine = getProcessDefinition().getProcessEngine();
       SignalService sigService = engine.getService(SignalService.class);
 
-      public void throwEnterSignal(Token token)
+      public void throwEnterSignal(Execution token)
       {
         Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_EVENT_ENTER, getKey());
         sigService.throwSignal(signal);
       }
 
-      public void throwExitSignal(Token token)
+      public void throwExitSignal(Execution token)
       {
         Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_EVENT_EXIT, getKey());
         sigService.throwSignal(signal);
@@ -214,7 +214,7 @@
   }
 
   @Override
-  protected void create(Process proc)
+  protected void create(ProcessInstance proc)
   {
     super.create(proc);
 

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -35,10 +35,10 @@
 import org.jbpm.api.model.SequenceFlow;
 import org.jbpm.api.model.SequenceFlow.ConditionType;
 import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 import org.jbpm.ri.runtime.ExpressionEvaluator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -88,7 +88,7 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(Token token)
+      public void execute(Execution token)
       {
         // Call the super default handler
         superExecHandler.execute(token);
@@ -122,7 +122,7 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(TokenExecutor tokenExecutor, Token token)
+      public void execute(TokenExecutor tokenExecutor, Execution token)
       {
         String sourceRef = token.getSequenceFlow().getSourceRef();
         
@@ -170,7 +170,7 @@
   // Get a single selected gate which' condition evaluates to TRUE
   // Fall back to the default gate if there is one
   // Choke if there is no selected gate
-  private SequenceFlow getSelectedGate(Token token)
+  private SequenceFlow getSelectedGate(Execution token)
   {
     SequenceFlow selectedGate = null;
     for (SequenceFlow auxGate : getGates())

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -42,9 +42,9 @@
 import org.jbpm.api.model.SequenceFlow.ConditionType;
 import org.jbpm.api.model.builder.ObjectNameFactory;
 import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.SignalHandler;
 import org.jbpm.api.service.SignalService;
 import org.jbpm.ri.model.builder.MultipleInFlowSupport;
 import org.jbpm.ri.model.builder.MultipleOutFlowSupport;
@@ -71,7 +71,7 @@
   
   // The list of received tokens
   @Transient
-  protected List<Token> receivedTokens;
+  protected List<Execution> receivedTokens;
   
   public GatewayImpl(ProcessStructure procStruct, String name, GatewayType gatewayType)
   {
@@ -162,13 +162,13 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(Token token)
+      public void execute(Execution token)
       {
         // Initialize the gateway
         if (expectedFlows == null)
         {
           expectedFlows = new ArrayList<SequenceFlow>(inFlows);
-          receivedTokens = new ArrayList<Token>();
+          receivedTokens = new ArrayList<Execution>();
         }
         
         // Check that token from flow is valid
@@ -207,13 +207,13 @@
       ProcessEngine engine = getProcessDefinition().getProcessEngine();
       SignalService sigService = engine.getService(SignalService.class);
       
-      public void throwEnterSignal(Token token)
+      public void throwEnterSignal(Execution token)
       {
         Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_GATEWAY_ENTER, getKey());
         sigService.throwSignal(signal);
       }
 
-      public void throwExitSignal(Token token)
+      public void throwExitSignal(Execution token)
       {
         Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_GATEWAY_EXIT, getKey());
         sigService.throwSignal(signal);

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -37,11 +37,11 @@
 import org.jbpm.api.model.Expression.ExpressionLanguage;
 import org.jbpm.api.model.SequenceFlow.ConditionType;
 import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Execution;
 import org.jbpm.api.runtime.Attachments.Key;
+import org.jbpm.api.runtime.internal.ExecutionContext;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 import org.jbpm.ri.runtime.MutableToken;
 import org.mvel.MVEL;
 import org.slf4j.Logger;
@@ -81,7 +81,7 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(TokenExecutor tokenExecutor, Token token)
+      public void execute(TokenExecutor tokenExecutor, Execution token)
       {
         MutableToken mutableToken = (MutableToken)token;
         String sourceRef = token.getSequenceFlow().getSourceRef();
@@ -98,15 +98,15 @@
         }
         else
         {
-          List<Token> outTokens = new ArrayList<Token>();
+          List<Execution> outTokens = new ArrayList<Execution>();
           for (SequenceFlow auxGate : applicableGates)
           {
             SequenceFlow outFlow = auxGate;
-            Token outToken = mutableToken.copyToken();
+            Execution outToken = mutableToken.copyToken();
             tokenExecutor.create(outToken, outFlow);
             outTokens.add(outToken);
           }
-          for (Token outToken : outTokens)
+          for (Execution outToken : outTokens)
           {
             tokenExecutor.start(outToken);
           }
@@ -134,7 +134,7 @@
   // Get applicable gates which' condition evaluates to TRUE.
   // Fall back to the default gate if there is one.
   // Choke if there is no applicable gate.
-  private List<SequenceFlow> getApplicableGates(Token token)
+  private List<SequenceFlow> getApplicableGates(Execution token)
   {
     List<SequenceFlow> applicableGates = new ArrayList<SequenceFlow>();
     for (SequenceFlow auxGate : getGates())

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -47,20 +47,20 @@
 import org.jbpm.api.model.EndEvent;
 import org.jbpm.api.model.Group;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Property;
 import org.jbpm.api.model.SequenceFlow;
 import org.jbpm.api.model.StartEvent;
 import org.jbpm.api.model.internal.ProcessStructure;
 import org.jbpm.api.model.internal.PropertySupport;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.NodeHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
-import org.jbpm.api.runtime.Token.TokenStatus;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.Execution.ExecutionStatus;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.NodeHandler;
+import org.jbpm.api.runtime.internal.SignalHandler;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 import org.jbpm.ri.model.builder.MultipleInFlowSupport;
 import org.jbpm.ri.model.builder.MultipleOutFlowSupport;
 import org.jbpm.ri.model.builder.SingleInFlowSupport;
@@ -129,7 +129,7 @@
   private ProcessDefinition procDef;
 
   @ManyToOne(targetEntity = ProcessImpl.class)
-  private Process proc;
+  private ProcessInstance proc;
 
   @ManyToOne(targetEntity = GroupImpl.class)
   private Group groupRef;
@@ -152,7 +152,7 @@
   }
 
   @Override
-  public Process getProcess()
+  public ProcessInstance getProcess()
   {
     return proc;
   }
@@ -248,7 +248,7 @@
 
   public void execute(RuntimeContext rtContext)
   {
-    Token token = rtContext.getToken();
+    Execution token = rtContext.getToken();
 
     // The default implementation calls the ExecutionHandler
     ExecutionHandler execHandler = getExecutionHandler();
@@ -289,7 +289,7 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(Token token)
+      public void execute(Execution token)
       {
         // nothing to do
       }
@@ -340,12 +340,12 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(TokenExecutor tokenExecutor, Token token)
+      public void execute(TokenExecutor tokenExecutor, Execution token)
       {
         if (getOutFlows().size() == 1)
         {
           SequenceFlow outFlow = getOutFlows().get(0);
-          if (token.getTokenStatus() == TokenStatus.Started)
+          if (token.getStatus() == ExecutionStatus.Started)
             tokenExecutor.move(token, outFlow);
         }
         else
@@ -396,7 +396,7 @@
   }
 
   @Override
-  protected void create(Process proc)
+  protected void create(ProcessInstance proc)
   {
     super.create(proc);
     this.proc = proc;

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -35,10 +35,10 @@
 import org.jbpm.api.model.ParallelGateway;
 import org.jbpm.api.model.SequenceFlow;
 import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 import org.jbpm.ri.runtime.MutableToken;
 import org.jbpm.ri.runtime.TokenImpl;
 import org.slf4j.Logger;
@@ -63,7 +63,7 @@
   private Set<SequenceFlow> outstandingFlows;
   
   @Transient
-  private Set<Token> mergeTokens;
+  private Set<Execution> mergeTokens;
 
   public ParallelGatewayImpl(ProcessStructure procStruct, String name)
   {
@@ -85,7 +85,7 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(Token token)
+      public void execute(Execution token)
       {
         // Call the super default handler
         superExecHandler.execute(token);
@@ -94,7 +94,7 @@
         if (outstandingFlows == null)
         {
           outstandingFlows = new HashSet<SequenceFlow>(inFlows);
-          mergeTokens = new HashSet<Token>();
+          mergeTokens = new HashSet<Execution>();
         }
 
         SequenceFlow flow = token.getSequenceFlow();
@@ -123,7 +123,7 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(TokenExecutor tokenExecutor, Token token)
+      public void execute(TokenExecutor tokenExecutor, Execution token)
       {
         // In any case, the incomming token is not propagated
         tokenExecutor.suspend(token);
@@ -152,7 +152,7 @@
         if (outToken != null)
         {
           // Start a copy of the outgoing token for every gate
-          List<Token> outTokens = new ArrayList<Token>();
+          List<Execution> outTokens = new ArrayList<Execution>();
           for(SequenceFlow auxGate : getGates())
           {
             SequenceFlow outFlow = auxGate;
@@ -160,13 +160,13 @@
             tokenExecutor.create(outToken, outFlow);
             outTokens.add(outToken);
           }
-          for (Token auxToken : outTokens)
+          for (Execution auxToken : outTokens)
           {
             tokenExecutor.start(auxToken);
           }
           
           // Destroy the received tokens
-          for (Token auxToken : receivedTokens)
+          for (Execution auxToken : receivedTokens)
           {
             tokenExecutor.destroy(auxToken);
           }
@@ -200,7 +200,7 @@
   private TokenImpl getMergedTokens()
   {
     TokenImpl mergedToken = new TokenImpl(getProcess(), null);
-    for (Token auxToken : mergeTokens)
+    for (Execution auxToken : mergeTokens)
     {
       log.debug("mergeToken: " + auxToken);
       mergedToken.mergeToken(auxToken);

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -46,7 +46,7 @@
 import org.jbpm.api.model.Group;
 import org.jbpm.api.model.Message;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Property;
 import org.jbpm.api.model.builder.ObjectNameFactory;
@@ -87,7 +87,7 @@
   }
 
   @Override
-  public Process newInstance()
+  public ProcessInstance newInstance()
   {
     // Create a copy of the process structure from raw data
     ProcessStructureImpl procStructCopy;

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -43,7 +43,7 @@
 import org.jbpm.api.model.Group;
 import org.jbpm.api.model.Message;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Property;
 import org.jbpm.api.model.builder.ObjectNameFactory;
@@ -60,7 +60,7 @@
  * @since 08-Jul-2008
  */
 @Entity(name = "BPMProcess")
-public class ProcessImpl extends AbstractElementImpl implements Process
+public class ProcessImpl extends AbstractElementImpl implements ProcessInstance
 {
   private static final long serialVersionUID = 1L;
 
@@ -284,28 +284,28 @@
   }
   
   @Override
-  protected void create(Process proc)
+  protected void create(ProcessInstance proc)
   {
     super.create(proc);
     procStruct.create(proc);
   }
 
   @Override
-  public void register(Process proc)
+  public void register(ProcessInstance proc)
   {
     super.register(proc);
     procStruct.register(proc);
   }
 
   @Override
-  public void unregister(Process proc)
+  public void unregister(ProcessInstance proc)
   {
     super.unregister(proc);
     procStruct.unregister(proc);
   }
 
   @Override
-  protected void destroy(Process proc)
+  protected void destroy(ProcessInstance proc)
   {
     super.destroy(proc);
     procStruct.destroy(proc);

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -47,7 +47,7 @@
 import org.jbpm.api.model.Group;
 import org.jbpm.api.model.Message;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Property;
 import org.jbpm.api.model.StartEvent;
@@ -359,7 +359,7 @@
   }
 
   @Override
-  protected void create(Process proc)
+  protected void create(ProcessInstance proc)
   {
     super.create(proc);
     for (Node node : getNodes())
@@ -370,7 +370,7 @@
   }
 
   @Override
-  protected void register(Process proc)
+  protected void register(ProcessInstance proc)
   {
     super.register(proc);
     for (Node node : getNodes())
@@ -381,7 +381,7 @@
   }
 
   @Override
-  protected void unregister(Process proc)
+  protected void unregister(ProcessInstance proc)
   {
     super.unregister(proc);
     for (Node node : getNodes())
@@ -392,7 +392,7 @@
   }
 
   @Override
-  protected void destroy(Process proc)
+  protected void destroy(ProcessInstance proc)
   {
     super.destroy(proc);
     for (Node node : getNodes())

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -31,15 +31,15 @@
 
 import org.jbpm.api.InvalidProcessException;
 import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.client.MessageListener;
+import org.jbpm.api.client.preliminary.MessageListener;
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.ReceiveTask;
 import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionContext;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 import org.jbpm.ri.runtime.RuntimeContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -65,7 +65,7 @@
   private List<Message> receivedMessages = new ArrayList<Message>();
 
   @Transient
-  private transient Token suspendedToken;
+  private transient Execution suspendedToken;
 
   @Transient
   private transient TokenExecutor tokenExecutor;
@@ -100,7 +100,7 @@
   @Override
   public void execute(RuntimeContext rtContext)
   {
-    Token token = rtContext.getToken();
+    Execution token = rtContext.getToken();
     tokenExecutor = rtContext.getTokenExecutor();
     
     if (receivedMessages.size() > 0)
@@ -142,7 +142,7 @@
       // Activate the suspended token
       if (suspendedToken != null)
       {
-        tokenExecutor.activate(suspendedToken.getTokenID());
+        tokenExecutor.activate(suspendedToken.getID());
         suspendedToken = null;
       }
     }
@@ -165,7 +165,7 @@
   }
 
   @Override
-  protected void create(Process proc)
+  protected void create(ProcessInstance proc)
   {
     super.create(proc);
 

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -29,12 +29,12 @@
 import org.jbpm.api.InvalidProcessException;
 import org.jbpm.api.model.Message;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.SendTask;
 import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
 import org.jbpm.ri.runtime.MessageSender;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -83,7 +83,7 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(Token token)
+      public void execute(Execution token)
       {
         Message messageRef = thisNode.getMessageRef();
         MessageSender messageSender = new MessageSender(thisNode, messageRef);
@@ -119,7 +119,7 @@
   }
 
   @Override
-  protected void create(Process proc)
+  protected void create(ProcessInstance proc)
   {
     super.create(proc);
 

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -30,9 +30,9 @@
 import org.jbpm.api.Constants;
 import org.jbpm.api.InvalidProcessException;
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.client.preliminary.SignalListener;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.SequenceFlow;
 import org.jbpm.api.model.Signal;
@@ -40,8 +40,8 @@
 import org.jbpm.api.model.Signal.SignalType;
 import org.jbpm.api.model.builder.ObjectNameFactory;
 import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.SignalHandler;
 import org.jbpm.api.service.ExecutionService;
 import org.jbpm.api.service.SignalService;
 import org.jbpm.ri.model.builder.SingleOutFlowSupport;
@@ -123,13 +123,13 @@
       ProcessEngine engine = getProcessDefinition().getProcessEngine();
       SignalService sigService = engine.getService(SignalService.class);
 
-      public void throwEnterSignal(Token token)
+      public void throwEnterSignal(Execution token)
       {
         Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_START_EVENT_ENTER, getKey());
         sigService.throwSignal(signal);
       }
 
-      public void throwExitSignal(Token token)
+      public void throwExitSignal(Execution token)
       {
         Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_START_EVENT_EXIT, getKey());
         sigService.throwSignal(signal);
@@ -187,7 +187,7 @@
 
             // There MAY be multiple Start Events for a given Process level. Each Start Event is an independent event. 
             // That is, a Process Instance SHALL be generated when the Start Event is triggered.
-            Process proc = procDef.newInstance();
+            ProcessInstance proc = procDef.newInstance();
             StartEvent startEvent = proc.getNode(StartEvent.class, startEventName);
             
             ExecutionService execService = engine.getService(ExecutionService.class);

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -50,10 +50,10 @@
 import org.jbpm.api.model.Task;
 import org.jbpm.api.model.builder.ObjectNameFactory;
 import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionContext;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.SignalHandler;
 import org.jbpm.api.service.SignalService;
 import org.jbpm.ri.model.builder.SingleInFlowSupport;
 import org.jbpm.ri.model.builder.SingleOutFlowSupport;
@@ -187,7 +187,7 @@
     {
       private static final long serialVersionUID = 1L;
 
-      public void execute(Token token)
+      public void execute(Execution token)
       {
         superExecHandler.execute(token);
         processOutputSet(token);
@@ -209,7 +209,7 @@
   /**
    * Select and validate active inputSet
    */
-  protected InputSet getActiveInputSet(Token token)
+  protected InputSet getActiveInputSet(Execution token)
   {
     InputSetImpl inputSet = null;
     ExecutionContext exContext = token.getExecutionContext();
@@ -280,7 +280,7 @@
   /**
    * Transfer data from outputSet to Token
    */
-  protected void processOutputSet(Token token)
+  protected void processOutputSet(Execution token)
   {
     ExecutionContext exContext = token.getExecutionContext();
 
@@ -308,13 +308,13 @@
       
       ProcessEngine engine = getProcessEngine();
       SignalService sigService = engine.getService(SignalService.class);
-      public void throwEnterSignal(Token token)
+      public void throwEnterSignal(Execution token)
       {
         Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_TASK_ENTER, getKey());
         sigService.throwSignal(signal);
       }
 
-      public void throwExitSignal(Token token)
+      public void throwExitSignal(Execution token)
       {
         Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_TASK_EXIT, getKey());
         sigService.throwSignal(signal);

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -33,16 +33,16 @@
 import javax.persistence.Transient;
 
 import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.MessageListener;
-import org.jbpm.api.client.UserTaskCallback;
+import org.jbpm.api.client.preliminary.MessageListener;
+import org.jbpm.api.client.preliminary.UserTaskCallback;
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.UserTask;
 import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionContext;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 import org.jbpm.ri.runtime.MessageSender;
 import org.jbpm.ri.runtime.RuntimeContext;
 import org.slf4j.Logger;
@@ -71,7 +71,7 @@
   private List<Message> receivedMessages = new ArrayList<Message>();
 
   @Transient
-  private transient Token suspendedToken;
+  private transient Execution suspendedToken;
 
   @Transient
   private transient TokenExecutor tokenExecutor;
@@ -126,7 +126,7 @@
   @Override
   public void execute(RuntimeContext rtContext)
   {
-    Token token = rtContext.getToken();
+    Execution token = rtContext.getToken();
     tokenExecutor = rtContext.getTokenExecutor();
 
     if (receivedMessages.size() == 0)
@@ -176,7 +176,7 @@
       // Activate the suspended token
       if (suspendedToken != null)
       {
-        tokenExecutor.activate(suspendedToken.getTokenID());
+        tokenExecutor.activate(suspendedToken.getID());
         suspendedToken = null;
       }
     }
@@ -202,7 +202,7 @@
   }
 
   @Override
-  protected void create(Process proc)
+  protected void create(ProcessInstance proc)
   {
     super.create(proc);
 
@@ -212,7 +212,7 @@
   }
 
   @Override
-  protected void register(Process proc)
+  protected void register(ProcessInstance proc)
   {
     super.register(proc);
     
@@ -227,7 +227,7 @@
   }
 
   @Override
-  protected void unregister(Process proc)
+  protected void unregister(ProcessInstance proc)
   {
     super.unregister(proc);
 

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -25,7 +25,7 @@
 
 import org.jbpm.api.NotImplementedException;
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Assignment.AssignTime;
 import org.jbpm.api.model.Event.EventDetailType;
@@ -39,9 +39,9 @@
 import org.jbpm.api.model.builder.MessageBuilder;
 import org.jbpm.api.model.builder.ProcessBuilder;
 import org.jbpm.api.model.builder.TaskBuilder;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.SignalHandler;
 import org.jbpm.ri.model.AssignmentImpl;
 import org.jbpm.ri.model.ComplexGatewayImpl;
 import org.jbpm.ri.model.EndEventImpl;
@@ -63,7 +63,7 @@
 import org.jbpm.ri.model.UserTaskImpl;
 
 /**
- * The ProcessBuilder can be used to dynamically build a {@link Process}.
+ * The ProcessBuilder can be used to dynamically build a {@link ProcessInstance}.
  * 
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -27,8 +27,8 @@
 import org.jbpm.api.model.Expression;
 import org.jbpm.api.model.Node;
 import org.jbpm.api.model.Assignment.AssignTime;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionContext;
 
 /**
  * An interceptor that invokes the ExecutionHandler.execute
@@ -42,7 +42,7 @@
   public void execute(RuntimeContext rtContext)
   {
     Node node = rtContext.getNode();
-    Token token = rtContext.getToken();
+    Execution token = rtContext.getToken();
 
     // Do start time assignments
     for (Assignment ass : node.getAssignments())
@@ -62,7 +62,7 @@
     }
   }
 
-  protected void anyTimeAssignment(Assignment ass, Token token)
+  protected void anyTimeAssignment(Assignment ass, Execution token)
   {
     Expression expr = ass.getFrom();
     ExpressionEvaluator exprEvaluator = new ExpressionEvaluator(expr);

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -29,13 +29,13 @@
 import java.util.Map;
 
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Property;
-import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.runtime.internal.ExecutionContext;
 
 /**
- * An ExecutionContext that delegates to the current {@link Node} or {@link Process} for property rerieval.
+ * An ExecutionContext that delegates to the current {@link Node} or {@link ProcessInstance} for property rerieval.
  * 
  * @author Thomas.Diesler at jboss.com
  * @since 15-Aug-2008

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -25,13 +25,13 @@
 
 import org.hibernate.Session;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionContext;
 
 /**
- * A {@link Token} that includes properties from the current {@link Node}
+ * A {@link Execution} that includes properties from the current {@link Node}
  * 
  * @author Thomas.Diesler at jboss.com
  * @since 15-Aug-2008
@@ -46,7 +46,7 @@
     this.delegateToken = token;
 
     String targetRef = token.getSequenceFlow().getTargetRef();
-    Node targetNode = token.getProcess().getNode(targetRef);
+    Node targetNode = token.getProcessInstance().getNode(targetRef);
     ExecutionContext exContext = token.getExecutionContext();
     this.delegateContext = new DelegatingExecutionContext(targetNode, exContext);
   }
@@ -72,23 +72,23 @@
   @Override
   public String getTokenID()
   {
-    return delegateToken.getTokenID();
+    return delegateToken.getID();
   }
 
   @Override
-  public TokenStatus getTokenStatus()
+  public ExecutionStatus getTokenStatus()
   {
-    return delegateToken.getTokenStatus();
+    return delegateToken.getStatus();
   }
 
   @Override
-  public Process getProcess()
+  public ProcessInstance getProcess()
   {
-    return delegateToken.getProcess();
+    return delegateToken.getProcessInstance();
   }
 
   @Override
-  public void mergeToken(Token token)
+  public void mergeToken(Execution token)
   {
     delegateToken.mergeToken(token);
   }
@@ -100,7 +100,7 @@
   }
 
   @Override
-  public void setTokenStatus(TokenStatus status)
+  public void setTokenStatus(ExecutionStatus status)
   {
     delegateToken.setTokenStatus(status);
   }

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -24,8 +24,8 @@
 //$Id$
 
 import org.jbpm.api.model.Node;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.SignalHandler;
 
 /**
  * An interceptor that invokes the SignalHandler.throwExitSignal 
@@ -39,7 +39,7 @@
   public void execute(RuntimeContext rtContext)
   {
     Node node = rtContext.getNode();
-    Token token = rtContext.getToken();
+    Execution token = rtContext.getToken();
     
     SignalHandler sigHandler = node.getSignalHandler();
     sigHandler.throwExitSignal(token);

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -28,9 +28,9 @@
 
 import org.jbpm.api.model.Expression;
 import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
 import org.jbpm.api.runtime.Attachments.Key;
+import org.jbpm.api.runtime.internal.ExecutionContext;
 import org.mvel.MVEL;
 
 /**
@@ -52,7 +52,7 @@
    * Evaluate an expression for a given token. <p/> Note that <code>propName.replace(".", "_")</code> applies to
    * property names for MVEL expressions, because the dot notation has special meaning in MVEL.
    */
-  public Object evaluateExpression(Token token)
+  public Object evaluateExpression(Execution token)
   {
     ExpressionLanguage exprLang = expr.getExpressionLanguage();
     if (exprLang == ExpressionLanguage.MVEL)

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -24,9 +24,9 @@
 //$Id$
 
 import org.jbpm.api.model.Node;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 
 /**
  * An interceptor that invokes the FlowHandler.execute 
@@ -41,7 +41,7 @@
   {
     TokenExecutor tokenExecutor = rtContext.getTokenExecutor();
     Node node = rtContext.getNode();
-    Token token = rtContext.getToken();
+    Execution token = rtContext.getToken();
     
     // Call the next Interceptor
     rtContext.next();

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -31,8 +31,8 @@
 import org.jbpm.api.model.Participant;
 import org.jbpm.api.model.Property;
 import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionContext;
 import org.jbpm.api.service.MessageService;
 import org.jbpm.ri.model.MessageImpl;
 import org.jbpm.ri.model.ParticipantImpl;
@@ -65,7 +65,7 @@
    * Extract message content from the token and send the message
    * to it's recipient.
    */
-  public void sendMessage(Token token)
+  public void sendMessage(Execution token)
   {
     ExecutionContext exContext = token.getExecutionContext();
     MessageBuilder msgBuilder = new MessageBuilderImpl();

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -25,7 +25,7 @@
 
 import org.hibernate.Session;
 import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
 
 /**
  * A mutable extension to the Token.
@@ -33,12 +33,12 @@
  * @author Thomas.Diesler at jboss.com
  * @since 20-Apr-2007
  */
-public interface MutableToken extends Token
+public interface MutableToken extends Execution
 {
   /**
    * Set the token status
    */
-  void setTokenStatus(TokenStatus status);
+  void setTokenStatus(ExecutionStatus status);
 
   /**
    * Set the associated session
@@ -59,5 +59,5 @@
   /**
    * Merge this Token with another token.
    */
-  void mergeToken(Token token);
+  void mergeToken(Execution token);
 }
\ No newline at end of file

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -26,7 +26,7 @@
 import org.hibernate.Session;
 import org.jbpm.api.client.ProcessEngine;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.runtime.Token.TokenStatus;
+import org.jbpm.api.runtime.Execution.ExecutionStatus;
 import org.jbpm.api.service.PersistenceService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -64,8 +64,8 @@
     }
     finally
     {
-      TokenStatus status = token.getTokenStatus();
-      if (status == TokenStatus.Destroyed || status == TokenStatus.Suspended)
+      ExecutionStatus status = token.getStatus();
+      if (status == ExecutionStatus.Destroyed || status == ExecutionStatus.Suspended)
       {
         session.close();
         token.setSession(null);

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -22,12 +22,12 @@
 package org.jbpm.ri.runtime;
 
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Process.ProcessStatus;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
-import org.jbpm.api.runtime.Token.TokenStatus;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.Execution.ExecutionStatus;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 import org.jbpm.api.service.ProcessService;
 import org.jbpm.ri.model.ProcessImpl;
 import org.jbpm.ri.service.ProcessServiceImpl;
@@ -57,7 +57,7 @@
     this.token = token;
   }
 
-  public Token getToken()
+  public Execution getToken()
   {
     return token;
   }
@@ -69,7 +69,7 @@
 
   public void run()
   {
-    Process proc = rtProc.getProcess();
+    ProcessInstance proc = rtProc.getProcess();
     try
     {
       SequenceFlow flow = token.getSequenceFlow();
@@ -105,9 +105,9 @@
       ((ProcessImpl)proc).setRuntimeException(rte);
 
       log.debug("Terminate all suspended tokens");
-      for (Token auxToken : tokenExecutor.getRunnableTokens())
+      for (Execution auxToken : tokenExecutor.getRunnableTokens())
       {
-        if (auxToken.getTokenStatus() == TokenStatus.Suspended)
+        if (auxToken.getStatus() == ExecutionStatus.Suspended)
           tokenExecutor.destroy(auxToken);
       }
       
@@ -123,9 +123,9 @@
 
   private boolean continueTokenThread()
   {
-    TokenStatus tokStatus = token.getTokenStatus();
+    ExecutionStatus tokStatus = token.getStatus();
     ProcessStatus procStatus = rtProc.getProcess().getProcessStatus();
-    return releaseThread == false && procStatus == ProcessStatus.Active && tokStatus == TokenStatus.Started;
+    return releaseThread == false && procStatus == ProcessStatus.Active && tokStatus == ExecutionStatus.Started;
   }
 
   private void notifyRuntimeProcess()

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -27,8 +27,8 @@
 import java.util.List;
 
 import org.jbpm.api.model.Node;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 
 /**
  * A runtime context that passes through a chain of interceptors.
@@ -58,10 +58,10 @@
   public Node getNode()
   {
     String targetRef = token.getSequenceFlow().getTargetRef();
-    return token.getProcess().getNode(targetRef);
+    return token.getProcessInstance().getNode(targetRef);
   }
 
-  public Token getToken()
+  public Execution getToken()
   {
     return token;
   }

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -23,12 +23,12 @@
 
 //$Id$
 
-import org.jbpm.api.model.Process;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 
 /**
- * A RuntimeProcess add runtime behaviour to the {@link Process} <p/> To protect the engine from maligious user code it
- * does not extend {@link Process} directly.
+ * A RuntimeProcess add runtime behaviour to the {@link ProcessInstance} <p/> To protect the engine from maligious user code it
+ * does not extend {@link ProcessInstance} directly.
  * 
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008
@@ -36,12 +36,12 @@
 public interface RuntimeProcess
 {
   /**
-   * Get the associated {@link Process}
+   * Get the associated {@link ProcessInstance}
    */
-  Process getProcess();
+  ProcessInstance getProcess();
 
   /**
-   * Get the {@link TokenExecutor} for this {@link Process}
+   * Get the {@link TokenExecutor} for this {@link ProcessInstance}
    */
   TokenExecutor getTokenExecutor();
 }
\ No newline at end of file

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -23,27 +23,27 @@
 
 //$Id$
 
-import org.jbpm.api.model.Process;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 
 /**
- * A RuntimeProcess add runtime behaviour to the {@link Process}
+ * A RuntimeProcess add runtime behaviour to the {@link ProcessInstance}
  * 
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008
  */
 public class RuntimeProcessImpl implements RuntimeProcess
 {
-  private Process proc;
+  private ProcessInstance proc;
   private TokenExecutor tokenExecutor;
 
-  public RuntimeProcessImpl(Process proc)
+  public RuntimeProcessImpl(ProcessInstance proc)
   {
     this.proc = proc;
     this.tokenExecutor = new TokenExecutorImpl(this);
   }
 
-  public Process getProcess()
+  public ProcessInstance getProcess()
   {
     return proc;
   }

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -24,8 +24,8 @@
 //$Id$
 
 import org.jbpm.api.model.Node;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.SignalHandler;
 
 /**
  * An interceptor that invokes the SignalHandler.throwEnterSignal 
@@ -39,7 +39,7 @@
   public void execute(RuntimeContext rtContext)
   {
     Node node = rtContext.getNode();
-    Token token = rtContext.getToken();
+    Execution token = rtContext.getToken();
     
     try
     {

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -32,17 +32,17 @@
 import java.util.concurrent.Executors;
 
 import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Process.ProcessStatus;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
-import org.jbpm.api.runtime.Token.TokenStatus;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.Execution.ExecutionStatus;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * The {@link FlowHandler} invokes the TokenExecutor to schedule {@link SequenceFlow} objects together with their
- * associated {@link Token}.
+ * associated {@link Execution}.
  * 
  * @author thomas.diesler at jboss.com
  * @since 08-Jul-2008
@@ -61,11 +61,11 @@
     this.rtProc = rtProc;
   }
 
-  public Set<Token> getRunnableTokens()
+  public Set<Execution> getRunnableTokens()
   {
     synchronized (runnableTokens)
     {
-      Set<Token> tokenSet = new HashSet<Token>();
+      Set<Execution> tokenSet = new HashSet<Execution>();
       for (RunnableToken rt : runnableTokens.values())
         tokenSet.add(rt.getToken());
 
@@ -81,22 +81,22 @@
     }
   }
 
-  public void create(Token token, SequenceFlow initialFlow)
+  public void create(Execution token, SequenceFlow initialFlow)
   {
     synchronized (runnableTokens)
     {
       MutableToken mutableToken = (MutableToken)token;
-      mutableToken.setTokenStatus(TokenStatus.Created);
+      mutableToken.setTokenStatus(ExecutionStatus.Created);
       mutableToken.setSequenceFlow(initialFlow);
 
       log.debug("Create Token: " + token);
 
       RunnableToken rtToken = new RunnableToken(this, rtProc, mutableToken);
-      runnableTokens.put(token.getTokenID(), rtToken);
+      runnableTokens.put(token.getID(), rtToken);
     }
   }
 
-  public void start(Token token)
+  public void start(Execution token)
   {
     synchronized (runnableTokens)
     {
@@ -106,69 +106,69 @@
 
       log.debug("Start Token: " + token);
       MutableToken mutableToken = (MutableToken)token;
-      mutableToken.setTokenStatus(TokenStatus.Started);
+      mutableToken.setTokenStatus(ExecutionStatus.Started);
 
-      RunnableToken rtToken = runnableTokens.get(token.getTokenID());
+      RunnableToken rtToken = runnableTokens.get(token.getID());
       executor.submit(rtToken);
     }
   }
 
-  public void move(Token token, SequenceFlow flow)
+  public void move(Execution token, SequenceFlow flow)
   {
     synchronized (runnableTokens)
     {
       if (flow == null)
         throw new IllegalArgumentException("Flow cannot be null");
 
-      if (token.getTokenStatus() != TokenStatus.Started)
-        throw new IllegalStateException("Cannot move token in state: " + token.getTokenStatus());
+      if (token.getStatus() != ExecutionStatus.Started)
+        throw new IllegalStateException("Cannot move token in state: " + token.getStatus());
 
       MutableToken mutableToken = (MutableToken)token;
       mutableToken.setSequenceFlow(flow);
     }
   }
 
-  public void stop(Token token)
+  public void stop(Execution token)
   {
     synchronized (runnableTokens)
     {
       log.debug("Stop Token: " + token);
       MutableToken mutableToken = (MutableToken)token;
-      mutableToken.setTokenStatus(TokenStatus.Stoped);
+      mutableToken.setTokenStatus(ExecutionStatus.Stoped);
     }
   }
 
-  public void destroy(Token token)
+  public void destroy(Execution token)
   {
     synchronized (runnableTokens)
     {
       log.debug("Destroy Token: " + token);
       MutableToken mutableToken = (MutableToken)token;
-      mutableToken.setTokenStatus(TokenStatus.Destroyed);
-      runnableTokens.remove(token.getTokenID());
+      mutableToken.setTokenStatus(ExecutionStatus.Destroyed);
+      runnableTokens.remove(token.getID());
     }
   }
 
-  public String suspend(Token token)
+  public String suspend(Execution token)
   {
     synchronized (runnableTokens)
     {
-      RunnableToken rtToken = runnableTokens.get(token.getTokenID());
+      RunnableToken rtToken = runnableTokens.get(token.getID());
       if (rtToken == null)
         throw new IllegalStateException("Not a runnable token: " + token);
 
       log.debug("Suspend Token: " + token);
       MutableToken mutableToken = (MutableToken)token;
-      mutableToken.setTokenStatus(TokenStatus.Suspended);
+      mutableToken.setTokenStatus(ExecutionStatus.Suspended);
 
       // Release the thread for a suspended token
       rtToken.releaseThread();
 
-      return token.getTokenID();
+      return token.getID();
     }
   }
 
-  public Token activate(String tokenID)
+  public Execution activate(String tokenID)
   {
     synchronized (runnableTokens)
     {
@@ -176,16 +176,16 @@
       if (rtToken == null)
         throw new IllegalStateException("Not a runnable token: " + tokenID);
 
-      Token token = rtToken.getToken();
-      if (token.getTokenStatus() != TokenStatus.Suspended)
-        throw new IllegalStateException("Activate token in state: " + token.getTokenStatus());
+      Execution token = rtToken.getToken();
+      if (token.getStatus() != ExecutionStatus.Suspended)
+        throw new IllegalStateException("Activate token in state: " + token.getStatus());
 
       log.debug("Activate Token: " + token);
       MutableToken mutableToken = (MutableToken)token;
-      mutableToken.setTokenStatus(TokenStatus.Started);
+      mutableToken.setTokenStatus(ExecutionStatus.Started);
 
       rtToken = new RunnableToken(this, rtProc, mutableToken);
-      runnableTokens.put(token.getTokenID(), rtToken);
+      runnableTokens.put(token.getID(), rtToken);
       executor.submit(rtToken);
 
       return token;

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -25,13 +25,13 @@
 
 import org.hibernate.Session;
 import org.jboss.util.id.UID;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.SequenceFlow;
 import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.BasicExecutionContext;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
 import org.jbpm.api.runtime.Attachments.Key;
+import org.jbpm.api.runtime.internal.BasicExecutionContext;
+import org.jbpm.api.runtime.internal.ExecutionContext;
 
 /**
  * A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
@@ -50,18 +50,18 @@
   private String id;
   private SequenceFlow flow;
   private ExecutionContext context;
-  private TokenStatus status;
-  private Process process;
+  private ExecutionStatus status;
+  private ProcessInstance process;
   private Session session;
 
   /**
    * Construct a Token with given {@link Attachments}
    */
-  public TokenImpl(Process process, Attachments att)
+  public TokenImpl(ProcessInstance process, Attachments att)
   {
     this.context = new BasicExecutionContext(att);
     this.id = new UID().toString();
-    this.status = TokenStatus.Created;
+    this.status = ExecutionStatus.Created;
     this.process = process;
   }
 
@@ -72,19 +72,19 @@
   }
 
   @Override
-  public TokenStatus getTokenStatus()
+  public ExecutionStatus getTokenStatus()
   {
     return status;
   }
 
   @Override
-  public void setTokenStatus(TokenStatus status)
+  public void setTokenStatus(ExecutionStatus status)
   {
     this.status = status;
   }
   
   @Override
-  public Process getProcess()
+  public ProcessInstance getProcess()
   {
     return process;
   }
@@ -126,7 +126,7 @@
   }
   
   @Override
-  public void mergeToken(Token token)
+  public void mergeToken(Execution token)
   {
     ExecutionContext mergeContext = token.getExecutionContext();
     for(Key key : mergeContext.getAttachmentKeys())
@@ -142,6 +142,6 @@
   
   public String toString()
   {
-    return "[sf=" + getSequenceFlow() + ",status=" + getTokenStatus() + ",ctx=" + getExecutionContext() + ",id=" + id + "]";
+    return "[sf=" + getSequenceFlow() + ",status=" + getStatus() + ",ctx=" + getExecutionContext() + ",id=" + id + "]";
   }
 }
\ No newline at end of file

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -33,7 +33,7 @@
 import org.jbpm.api.model.Node;
 import org.jbpm.api.model.Property;
 import org.jbpm.api.model.Group.GroupType;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Execution;
 import org.jbpm.api.service.PersistenceService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -52,7 +52,7 @@
   public void execute(RuntimeContext rtContext)
   {
     Node node = rtContext.getNode();
-    Token token = rtContext.getToken();
+    Execution token = rtContext.getToken();
     Session session = token.getSession();
 
     // Get the Thread associated Tx

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -35,16 +35,16 @@
 import org.jbpm.api.client.ProcessEngine;
 import org.jbpm.api.model.Assignment;
 import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.StartEvent;
 import org.jbpm.api.model.Assignment.AssignTime;
 import org.jbpm.api.model.Event.EventDetailType;
-import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
 import org.jbpm.api.model.Signal.SignalType;
 import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionContext;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 import org.jbpm.api.service.ExecutionService;
 import org.jbpm.api.service.ProcessService;
 import org.jbpm.api.service.SignalService;
@@ -81,7 +81,7 @@
   }
 
   @Override
-  public void startProcess(Process proc, Attachments att)
+  public void startProcess(ProcessInstance proc, Attachments att)
   {
     // Get the None Start Event if there is one and start the initial flow
     StartEvent start = getNoneStartEvent(proc);
@@ -98,12 +98,12 @@
   }
 
   @Override
-  public void startProcess(Process proc, StartEvent start, Attachments att)
+  public void startProcess(ProcessInstance proc, StartEvent start, Attachments att)
   {
     startProcessInternal(proc, start, att);
   }
 
-  private synchronized void startProcessInternal(Process proc, StartEvent start, Attachments att)
+  private synchronized void startProcessInternal(ProcessInstance proc, StartEvent start, Attachments att)
   {
     // Prepare the process to start
     startProcessPrepare(proc);
@@ -158,7 +158,7 @@
     tokenExecutor.start(initialToken);
   }
 
-  private void startProcessPrepare(Process proc)
+  private void startProcessPrepare(ProcessInstance proc)
   {
     // Veriy the process state
     ProcessStatus procStatus = proc.getProcessStatus();
@@ -173,7 +173,7 @@
   }
 
   // Evaluate the Start time assignments
-  private void startTimeAssignments(Process proc, Token token)
+  private void startTimeAssignments(ProcessInstance proc, Execution token)
   {
     DelegatingToken delegatingToken = new DelegatingToken((MutableToken)token);
     ExecutionContext exContext = token.getExecutionContext();
@@ -190,12 +190,12 @@
     }
   }
 
-  public ProcessStatus waitForEnd(Process proc)
+  public ProcessStatus waitForEnd(ProcessInstance proc)
   {
     return waitForEndInternal(proc, 0);
   }
 
-  public ProcessStatus waitForEnd(Process proc, long timeout)
+  public ProcessStatus waitForEnd(ProcessInstance proc, long timeout)
   {
     return waitForEndInternal(proc, timeout);
   }
@@ -205,7 +205,7 @@
    * arrive at an End Event. The Process will be in a running state until all Tokens are consumed. If the process was
    * aborted this method throws the causing RuntimeException if avaialable.
    */
-  private ProcessStatus waitForEndInternal(Process proc, long timeout)
+  private ProcessStatus waitForEndInternal(ProcessInstance proc, long timeout)
   {
     ProcessImpl procImpl = (ProcessImpl)proc;
 
@@ -270,13 +270,13 @@
     return status;
   }
 
-  private boolean isProcessTerminated(Process proc)
+  private boolean isProcessTerminated(ProcessInstance proc)
   {
     ProcessStatus status = proc.getProcessStatus();
     return status == ProcessStatus.Cancelled || status == ProcessStatus.Completed || status == ProcessStatus.Aborted;
   }
 
-  private StartEvent getNoneStartEvent(Process proc)
+  private StartEvent getNoneStartEvent(ProcessInstance proc)
   {
     StartEvent start = null;
     for (StartEvent aux : proc.getNodes(StartEvent.class))
@@ -291,7 +291,7 @@
     return start;
   }
 
-  private RuntimeProcess getRuntimeProcess(Process proc, boolean createNew)
+  private RuntimeProcess getRuntimeProcess(ProcessInstance proc, boolean createNew)
   {
     RuntimeProcess rtProcess;
     synchronized (runtimeProcesses)
@@ -322,7 +322,7 @@
     {
       TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
       ProcessImpl procImpl = (ProcessImpl)rtProc.getProcess();
-      Process proc = rtProc.getProcess();
+      ProcessInstance proc = rtProc.getProcess();
 
       ProcessEngine engine = getProcessEngine();
       SignalService sigService = engine.getService(SignalService.class);

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -38,7 +38,7 @@
 import org.jbpm.api.ProcessNotFoundException;
 import org.jbpm.api.client.ProcessEngine;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.service.PersistenceService;
 import org.jbpm.api.service.Service;
@@ -151,7 +151,7 @@
   }
 
   @Override
-  public ObjectName saveProcess(Process proc)
+  public ObjectName saveProcess(ProcessInstance proc)
   {
     log.debug("START saveProcess: " + proc.getKey());
     Session session = getSessionFactory().openSession();
@@ -170,15 +170,15 @@
   }
 
   @Override
-  public Process loadProcess(ObjectName procID)
+  public ProcessInstance loadProcess(ObjectName procID)
   {
     log.debug("START loadProcess: " + procID);
-    Process proc = null;
+    ProcessInstance proc = null;
     Session session = getSessionFactory().openSession();
     try
     {
       Integer id = Integer.valueOf(procID.getKeyProperty("id"));
-      proc = (Process)session.load(ProcessImpl.class, id);
+      proc = (ProcessInstance)session.load(ProcessImpl.class, id);
       AbstractElementImpl elImpl = (AbstractElementImpl)proc;
       elImpl.initialize(session);
     }
@@ -195,7 +195,7 @@
   }
 
   @Override
-  public void deleteProcess(Process proc)
+  public void deleteProcess(ProcessInstance proc)
   {
     log.debug("START deleteProcess: " + proc);
     Session session = getSessionFactory().openSession();
@@ -204,7 +204,7 @@
     {
       ObjectName procID = proc.getKey();
       Integer id = Integer.valueOf(procID.getKeyProperty("id"));
-      proc = (Process)session.load(ProcessImpl.class, id);
+      proc = (ProcessInstance)session.load(ProcessImpl.class, id);
       session.delete(proc);
       tx.commit();
     }

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -32,7 +32,7 @@
 import org.jbpm.api.ProcessNotFoundException;
 import org.jbpm.api.client.ProcessEngine;
 import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.service.PersistenceService;
 import org.slf4j.Logger;
@@ -50,7 +50,7 @@
   final Logger log = LoggerFactory.getLogger(InMemoryPersistenceServiceImpl.class);
 
   private Map<ObjectName, ProcessDefinition> procDefs = new HashMap<ObjectName, ProcessDefinition>();
-  private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
+  private Map<ObjectName, ProcessInstance> procs = new HashMap<ObjectName, ProcessInstance>();
   private Map<ObjectName, Node> nodes = new HashMap<ObjectName, Node>();
 
   @Override
@@ -89,7 +89,7 @@
   }
 
   @Override
-  public ObjectName saveProcess(Process proc)
+  public ObjectName saveProcess(ProcessInstance proc)
   {
     procs.put(proc.getKey(), proc);
     
@@ -100,9 +100,9 @@
   }
 
   @Override
-  public Process loadProcess(ObjectName procID)
+  public ProcessInstance loadProcess(ObjectName procID)
   {
-    Process proc = procs.get(procID);
+    ProcessInstance proc = procs.get(procID);
     if (proc == null)
       throw new ProcessNotFoundException("Cannot find process: " + procID);
     
@@ -110,7 +110,7 @@
   }
 
   @Override
-  public void deleteProcess(Process proc)
+  public void deleteProcess(ProcessInstance proc)
   {
     procs.remove(proc.getKey());
     

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -27,8 +27,8 @@
 import javax.transaction.Synchronization;
 
 import org.hibernate.Transaction;
-import org.jbpm.api.client.MessageListener;
 import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.preliminary.MessageListener;
 import org.jbpm.api.model.Message;
 import org.jbpm.api.service.MessageService;
 import org.jbpm.ri.runtime.TransactionAssociation;

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -24,13 +24,13 @@
 // $Id$
 
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.builder.ProcessBuilder;
 import org.jbpm.api.service.ProcessBuilderService;
 import org.jbpm.ri.model.builder.ProcessBuilderImpl;
 
 /**
- * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ * The ProcessBuilder can be used to build a {@link ProcessInstance} dynamically.
  * 
  * @author thomas.diesler at jboss.com
  * @since 18-Jun-2008

Modified: projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -30,8 +30,8 @@
 import javax.management.ObjectName;
 
 import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
 import org.jbpm.api.service.PersistenceService;
 import org.jbpm.api.service.ProcessService;
 import org.jbpm.ri.model.ProcessImpl;
@@ -73,7 +73,7 @@
   }
 
   @Override
-  public ObjectName registerProcess(Process proc)
+  public ObjectName registerProcess(ProcessInstance proc)
   {
     ObjectName procID = super.registerProcess(proc);
     

Modified: projects/spec/branches/tdiesler/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -28,7 +28,7 @@
 import org.jbpm.api.ProcessNotFoundException;
 import org.jbpm.api.client.ProcessEngine;
 import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.StartEvent;
 import org.jbpm.api.model.Task;
@@ -59,12 +59,12 @@
     procDefService.registerProcessDefinition(procDef);
     
     // Create and save the Process
-    Process proc = procDef.newInstance();
+    ProcessInstance proc = procDef.newInstance();
     service.saveProcess(proc);
 
     // Load the process
     ObjectName procID = proc.getKey();
-    Process loadProc = service.loadProcess(procID);
+    ProcessInstance loadProc = service.loadProcess(procID);
     ProcessCatalog.validateDefaultProcess(loadProc.getProcessDefinition());
 
     StartEvent start = loadProc.getNode(StartEvent.class, "Start");

Modified: projects/spec/branches/tdiesler/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -38,11 +38,11 @@
 import org.jbpm.api.model.Assignment.AssignTime;
 import org.jbpm.api.model.SequenceFlow.ConditionType;
 import org.jbpm.api.model.Task.TaskType;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Execution;
+import org.jbpm.api.runtime.internal.ExecutionHandler;
+import org.jbpm.api.runtime.internal.FlowHandler;
+import org.jbpm.api.runtime.internal.SignalHandler;
+import org.jbpm.api.runtime.internal.TokenExecutor;
 import org.jbpm.ri.model.AssignmentImpl;
 import org.jbpm.ri.model.ExpressionImpl;
 import org.jbpm.ri.model.InputSetImpl;
@@ -165,7 +165,7 @@
       private static final long serialVersionUID = 1L;
 
       @Override
-      public void execute(Token token)
+      public void execute(Execution token)
       {
       }
 
@@ -213,12 +213,12 @@
       }
 
       @Override
-      public void throwEnterSignal(Token token)
+      public void throwEnterSignal(Execution token)
       {
       }
 
       @Override
-      public void throwExitSignal(Token token)
+      public void throwExitSignal(Execution token)
       {
       }
     }
@@ -255,7 +255,7 @@
       }
 
       @Override
-      public void execute(TokenExecutor tokenExecutor, Token token)
+      public void execute(TokenExecutor tokenExecutor, Execution token)
       {
       }
     }

Modified: projects/spec/branches/tdiesler/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java
===================================================================
--- projects/spec/branches/tdiesler/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -15,10 +15,10 @@
 import org.jboss.bpm.samples.airticket.client.OfferMessage;
 import org.jboss.bpm.samples.airticket.client.OrderMessage;
 import org.jboss.bpm.samples.airticket.client.RequestMessage;
-import org.jbpm.api.client.MessageListener;
-import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.client.preliminary.MessageListener;
+import org.jbpm.api.client.preliminary.SignalListener;
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.Signal;
 import org.jbpm.api.model.builder.MessageBuilder;
@@ -65,7 +65,7 @@
       System.out.println("Create new Process");
       AirticketProcessBuilder procBuilder = new AirticketProcessBuilder(sampleID);
       ProcessDefinition procDef = procBuilder.buildProcessDefinition();
-      Process proc = procDef.newInstance();
+      ProcessInstance proc = procDef.newInstance();
       procService.registerProcess(proc);
       procID = proc.startProcess();
       httpSession.setAttribute("procID", procID);

Modified: projects/spec/branches/tdiesler/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
===================================================================
--- projects/spec/branches/tdiesler/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java	2008-11-06 07:26:54 UTC (rev 2764)
+++ projects/spec/branches/tdiesler/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java	2008-11-06 07:29:45 UTC (rev 2765)
@@ -25,10 +25,10 @@
 
 import javax.management.ObjectName;
 
-import org.jbpm.api.client.MessageListener;
-import org.jbpm.api.client.UserTaskCallback;
+import org.jbpm.api.client.preliminary.MessageListener;
+import org.jbpm.api.client.preliminary.UserTaskCallback;
 import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
 import org.jbpm.api.model.ProcessDefinition;
 import org.jbpm.api.model.UserTask;
 import org.jbpm.api.model.builder.MessageBuilder;
@@ -53,7 +53,7 @@
   
   private MessageService messageManager = MessageService.locateMessageService();
   private AirticketMessageListener msgListener;
-  private Process proc;
+  private ProcessInstance proc;
   
   public void testValidData() throws Exception
   {




More information about the jbpm-commits mailing list