[jbpm-commits] JBoss JBPM SVN: r3123 - in jbpm3/trunk/modules/integration/spec/src: main/java/org/jbpm/integration/model and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Nov 27 08:22:32 EST 2008


Author: thomas.diesler at jboss.com
Date: 2008-11-27 08:22:32 -0500 (Thu, 27 Nov 2008)
New Revision: 3123

Added:
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EventImpl.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/TokenImpl.java
Removed:
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/client/TokenImpl.java
Modified:
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EndEventImpl.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/GatewayImpl.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessImpl.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/StartEventImpl.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/TaskImpl.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java
   jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/TokenAttachmentDelegate.java
   jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/jpdl/DialectHandlerTest.java
Log:
Move spec token to runtime

Deleted: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/client/TokenImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/client/TokenImpl.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/client/TokenImpl.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -1,180 +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.integration.client;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.jboss.bpm.api.Constants;
-import org.jboss.bpm.api.NotImplementedException;
-import org.jboss.bpm.api.client.ProcessEngine;
-import org.jboss.bpm.api.client.Token;
-import org.jboss.bpm.api.model.Node;
-import org.jboss.bpm.api.model.Process;
-import org.jboss.bpm.api.model.SequenceFlow;
-import org.jboss.bpm.api.model.Process.ProcessStatus;
-import org.jboss.bpm.api.model.builder.ObjectNameFactory;
-import org.jboss.bpm.api.runtime.Attachments;
-import org.jboss.bpm.api.runtime.BasicAttachments;
-import org.jbpm.context.exe.ContextInstance;
-import org.jbpm.integration.model.ProcessImpl;
-import org.jbpm.integration.runtime.TokenAttachmentDelegate;
-
-/**
- * An integration wrapper
- * 
- * @author thomas.diesler at jboss.com
- * @since 15-Nov-2008
- */
-public class TokenImpl implements Token
-{
-  private static final long serialVersionUID = 1L;
-
-  private org.jbpm.graph.exe.Token oldToken;
-  private ProcessImpl procImpl;
-  private Attachments att;
-
-  public TokenImpl(ProcessImpl proc, org.jbpm.graph.exe.Token oldToken)
-  {
-    this.oldToken = oldToken;
-    this.procImpl = proc;
-    
-    ContextInstance context = proc.getOldProcessInstance().getContextInstance();
-    this.att = new TokenAttachmentDelegate(this, context);
-  }
-
-  public org.jbpm.graph.exe.Token getOldToken()
-  {
-    return oldToken;
-  }
-
-  public ObjectName getKey()
-  {
-    return ObjectNameFactory.create(Constants.ID_DOMAIN + ":id=" + oldToken.getId());
-  }
-
-  public Process getProcess()
-  {
-    return procImpl;
-  }
-
-  public ProcessEngine getProcessEngine()
-  {
-    return procImpl.getProcessEngine();
-  }
-
-  // @Override
-  public Attachments getAttachments()
-  {
-    return att;
-  }
-
-  // @Override
-  public TokenStatus getTokenStatus()
-  {
-    TokenStatus status = TokenStatus.Suspended;
-    if (oldToken.hasEnded())
-    {
-      status = TokenStatus.Destroyed;
-    }
-    return status;
-  }
-
-  // @Override
-  public Set<Token> getChildTokens()
-  {
-    Set<Token> childTokens = new HashSet<Token>();
-    Map oldChildMap = oldToken.getChildren();
-    if (oldChildMap != null)
-    {
-      Collection<org.jbpm.graph.exe.Token> oldChildTokens = oldChildMap.values();
-      for (org.jbpm.graph.exe.Token oldChildToken : oldChildTokens)
-      {
-        TokenImpl childToken = new TokenImpl(procImpl, oldChildToken);
-        childTokens.add(childToken);
-      }
-    }
-    return childTokens;
-  }
-
-  // @Override
-  public Node getCurrentNode()
-  {
-    String nodeName = oldToken.getNode().getName();
-    return procImpl.getNode(nodeName);
-  }
-
-  // @Override
-  public SequenceFlow getLastFlow()
-  {
-    throw new NotImplementedException();
-  }
-
-  // @Override
-  public Token getParentToken()
-  {
-    org.jbpm.graph.exe.Token parent = oldToken.getParent();
-    return parent != null ? new TokenImpl(procImpl, parent) : null;
-  }
-
-  // @Override
-  public Token getRootToken()
-  {
-    org.jbpm.graph.exe.Token root = oldToken;
-    while (root.getParent() != null)
-      root = root.getParent();
-
-    return new TokenImpl(procImpl, root);
-  }
-
-  // @Override
-  public void signal(String name)
-  {
-    try
-    {
-      oldToken.signal(name);
-    }
-    catch (RuntimeException rte)
-    {
-      procImpl.setProcessStatus(ProcessStatus.Aborted);
-      throw rte;
-    }
-  }
-
-  // @Override
-  public void signal()
-  {
-    try
-    {
-      oldToken.signal();
-    }
-    catch (RuntimeException rte)
-    {
-      procImpl.setProcessStatus(ProcessStatus.Aborted);
-      throw rte;
-    }
-  }
-}

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EndEventImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EndEventImpl.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EndEventImpl.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -33,16 +33,13 @@
  * @author thomas.diesler at jboss.com
  * @since 15-Nov-2008
  */
