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

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Jun 26 04:23:25 EDT 2009


Author: tom.baeyens at jboss.com
Date: 2009-06-26 04:23:24 -0400 (Fri, 26 Jun 2009)
New Revision: 5125

Added:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElement.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/OpenProcessDefinition.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java
Removed:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Activity.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/CompositeElement.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ObservableElement.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessDefinition.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Transition.java
Modified:
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListenerExecution.java
   jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java
   jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java
   jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/LogListener.java
   jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/eventlistener/process.jpdl.xml
   jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
   jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EndActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/GroupActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
   jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
   jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/client/ClientProcessDefinition.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElementImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/DisplaySource.java
   jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java
   jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java
   jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java
   jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java
   jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml
Log:
JBPM-2307 pruning the api to the minimal

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Deployment.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -35,6 +35,9 @@
    * to have a kind of undoable delete operation. */
   String STATE_SUSPENDED = "suspended";
 
+  /** unique identification of this deployment */ 
+  String getId();
+
   long getDbid();
 
   /** typically correspond to the file name or url or some other 

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/Execution.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -26,8 +26,6 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.jbpm.api.model.ObservableElement;
-
 /** a runtime path of execution.
  * 
  * <h3 id="state">State of an execution</h3>

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/activity/ActivityExecution.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,10 +23,7 @@
 
 import org.jbpm.api.Execution;
 import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.ObservableElement;
 import org.jbpm.api.model.OpenExecution;
-import org.jbpm.api.model.Transition;
 
 
 /** view upon an {@link Execution path of execution} exposed to 
@@ -40,9 +37,6 @@
    * name of the current activity. */
   String getActivityName();
 
-  /** the current activity. */
-  Activity getActivity();
-
   
   // wait state behaviour /////////////////////////////////////////////////////
   
@@ -76,7 +70,7 @@
    * will decide how to interpret the signal.</p>
    * 
    * <p>Transitions will be looked up recursively starting from the 
