[jbpm-commits] JBoss JBPM SVN: r3121 - in jbpm3/trunk/modules: core/src/main/java/org/jbpm/graph/exe and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Nov 27 07:09:28 EST 2008


Author: thomas.diesler at jboss.com
Date: 2008-11-27 07:09:28 -0500 (Thu, 27 Nov 2008)
New Revision: 3121

Modified:
   jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java
   jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java
Log:
signal(signame) fall back to target node name

Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java	2008-11-27 11:52:47 UTC (rev 3120)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/Node.java	2008-11-27 12:09:28 UTC (rev 3121)
@@ -44,10 +44,11 @@
 import org.jbpm.svc.Services;
 import org.jbpm.util.Clock;
 
-public class Node extends GraphElement implements Parsable {
-  
+public class Node extends GraphElement implements Parsable
+{
+
   private static final long serialVersionUID = 1L;
-  
+
   protected List<Transition> leavingTransitions = null;
   transient Map leavingTransitionMap = null;
   protected Set<Transition> arrivingTransitions = null;
@@ -58,8 +59,11 @@
 
   // event types //////////////////////////////////////////////////////////////
 
-  public static final String[] supportedEventTypes = new String[]{Event.EVENTTYPE_NODE_ENTER,Event.EVENTTYPE_NODE_LEAVE,Event.EVENTTYPE_BEFORE_SIGNAL,Event.EVENTTYPE_AFTER_SIGNAL};
-  public String[] getSupportedEventTypes() {
+  public static final String[] supportedEventTypes = new String[] { Event.EVENTTYPE_NODE_ENTER, Event.EVENTTYPE_NODE_LEAVE, Event.EVENTTYPE_BEFORE_SIGNAL,
+      Event.EVENTTYPE_AFTER_SIGNAL };
+
+  public String[] getSupportedEventTypes()
+  {
     return supportedEventTypes;
   }
 
@@ -68,22 +72,27 @@
   /**
    * creates an unnamed node.
    */
-  public Node() {
+  public Node()
+  {
   }
 
   /**
    * creates a node with the given name.
    */
-  public Node(String name) {
+  public Node(String name)
+  {
     super(name);
   }
 
-  public void read(Element nodeElement, JpdlXmlReader jpdlXmlReader) {
+  public void read(Element nodeElement, JpdlXmlReader jpdlXmlReader)
+  {
     action = jpdlXmlReader.readSingleAction(nodeElement);
   }
-  
-  public void write(Element nodeElement) {
-    if (action!=null) {
+
+  public void write(Element nodeElement)
+  {
+    if (action != null)
+    {
       String actionName = ActionTypes.getActionName(action.getClass());
       Element actionElement = nodeElement.addElement(actionName);
       action.write(actionElement);
@@ -91,26 +100,30 @@
   }
 
   // leaving transitions //////////////////////////////////////////////////////
-  
-  public List<Transition> getLeavingTransitions() {
+
+  public List<Transition> getLeavingTransitions()
+  {
     return leavingTransitions;
   }
 
-  public List<Transition> getLeavingTransitionsList() {
+  public List<Transition> getLeavingTransitionsList()
+  {
     return leavingTransitions;
   }
 
   /**
    * are the leaving {@link Transition}s, mapped by their name (java.lang.String).
    */
-  public Map getLeavingTransitionsMap() {
-    if ( (leavingTransitionMap==null)
-         && (leavingTransitions!=null) ){
+  public Map getLeavingTransitionsMap()
+  {
+    if ((leavingTransitionMap == null) && (leavingTransitions != null))
+    {
       // initialize the cached leaving transition map
       leavingTransitionMap = new HashMap();
       ListIterator iter = leavingTransitions.listIterator(leavingTransitions.size());
-      while (iter.hasPrevious()) {
-        Transition leavingTransition = (Transition) iter.previous();
+      while (iter.hasPrevious())
+      {
+        Transition leavingTransition = (Transition)iter.previous();
         leavingTransitionMap.put(leavingTransition.getName(), leavingTransition);
       }
     }
@@ -119,11 +132,15 @@
 
   /**
    * creates a bidirection relation between this node and the given leaving transition.
+   * 
    * @throws IllegalArgumentException if leavingTransition is null.
    */
-  public Transition addLeavingTransition(Transition leavingTransition) {
-    if (leavingTransition == null) throw new IllegalArgumentException("can't add a null leaving transition to an node");
-    if (leavingTransitions == null) leavingTransitions = new ArrayList();
+  public Transition addLeavingTransition(Transition leavingTransition)
+  {
+    if (leavingTransition == null)
+      throw new IllegalArgumentException("can't add a null leaving transition to an node");
+    if (leavingTransitions == null)
+      leavingTransitions = new ArrayList();
     leavingTransitions.add(leavingTransition);
     leavingTransition.from = this;
     leavingTransitionMap = null;
@@ -132,12 +149,17 @@
 
   /**
    * removes the bidirection relation between this node and the given leaving transition.
+   * 
    * @throws IllegalArgumentException if leavingTransition is null.
    */
-  public void removeLeavingTransition(Transition leavingTransition) {
-    if (leavingTransition == null) throw new IllegalArgumentException("can't remove a null leavingTransition from an node");
-    if (leavingTransitions != null) {
-      if (leavingTransitions.remove(leavingTransition)) {
+  public void removeLeavingTransition(Transition leavingTransition)
+  {
+    if (leavingTransition == null)
+      throw new IllegalArgumentException("can't remove a null leavingTransition from an node");
+    if (leavingTransitions != null)
+    {
+      if (leavingTransitions.remove(leavingTransition))
+      {
         leavingTransition.from = null;
         leavingTransitionMap = null;
       }
@@ -146,61 +168,70 @@
 
   /**
    * checks for the presence of a leaving transition with the given name.
-   * @return true if this node has a leaving transition with the given name,
-   *         false otherwise.
+   * 
+   * @return true if this node has a leaving transition with the given name, false otherwise.
    */
-  public boolean hasLeavingTransition(String transitionName) {
-    if (leavingTransitions==null) return false;
+  public boolean hasLeavingTransition(String transitionName)
+  {
+    if (leavingTransitions == null)
+      return false;
     return getLeavingTransitionsMap().containsKey(transitionName);
   }
 
   /**
-   * retrieves a leaving transition by name. note that also the leaving
-   * transitions of the supernode are taken into account.
+   * retrieves a leaving transition by name. note that also the leaving transitions of the supernode are taken into
+   * account.
    */
-  public Transition getLeavingTransition(String transitionName) {
+  public Transition getLeavingTransition(String transitionName)
+  {
     Transition transition = null;
-    if (leavingTransitions!=null) {
-      transition = (Transition) getLeavingTransitionsMap().get(transitionName);
+    if (leavingTransitions != null)
+    {
+      transition = (Transition)getLeavingTransitionsMap().get(transitionName);
     }
-    if ( (transition==null)
-         && (superState!=null)
-       ) {
-      transition = superState.getLeavingTransition(transitionName); 
+    if ((transition == null) && (superState != null))
+    {
+      transition = superState.getLeavingTransition(transitionName);
     }
     return transition;
   }
 
   /**
-   * true if this transition has leaving transitions. 
+   * true if this transition has leaving transitions.
    */
-  public boolean hasNoLeavingTransitions() {
-    return ( ( (leavingTransitions == null) 
-               || (leavingTransitions.size() == 0) ) 
-             && ( (superState==null) 
-                  || (superState.hasNoLeavingTransitions() ) ) );
+  public boolean hasNoLeavingTransitions()
+  {
+    return (((leavingTransitions == null) || (leavingTransitions.size() == 0)) && ((superState == null) || (superState.hasNoLeavingTransitions())));
   }
 
   /**
-   * generates a new name for a transition that will be added as a leaving transition. 
+   * generates a new name for a transition that will be added as a leaving transition.
    */
-  public String generateNextLeavingTransitionName() {
+  public String generateNextLeavingTransitionName()
+  {
     String name = null;
-    if (leavingTransitions!=null && containsName(leavingTransitions, null)) {
+    if (leavingTransitions != null && containsName(leavingTransitions, null))
+    {
       int n = 1;
-      while (containsName(leavingTransitions, Integer.toString(n))) n++;
+      while (containsName(leavingTransitions, Integer.toString(n)))
+        n++;
       name = Integer.toString(n);
     }
     return name;
   }
 
-  boolean containsName(List leavingTransitions, String name) {
+  boolean containsName(List leavingTransitions, String name)
+  {
     Iterator iter = leavingTransitions.iterator();
-    while (iter.hasNext()) {
-      Transition transition = (Transition) iter.next();
-      if ( (name==null) && (transition.getName()==null) ) {
+    while (iter.hasNext())
+    {
+      Transition transition = (Transition)iter.next();
+      if ((name == null) && (transition.getName() == null))
+      {
         return true;
-      } else if ( (name!=null) && (name.equals(transition.getName())) ) {
+      }
+      else if ((name != null) && (name.equals(transition.getName())))
+      {
         return true;
       }
     }
@@ -212,12 +243,15 @@
   /**
    * is the default leaving transition.
    */
-  public Transition getDefaultLeavingTransition() {
+  public Transition getDefaultLeavingTransition()
+  {
     Transition defaultTransition = null;
-    if ( (leavingTransitions!=null)
-         && (leavingTransitions.size()>0) ) {
-      defaultTransition = (Transition) leavingTransitions.get(0);
-    } else if ( superState!=null ){
+    if ((leavingTransitions != null) && (leavingTransitions.size() > 0))
+    {
+      defaultTransition = (Transition)leavingTransitions.get(0);
+    }
+    else if (superState != null)
+    {
       defaultTransition = superState.getDefaultLeavingTransition();
     }
     return defaultTransition;
@@ -226,10 +260,10 @@
   /**
    * moves one leaving transition from the oldIndex and inserts it at the newIndex.
    */
-  public void reorderLeavingTransition( int oldIndex, int newIndex ) {
-    if ( (leavingTransitions!=null)
-         && (Math.min(oldIndex, newIndex)>=0)
-         && (Math.max(oldIndex, newIndex)<leavingTransitions.size()) ) {
+  public void reorderLeavingTransition(int oldIndex, int newIndex)
+  {
+    if ((leavingTransitions != null) && (Math.min(oldIndex, newIndex) >= 0) && (Math.max(oldIndex, newIndex) < leavingTransitions.size()))
+    {
       Transition o = leavingTransitions.remove(oldIndex);
       leavingTransitions.add(newIndex, o);
     }
@@ -240,46 +274,55 @@
   /**
    * are the arriving transitions.
    */
-  public Set getArrivingTransitions() {
+  public Set getArrivingTransitions()
+  {
     return arrivingTransitions;
   }
 
   /**
-   * add a bidirection relation between this node and the given arriving
-   * transition.
+   * add a bidirection relation between this node and the given arriving transition.
+   * 
    * @throws IllegalArgumentException if t is null.
    */
-  public Transition addArrivingTransition(Transition arrivingTransition) {
-    if (arrivingTransition == null) throw new IllegalArgumentException("can't add a null arrivingTransition to a node");
-    if (arrivingTransitions == null) arrivingTransitions = new HashSet();
+  public Transition addArrivingTransition(Transition arrivingTransition)
+  {
+    if (arrivingTransition == null)
+      throw new IllegalArgumentException("can't add a null arrivingTransition to a node");
+    if (arrivingTransitions == null)
+      arrivingTransitions = new HashSet();
     arrivingTransitions.add(arrivingTransition);
     arrivingTransition.to = this;
     return arrivingTransition;
   }
 
   /**
-   * removes the bidirection relation between this node and the given arriving
-   * transition.
+   * removes the bidirection relation between this node and the given arriving transition.
+   * 
    * @throws IllegalArgumentException if t is null.
    */
-  public void removeArrivingTransition(Transition arrivingTransition) {
-    if (arrivingTransition == null) throw new IllegalArgumentException("can't remove a null arrivingTransition from a node");
-    if (arrivingTransitions != null) {
-      if (arrivingTransitions.remove(arrivingTransition)) {
+  public void removeArrivingTransition(Transition arrivingTransition)
+  {
+    if (arrivingTransition == null)
+      throw new IllegalArgumentException("can't remove a null arrivingTransition from a node");
+    if (arrivingTransitions != null)
+    {
+      if (arrivingTransitions.remove(arrivingTransition))
+      {
         arrivingTransition.to = null;
       }
     }
   }
-  
+
   // various //////////////////////////////////////////////////////////////////
 
   /**
-   * is the {@link SuperState} or the {@link ProcessDefinition} in which this 
-   * node is contained.
+   * is the {@link SuperState} or the {@link ProcessDefinition} in which this node is contained.
    */
-  public GraphElement getParent() {
+  public GraphElement getParent()
+  {
     GraphElement parent = processDefinition;
-    if (superState!=null) parent = superState;
+    if (superState != null)
+      parent = superState;
     return parent;
   }
 
@@ -288,7 +331,8 @@
   /**
    * called by a transition to pass execution to this node.
    */
-  public void enter(ExecutionContext executionContext) {
+  public void enter(ExecutionContext executionContext)
+  {
     Token token = executionContext.getToken();
 
     // update the runtime context information
@@ -296,7 +340,7 @@
 
     // fire the leave-node event for this node
     fireEvent(Event.EVENTTYPE_NODE_ENTER, executionContext);
-    
+
     // keep track of node entrance in the token, so that a node-log can be generated at node leave time.
     token.setNodeEnter(Clock.getCurrentTime());
 
@@ -305,41 +349,52 @@
     executionContext.setTransitionSource(null);
 
     // execute the node
-    if (isAsync) {
+    if (isAsync)
+    {
       ExecuteNodeJob job = createAsyncContinuationJob(token);
-      MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
+      MessageService messageService = (MessageService)Services.getCurrentService(Services.SERVICENAME_MESSAGE);
       messageService.send(job);
       token.lock(job.toString());
-    } else {
+    }
+    else
+    {
       execute(executionContext);
     }
   }
 
-  protected ExecuteNodeJob createAsyncContinuationJob(Token token) {
+  protected ExecuteNodeJob createAsyncContinuationJob(Token token)
+  {
     ExecuteNodeJob job = new ExecuteNodeJob(token);
     job.setNode(this);
     job.setDueDate(new Date());
     job.setExclusive(isAsyncExclusive);
     return job;
   }
-  
+
   /**
    * override this method to customize the node behaviour.
    */
-  public void execute(ExecutionContext executionContext) {
+  public void execute(ExecutionContext executionContext)
+  {
     // if there is a custom action associated with this node
-    if (action!=null) {
-      try {
+    if (action != null)
+    {
+      try
+      {
         // execute the action
         executeAction(action, executionContext);
 
-      } catch (Exception exception) {
+      }
+      catch (Exception exception)
+      {
         // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
         // search for an exception handler or throw to the client
         raiseException(exception, executionContext);
       }
 
-    } else {
+    }
+    else
+    {
       // let this node handle the token
       // the default behaviour is to leave the node over the default transition.
       leave(executionContext);
@@ -349,17 +404,20 @@
   /**
    * called by the implementation of this node to continue execution over the default transition.
    */
-  public void leave(ExecutionContext executionContext) {
+  public void leave(ExecutionContext executionContext)
+  {
     leave(executionContext, getDefaultLeavingTransition());
   }
 
   /**
    * called by the implementation of this node to continue execution over the specified transition.
    */
-  public void leave(ExecutionContext executionContext, String transitionName) {
+  public void leave(ExecutionContext executionContext, String transitionName)
+  {
     Transition transition = getLeavingTransition(transitionName);
-    if (transition==null) {
-      throw new JbpmException("transition '"+transitionName+"' is not a leaving transition of node '"+this+"'");
+    if (transition == null)
+    {
+      throw new JbpmException("transition '" + transitionName + "' is not a leaving transition of node '" + this + "'");
     }
     leave(executionContext, transition);
   }
@@ -367,17 +425,20 @@
   /**
    * called by the implementation of this node to continue execution over the given transition.
    */
-  public void leave(ExecutionContext executionContext, Transition transition) {
-    if (transition==null) throw new JbpmException("can't leave node '"+this+"' without leaving transition");
+  public void leave(ExecutionContext executionContext, Transition transition)
+  {
+    if (transition == null)
+      throw new JbpmException("can't leave node '" + this + "' without leaving transition");
     Token token = executionContext.getToken();
     token.setNode(this);
     executionContext.setTransition(transition);
-    
+
     // fire the leave-node event for this node
     fireEvent(Event.EVENTTYPE_NODE_LEAVE, executionContext);
-    
+
     // log this node
-    if (token.getNodeEnter()!=null) {
+    if (token.getNodeEnter() != null)
+    {
       addNodeLog(token);
     }
 
@@ -389,15 +450,18 @@
     transition.take(executionContext);
   }
 
-  protected void addNodeLog(Token token) {
+  protected void addNodeLog(Token token)
+  {
     token.addLog(new NodeLog(this, token.getNodeEnter(), Clock.getCurrentTime()));
   }
 
-  /////////////////////////////////////////////////////////////////////////////
-  
-  public ProcessDefinition getProcessDefinition() {
+  // ///////////////////////////////////////////////////////////////////////////
+
+  public ProcessDefinition getProcessDefinition()
+  {
     ProcessDefinition pd = this.processDefinition;
-    if (superState!=null) {
+    if (superState != null)
+    {
       pd = superState.getProcessDefinition();
     }
     return pd;
@@ -407,34 +471,45 @@
   /**
    * updates the name of this node
    */
-  public void setName(String name) {
-    if (isDifferent(this.name, name)) {
+  public void setName(String name)
+  {
+    if (isDifferent(this.name, name))
+    {
       String oldName = this.name;
-      if (superState!=null) {
-        if ( superState.hasNode(name) ) {
-          throw new IllegalArgumentException("couldn't set name '"+name+"' on node '"+this+"'cause the superState of this node has already another child node with the same name");
+      if (superState != null)
+      {
+        if (superState.hasNode(name))
+        {
+          throw new IllegalArgumentException("couldn't set name '" + name + "' on node '" + this
+              + "'cause the superState of this node has already another child node with the same name");
         }
         Map nodes = superState.getNodesMap();
         nodes.remove(oldName);
-        nodes.put(name,this);
-      } else if (processDefinition!=null) {
-        if ( processDefinition.hasNode(name) ) {
-          throw new IllegalArgumentException("couldn't set name '"+name+"' on node '"+this+"'cause the process definition of this node has already another node with the same name");
+        nodes.put(name, this);
+      }
+      else if (processDefinition != null)
+      {
+        if (processDefinition.hasNode(name))
+        {
+          throw new IllegalArgumentException("couldn't set name '" + name + "' on node '" + this
+              + "'cause the process definition of this node has already another node with the same name");
         }
         Map nodeMap = processDefinition.getNodesMap();
         nodeMap.remove(oldName);
-        nodeMap.put(name,this);
+        nodeMap.put(name, this);
       }
       this.name = name;
     }
   }
-  
-  boolean isDifferent(String name1, String name2) {
-    if ((name1!=null)
-        && (name1.equals(name2))) {
+
+  boolean isDifferent(String name1, String name2)
+  {
+    if ((name1 != null) && (name1.equals(name2)))
+    {
       return false;
-    } else if ( (name1==null)
-                && (name2==null) ) {
+    }
+    else if ((name1 == null) && (name2 == null))
+    {
       return false;
     }
     return true;
@@ -443,45 +518,62 @@
   /**
    * the slash separated name that includes all the superstate names.
    */
-  public String getFullyQualifiedName() {
+  public String getFullyQualifiedName()
+  {
     String fullyQualifiedName = name;
-    if (superState!=null) {
-      fullyQualifiedName = superState.getFullyQualifiedName()+"/"+name;
+    if (superState != null)
+    {
+      fullyQualifiedName = superState.getFullyQualifiedName() + "/" + name;
     }
     return fullyQualifiedName;
   }
 
   /** indicates wether this node is a superstate. */
-  public boolean isSuperStateNode() {
+  public boolean isSuperStateNode()
+  {
     return false;
   }
 
   /** returns a list of child nodes (only applicable for {@link SuperState})s. */
-  public List getNodes() {
+  public List getNodes()
+  {
     return null;
   }
 
   // getters and setters //////////////////////////////////////////////////////
-  
-  public SuperState getSuperState() {
+
+  public SuperState getSuperState()
+  {
     return superState;
   }
-  public Action getAction() {
+
+  public Action getAction()
+  {
     return action;
   }
-  public void setAction(Action action) {
+
+  public void setAction(Action action)
+  {
     this.action = action;
   }
-  public boolean isAsync() {
+
+  public boolean isAsync()
+  {
     return isAsync;
   }
-  public void setAsync(boolean isAsync) {
+
+  public void setAsync(boolean isAsync)
+  {
     this.isAsync = isAsync;
   }
-  public boolean isAsyncExclusive() {
+
+  public boolean isAsyncExclusive()
+  {
     return isAsyncExclusive;
   }
-  public void setAsyncExclusive(boolean isAsyncExclusive) {
+
+  public void setAsyncExclusive(boolean isAsyncExclusive)
+  {
     this.isAsyncExclusive = isAsyncExclusive;
   }
 }

Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java	2008-11-27 11:52:47 UTC (rev 3120)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/exe/Token.java	2008-11-27 12:09:28 UTC (rev 3121)
@@ -53,12 +53,12 @@
 import org.jbpm.util.EqualsUtil;
 
 /**
- * represents one path of execution and maintains a pointer to a node 
- * in the {@link org.jbpm.graph.def.ProcessDefinition}.  Most common 
- * way to get a hold of the token objects is with {@link ProcessInstance#getRootToken()}
- * or {@link org.jbpm.graph.exe.ProcessInstance#findToken(String)}.
+ * represents one path of execution and maintains a pointer to a node in the
+ * {@link org.jbpm.graph.def.ProcessDefinition}. Most common way to get a hold of the token objects is with
+ * {@link ProcessInstance#getRootToken()} or {@link org.jbpm.graph.exe.ProcessInstance#findToken(String)}.
  */
-public class Token implements Serializable {
+public class Token implements Serializable
+{
 
   private static final long serialVersionUID = 1L;
 
@@ -81,28 +81,31 @@
   String lock = null;
 
   // constructors
-  /////////////////////////////////////////////////////////////////////////////
-  
-  public Token() {
+  // ///////////////////////////////////////////////////////////////////////////
+
+  public Token()
+  {
   }
 
   /**
    * creates a root token.
    */
-  public Token(ProcessInstance processInstance) {
+  public Token(ProcessInstance processInstance)
+  {
     this.start = Clock.getCurrentTime();
     this.processInstance = processInstance;
     this.node = processInstance.getProcessDefinition().getStartState();
     this.isTerminationImplicit = processInstance.getProcessDefinition().isTerminationImplicit();
-    
-    // optimization:  assigning an id is not necessary since the process instance will be saved shortly.
+
+    // optimization: assigning an id is not necessary since the process instance will be saved shortly.
     // Services.assignId(this);
   }
 
   /**
    * creates a child token.
    */
-  public Token(Token parent, String name) {
+  public Token(Token parent, String name)
+  {
     this.start = Clock.getCurrentTime();
     this.processInstance = parent.getProcessInstance();
     this.name = name;
@@ -111,225 +114,279 @@
     parent.addChild(this);
     this.isTerminationImplicit = parent.isTerminationImplicit();
     parent.addLog(new TokenCreateLog(this));
-    
+
     // assign an id to this token before events get fired
     Services.assignId(this);
   }
 
   // operations
-  /////////////////////////////////////////////////////////////////////////////
+  // ///////////////////////////////////////////////////////////////////////////
 
-  void addChild(Token token) {
-    if (children==null) {
+  void addChild(Token token)
+  {
+    if (children == null)
+    {
       children = new HashMap();
     }
     children.put(token.getName(), token);
   }
 
   /**
-   * provides a signal to the token. this method activates this token and leaves
-   * the current state over the default transition.
+   * provides a signal to the token. this method activates this token and leaves the current state over the default
+   * transition.
    */
-  public void signal() {
-    if (node==null) {
+  public void signal()
+  {
+    if (node == null)
+    {
       throw new JbpmException("token '" + this + "' can't be signalled cause it is currently not positioned in a node");
     }
-    if (node.getDefaultLeavingTransition() == null) {
+    if (node.getDefaultLeavingTransition() == null)
+    {
       throw new JbpmException("couldn't signal token '" + this + "' : node '" + node + "' doesn't have a default transition");
     }
     signal(node.getDefaultLeavingTransition(), new ExecutionContext(this));
   }
 
   /**
-   * provides a signal to the token. this leave the current state over the given
-   * transition name.
+   * Provides a signal to the token. 
+   * This leave the current state over the given transition name.
    */
-  public void signal(String transitionName) {
-    if (node==null) {
+  public void signal(String transitionName)
+  {
+    if (node == null)
       throw new JbpmException("token '" + this + "' can't be signalled cause it is currently not positioned in a node");
-    }
+    
     Transition leavingTransition = node.getLeavingTransition(transitionName);
-    if (leavingTransition==null) {
-      throw new JbpmException("transition '"+transitionName+"' does not exist on "+node);
+    
+    if (leavingTransition == null)
+    {
+      // Fall back to the name of the target node
+      for (Transition auxTrans : node.getLeavingTransitions())
+      {
+        if (transitionName.equals(auxTrans.getTo().getName()))
+        {
+          leavingTransition = auxTrans;
+          break;
+        }
+      }
     }
+    
+    if (leavingTransition == null)
+      throw new JbpmException("transition '" + transitionName + "' does not exist on " + node);
+    
     signal(leavingTransition, new ExecutionContext(this));
   }
-  
+
   /**
-   * provides a signal to the token. this leave the current state over the given
-   * transition name.
+   * provides a signal to the token. this leave the current state over the given transition name.
    */
-  public void signal(Transition transition) {
+  public void signal(Transition transition)
+  {
     signal(transition, new ExecutionContext(this));
   }
-  
 
-  void signal(ExecutionContext executionContext) {
+  void signal(ExecutionContext executionContext)
+  {
     signal(node.getDefaultLeavingTransition(), executionContext);
   }
 
-  void signal(Transition transition, ExecutionContext executionContext) {
-    if (transition == null) {
+  void signal(Transition transition, ExecutionContext executionContext)
+  {
+    if (transition == null)
+    {
       throw new JbpmException("couldn't signal without specifying  a leaving transition : transition is null");
     }
-    if (executionContext == null) {
+    if (executionContext == null)
+    {
       throw new JbpmException("couldn't signal without an execution context: executionContext is null");
     }
-    if (isSuspended) {
-      throw new JbpmException("can't signal token '"+name+"' ("+id+"): it is suspended");
+    if (isSuspended)
+    {
+      throw new JbpmException("can't signal token '" + name + "' (" + id + "): it is suspended");
     }
-    if (isLocked()) {
-      throw new JbpmException("this token is locked by "+lock);
+    if (isLocked())
+    {
+      throw new JbpmException("this token is locked by " + lock);
     }
 
     startCompositeLog(new SignalLog(transition));
-    try {
+    try
+    {
       // fire the event before-signal
       Node signalNode = node;
       signalNode.fireEvent(Event.EVENTTYPE_BEFORE_SIGNAL, executionContext);
-      
+
       // start calculating the next state
       node.leave(executionContext, transition);
-      
+
       // if required, check if this token is implicitly terminated
       checkImplicitTermination();
-      
+
       // fire the event after-signal
       signalNode.fireEvent(Event.EVENTTYPE_AFTER_SIGNAL, executionContext);
-      
-    } finally {
+
+    }
+    finally
+    {
       endCompositeLog();
     }
   }
-  
+
   /**
-   * a set of all the leaving transitions on the current node for which the condition expression resolves to true. 
+   * a set of all the leaving transitions on the current node for which the condition expression resolves to true.
    */
-  public Set getAvailableTransitions() {
+  public Set getAvailableTransitions()
+  {
     Set availableTransitions = new HashSet();
-    if (node!=null) {
-    	addAvailableTransitionsOfNode(node, availableTransitions);
+    if (node != null)
+    {
+      addAvailableTransitionsOfNode(node, availableTransitions);
     }
     return availableTransitions;
   }
-  
+
   /**
-   * adds available transitions of that node to the Set
-   * and after that calls itself recursivly for the SuperSate of the Node
-   * if it has a super state
+   * adds available transitions of that node to the Set and after that calls itself recursivly for the SuperSate of the
+   * Node if it has a super state
    */
-  private void addAvailableTransitionsOfNode(Node currentNode, Set availableTransitions) {
-      List leavingTransitions = currentNode.getLeavingTransitions();
-      if (leavingTransitions!=null) {
-        Iterator iter = leavingTransitions.iterator();
-        while (iter.hasNext()) {
-          Transition transition = (Transition) iter.next();
-          String conditionExpression = transition.getCondition();
-          if (conditionExpression!=null) {
-            Object result = JbpmExpressionEvaluator.evaluate(conditionExpression, new ExecutionContext(this));
-            if ( (result instanceof Boolean)
-                 && (((Boolean)result).booleanValue())
-               ) {
-              availableTransitions.add(transition);
-            }
-          } else {
+  private void addAvailableTransitionsOfNode(Node currentNode, Set availableTransitions)
+  {
+    List leavingTransitions = currentNode.getLeavingTransitions();
+    if (leavingTransitions != null)
+    {
+      Iterator iter = leavingTransitions.iterator();
+      while (iter.hasNext())
+      {
+        Transition transition = (Transition)iter.next();
+        String conditionExpression = transition.getCondition();
+        if (conditionExpression != null)
+        {
+          Object result = JbpmExpressionEvaluator.evaluate(conditionExpression, new ExecutionContext(this));
+          if ((result instanceof Boolean) && (((Boolean)result).booleanValue()))
+          {
             availableTransitions.add(transition);
           }
         }
-      }	  
-      if (currentNode.getSuperState() != null) {
-    	  addAvailableTransitionsOfNode(currentNode.getSuperState(), availableTransitions);
+        else
+        {
+          availableTransitions.add(transition);
+        }
       }
+    }
+    if (currentNode.getSuperState() != null)
+    {
+      addAvailableTransitionsOfNode(currentNode.getSuperState(), availableTransitions);
+    }
   }
 
   /**
-   * ends this token and all of its children (if any). this is the last active (=not-ended) child of a parent token, 
-   * the parent token will be ended as well and that verification will continue to 
-   * propagate.
+   * ends this token and all of its children (if any). this is the last active (=not-ended) child of a parent token, the
+   * parent token will be ended as well and that verification will continue to propagate.
    */
-  public void end() {
+  public void end()
+  {
     end(true);
   }
-  
+
   /**
    * ends this token with optional parent ending verification.
-   * @param verifyParentTermination specifies if the parent token should be checked for termination.
-   * if verifyParentTermination is set to true and this is the last non-ended child of a parent token, 
-   * the parent token will be ended as well and the verification will continue to propagate.
+   * 
+   * @param verifyParentTermination specifies if the parent token should be checked for termination. if
+   *          verifyParentTermination is set to true and this is the last non-ended child of a parent token, the parent
+   *          token will be ended as well and the verification will continue to propagate.
    */
-  public void end(boolean verifyParentTermination) {
+  public void end(boolean verifyParentTermination)
+  {
     // if not already ended
-    if (end==null) {
+    if (end == null)
+    {
 
       // ended tokens cannot reactivate parents
       isAbleToReactivateParent = false;
-      
+
       // set the end date
       // the end date is also the flag that indicates that this token has ended.
       this.end = Clock.getCurrentTime();
-      
+
       // end all this token's children
-      if (children != null) {
+      if (children != null)
+      {
         Iterator iter = children.values().iterator();
-        while (iter.hasNext()) {
-          Token child = (Token) iter.next();
-          if (!child.hasEnded()) {
+        while (iter.hasNext())
+        {
+          Token child = (Token)iter.next();
+          if (!child.hasEnded())
+          {
             child.end();
           }
         }
       }
-      
-      if (subProcessInstance!=null) {
+
+      if (subProcessInstance != null)
+      {
         subProcessInstance.end();
       }
 
-      // only log the end of child-tokens.  the process instance logs replace the root token logs.
-      if (parent!=null) {
+      // only log the end of child-tokens. the process instance logs replace the root token logs.
+      if (parent != null)
+      {
         // add a log
         parent.addLog(new TokenEndLog(this));
       }
 
       // if there are tasks associated to this token, remove signalling capabilities
-      TaskMgmtInstance taskMgmtInstance = (processInstance!=null ? processInstance.getTaskMgmtInstance() : null);
-      if (taskMgmtInstance!=null) {
+      TaskMgmtInstance taskMgmtInstance = (processInstance != null ? processInstance.getTaskMgmtInstance() : null);
+      if (taskMgmtInstance != null)
+      {
         taskMgmtInstance.removeSignalling(this);
       }
 
-      if (verifyParentTermination) {
-        // if this is the last active token of the parent, 
+      if (verifyParentTermination)
+      {
+        // if this is the last active token of the parent,
         // the parent needs to be ended as well
         notifyParentOfTokenEnd();
       }
     }
   }
-  
+
   // comments /////////////////////////////////////////////////////////////////
 
-  public void addComment(String message) {
+  public void addComment(String message)
+  {
     addComment(new Comment(message));
   }
 
-  public void addComment(Comment comment) {
-    if (comments==null) comments = new ArrayList();
+  public void addComment(Comment comment)
+  {
+    if (comments == null)
+      comments = new ArrayList();
     comments.add(comment);
     comment.setToken(this);
   }
-  
-  public List getComments() {
+
+  public List getComments()
+  {
     return comments;
   }
- 
+
   // operations helper methods ////////////////////////////////////////////////
 
   /**
    * notifies a parent that one of its nodeMap has ended.
    */
-  void notifyParentOfTokenEnd() {
-    if (isRoot()) {
+  void notifyParentOfTokenEnd()
+  {
+    if (isRoot())
+    {
       processInstance.end();
-    } else {
-      
-      if (!parent.hasActiveChildren()) {
+    }
+    else
+    {
+
+      if (!parent.hasActiveChildren())
+      {
         parent.end();
       }
     }
@@ -338,15 +395,19 @@
   /**
    * tells if this token has child tokens that have not yet ended.
    */
-  public boolean hasActiveChildren() {
+  public boolean hasActiveChildren()
+  {
     boolean foundActiveChildToken = false;
     // try and find at least one child token that is
     // still active (= not ended)
-    if (children!=null) {
+    if (children != null)
+    {
       Iterator iter = children.values().iterator();
-      while ((iter.hasNext()) && (!foundActiveChildToken)) {
-        Token child = (Token) iter.next();
-        if (!child.hasEnded()) {
+      while ((iter.hasNext()) && (!foundActiveChildToken))
+      {
+        Token child = (Token)iter.next();
+        if (!child.hasEnded())
+        {
           foundActiveChildToken = true;
         }
       }
@@ -359,145 +420,183 @@
   /**
    * convenience method for adding a process log.
    */
-  public void addLog(ProcessLog processLog) {
-    LoggingInstance li = (LoggingInstance) processInstance.getInstance(LoggingInstance.class);
-    if (li != null) {
+  public void addLog(ProcessLog processLog)
+  {
+    LoggingInstance li = (LoggingInstance)processInstance.getInstance(LoggingInstance.class);
+    if (li != null)
+    {
       processLog.setToken(this);
       li.addLog(processLog);
     }
   }
+
   /**
-   * convenience method for starting a composite log.  When you add composite logs,
-   * make sure you put the {@link #endCompositeLog()} in a finally block.
+   * convenience method for starting a composite log. When you add composite logs, make sure you put the
+   * {@link #endCompositeLog()} in a finally block.
    */
-  public void startCompositeLog(CompositeLog compositeLog) {
-    LoggingInstance li = (LoggingInstance) processInstance.getInstance(LoggingInstance.class);
-    if (li != null) {
+  public void startCompositeLog(CompositeLog compositeLog)
+  {
+    LoggingInstance li = (LoggingInstance)processInstance.getInstance(LoggingInstance.class);
+    if (li != null)
+    {
       compositeLog.setToken(this);
       li.startCompositeLog(compositeLog);
     }
   }
+
   /**
-   * convenience method for ending a composite log.  Make sure you put this in a finally block.
+   * convenience method for ending a composite log. Make sure you put this in a finally block.
    */
-  public void endCompositeLog() {
-    LoggingInstance li = (LoggingInstance) processInstance.getInstance(LoggingInstance.class);
-    if (li != null) {
+  public void endCompositeLog()
+  {
+    LoggingInstance li = (LoggingInstance)processInstance.getInstance(LoggingInstance.class);
+    if (li != null)
+    {
       li.endCompositeLog();
     }
   }
 
   // various information extraction methods ///////////////////////////////////
 
-  public String toString() {
-    return "Token("+getFullName()+")";
+  public String toString()
+  {
+    return "Token(" + getFullName() + ")";
   }
 
-  public boolean hasEnded() {
+  public boolean hasEnded()
+  {
     return (end != null);
   }
 
-  public boolean isRoot() {
+  public boolean isRoot()
+  {
     return (parent == null);
   }
 
-  public boolean hasParent() {
+  public boolean hasParent()
+  {
     return (parent != null);
   }
 
-  public boolean hasChild(String name) {
+  public boolean hasChild(String name)
+  {
     return (children != null ? children.containsKey(name) : false);
   }
 
-  public Token getChild(String name) {
+  public Token getChild(String name)
+  {
     Token child = null;
-    if (children != null) {
-      child = (Token) children.get(name);
+    if (children != null)
+    {
+      child = (Token)children.get(name);
     }
     return child;
   }
 
-  public String getFullName() {
-    if (parent==null) return "/";
-    if (parent.getParent()==null) return "/"+name;
-    return parent.getFullName()+"/"+name;
+  public String getFullName()
+  {
+    if (parent == null)
+      return "/";
+    if (parent.getParent() == null)
+      return "/" + name;
+    return parent.getFullName() + "/" + name;
   }
 
-  public List getChildrenAtNode(Node aNode) {
+  public List getChildrenAtNode(Node aNode)
+  {
     List foundChildren = new ArrayList();
     getChildrenAtNode(aNode, foundChildren);
     return foundChildren;
   }
-  
-  void getChildrenAtNode(Node aNode, List foundTokens) {
-    if(aNode.equals(node)) {
+
+  void getChildrenAtNode(Node aNode, List foundTokens)
+  {
+    if (aNode.equals(node))
+    {
       foundTokens.add(this);
     }
-    else if(children != null && !children.isEmpty()) {
-      for(Iterator it = children.values().iterator(); it.hasNext();) {
+    else if (children != null && !children.isEmpty())
+    {
+      for (Iterator it = children.values().iterator(); it.hasNext();)
+      {
         Token aChild = (Token)it.next();
         aChild.getChildrenAtNode(aNode, foundTokens);
       }
     }
   }
-  
-  public void collectChildrenRecursively(List tokens) {
-    if (children!=null) {
+
+  public void collectChildrenRecursively(List tokens)
+  {
+    if (children != null)
+    {
       Iterator iter = children.values().iterator();
-      while (iter.hasNext()) {
-        Token child = (Token) iter.next();
+      while (iter.hasNext())
+      {
+        Token child = (Token)iter.next();
         tokens.add(child);
         child.collectChildrenRecursively(tokens);
       }
     }
   }
 
-  
-  public Token findToken(String relativeTokenPath) {
+  public Token findToken(String relativeTokenPath)
+  {
     if (relativeTokenPath == null)
       return null;
     String path = relativeTokenPath.trim();
-    if (("".equals(path)) || (".".equals(path))) {
+    if (("".equals(path)) || (".".equals(path)))
+    {
       return this;
     }
-    if ("..".equals(path)) {
+    if ("..".equals(path))
+    {
       return parent;
     }
-    if (path.startsWith("/")) {
+    if (path.startsWith("/"))
+    {
       Token root = processInstance.getRootToken();
       return root.findToken(path.substring(1));
     }
-    if (path.startsWith("./")) {
+    if (path.startsWith("./"))
+    {
       return findToken(path.substring(2));
     }
-    if (path.startsWith("../")) {
-      if (parent != null) {
+    if (path.startsWith("../"))
+    {
+      if (parent != null)
+      {
         return parent.findToken(path.substring(3));
       }
       return null;
     }
     int slashIndex = path.indexOf('/');
-    if (slashIndex == -1) {
-      return (Token) (children != null ? children.get(path) : null);
+    if (slashIndex == -1)
+    {
+      return (Token)(children != null ? children.get(path) : null);
     }
     Token token = null;
     String name = path.substring(0, slashIndex);
-    token = (Token) children.get(name);
-    if (token != null) {
+    token = (Token)children.get(name);
+    if (token != null)
+    {
       return token.findToken(path.substring(slashIndex + 1));
     }
     return null;
   }
 
-  public Map getActiveChildren() {
+  public Map getActiveChildren()
+  {
     Map activeChildren = new HashMap();
-    if (children != null) {
+    if (children != null)
+    {
       Iterator iter = children.entrySet().iterator();
-      while (iter.hasNext()) {
-        Map.Entry entry = (Map.Entry) iter.next();
-        Token child = (Token) entry.getValue();
-        if (!child.hasEnded()) {
-          String childName = (String) entry.getKey();
+      while (iter.hasNext())
+      {
+        Map.Entry entry = (Map.Entry)iter.next();
+        Token child = (Token)entry.getValue();
+        if (!child.hasEnded())
+        {
+          String childName = (String)entry.getKey();
           activeChildren.put(childName, child);
         }
       }
@@ -505,30 +604,38 @@
     return activeChildren;
   }
 
-  public void checkImplicitTermination() {
-    if (isTerminationImplicit && node.hasNoLeavingTransitions()) {
+  public void checkImplicitTermination()
+  {
+    if (isTerminationImplicit && node.hasNoLeavingTransitions())
+    {
       end();
-      
-      if (processInstance.isTerminatedImplicitly()) {
+
+      if (processInstance.isTerminatedImplicitly())
+      {
         processInstance.end();
       }
     }
   }
 
-  public boolean isTerminatedImplicitly() {
-    if (end != null) return true;
+  public boolean isTerminatedImplicitly()
+  {
+    if (end != null)
+      return true;
 
     Map leavingTransitions = node.getLeavingTransitionsMap();
-    if ((leavingTransitions != null) && (leavingTransitions.size() > 0)) {
+    if ((leavingTransitions != null) && (leavingTransitions.size() > 0))
+    {
       // ok: found a non-terminated token
       return false;
     }
 
     // loop over all active child tokens
     Iterator iter = getActiveChildren().values().iterator();
-    while (iter.hasNext()) {
-      Token child = (Token) iter.next();
-      if (!child.isTerminatedImplicitly()) {
+    while (iter.hasNext())
+    {
+      Token child = (Token)iter.next();
+      if (!child.isTerminatedImplicitly())
+      {
         return false;
       }
     }
@@ -536,40 +643,48 @@
     return true;
   }
 
-  public int nextLogIndex() {
+  public int nextLogIndex()
+  {
     return nextLogIndex++;
   }
 
   /**
    * suspends a process execution.
    */
-  public void suspend() {
+  public void suspend()
+  {
     isSuspended = true;
-    
+
     suspendJobs();
     suspendTaskInstances();
 
     // propagate to child tokens
-    if (children!=null) {
+    if (children != null)
+    {
       Iterator iter = children.values().iterator();
-      while (iter.hasNext()) {
-        Token child = (Token) iter.next();
-        child.suspend(); 
+      while (iter.hasNext())
+      {
+        Token child = (Token)iter.next();
+        child.suspend();
       }
     }
   }
 
-  void suspendJobs() {
+  void suspendJobs()
+  {
     JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
-    JobSession jobSession = (jbpmContext!=null ? jbpmContext.getJobSession() : null);
-    if (jobSession!=null) {
+    JobSession jobSession = (jbpmContext != null ? jbpmContext.getJobSession() : null);
+    if (jobSession != null)
+    {
       jobSession.suspendJobs(this);
     }
   }
 
-  void suspendTaskInstances() {
-    TaskMgmtInstance taskMgmtInstance = (processInstance!=null ? processInstance.getTaskMgmtInstance() : null);
-    if (taskMgmtInstance!=null) {
+  void suspendTaskInstances()
+  {
+    TaskMgmtInstance taskMgmtInstance = (processInstance != null ? processInstance.getTaskMgmtInstance() : null);
+    if (taskMgmtInstance != null)
+    {
       taskMgmtInstance.suspend(this);
     }
   }
@@ -577,46 +692,54 @@
   /**
    * resumes a process execution.
    */
-  public void resume() {
+  public void resume()
+  {
     isSuspended = false;
-    
+
     resumeJobs();
     resumeTaskInstances();
 
     // propagate to child tokens
-    if (children!=null) {
+    if (children != null)
+    {
       Iterator iter = children.values().iterator();
-      while (iter.hasNext()) {
-        Token child = (Token) iter.next();
-        child.resume(); 
+      while (iter.hasNext())
+      {
+        Token child = (Token)iter.next();
+        child.resume();
       }
     }
   }
 
-  void resumeJobs() {
+  void resumeJobs()
+  {
     JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
-    JobSession jobSession = (jbpmContext!=null ? jbpmContext.getJobSession() : null);
-    if (jobSession!=null) {
+    JobSession jobSession = (jbpmContext != null ? jbpmContext.getJobSession() : null);
+    if (jobSession != null)
+    {
       jobSession.resumeJobs(this);
     }
   }
 
-  void resumeTaskInstances() {
-    TaskMgmtInstance taskMgmtInstance = (processInstance!=null ? processInstance.getTaskMgmtInstance() : null);
-    if (taskMgmtInstance!=null) {
+  void resumeTaskInstances()
+  {
+    TaskMgmtInstance taskMgmtInstance = (processInstance != null ? processInstance.getTaskMgmtInstance() : null);
+    if (taskMgmtInstance != null)
+    {
       taskMgmtInstance.resume(this);
     }
   }
 
-
   // equals ///////////////////////////////////////////////////////////////////
   // hack to support comparing hibernate proxies against the real objects
   // since this always falls back to ==, we don't need to overwrite the hashcode
-  public boolean equals(Object o) {
+  public boolean equals(Object o)
+  {
     return EqualsUtil.equals(this, o);
   }
 
-  public ProcessInstance createSubProcessInstance(ProcessDefinition subProcessDefinition) {
+  public ProcessInstance createSubProcessInstance(ProcessDefinition subProcessDefinition)
+  {
     // create the new sub process instance
     subProcessInstance = new ProcessInstance(subProcessDefinition);
     // bind the subprocess to the super-process-token
@@ -628,102 +751,146 @@
   }
 
   /**
-   * locks a process instance for further execution.  A locked token 
-   * cannot continue execution.  This is a non-persistent
-   * operation.  This is used to prevent tokens being propagated during 
-   * the execution of actions.
-   * @see #unlock(String) 
+   * locks a process instance for further execution. A locked token cannot continue execution. This is a non-persistent
+   * operation. This is used to prevent tokens being propagated during the execution of actions.
+   * 
+   * @see #unlock(String)
    */
-  public void lock(String lockOwnerId) {
-    if (lockOwnerId==null) {
+  public void lock(String lockOwnerId)
+  {
+    if (lockOwnerId == null)
+    {
       throw new JbpmException("can't lock with null value for the lockOwnerId");
     }
-    if ( (lock!=null)
-         && (!lock.equals(lockOwnerId))
-       ) {
-      throw new JbpmException("token '"+id+"' can't be locked by '"+lockOwnerId+"' cause it's already locked by '"+lock+"'");
+    if ((lock != null) && (!lock.equals(lockOwnerId)))
+    {
+      throw new JbpmException("token '" + id + "' can't be locked by '" + lockOwnerId + "' cause it's already locked by '" + lock + "'");
     }
-    log.debug("token["+id+"] is locked by "+lockOwnerId);
+    log.debug("token[" + id + "] is locked by " + lockOwnerId);
     lock = lockOwnerId;
   }
 
   /**
    * @see #lock(String)
    */
-  public void unlock(String lockOwnerId) {
-    if (lock==null) {
-      log.warn("lock owner '"+lockOwnerId+"' tries to unlock token '"+id+"' which is not locked");
-    } else if (!lock.equals(lockOwnerId)) {
-      throw new JbpmException("'"+lockOwnerId+"' can't unlock token '"+id+"' because it was already locked by '"+lock+"'");
+  public void unlock(String lockOwnerId)
+  {
+    if (lock == null)
+    {
+      log.warn("lock owner '" + lockOwnerId + "' tries to unlock token '" + id + "' which is not locked");
     }
-    log.debug("token["+id+"] is unlocked by "+lockOwnerId);
+    else if (!lock.equals(lockOwnerId))
+    {
+      throw new JbpmException("'" + lockOwnerId + "' can't unlock token '" + id + "' because it was already locked by '" + lock + "'");
+    }
+    log.debug("token[" + id + "] is unlocked by " + lockOwnerId);
     lock = null;
   }
-  
-  public boolean isLocked() {
-    return lock!=null;
+
+  public boolean isLocked()
+  {
+    return lock != null;
   }
 
   // getters and setters //////////////////////////////////////////////////////
 
-  public long getId() {
+  public long getId()
+  {
     return id;
   }
-  public Date getStart() {
+
+  public Date getStart()
+  {
     return start;
   }
-  public Date getEnd() {
+
+  public Date getEnd()
+  {
     return end;
   }
-  public String getName() {
+
+  public String getName()
+  {
     return name;
   }
-  public ProcessInstance getProcessInstance() {
+
+  public ProcessInstance getProcessInstance()
+  {
     return processInstance;
   }
-  public Map getChildren() {
+
+  public Map getChildren()
+  {
     return children;
   }
-  public Node getNode() {
+
+  public Node getNode()
+  {
     return node;
   }
-  public void setNode(Node node) {
+
+  public void setNode(Node node)
+  {
     this.node = node;
   }
-  public Token getParent() {
+
+  public Token getParent()
+  {
     return parent;
   }
-  public void setParent(Token parent) {
+
+  public void setParent(Token parent)
+  {
     this.parent = parent;
   }
-  public void setProcessInstance(ProcessInstance processInstance) {
+
+  public void setProcessInstance(ProcessInstance processInstance)
+  {
     this.processInstance = processInstance;
   }
-  public ProcessInstance getSubProcessInstance() {
+
+  public ProcessInstance getSubProcessInstance()
+  {
     return subProcessInstance;
   }
-  public Date getNodeEnter() {
+
+  public Date getNodeEnter()
+  {
     return nodeEnter;
   }
-  public void setNodeEnter(Date nodeEnter) {
+
+  public void setNodeEnter(Date nodeEnter)
+  {
     this.nodeEnter = nodeEnter;
   }
-  public boolean isAbleToReactivateParent() {
+
+  public boolean isAbleToReactivateParent()
+  {
     return isAbleToReactivateParent;
   }
-  public void setAbleToReactivateParent(boolean isAbleToReactivateParent) {
+
+  public void setAbleToReactivateParent(boolean isAbleToReactivateParent)
+  {
     this.isAbleToReactivateParent = isAbleToReactivateParent;
   }
-  public boolean isTerminationImplicit() {
+
+  public boolean isTerminationImplicit()
+  {
     return isTerminationImplicit;
   }
-  public void setTerminationImplicit(boolean isTerminationImplicit) {
+
+  public void setTerminationImplicit(boolean isTerminationImplicit)
+  {
     this.isTerminationImplicit = isTerminationImplicit;
   }
-  public boolean isSuspended() {
+
+  public boolean isSuspended()
+  {
     return isSuspended;
   }
-  public void setSubProcessInstance(ProcessInstance subProcessInstance) {
+
+  public void setSubProcessInstance(ProcessInstance subProcessInstance)
+  {
     this.subProcessInstance = subProcessInstance;
   }
 

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java	2008-11-27 11:52:47 UTC (rev 3120)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/SequenceFlowImpl.java	2008-11-27 12:09:28 UTC (rev 3121)
@@ -63,6 +63,12 @@
   }
 
   //@Override
+  public String getName()
+  {
+    return oldTrans.getName();
+  }
+
+  //@Override
   public Expression getConditionExpression()
   {
     return expr;




More information about the jbpm-commits mailing list