-public class EndEventImpl extends NodeImpl implements EndEvent
+public class EndEventImpl extends EventImpl implements EndEvent
 {
   private static final long serialVersionUID = 1L;
   
-  private EndState oldEnd;
-
   public EndEventImpl(ProcessDefinition procDef, EndState oldEnd)
   {
     super(procDef, oldEnd);
-    this.oldEnd = oldEnd;
   }
 
   //@Override
@@ -57,8 +54,14 @@
     return EventType.End;
   }
 
+  //@Override
   public SequenceFlow getInFlow()
   {
     throw new NotImplementedException();
   }
+
+  public String toString()
+  {
+    return getEventType() + "Event[" + getName() + "," + getResultType() + "]";
+  }
 }

Added: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EventImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EventImpl.java	                        (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EventImpl.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -0,0 +1,42 @@
+/*
+ * 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.integration.model;
+
+import org.jboss.bpm.api.model.Event;
+import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jbpm.graph.def.Node;
+
+/**
+ * An integration wrapper 
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 15-Nov-2008
+ */
+public abstract class EventImpl extends NodeImpl implements Event
+{
+  private static final long serialVersionUID = 1L;
+  
+  public EventImpl(ProcessDefinition procDef, Node oldNode)
+  {
+    super(procDef, oldNode);
+  }
+}


Property changes on: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EventImpl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ExclusiveGatewayImpl.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -23,12 +23,12 @@
 
 // $Id$
 
-import org.jboss.bpm.api.client.Token;
 import org.jboss.bpm.api.model.ExclusiveGateway;
 import org.jboss.bpm.api.model.Expression;
 import org.jboss.bpm.api.model.ProcessDefinition;
 import org.jboss.bpm.api.model.SequenceFlow;
 import org.jboss.bpm.api.model.SequenceFlow.ConditionType;
+import org.jboss.bpm.api.runtime.Token;
 import org.jbpm.graph.exe.ExecutionContext;
 import org.jbpm.graph.node.Decision;
 import org.jbpm.graph.node.DecisionHandler;

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/GatewayImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/GatewayImpl.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/GatewayImpl.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -61,4 +61,9 @@
   {
     throw new NotImplementedException();
   }
+
+  public String toString()
+  {
+    return getGatewayType() + "Gateway[" + getName() + "]";
+  }
 }

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -201,4 +201,9 @@
       }
     }
   }
+
+  public String toString()
+  {
+    return "ProcessDefinition[" + getKey() + "]";
+  }
 }

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessImpl.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessImpl.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -30,17 +30,17 @@
 
 import org.jboss.bpm.api.Constants;
 import org.jboss.bpm.api.client.ProcessEngine;
-import org.jboss.bpm.api.client.Token;
-import org.jboss.bpm.api.client.Token.TokenStatus;
 import org.jboss.bpm.api.model.Node;
 import org.jboss.bpm.api.model.Process;
 import org.jboss.bpm.api.model.ProcessDefinition;
 import org.jboss.bpm.api.model.builder.ObjectNameFactory;
 import org.jboss.bpm.api.runtime.Attachments;
+import org.jboss.bpm.api.runtime.Token;
 import org.jboss.bpm.api.runtime.Attachments.Key;