-   * {@link #getActivity() current activity} and then up the {@link Activity#getParent() activity-parent-hierarchy} </p>
+   * {@link #getActivityName() current activity} and then up the activity-parent-hierarchy</p>
    * 
    * @param transitionName is the name of the transition to take.  A null value will 
    * match the first unnamed transition.
@@ -85,25 +79,6 @@
    * or in case this method is called from inside an {@link ActivityBehaviour}.*/
   void take(String transitionName);
 
-  /** takes the given outgoing transition.  
-   * 
-   * <p>This method can only be called 
-   * from inside {@link ExternalActivityBehaviour} implementations and in rare occasions also from 
-   * outside of the execution (from an external client while the process is in a wait state).
-   * For external clients, it is more normal to use the {@link #signal(String)} 
-   * method as in that case, it's the current activity (hence the process language)that 
-   * will decide how to interpret the signal.</p>
-   * 
-   * <p>CAUTION: It's up to the client to make sure 
-   * that this transition makes sense as there is no check whether the given transition 
-   * is an outgoing transition of the current activity.  The motivation for that is 
-   * that in case of groups, that check can become too 'expensive'. </p> */
-  void take(Transition transition);
-
-  /** let's the given execution take the transition.
-   * @throws JbpmException if the execution is not part of this process instance. */
-  void take(Transition transition, Execution execution);
-  
   // execute a child activity /////////////////////////////////////////////////////
   
   /** executes the given nested activity. 
@@ -118,25 +93,6 @@
    * will decide how to interpret the signal.</p> */
   void execute(String activityName);
   
-  /** executes the given activity. 
-   * 
-   * <p>This method can only be called 
-   * from inside {@link ExternalActivityBehaviour} implementations and in rare occasions also from 
-   * outside of the execution (from an external client while the process is in a wait state).
-   * For external clients, it is more normal to use the {@link #signal(String)} 
-   * method as in that case, it's the current activity (hence the process language)that 
-   * will decide how to interpret the signal.</p>
-   */
-  void execute(Activity activity);
-  
-  // reposition the execution in another activity /////////////////////////////////
-
-  /** position this execution in the destination activity. */
-  void setActivity(Activity destination);
-
-  /** position the given execution in the destination activity */
-  void setActivity(Activity destination, Execution execution);
-  
   // ending an execution //////////////////////////////////////////////////////
   
   /** ends this execution and all of its child executions.
@@ -157,27 +113,8 @@
    * <p>The execution will be removed from it's parent.</p> */
   void end(String state);
   
-  /** ends the given execution and all it's child executions. */
-  void end(OpenExecution executionToEnd);
-
-  /** ends the given execution and all it's child executions with a user defined 
-   * status. */
-  void end(OpenExecution executionToEnd, String state);
-
-  // firing events ////////////////////////////////////////////////////////////
-  
-  /** fires the event on the given eventSource and then propagates the event 
-   * up to the eventSource's parent chain.  All the actions will see the given 
-   * eventSource in {@link #getEventSource()}, event if the events are 
-   * registered to parent's of the given eventSource. */
-  void fire(String eventName, ObservableElement eventSource);
-  
   // extra state information methods //////////////////////////////////////////
   
-  /** the current transition indicating the position in the process definition graph.
-   * Can be null in case this execution is not taking a transition. */
-  Transition getTransition();
-  
   /** setter for the priority.  The default priority is 0, which means 
    * NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1), 
    * LOW (-1) and LOWEST (-2). For the rest, the user can set any other 
@@ -185,24 +122,4 @@
    * an integer and not the named value.*/
   void setPriority(int priority);
 
-  // history methods //////////////////////////////////////////////////////////
-  
-  /** record history event that specifies for a decision activity which transition 
-   * has been taken. */
-  void historyDecision(String transitionName);
-
-  /** records the end of an automatic event.  This should be called at the end of 
-   * the activity.  Before the activity's execute method is invoked, the start time 
-   * is automatically recorded.  And invocation of this historyAutomatic will 
-   * capture the end time. */
-  void historyAutomatic();
-
-  /** marks the start of an activity for history purposes. */
-  void historyActivityStart();
-
-  /** marks the end of an activity for history purposes. */
-  void historyActivityEnd();
-
-  /** marks the end of an activity with a specific transitionName for history purposes. */
-  void historyActivityEnd(String transitionName);
 }

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListenerExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListenerExecution.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/listener/EventListenerExecution.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -22,11 +22,7 @@
 package org.jbpm.api.listener;
 
 import org.jbpm.api.Execution;
-import org.jbpm.api.activity.ActivityBehaviour;
-import org.jbpm.api.model.Event;
-import org.jbpm.api.model.ObservableElement;
 import org.jbpm.api.model.OpenExecution;
-import org.jbpm.api.model.Transition;
 
 
 /** view upon an {@link Execution path of execution} exposed to 
@@ -36,29 +32,6 @@
  */
 public interface EventListenerExecution extends OpenExecution {
   
-
-  /** the original object that fired the event, part of the current position in the 
-   * process graph.  Can be null in case no event is being fired. This is mostly the 
-   * object that is listened to with an {@link ActivityBehaviour}, but the eventSource can also 
-   * be a child of the object to which is listened in case of event propagation. */
-  ObservableElement getEventSource();
-  
-  /** the event that is being fired, part of the current position in the process 
-   * graph.  Can be null in case no event is being fired. */
-  Event getEvent();
-
-  // extra state information methods //////////////////////////////////////////
-  
-  /** the current transition indicating the position in the process definition graph.
-   * Can be null in case this execution is not taking a transition. */
-  Transition getTransition();
-  
-  /** fires the event on the given eventSource and then propagates the event 
-   * up to the eventSource's parent chain.  All the actions will see the given 
-   * eventSource in {@link #getEventSource()}, event if the events are 
-   * registered to parent's of the given eventSource. */
-  void fire(String eventName, ObservableElement eventSource);
-
   /** setter for the priority.  The default priority is 0, which means 
    * NORMAL. Other recognized named priorities are HIGHEST (2), HIGH (1), 
    * LOW (-1) and LOWEST (-2). For the rest, the user can set any other 

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Activity.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Activity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Activity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -1,111 +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;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * a activity in a {@link OpenProcessDefinition} graph.
- * 
- * <p>The activity supports both graph based process models as well as 
- * block structured (tree based) process models.  First we describe 
- * tranisions that can be used to form graph based process structures 
- * and then we'll describe activity composition to form block structured
- * process models.  Both models can be combined as well.
- * </p>
- * 
- * <p>Activities have {@link #getIncomingTransitions() incoming}
- * and {@link #getOutgoingTransitions() outgoing transitions}.
- * These are lists of transitions.
- * </p>
- * 
- * <p>Optionally, transitions can have names.  In that case the 
- * transition {@link #getOutgoingTransition(String) names are associated 
- * to activity's outgoing transitions}.  The {@link #getOutgoingTransitionsMap() map 
- * of outgoing transitions} provides easy access to the named transitions.
- * </p> 
- *   
- * <p>One of the outgoing transitions can optionally be marked as 
- * {@link #getDefaultOutgoingTransition() the default transition}.
- * </p>
- * 
- * <p>Block structured process languages have composite activities that can be 
- * modeled with the {@link #getParent() parent}-{@link #getActivities() child} 
- * relation.
- * </p> 
- * 
- * @author Tom Baeyens
- */
-public interface Activity extends CompositeElement {
-
-  /** the list of outgoing transitions.
-   * Caution: the actual member is returned.  No copy is made. */
-  List<Transition> getOutgoingTransitions();
-
-  /** the default outgoing transition. */
-  Transition getDefaultOutgoingTransition();
-
-  /** the first leaving transition with the given name or null of no
-   * such leaving transition exists. If the multiple transitions have 
-   * the given transition name, the first (in order of {@link #getOutgoingTransitions()})
-   * will be returned.
-   *  
-   * @param transitionName is the name of the transition to take.  A null value will 
-   * match the first unnamed transition. */
-  Transition getOutgoingTransition(String transitionName);
-
-  /** indicates if a leaving transition with the given transitionName exists. 
-   * A null value matches an unnamed transition. */
-  boolean hasOutgoingTransition(String transitionName);
-
-  /** indicates if this activity has leaving transitions */
-  boolean hasOutgoingTransitions();
-
-  /** the leaving transitions, keyed by transition name.  If a transition with 
-   * the same name occurs mutltiple times, the first one is returned.
-   * Leaving transitions with a null value for their name are not included 
-   * in the map.
-   * Beware: the actual member is returned.  No copy is made.  In fact, the 
-   * returned map is maintained as a cache.  So updates to the map will 
-   * influence subsequent retrievals of outgoing transitions by name. */
-  Map<String, Transition> getOutgoingTransitionsMap();
-  
-  /** searches for the given transitionName in this activity and then up the 
-   * parent chain. Returns null if no such transition is found. */
-  Transition findOutgoingTransition(String transitionName);
-
-  /** the list of arriving transitions.
-   * Beware: the actual member is returned.  No copy is made. */
-  List<Transition> getIncomingTransitions();
-
-  /** indicates if this activity has arriving transitions */
-  boolean hasIncomingTransitions();
-  
-  /** retrieve the parent activity in the composite activity structure.  This is 
-   * different from {@link ObservableElement#getParent()} in that it is restricted 
-   * to the parent activities.  It doesn't take into account the process definition. */ 
-  Activity getParentActivity();
-
-  /** the type of this activity which corresponds to the xml tag */
-  String getType();
-}
\ No newline at end of file

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/CompositeElement.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/CompositeElement.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/CompositeElement.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -1,67 +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;
-
-import java.util.List;
-import java.util.Map;
-
-
-
-/** activity container base class for {@link OpenProcessDefinition} and {@link Activity}.
- * 
- * @author Tom Baeyens
- */
-public interface CompositeElement extends ObservableElement {
-
-  /** indicates if this processDefinition has activities. */
-  boolean hasActivities();
-
-  /** the list of direct composite activities.  Recursively contained 
-   * activities are not included in the list. 
-   * Beware: the actual member is returned.  No copy is made. */
-  List<Activity> getActivities();
-
-  /** indicates if an activity with the given name exists directly in 
-   * this element.  Only the direct contained activities are 
-   * searched.  No recursive search is made. */
-  boolean hasActivity(String activityName);
-
-  /** the first composite activity with the given name or null of no
-   * such activity exists. Only the direct contained activities are 
-   * searched.  No recursive search is made. */
-  Activity getActivity(String activityName);
-
-  /** searches for the given activity in this element recursively, 
-   * including this activity and all child activities.  The search 
-   * is done depth-first. A null value for activityName matches a activity 
-   * without a name. */
-  Activity findActivity(String activityName);
-
-  /** the composite activities, keyed by activity name.  If an activity 
-   * with the same name occurs mutltiple times, the first in the list
-   * is included in the map. Activities with a null value for their name 
-   * are not included in the map. 
-   * Beware: the actual member is returned.  No copy is made. In fact, the 
-   * returned map is maintained as a cache.  So updates to the map will 
-   * influence subsequent retrievals of activities by name.*/
-  Map<String, Activity> getActivitiesMap();
-}

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ObservableElement.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ObservableElement.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ObservableElement.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -1,65 +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;
-
-import java.util.Set;
-
-
-/** a super class for process elements that have events.
- * 
- * @author Tom Baeyens
- */
-public interface ObservableElement {
-  
-  /** the meaningless database primary key */
-  long getDbid();
-
-  /** the short display name given to this element. */
-  String getName();
-
-  /** the process definition to which this process element belongs */
-  OpenProcessDefinition getProcessDefinition();
-
-  /** the property value for the given key or null if no such 
-   * configuration key is present.
-   * 
-   * This is extra static configuration information that can be 
-   * associated to a process element.  Process languages can use this 
-   * to store configuration properties for extensions in it.  That way, 
-   * these extensions can be added without changing the process model 
-   * or the database schema. Examples of extensions that may use these 
-   * configuration properties are simulation, predictive scheduling, 
-   * graphical information,... */
-  Object getProperty(String key);
-  
-  /** the set of available property keys or an empty set in case 
-   * there are no keys. */
-  Set<String> getPropertyKeys();
-
-  /** indicates if the given event is defined no this element.
-   * This method only looks in this observable element and it will not 
-   * search the parent hierarchy for the given event. */
-  boolean hasEvent(String eventName);
-  
-  /** the enclosing activity or the process definition */
-  ObservableElement getParent();
-}

Modified: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenExecution.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -44,9 +44,6 @@
  */
 public interface OpenExecution extends Execution, Discussable {
   
-  /** the process definition for this execution.*/
-  OpenProcessDefinition getProcessDefinition();
-  
   /** update the state */
   void setState(String state);
 

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessDefinition.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessDefinition.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -1,59 +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;
-
-import org.jbpm.api.ProcessDefinition;
-
-
-
-/**
- * a graph (or tree) structure that can be executed.
- * 
- * <h2>Purpose</h2>
- * <p>ProcessDefinition is a base implementation that can be leveraged to build 
- * graph based execution languages.  While the ProcessDefinition class is concrete and 
- * can be used as-is (e.g. by aggregation), most likely processDefinition languages
- * will inherit from this ProcessDefinition and create more specialized implementations.  
- * </p>
- * 
- * <p>The specialized processDefinition language classes can extend this ProcessDefinition  
- * with new datastructures relevant for that perticular processDefinition language.
- * </p>
- * 
- * <h2>Structure</h2>
- * <p>A processDefinition contains a set of activities.  Activities can be connected with 
- * transitions or activities can have nested activities.  But the transitions and 
- * nested activities can be combined.
- * </p>
- * 
- * <h2>Execution</h2>
- * <p>To create a new execution for a given processDefinition, see {@link #startExecution()}.
- * </p>
- * 
- * @author Tom Baeyens
- */
-public interface OpenProcessDefinition extends ProcessDefinition, CompositeElement {
-  
-  /** the initial activity of this process definition */
-  Activity getInitial();
-
-}
\ No newline at end of file

Deleted: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Transition.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Transition.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Transition.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -1,65 +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;
-
-/**
- * a transition in a {@link OpenProcessDefinition} graph.
- * 
- * <h3 id="guardconditions">Guard conditions</h3>
- * <p>TODO</p>
- * 
- * <h3 id="transitionsaswaitstates">Transitions as wait states</h3>
- * <p>A wait condition indicates wether a transition is to be taken synchronously
- * or wether the transition will behave as a wait state.
- * </p>
- * 
- * <p>Transitions that are wait states can occur when an analyst has 
- * an actual state (e.g. 'making loss') and a desired state (e.g. 'making profit')
- * and models a transition between those states.  In that case the transition 
- * might take a long time and hence it results into a wait state for the system.
- * </p>
- * 
- * <p>If the wait condition is null or if it returns false, then the transition 
- * will be taking synchronously.  Otherwise the transition will behave as 
- * a wait state and wait for a signal on the execution.
- * </p>
- * 
- * <p>Transitions as wait states has every thing to do with matching the 
- * process graph to transactions on the server.  If the transition is taken 
- * in one (the current) transaction, then the async condition should be empty 
- * or evaluate to false.  If the arrival of the execution in the destination 
- * activity should occur in a separate execution 
- * 
- * @author Tom Baeyens
- */
-public interface Transition extends ObservableElement {
-  
-  /** the activity from which this transition leaves. */
-  Activity getSource();
-
-  /** the activity in which this transition arrives. */ 
-  Activity getDestination();
-  
-  /** the general purpose condition that can be used in various ways by the 
-   * activities. */
-  Condition getCondition();
-}
\ No newline at end of file

Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/WaitState.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,8 +25,8 @@
 
 import org.jbpm.api.activity.ActivityExecution;
 import org.jbpm.api.activity.ExternalActivityBehaviour;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.Transition;
 
 /**
  * @author Alejandro Guizar
@@ -45,13 +45,13 @@
       execution.setVariables(parameters);
     }
 
-    Activity activity = execution.getActivity();
-    execution.fire(signalName, activity);
-
-    Transition transition = activity.findOutgoingTransition(signalName);
-    if (transition != null) {
-      execution.take(transition);
-    }
+//    Activity activity = execution.getActivity();
+//    execution.fire(signalName, activity);
+//
+//    Transition transition = activity.findOutgoingTransition(signalName);
+//    if (transition != null) {
+//      execution.take(transition);
+//    }
     else {
       execution.waitForSignal();
     }

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/EventListenerTest.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -33,10 +33,10 @@
     executionService.signalExecutionById(execution.getId());
     
     List<String> expectedLogs = new ArrayList<String>();
-    expectedLogs.add("event(start) on process(EventListener)");
-    expectedLogs.add("event(start) on activity(wait)");
-    expectedLogs.add("event(end) on activity(wait)");
-    expectedLogs.add("event(take) on (wait)-->(park)");
+    expectedLogs.add("start on process definition");
+    expectedLogs.add("start on activity wait");
+    expectedLogs.add("end on activity wait");
+    expectedLogs.add("take transition");
     
     List<String> logs = (List<String>) executionService.getVariable(processInstance.getId(), "logs");
     

Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/LogListener.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/LogListener.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/eventlistener/LogListener.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -11,14 +11,18 @@
 
   private static final long serialVersionUID = 1L;
   
+  // value gets injected from process definition
+  String msg;
+  
   public void notify(EventListenerExecution execution) {
     List<String> logs = (List<String>) execution.getVariable("logs");
     if (logs==null) {
       logs = new ArrayList<String>();
       execution.setVariable("logs", logs);
     }
-    logs.add(execution.getEvent()+" on "+execution.getEventSource());
     
+    logs.add(msg);
+    
     execution.setVariable("logs", logs);
   }
 }

Modified: jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/eventlistener/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/eventlistener/process.jpdl.xml	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/examples/src/test/resources/org/jbpm/examples/eventlistener/process.jpdl.xml	2009-06-26 08:23:24 UTC (rev 5125)
@@ -3,27 +3,30 @@
 <process name="EventListener" xmlns="http://jbpm.org/4.0/jpdl">
 
   <on event="start">
-    <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
+    <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+      <field name="msg"><string value="start on process definition"/></field>
+    </event-listener>
   </on>
 
-  <on event="end">
-    <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
-  </on>
-
-
   <start g="17,19,48,48">
     <transition to="wait"/>
   </start>
 
   <state name="wait" g="96,16,104,52">
 	  <on event="start">
-	    <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
+	    <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+        <field name="msg"><string value="start on activity wait"/></field>
+      </event-listener>
 	  </on>
     <on event="end">
-      <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
+      <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+        <field name="msg"><string value="end on activity wait"/></field>
+      </event-listener>
     </on>
     <transition to="park">
-      <event-listener class="org.jbpm.examples.eventlistener.LogListener"/>
+      <event-listener class="org.jbpm.examples.eventlistener.LogListener">
+        <field name="msg"><string value="take transition"/></field>
+      </event-listener>
     </transition>
   </state>
   

Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,11 +24,11 @@
 import org.jboss.bpm.console.client.model.*;
 import org.jbpm.api.Deployment;
 import org.jbpm.api.ProcessDefinition;
-import org.jbpm.api.model.Transition;
 import org.jbpm.api.task.Participation;
 import org.jbpm.api.task.Task;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 import org.jbpm.pvm.internal.repository.DeploymentImpl;
 import org.jbpm.pvm.internal.task.TaskImpl;
 

Modified: jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -47,13 +47,13 @@
 import org.jbpm.api.ProcessEngine;
 import org.jbpm.api.RepositoryService;
 import org.jbpm.api.TaskService;
-import org.jbpm.api.model.Transition;
 import org.jbpm.api.task.Task;
 import org.jbpm.integration.spi.mgmt.ServerConfig;
 import org.jbpm.integration.spi.mgmt.ServerConfigFactory;
 import org.jbpm.pvm.internal.env.Environment;
 import org.jbpm.pvm.internal.env.EnvironmentFactory;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 import org.jbpm.pvm.internal.task.TaskImpl;
 
 import freemarker.template.DefaultObjectWrapper;

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionConditionActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,9 +25,10 @@
 
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
 import org.jbpm.api.model.Condition;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 
 
 /**
@@ -38,6 +39,10 @@
   private static final long serialVersionUID = 1L;
 
   public void execute(ActivityExecution execution) {
+    execute((ExecutionImpl) execution); 
+  }
+  
+  public void execute(ExecutionImpl execution) {
     Transition transition = findTransition(execution);
     if (transition==null) {
       throw new JbpmException("no outgoing transition condition evaluated to true for decision "+execution.getActivity());
@@ -48,7 +53,7 @@
     execution.take(transition);
   }
 
-  private Transition findTransition(ActivityExecution execution) {
+  private Transition findTransition(ExecutionImpl execution) {
     Activity activity = execution.getActivity();
     List<Transition> outgoingTransitions = activity.getOutgoingTransitions();
     for (Transition transition : outgoingTransitions) {

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,9 +23,10 @@
 
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
 import org.jbpm.pvm.internal.env.EnvironmentDefaults;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 import org.jbpm.pvm.internal.script.ScriptManager;
 
 /**
@@ -38,7 +39,11 @@
   protected String expr;
   protected String lang;
 
-  public void execute(ActivityExecution execution) throws Exception {
+  public void execute(ActivityExecution execution) {
+    execute((ExecutionImpl) execution); 
+  }
+  
+  public void execute(ExecutionImpl execution) {
     Activity activity = execution.getActivity();
     String transitionName = null;
 

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,9 +24,10 @@
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.activity.ActivityExecution;
 import org.jbpm.api.jpdl.DecisionHandler;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.WireContext;
 
@@ -40,7 +41,11 @@
   protected String decisionHandlerName;
   protected Descriptor decisionHandlerDescriptor;
 
-  public void execute(ActivityExecution execution) throws Exception {
+  public void execute(ActivityExecution execution) {
+    execute((ExecutionImpl) execution); 
+  }
+  
+  public void execute(ExecutionImpl execution) {
     Activity activity = execution.getActivity();
     String transitionName = null;
 

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EndActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EndActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/EndActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,11 +24,11 @@
 import java.util.List;
 
 import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
 import org.jbpm.api.model.OpenExecution;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
 import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 
 
 /**

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ForkActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -26,10 +26,10 @@
 
 import org.jbpm.api.Execution;
 import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
 import org.jbpm.api.model.Condition;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 
 
 /**

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/GroupActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/GroupActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/GroupActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -28,10 +28,10 @@
 import org.jbpm.api.Execution;
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
 import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 
 
 /**
@@ -41,10 +41,11 @@
 
   private static final long serialVersionUID = 1L;
 
-  public void execute(ActivityExecution execution) throws Exception {
+  public void execute(ActivityExecution execution) {
     execute((ExecutionImpl)execution);
   }
-  public void execute(ExecutionImpl execution) throws Exception {
+  
+  public void execute(ExecutionImpl execution) {
     // find the start activity
     Activity activity = execution.getActivity();
     List<Activity> startActivities = findStartActivities(activity);
@@ -84,6 +85,10 @@
   }
 
   public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
+    signal((ExecutionImpl)execution, signalName, parameters);
+  }
+
+  public void signal(ExecutionImpl execution, String signalName, Map<String, ?> parameters) throws Exception {
     Transition transition = null;
     Activity activity = execution.getActivity();
     List<Transition> outgoingTransitions = activity.getOutgoingTransitions();

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -29,10 +29,10 @@
 import org.jbpm.api.Execution;
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.Activity;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 
 
 /**

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JpdlAutomaticActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -4,6 +4,7 @@
 import org.jbpm.api.listener.EventListener;
 import org.jbpm.api.listener.EventListenerExecution;
 import org.jbpm.api.model.OpenExecution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 
 
 public abstract class JpdlAutomaticActivity extends JpdlActivity implements EventListener {
@@ -12,7 +13,7 @@
 
   public void execute(ActivityExecution execution) throws Exception {
     perform(execution);
-    execution.historyAutomatic();
+    ((ExecutionImpl)execution).historyAutomatic();
   }
     
   public void notify(EventListenerExecution execution) throws Exception {

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/StateActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,8 +24,9 @@
 import java.util.Map;
 
 import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 
 /**
  * @author Tom Baeyens
@@ -35,12 +36,20 @@
   private static final long serialVersionUID = 1L;
   
   public void execute(ActivityExecution execution) {
+    execute((ExecutionImpl)execution);
+  }
+
+  public void execute(ExecutionImpl execution) {
     execution.historyActivityStart();
 
     execution.waitForSignal();
   }
 
-  public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) {
+  public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
+    signal((ExecutionImpl)execution, signalName, parameters);
+  }
+
+  public void signal(ExecutionImpl execution, String signalName, Map<String, ?> parameters) throws Exception {
     Activity activity = execution.getActivity();
     
     if (parameters!=null) {

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,11 +25,11 @@
 import java.util.Map;
 
 import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.env.Context;
 import org.jbpm.pvm.internal.env.Environment;
 import org.jbpm.pvm.internal.env.ExecutionContext;
+import org.jbpm.pvm.internal.model.Activity;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.script.ScriptManager;
 import org.jbpm.pvm.internal.session.RepositorySession;
@@ -85,7 +85,11 @@
     execution.waitForSignal();
   }
 
-  public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) {
+  public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
+    signal((ExecutionImpl)execution, signalName, parameters);
+  }
+
+  public void signal(ExecutionImpl execution, String signalName, Map<String, ?> parameters) throws Exception {
     ExecutionImpl executionImpl = (ExecutionImpl) execution;
 
     ExecutionImpl subProcessInstance = executionImpl.getSubProcessInstance();

Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,12 +25,12 @@
 import java.util.Map;
 
 import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
 import org.jbpm.api.task.Task;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.Activity;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 import org.jbpm.pvm.internal.session.DbSession;
 import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
 import org.jbpm.pvm.internal.task.TaskHandler;
@@ -60,7 +60,11 @@
     }
   }
   
-  public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) {
+  public void signal(ActivityExecution execution, String signalName, Map<String, ?> parameters) throws Exception {
+    signal((ExecutionImpl)execution, signalName, parameters);
+  }
+
+  public void signal(ExecutionImpl execution, String signalName, Map<String, ?> parameters) throws Exception {
     Activity activity = execution.getActivity();
     
     if (parameters!=null) {

Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TransitionParsingTest.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,9 +24,9 @@
 import java.util.List;
 
 import org.jbpm.api.Problem;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.Transition;
 
 
 /**

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/client/ClientProcessDefinition.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/client/ClientProcessDefinition.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/client/ClientProcessDefinition.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,7 +23,7 @@
 
 import org.jbpm.api.Execution;
 import org.jbpm.api.model.OpenExecution;
-import org.jbpm.api.model.OpenProcessDefinition;
+import org.jbpm.pvm.internal.model.OpenProcessDefinition;
 
 
 /** adds factory methods for creating and beginning new process instances.

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -22,8 +22,8 @@
 package org.jbpm.pvm.internal.cmd;
 
 import org.jbpm.api.ProcessDefinition;
-import org.jbpm.api.model.OpenProcessDefinition;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.OpenProcessDefinition;
 import org.jbpm.pvm.internal.session.DbSession;
 
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -21,8 +21,8 @@
  */
 package org.jbpm.pvm.internal.cmd;
 
-import org.jbpm.api.model.OpenProcessDefinition;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.OpenProcessDefinition;
 import org.jbpm.pvm.internal.session.DbSession;
 
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -26,11 +26,11 @@
 import java.util.Set;
 
 import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.Transition;
 import org.jbpm.api.task.Task;
 import org.jbpm.pvm.internal.env.Environment;
 import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.Transition;
 import org.jbpm.pvm.internal.session.DbSession;
 import org.jbpm.pvm.internal.task.TaskImpl;
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -26,7 +26,6 @@
 
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.job.Timer;
-import org.jbpm.api.model.ObservableElement;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.cal.BusinessCalendar;
 import org.jbpm.pvm.internal.cal.Duration;
@@ -34,6 +33,7 @@
 import org.jbpm.pvm.internal.env.Transaction;
 import org.jbpm.pvm.internal.jobexecutor.JobAddedNotification;
 import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
+import org.jbpm.pvm.internal.model.ObservableElement;
 import org.jbpm.pvm.internal.session.DbSession;
 import org.jbpm.pvm.internal.session.TimerSession;
 import org.jbpm.pvm.internal.util.Clock;

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java (from rev 5108, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Activity.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Activity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -0,0 +1,111 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.model;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * a activity in a {@link OpenProcessDefinition} graph.
+ * 
+ * <p>The activity supports both graph based process models as well as 
+ * block structured (tree based) process models.  First we describe 
+ * tranisions that can be used to form graph based process structures 
+ * and then we'll describe activity composition to form block structured
+ * process models.  Both models can be combined as well.
+ * </p>
+ * 
+ * <p>Activities have {@link #getIncomingTransitions() incoming}
+ * and {@link #getOutgoingTransitions() outgoing transitions}.
+ * These are lists of transitions.
+ * </p>
+ * 
+ * <p>Optionally, transitions can have names.  In that case the 
+ * transition {@link #getOutgoingTransition(String) names are associated 
+ * to activity's outgoing transitions}.  The {@link #getOutgoingTransitionsMap() map 
+ * of outgoing transitions} provides easy access to the named transitions.
+ * </p> 
+ *   
+ * <p>One of the outgoing transitions can optionally be marked as 
+ * {@link #getDefaultOutgoingTransition() the default transition}.
+ * </p>
+ * 
+ * <p>Block structured process languages have composite activities that can be 
+ * modeled with the {@link #getParent() parent}-{@link #getActivities() child} 
+ * relation.
+ * </p> 
+ * 
+ * @author Tom Baeyens
+ */
+public interface Activity extends CompositeElement {
+
+  /** the list of outgoing transitions.
+   * Caution: the actual member is returned.  No copy is made. */
+  List<Transition> getOutgoingTransitions();
+
+  /** the default outgoing transition. */
+  Transition getDefaultOutgoingTransition();
+
+  /** the first leaving transition with the given name or null of no
+   * such leaving transition exists. If the multiple transitions have 
+   * the given transition name, the first (in order of {@link #getOutgoingTransitions()})
+   * will be returned.
+   *  
+   * @param transitionName is the name of the transition to take.  A null value will 
+   * match the first unnamed transition. */
+  Transition getOutgoingTransition(String transitionName);
+
+  /** indicates if a leaving transition with the given transitionName exists. 
+   * A null value matches an unnamed transition. */
+  boolean hasOutgoingTransition(String transitionName);
+
+  /** indicates if this activity has leaving transitions */
+  boolean hasOutgoingTransitions();
+
+  /** the leaving transitions, keyed by transition name.  If a transition with 
+   * the same name occurs mutltiple times, the first one is returned.
+   * Leaving transitions with a null value for their name are not included 
+   * in the map.
+   * Beware: the actual member is returned.  No copy is made.  In fact, the 
+   * returned map is maintained as a cache.  So updates to the map will 
+   * influence subsequent retrievals of outgoing transitions by name. */
+  Map<String, Transition> getOutgoingTransitionsMap();
+  
+  /** searches for the given transitionName in this activity and then up the 
+   * parent chain. Returns null if no such transition is found. */
+  Transition findOutgoingTransition(String transitionName);
+
+  /** the list of arriving transitions.
+   * Beware: the actual member is returned.  No copy is made. */
+  List<Transition> getIncomingTransitions();
+
+  /** indicates if this activity has arriving transitions */
+  boolean hasIncomingTransitions();
+  
+  /** retrieve the parent activity in the composite activity structure.  This is 
+   * different from {@link ObservableElement#getParent()} in that it is restricted 
+   * to the parent activities.  It doesn't take into account the process definition. */ 
+  Activity getParentActivity();
+
+  /** the type of this activity which corresponds to the xml tag */
+  String getType();
+}
\ No newline at end of file


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

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -28,8 +28,6 @@
 
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.activity.ActivityBehaviour;
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.Transition;
 import org.jbpm.pvm.internal.wire.Descriptor;
 
 /**

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java (from rev 5108, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/CompositeElement.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElement.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.model;
+
+import java.util.List;
+import java.util.Map;
+
+
+
+/** activity container base class for {@link OpenProcessDefinition} and {@link Activity}.
+ * 
+ * @author Tom Baeyens
+ */
+public interface CompositeElement extends ObservableElement {
+
+  /** indicates if this processDefinition has activities. */
+  boolean hasActivities();
+
+  /** the list of direct composite activities.  Recursively contained 
+   * activities are not included in the list. 
+   * Beware: the actual member is returned.  No copy is made. */
+  List<Activity> getActivities();
+
+  /** indicates if an activity with the given name exists directly in 
+   * this element.  Only the direct contained activities are 
+   * searched.  No recursive search is made. */
+  boolean hasActivity(String activityName);
+
+  /** the first composite activity with the given name or null of no
+   * such activity exists. Only the direct contained activities are 
+   * searched.  No recursive search is made. */
+  Activity getActivity(String activityName);
+
+  /** searches for the given activity in this element recursively, 
+   * including this activity and all child activities.  The search 
+   * is done depth-first. A null value for activityName matches a activity 
+   * without a name. */
+  Activity findActivity(String activityName);
+
+  /** the composite activities, keyed by activity name.  If an activity 
+   * with the same name occurs mutltiple times, the first in the list
+   * is included in the map. Activities with a null value for their name 
+   * are not included in the map. 
+   * Beware: the actual member is returned.  No copy is made. In fact, the 
+   * returned map is maintained as a cache.  So updates to the map will 
+   * influence subsequent retrievals of activities by name.*/
+  Map<String, Activity> getActivitiesMap();
+}


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

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/CompositeElementImpl.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,8 +25,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.jbpm.api.model.Activity;
-import org.jbpm.api.model.CompositeElement;
 
 /**
  * @author Tom Baeyens

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -28,7 +28,6 @@
 
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.listener.EventListener;
-import org.jbpm.api.model.OpenProcessDefinition;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.cmd.CommandService;
 import org.jbpm.pvm.internal.env.Environment;

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -42,12 +42,9 @@
 import org.jbpm.api.job.Job;
 import org.jbpm.api.job.Timer;
 import org.jbpm.api.listener.EventListenerExecution;
-import org.jbpm.api.model.Activity;
 import org.jbpm.api.model.Comment;
 import org.jbpm.api.model.Event;
-import org.jbpm.api.model.ObservableElement;
 import org.jbpm.api.model.OpenExecution;
-import org.jbpm.api.model.Transition;
 import org.jbpm.api.task.Assignable;
 import org.jbpm.api.task.AssignmentHandler;
 import org.jbpm.internal.log.Log;

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElement.java (from rev 5108, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/ObservableElement.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElement.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElement.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.model;
+
+import java.util.Set;
+
+
+/** a super class for process elements that have events.
+ * 
+ * @author Tom Baeyens
+ */
+public interface ObservableElement {
+  
+  /** the meaningless database primary key */
+  long getDbid();
+
+  /** the short display name given to this element. */
+  String getName();
+
+  /** the process definition to which this process element belongs */
+  OpenProcessDefinition getProcessDefinition();
+
+  /** the property value for the given key or null if no such 
+   * configuration key is present.
+   * 
+   * This is extra static configuration information that can be 
+   * associated to a process element.  Process languages can use this 
+   * to store configuration properties for extensions in it.  That way, 
+   * these extensions can be added without changing the process model 
+   * or the database schema. Examples of extensions that may use these 
+   * configuration properties are simulation, predictive scheduling, 
+   * graphical information,... */
+  Object getProperty(String key);
+  
+  /** the set of available property keys or an empty set in case 
+   * there are no keys. */
+  Set<String> getPropertyKeys();
+
+  /** indicates if the given event is defined no this element.
+   * This method only looks in this observable element and it will not 
+   * search the parent hierarchy for the given event. */
+  boolean hasEvent(String eventName);
+  
+  /** the enclosing activity or the process definition */
+  ObservableElement getParent();
+}


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

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElementImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElementImpl.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObservableElementImpl.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,7 +25,6 @@
 import java.util.Map;
 
 import org.jbpm.api.model.Event;
-import org.jbpm.api.model.ObservableElement;
 
 
 /** observable and visible process elements.

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/OpenProcessDefinition.java (from rev 5108, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/OpenProcessDefinition.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/OpenProcessDefinition.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/OpenProcessDefinition.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.model;
+
+import org.jbpm.api.ProcessDefinition;
+
+
+
+/**
+ * a graph (or tree) structure that can be executed.
+ * 
+ * <h2>Purpose</h2>
+ * <p>ProcessDefinition is a base implementation that can be leveraged to build 
+ * graph based execution languages.  While the ProcessDefinition class is concrete and 
+ * can be used as-is (e.g. by aggregation), most likely processDefinition languages
+ * will inherit from this ProcessDefinition and create more specialized implementations.  
+ * </p>
+ * 
+ * <p>The specialized processDefinition language classes can extend this ProcessDefinition  
+ * with new datastructures relevant for that perticular processDefinition language.
+ * </p>
+ * 
+ * <h2>Structure</h2>
+ * <p>A processDefinition contains a set of activities.  Activities can be connected with 
+ * transitions or activities can have nested activities.  But the transitions and 
+ * nested activities can be combined.
+ * </p>
+ * 
+ * <h2>Execution</h2>
+ * <p>To create a new execution for a given processDefinition, see {@link #startExecution()}.
+ * </p>
+ * 
+ * @author Tom Baeyens
+ */
+public interface OpenProcessDefinition extends ProcessDefinition, CompositeElement {
+  
+  /** the initial activity of this process definition */
+  Activity getInitial();
+
+}
\ No newline at end of file


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

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -27,7 +27,6 @@
 
 import org.jbpm.api.Execution;
 import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.OpenProcessDefinition;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.client.ClientProcessInstance;

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessModificationsImpl.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,7 +24,6 @@
 import java.io.Serializable;
 import java.util.List;
 
-import org.jbpm.api.model.Activity;
 
 
 /**

Copied: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java (from rev 5108, jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/model/Transition.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java	                        (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/Transition.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.model;
+
+import org.jbpm.api.model.Condition;
+
+/**
+ * a transition in a {@link OpenProcessDefinition} graph.
+ * 
+ * <h3 id="guardconditions">Guard conditions</h3>
+ * <p>TODO</p>
+ * 
+ * <h3 id="transitionsaswaitstates">Transitions as wait states</h3>
+ * <p>A wait condition indicates wether a transition is to be taken synchronously
+ * or wether the transition will behave as a wait state.
+ * </p>
+ * 
+ * <p>Transitions that are wait states can occur when an analyst has 
+ * an actual state (e.g. 'making loss') and a desired state (e.g. 'making profit')
+ * and models a transition between those states.  In that case the transition 
+ * might take a long time and hence it results into a wait state for the system.
+ * </p>
+ * 
+ * <p>If the wait condition is null or if it returns false, then the transition 
+ * will be taking synchronously.  Otherwise the transition will behave as 
+ * a wait state and wait for a signal on the execution.
+ * </p>
+ * 
+ * <p>Transitions as wait states has every thing to do with matching the 
+ * process graph to transactions on the server.  If the transition is taken 
+ * in one (the current) transaction, then the async condition should be empty 
+ * or evaluate to false.  If the arrival of the execution in the destination 
+ * activity should occur in a separate execution 
+ * 
+ * @author Tom Baeyens
+ */
+public interface Transition extends ObservableElement {
+  
+  /** the activity from which this transition leaves. */
+  Activity getSource();
+
+  /** the activity in which this transition arrives. */ 
+  Activity getDestination();
+  
+  /** the general purpose condition that can be used in various ways by the 
+   * activities. */
+  Condition getCondition();
+}
\ No newline at end of file


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

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/TransitionImpl.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,7 +25,6 @@
 
 import org.jbpm.api.model.Condition;
 import org.jbpm.api.model.Event;
-import org.jbpm.api.model.Transition;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.WireContext;
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListener.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,12 +24,12 @@
 import java.util.List;
 
 import org.jbpm.api.listener.EventListener;
-import org.jbpm.api.model.ObservableElement;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.job.MessageImpl;
 import org.jbpm.pvm.internal.model.EventImpl;
 import org.jbpm.pvm.internal.model.EventListenerReference;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.model.ObservableElement;
 import org.jbpm.pvm.internal.model.ObservableElementImpl;
 
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -281,6 +281,14 @@
     return this;
   }
 
+  // customized getters and setters ///////////////////////////////////////////
+  
+  public String getId() {
+    return Long.toString(dbid);
+  }
+  
+  // getters and setters //////////////////////////////////////////////////////
+
   public long getDbid() {
     return dbid;
   }

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/LifeCycle.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,7 +25,7 @@
 import java.util.Map;
 
 import org.jbpm.api.JbpmException;
-import org.jbpm.api.model.Activity;
+import org.jbpm.pvm.internal.model.Activity;
 import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.model.IdGenerator;

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/DisplaySource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/DisplaySource.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/activities/DisplaySource.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,12 +23,13 @@
 
 import org.jbpm.api.listener.EventListener;
 import org.jbpm.api.listener.EventListenerExecution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 
 public class DisplaySource implements EventListener {
   
   private static final long serialVersionUID = 1L;
 
   public void notify(EventListenerExecution execution) {
-    System.out.println("leaving "+execution.getEventSource());
+    System.out.println("leaving "+((ExecutionImpl)execution).getEventSource());
   }
 }

Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/builder/BuilderTest.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -24,10 +24,10 @@
 import java.util.List;
 import java.util.Map;
 
-import org.jbpm.api.model.Transition;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.model.ActivityImpl;
+import org.jbpm.pvm.internal.model.Transition;
 import org.jbpm.test.BaseJbpmTestCase;
 
 

Modified: jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-db/src/test/java/org/jbpm/test/eventlistener/EventListenerTest.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -127,7 +127,6 @@
   public static class TransitionListener implements EventListener {
     private static final long serialVersionUID = 1L;
     public void notify(EventListenerExecution execution) {
-      assertNotNull(execution.getTransition());
       execution.setVariable("isInvoked", "true");
     }
   }

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/AutomaticActivity.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,6 +23,7 @@
 
 import org.jbpm.api.activity.ActivityBehaviour;
 import org.jbpm.api.activity.ActivityExecution;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 
 /** a activity behaviour implementation that records its execution and then 
  * just proceeds.
@@ -37,6 +38,6 @@
   }
   
   public void execute(ActivityExecution execution) throws Exception {
-    ContinuationTest.recorder.record(execution.getId(), "execute("+execution.getActivity().getName()+")");
+    ContinuationTest.recorder.record(execution.getId(), "execute("+((ExecutionImpl)execution).getActivity().getName()+")");
   }
 }
\ No newline at end of file

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,10 +25,10 @@
 import java.util.List;
 
 import org.hibernate.Session;
-import org.jbpm.api.model.OpenProcessDefinition;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.pvm.internal.cmd.Command;
 import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.model.OpenProcessDefinition;
 
 /**
  * @author Tom Baeyens

Modified: jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java
===================================================================
--- jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-load/src/test/java/org/jbpm/test/load/async/WaitState.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -25,6 +25,7 @@
 
 import org.jbpm.api.activity.ActivityExecution;
 import org.jbpm.api.activity.ExternalActivityBehaviour;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 
 /**
  * @author Tom Baeyens
@@ -36,7 +37,10 @@
   public WaitState() {
   }
 
-  public void execute(ActivityExecution execution) throws Exception {
+  public void execute(ActivityExecution execution) {
+    execute((ExecutionImpl)execution);
+  }
+  public void execute(ExecutionImpl execution) {
     ContinuationTest.recorder.record(execution.getId(), "execute("+execution.getActivity().getName()+")");
   }
 

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/EventTest.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -23,18 +23,18 @@
 
 import java.util.Map;
 
-import org.apache.tools.ant.taskdefs.Exec;
 import org.jbpm.api.activity.ActivityBehaviour;
 import org.jbpm.api.activity.ActivityExecution;
 import org.jbpm.api.activity.ExternalActivityBehaviour;
 import org.jbpm.api.listener.EventListener;
 import org.jbpm.api.listener.EventListenerExecution;
-import org.jbpm.api.model.Activity;
 import org.jbpm.api.model.Event;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.pvm.internal.client.ClientExecution;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.client.ClientProcessInstance;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.test.BaseJbpmTestCase;
 
 /** shows how actions are listeners to following processDefinition events:
@@ -54,6 +54,9 @@
   public static class ActivityEndAction implements EventListener {
     private static final long serialVersionUID = 1L;
     public void notify(EventListenerExecution execution) {
+      notify((ExecutionImpl)execution);
+    }
+    public void notify(ExecutionImpl execution) {
       execution.setVariable("msg", "Kilroy was here");
 
       assertTrue(execution.isActive("initial"));
@@ -90,7 +93,10 @@
 
   public static class TransitionAction implements EventListener {
     private static final long serialVersionUID = 1L;
-    public void notify(EventListenerExecution execution) throws Exception {
+    public void notify(EventListenerExecution execution) {
+      notify((ExecutionImpl)execution);
+    }
+    public void notify(ExecutionImpl execution) {
       execution.setVariable("msg", "Kilroy was here");
       
       assertEquals("t", execution.getEventSource().getName());
@@ -126,7 +132,10 @@
 
   public static class ActivityStartAction implements EventListener {
     private static final long serialVersionUID = 1L;
-    public void notify(EventListenerExecution execution) throws Exception {
+    public void notify(EventListenerExecution execution) {
+      notify((ExecutionImpl)execution);
+    }
+    public void notify(ExecutionImpl execution) {
       execution.setVariable("msg", "Kilroy was here");
 
       assertTrue(execution.isActive("end"));
@@ -167,6 +176,9 @@
       execution.waitForSignal();
     }
     public void signal(ActivityExecution execution, String signal, Map<String, ?> parameters) throws Exception {
+      signal((ExecutionImpl)execution, signal, parameters);
+    }
+    public void signal(ExecutionImpl execution, String signal, Map<String, ?> parameters) throws Exception {
       Activity activity = execution.getActivity();
       if ( (signal!=null)
            && (activity!=null)
@@ -180,7 +192,10 @@
 
   public static class CheckRivetsAction implements EventListener {
     private static final long serialVersionUID = 1L;
-    public void notify(EventListenerExecution execution) throws Exception {
+    public void notify(EventListenerExecution execution) {
+      notify((ExecutionImpl)execution);
+    }
+    public void notify(ExecutionImpl execution) {
       execution.setVariable("msg", "Kilroy was here");
       
       assertTrue(execution.isActive("initial"));

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/FunctionalActivityTest.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -30,11 +30,12 @@
 import org.jbpm.api.activity.ExternalActivityBehaviour;
 import org.jbpm.api.listener.EventListener;
 import org.jbpm.api.listener.EventListenerExecution;
-import org.jbpm.api.model.Activity;
 import org.jbpm.api.model.OpenExecution;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.client.ClientProcessInstance;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.test.BaseJbpmTestCase;
 
 
@@ -137,6 +138,9 @@
   public static class Composite implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
+      execute((ExecutionImpl)execution);
+    }
+    public void execute(ExecutionImpl execution) {
       Activity nestedActivity = execution.getActivity().getActivities().get(0);
       execution.execute(nestedActivity);
     }

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/ScopeVariableDeclarationTest.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -26,11 +26,12 @@
 
 import org.jbpm.api.activity.ActivityExecution;
 import org.jbpm.api.activity.ExternalActivityBehaviour;
-import org.jbpm.api.model.Activity;
 import org.jbpm.api.model.OpenExecution;
 import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
 import org.jbpm.pvm.internal.client.ClientExecution;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.model.Activity;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.wire.descriptor.StringDescriptor;
 import org.jbpm.test.BaseJbpmTestCase;
 
@@ -53,6 +54,9 @@
   public static class Composite implements ExternalActivityBehaviour {
     private static final long serialVersionUID = 1L;
     public void execute(ActivityExecution execution) {
+      execute((ExecutionImpl)execution);
+    }
+    public void execute(ExecutionImpl execution) {
       Activity child = execution.getActivity().getActivities().get(0);
       execution.execute(child);
     }

Modified: jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java
===================================================================
--- jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/test-pojo/src/main/java/org/jbpm/test/activities/TransitionEventsTest.java	2009-06-26 08:23:24 UTC (rev 5125)
@@ -31,6 +31,7 @@
 import org.jbpm.pvm.internal.client.ClientExecution;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.client.ClientProcessInstance;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.test.BaseJbpmTestCase;
 
 /**
@@ -42,6 +43,9 @@
     private static final long serialVersionUID = 1L;
     public List<Object> events = new ArrayList<Object>();
     public void notify(EventListenerExecution execution) {
+      notify((ExecutionImpl)execution);
+    }
+    public void notify(ExecutionImpl execution) {
       events.add(execution.getEvent()+" on "+execution.getEventSource());
     }
   }

Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml	2009-06-25 23:03:16 UTC (rev 5124)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch06-Jpdl.xml	2009-06-26 08:23:24 UTC (rev 5125)
@@ -2461,38 +2461,44 @@
     </figure>
     <programlisting>&lt;process name=&quot;EventListener&quot; xmlns=&quot;http://jbpm.org/4.0/jpdl&quot;&gt;
 
-  <emphasis role="bold">&lt;on event=&quot;start&quot;&gt;
-    &lt;event-listener class=&quot;org.jbpm.examples.eventlistener.LogListener&quot;/&gt;
+  &lt;on event=&quot;start&quot;&gt;
+    &lt;event-listener class=&quot;org.jbpm.examples.eventlistener.LogListener&quot;&gt;
+      &lt;field name=&quot;msg&quot;&gt;&lt;string value=&quot;start on process definition&quot;/&gt;&lt;/field&gt;
+    &lt;/event-listener&gt;
   &lt;/on&gt;
 
-  &lt;on event=&quot;end&quot;&gt;
-    &lt;event-listener class=&quot;org.jbpm.examples.eventlistener.LogListener&quot;/&gt;
-  &lt;/on&gt;</emphasis>
-
-
-  &lt;start &gt;
+  &lt;start&gt;
     &lt;transition to=&quot;wait&quot;/&gt;
   &lt;/start&gt;
 
-  &lt;state name=&quot;wait&quot; &gt;
-    <emphasis role="bold">&lt;on event=&quot;start&quot;&gt;
-      &lt;event-listener class=&quot;org.jbpm.examples.eventlistener.LogListener&quot;/&gt;
+  &lt;state name=&quot;wait&quot;&gt;
+    &lt;on event=&quot;start&quot;&gt;
+      &lt;event-listener class=&quot;org.jbpm.examples.eventlistener.LogListener&quot;&gt;
+        &lt;field name=&quot;msg&quot;&gt;&lt;string value=&quot;start on activity wait&quot;/&gt;&lt;/field&gt;
+      &lt;/event-listener&gt;
     &lt;/on&gt;
     &lt;on event=&quot;end&quot;&gt;
-      &lt;event-listener class=&quot;org.jbpm.examples.eventlistener.LogListener&quot;/&gt;
-    &lt;/on&gt;</emphasis>
+      &lt;event-listener class=&quot;org.jbpm.examples.eventlistener.LogListener&quot;&gt;
+        &lt;field name=&quot;msg&quot;&gt;&lt;string value=&quot;end on activity wait&quot;/&gt;&lt;/field&gt;
+      &lt;/event-listener&gt;
+    &lt;/on&gt;
     &lt;transition to=&quot;park&quot;&gt;
-      <emphasis role="bold">&lt;event-listener class=&quot;org.jbpm.examples.eventlistener.LogListener&quot;/&gt;</emphasis>
+      &lt;event-listener class=&quot;org.jbpm.examples.eventlistener.LogListener&quot;&gt;
+        &lt;field name=&quot;msg&quot;&gt;&lt;string value=&quot;take transition&quot;/&gt;&lt;/field&gt;
+      &lt;/event-listener&gt;
     &lt;/transition&gt;
   &lt;/state&gt;
   
-  &lt;state name=&quot;park&quot; /&gt;
+  &lt;state name=&quot;park&quot;/&gt;
 
 &lt;/process&gt;</programlisting>
     <para><literal>LogListener</literal>  will maintain a list of logs in a static member 
     field:</para>
     <programlisting>public class <emphasis role="bold">LogListener</emphasis> implements EventListener {
 
+  // value gets injected from process definition
+  String msg;
+
   public void notify(EventListenerExecution execution) {
     List&lt;String&gt; logs = (List&lt;String&gt;) execution.getVariable(&quot;logs&quot;);
     if (logs==null) {
@@ -2500,7 +2506,7 @@
       execution.setVariable(&quot;logs&quot;, logs);
     }
     
-    logs.add(execution.getEvent()+&quot; on &quot;+execution.getEventSource());
+    logs.add(msg);
 
     execution.setVariable(&quot;logs&quot;, logs);
   }
@@ -2512,10 +2518,10 @@
     <programlisting>Execution execution = processInstance.findActiveExecutionIn(&quot;wait&quot;);
 executionService.signalExecutionById(execution.getId());</programlisting>
     <para>The list of log messages will now look like this:</para>
-    <programlisting>[event(start) on process(EventListener),
- event(start) on activity(wait),
- event(end) on activity(wait),
- event(take) on (wait)-->(park)]</programlisting>
+    <programlisting>[start on process definition,
+ start on activity wait,
+ end on activity wait,
+ take transition]</programlisting>
   </section>
 
   <section id="asynchronouscontinuations">




More information about the jbpm-commits mailing list