+import org.jboss.bpm.api.runtime.Token.TokenStatus;
 import org.jboss.bpm.api.service.ProcessService;
 import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.integration.client.TokenImpl;
+import org.jbpm.integration.runtime.TokenImpl;
 
 /**
  * An integration wrapper
@@ -199,4 +199,9 @@
     }
     return tokens;
   }
+
+  public String toString()
+  {
+    return "Process[" + getKey() + "]";
+  }
 }

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/StartEventImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/StartEventImpl.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/StartEventImpl.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -37,7 +37,7 @@
  * @author thomas.diesler at jboss.com
  * @since 15-Nov-2008
  */
-public class StartEventImpl extends NodeImpl implements StartEvent
+public class StartEventImpl extends EventImpl implements StartEvent
 {
   private static final long serialVersionUID = 1L;
   
@@ -65,7 +65,6 @@
   }
 
   //@Override
-  @SuppressWarnings("unchecked")
   public SequenceFlow getOutFlow()
   {
     List<Transition> leavingTransitions = oldStart.getLeavingTransitions();
@@ -77,4 +76,9 @@
     Transition to = leavingTransitions.get(0);
     return new SequenceFlowImpl(to);
   }
+
+  public String toString()
+  {
+    return getEventType() + "Event[" + getName() + "," + getTriggerType() + "]";
+  }
 }

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/TaskImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/TaskImpl.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/TaskImpl.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -79,4 +79,9 @@
     Transition to = leavingTransitions.get(0);
     return new SequenceFlowImpl(to);
   }
+
+  public String toString()
+  {
+    return "Task[" + getTaskType() + "," + getName() + "]";
+  }
 }

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/ExpressionEvaluator.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -26,10 +26,10 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.jboss.bpm.api.client.Token;
 import org.jboss.bpm.api.model.Expression;
 import org.jboss.bpm.api.model.Expression.ExpressionLanguage;
 import org.jboss.bpm.api.runtime.Attachments;
+import org.jboss.bpm.api.runtime.Token;
 import org.jboss.bpm.api.runtime.Attachments.Key;
 import org.mvel.MVEL;
 

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -23,7 +23,7 @@
 
 //$Id$
 
-import org.jboss.bpm.api.client.Token;
+import org.jboss.bpm.api.runtime.Token;
 
 /**
  * An interceptor that invokes the Node.execute 

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -26,7 +26,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.jboss.bpm.api.client.Token;
+import org.jboss.bpm.api.runtime.Token;
 
 /**
  * A runtime context that passes through a chain of interceptors.

Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/TokenAttachmentDelegate.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/TokenAttachmentDelegate.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/TokenAttachmentDelegate.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -29,7 +29,6 @@
 
 import org.jboss.bpm.api.runtime.Attachments;
 import org.jbpm.context.exe.ContextInstance;
-import org.jbpm.integration.client.TokenImpl;
 
 /**
  * An Attachment implementation that delegates to to the ContextInstance

Copied: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/TokenImpl.java (from rev 3114, jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/client/TokenImpl.java)
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/TokenImpl.java	                        (rev 0)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/runtime/TokenImpl.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -0,0 +1,183 @@
+/*
+ * 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.integration.runtime;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.api.Constants;
+import org.jboss.bpm.api.NotImplementedException;
+import org.jboss.bpm.api.client.ProcessEngine;
+import org.jboss.bpm.api.model.Node;
+import org.jboss.bpm.api.model.Process;
+import org.jboss.bpm.api.model.SequenceFlow;
+import org.jboss.bpm.api.model.Process.ProcessStatus;
+import org.jboss.bpm.api.model.builder.ObjectNameFactory;
+import org.jboss.bpm.api.runtime.Attachments;
+import org.jboss.bpm.api.runtime.Token;
+import org.jbpm.context.exe.ContextInstance;
+import org.jbpm.integration.model.ProcessImpl;
+
+/**
+ * An integration wrapper
+ * 
+ * @author thomas.diesler at jboss.com
+ * @since 15-Nov-2008
+ */
+public class TokenImpl implements Token
+{
+  private static final long serialVersionUID = 1L;
+
+  private org.jbpm.graph.exe.Token oldToken;
+  private ProcessImpl procImpl;
+  private Attachments att;
+
+  public TokenImpl(ProcessImpl proc, org.jbpm.graph.exe.Token oldToken)
+  {
+    this.oldToken = oldToken;
+    this.procImpl = proc;
+    
+    ContextInstance context = proc.getOldProcessInstance().getContextInstance();
+    this.att = new TokenAttachmentDelegate(this, context);
+  }
+
+  public org.jbpm.graph.exe.Token getOldToken()
+  {
+    return oldToken;
+  }
+
+  public ObjectName getKey()
+  {
+    return ObjectNameFactory.create(Constants.ID_DOMAIN + ":id=" + oldToken.getId());
+  }
+
+  public Process getProcess()
+  {
+    return procImpl;
+  }
+
+  public ProcessEngine getProcessEngine()
+  {
+    return procImpl.getProcessEngine();
+  }
+
+  // @Override
+  public Attachments getAttachments()
+  {
+    return att;
+  }
+
+  // @Override
+  public TokenStatus getTokenStatus()
+  {
+    TokenStatus status = TokenStatus.Suspended;
+    if (oldToken.hasEnded())
+    {
+      status = TokenStatus.Destroyed;
+    }
+    return status;
+  }
+
+  // @Override
+  public Set<Token> getChildTokens()
+  {
+    Set<Token> childTokens = new HashSet<Token>();
+    Map oldChildMap = oldToken.getChildren();
+    if (oldChildMap != null)
+    {
+      Collection<org.jbpm.graph.exe.Token> oldChildTokens = oldChildMap.values();
+      for (org.jbpm.graph.exe.Token oldChildToken : oldChildTokens)
+      {
+        TokenImpl childToken = new TokenImpl(procImpl, oldChildToken);
+        childTokens.add(childToken);
+      }
+    }
+    return childTokens;
+  }
+
+  // @Override
+  public Node getCurrentNode()
+  {
+    String nodeName = oldToken.getNode().getName();
+    return procImpl.getNode(nodeName);
+  }
+
+  // @Override
+  public SequenceFlow getLastFlow()
+  {
+    throw new NotImplementedException();
+  }
+
+  // @Override
+  public Token getParentToken()
+  {
+    org.jbpm.graph.exe.Token parent = oldToken.getParent();
+    return parent != null ? new TokenImpl(procImpl, parent) : null;
+  }
+
+  // @Override
+  public Token getRootToken()
+  {
+    org.jbpm.graph.exe.Token root = oldToken;
+    while (root.getParent() != null)
+      root = root.getParent();
+
+    return new TokenImpl(procImpl, root);
+  }
+
+  // @Override
+  public void signal(String name)
+  {
+    try
+    {
+      oldToken.signal(name);
+    }
+    catch (RuntimeException rte)
+    {
+      procImpl.setProcessStatus(ProcessStatus.Aborted);
+      throw rte;
+    }
+  }
+
+  // @Override
+  public void signal()
+  {
+    try
+    {
+      oldToken.signal();
+    }
+    catch (RuntimeException rte)
+    {
+      procImpl.setProcessStatus(ProcessStatus.Aborted);
+      throw rte;
+    }
+  }
+
+  public String toString()
+  {
+    return "[sf=" + getLastFlow() + ",status=" + getTokenStatus() + ",ctx=" + getAttachments() + ",key=" + getKey() + "]";
+  }
+}

Modified: jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/jpdl/DialectHandlerTest.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/jpdl/DialectHandlerTest.java	2008-11-27 12:57:32 UTC (rev 3122)
+++ jbpm3/trunk/modules/integration/spec/src/test/java/org/jbpm/test/integration/jpdl/DialectHandlerTest.java	2008-11-27 13:22:32 UTC (rev 3123)
@@ -27,10 +27,10 @@
 
 import org.jboss.bpm.api.client.Configuration;
 import org.jboss.bpm.api.client.ProcessEngine;
-import org.jboss.bpm.api.client.Token;
 import org.jboss.bpm.api.model.Process;
 import org.jboss.bpm.api.model.ProcessDefinition;
 import org.jboss.bpm.api.model.Process.ProcessStatus;
+import org.jboss.bpm.api.runtime.Token;
 import org.jboss.bpm.api.service.ProcessDefinitionService;
 import org.jboss.bpm.api.test.CTSTestCase;
 




More information about the jbpm-commits mailing list