JBoss JBPM SVN: r3127 - jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-27 09:56:11 -0500 (Thu, 27 Nov 2008)
New Revision: 3127
Modified:
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessImpl.java
Log:
Add suspended to process lifecycle
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 14:06:49 UTC (rev 3126)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessImpl.java 2008-11-27 14:56:11 UTC (rev 3127)
@@ -29,6 +29,7 @@
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;
@@ -187,6 +188,21 @@
return getAllTokens(getRootToken());
}
+ public void suspend()
+ {
+ oldProc.suspend();
+ }
+
+ public void resume()
+ {
+ oldProc.resume();
+ }
+
+ public void cancel()
+ {
+ throw new NotImplementedException();
+ }
+
private Set<Token> getAllTokens(Token token)
{
Set<Token> tokens = new HashSet<Token>();
17 years, 5 months
JBoss JBPM SVN: r3126 - in jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration: service and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-27 09:06:49 -0500 (Thu, 27 Nov 2008)
New Revision: 3126
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/ProcessImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java
Log:
Save process instance on register
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 13:26:37 UTC (rev 3125)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessDefinitionImpl.java 2008-11-27 14:06:49 UTC (rev 3126)
@@ -37,6 +37,7 @@
import org.jboss.bpm.api.model.Process;
import org.jboss.bpm.api.model.ProcessDefinition;
import org.jboss.bpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.JbpmConfiguration;
import org.jbpm.graph.def.Transition;
import org.jbpm.graph.node.EndState;
import org.jbpm.graph.node.StartState;
@@ -55,6 +56,7 @@
private org.jbpm.graph.def.ProcessDefinition oldProcDef;
private ProcessEngine engine;
private Map<String, Node> nodes = new LinkedHashMap<String, Node>();
+ private JbpmConfiguration jbpmConfigCache;
public ProcessDefinitionImpl(ProcessEngine engine, String name)
{
@@ -81,6 +83,15 @@
return oldProcDef;
}
+ public JbpmConfiguration getJbpmConfiguration()
+ {
+ if (jbpmConfigCache == null)
+ {
+ jbpmConfigCache = JbpmConfiguration.getInstance();
+ }
+ return jbpmConfigCache;
+ }
+
public ProcessEngine getProcessEngine()
{
return engine;
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 13:26:37 UTC (rev 3125)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/ProcessImpl.java 2008-11-27 14:06:49 UTC (rev 3126)
@@ -59,12 +59,13 @@
public ProcessImpl(ProcessDefinitionImpl procDef)
{
this.procDef = procDef;
+ this.oldProc = new ProcessInstance(procDef.getOldProcessDefinition());
}
//@Override
public ObjectName getKey()
{
- long id = oldProc != null ? oldProc.getId() : 0;
+ long id = oldProc.getId();
return ObjectNameFactory.create(Constants.ID_DOMAIN + ":proc=" + getName() + ",id=" + id);
}
@@ -110,12 +111,12 @@
public Date getEndDate()
{
- return oldProc != null ? oldProc.getEnd() : null;
+ return oldProc.getEnd();
}
public Date getStartDate()
{
- return oldProc != null ? oldProc.getStart() : null;
+ return oldProc.getStart();
}
//@Override
@@ -151,8 +152,6 @@
//@Override
public Token startProcess(Attachments contextData)
{
- oldProc = new ProcessInstance(procDef.getOldProcessDefinition());
-
// Register the Process
ProcessService procService = getProcessEngine().getService(ProcessService.class);
procService.registerProcess(this);
@@ -180,7 +179,7 @@
public Token getRootToken()
{
- return oldProc != null ? new TokenImpl(this, oldProc.getRootToken()) : null;
+ return new TokenImpl(this, oldProc.getRootToken());
}
public Set<Token> getTokens()
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java 2008-11-27 14:06:49 UTC (rev 3126)
@@ -53,7 +53,6 @@
// The set of registered ProcessDefinitions
private Map<ObjectName, ProcessDefinition> procDefs = new HashMap<ObjectName, ProcessDefinition>();
- private JbpmConfiguration jbpmConfigCache;
@Override
public void setProcessEngine(ProcessEngine engine)
@@ -79,13 +78,13 @@
log.debug("registerProcessDefinition: " + procDef);
// Works with the default configuration
- JbpmConfiguration jbpmConfig = getJbpmConfiguration();
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)procDef;
+ JbpmConfiguration jbpmConfig = procDefImpl.getJbpmConfiguration();
JbpmContext jbpmContext = jbpmConfig.createJbpmContext();
ObjectName procDefID;
try
{
- ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)procDef;
jbpmContext.deployProcessDefinition(procDefImpl.getOldProcessDefinition());
procDefID = procDef.getKey();
@@ -102,15 +101,6 @@
return procDefID;
}
- private JbpmConfiguration getJbpmConfiguration()
- {
- if (jbpmConfigCache == null)
- {
- jbpmConfigCache = JbpmConfiguration.getInstance();
- }
- return jbpmConfigCache;
- }
-
public boolean unregisterProcessDefinition(ObjectName procDefID)
{
boolean removed = false;
@@ -126,12 +116,12 @@
for (ObjectName procID : procService.getProcesses(procDefID, null))
procService.unregisterProcess(procID);
- // Works with the default configuration
- JbpmConfiguration jbpmConfig = getJbpmConfiguration();
+ // Save the ProcessDefinition
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)procDef;
+ JbpmConfiguration jbpmConfig = procDefImpl.getJbpmConfiguration();
JbpmContext jbpmContext = jbpmConfig.createJbpmContext();
try
{
- ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)procDef;
long oldID = procDefImpl.getOldProcessDefinition().getId();
jbpmContext.getGraphSession().deleteProcessDefinition(oldID);
@@ -147,6 +137,7 @@
jbpmContext.close();
}
}
+
return removed;
}
}
\ No newline at end of file
Modified: jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java
===================================================================
--- jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java 2008-11-27 14:06:49 UTC (rev 3126)
@@ -39,6 +39,9 @@
import org.jboss.bpm.api.model.Process.ProcessStatus;
import org.jboss.bpm.api.service.ProcessDefinitionService;
import org.jboss.bpm.api.service.ProcessService;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.integration.model.ProcessDefinitionImpl;
import org.jbpm.integration.model.ProcessImpl;
import org.jbpm.integration.runtime.NodeInterceptor;
import org.slf4j.Logger;
@@ -143,10 +146,27 @@
if (procDefService.getProcessDefinition(procDef.getKey()) == null)
procDefService.registerProcessDefinition(procDef);
+ // Save the Process instance
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)procDef;
+ JbpmConfiguration jbpmConfig = procDefImpl.getJbpmConfiguration();
+ JbpmContext jbpmContext = jbpmConfig.createJbpmContext();
+ ProcessImpl procImpl = (ProcessImpl)proc;
+ try
+ {
+ jbpmContext.save(procImpl.getOldProcessInstance());
+ procID = proc.getKey();
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ finally
+ {
+ jbpmContext.close();
+ }
+
// Register the process
registeredProcs.put(procID, proc);
-
- ProcessImpl procImpl = (ProcessImpl)proc;
procImpl.setProcessStatus(ProcessStatus.Ready);
return procID;
@@ -162,7 +182,25 @@
if (proc != null)
{
log.debug("unregisterProcess: " + proc);
-
+
+ // Delete the Process instance
+ ProcessDefinitionImpl procDefImpl = (ProcessDefinitionImpl)proc.getProcessDefinition();
+ JbpmConfiguration jbpmConfig = procDefImpl.getJbpmConfiguration();
+ JbpmContext jbpmContext = jbpmConfig.createJbpmContext();
+ ProcessImpl procImpl = (ProcessImpl)proc;
+ try
+ {
+ jbpmContext.getGraphSession().deleteProcessInstance(procImpl.getOldProcessInstance());
+ }
+ catch (RuntimeException rte)
+ {
+ throw rte;
+ }
+ finally
+ {
+ jbpmContext.close();
+ }
+
registeredProcs.remove(procID);
removed = true;
}
17 years, 5 months
JBoss JBPM SVN: r3125 - in projects/spec/trunk/modules: api/src/main/java/org/jboss/bpm/api/model and 10 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-27 08:26:37 -0500 (Thu, 27 Nov 2008)
New Revision: 3125
Added:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/runtime/Token.java
Removed:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/client/Token.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/Process.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/client/PersistenceToken.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/ExecutionHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/FlowHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/SignalHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/TokenExecutor.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/task/waitstate/WaitStateTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/task/java/JavaTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/transaction/TxRequiredTest.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ComplexGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/EndEventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/EventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ExclusiveGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/GatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/InclusiveGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/NodeImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ParallelGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ProcessImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ReceiveTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/SendTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/StartEventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/TaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/UserTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/WaitStateImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/AssignmentInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/DelegatingToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ExitSignalInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ExpressionEvaluator.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/FlowHandlerInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/InProcessTokenExecutor.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/MessageSender.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/MutableToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/NodeExecuteInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/PersistenceSessionInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/RunnableToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/RuntimeContext.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/SignalHandlerInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ThreadingTokenExecutor.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/TokenImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/service/ThreadingServiceImpl.java
Log:
Move Token to runtime
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/client/Token.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/client/Token.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/client/Token.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -1,116 +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.jboss.bpm.api.client;
-
-// $Id$
-
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-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.runtime.Attachments;
-
-/**
- * A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
- *
- * By tracking how the Token traverses the Flow Objects, gets diverted through alternative paths, and gets split into
- * parallel paths, the normal Sequence Flow should be completely definable.
- *
- * A Token will have a unique identity that can be used to separate multiple Tokens that may exist because of concurrent
- * process instances or the splitting of the Token for parallel processing within a single process instance.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public interface Token
-{
- public enum TokenStatus
- {
- Created, Started, Stoped, Destroyed, Suspended
- }
-
- /**
- * Get the associated ProcessEngine
- */
- ProcessEngine getProcessEngine();
-
- /**
- * Get the associated {@link Process}
- */
- Process getProcess();
-
- /**
- * Get the unique token identity
- */
- ObjectName getKey();
-
- /**
- * Get the token status
- */
- TokenStatus getTokenStatus();
-
- /**
- * Get the associated {@link Attachments}
- */
- Attachments getAttachments();
-
- /**
- * Get the last {@link SequenceFlow}
- */
- SequenceFlow getLastFlow();
-
- /**
- * Get the current {@link Node}
- */
- Node getCurrentNode();
-
- /**
- * Get the root token that his Token is associated with
- */
- Token getRootToken();
-
- /**
- * Get the parent token that his Token is associated with
- * @return null if this is the root token
- */
- Token getParentToken();
-
- /**
- * Get the set of child tokens
- * @return An empty set if there are none
- */
- Set<Token> getChildTokens();
-
- /**
- * Signal the Token, which takes it to the next wait state
- */
- void signal();
-
- /**
- * Signal the Token, which takes it to the next wait state
- * @param name A transition or target name
- */
- void signal(String name);
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/Process.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/Process.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/Process.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -27,8 +27,8 @@
import java.util.Set;
import org.jboss.bpm.api.client.ProcessEngine;
-import org.jboss.bpm.api.client.Token;
import org.jboss.bpm.api.runtime.Attachments;
+import org.jboss.bpm.api.runtime.Token;
/**
* A Process is any Activity performed within a company or organization.
Copied: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/runtime/Token.java (from rev 3111, projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/client/Token.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/runtime/Token.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/runtime/Token.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -0,0 +1,116 @@
+/*
+ * 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.jboss.bpm.api.runtime;
+
+// $Id$
+
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+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;
+
+/**
+ * A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
+ *
+ * By tracking how the Token traverses the Flow Objects, gets diverted through alternative paths, and gets split into
+ * parallel paths, the normal Sequence Flow should be completely definable.
+ *
+ * A Token will have a unique identity that can be used to separate multiple Tokens that may exist because of concurrent
+ * process instances or the splitting of the Token for parallel processing within a single process instance.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface Token
+{
+ public enum TokenStatus
+ {
+ Created, Started, Stoped, Destroyed, Suspended
+ }
+
+ /**
+ * Get the associated ProcessEngine
+ */
+ ProcessEngine getProcessEngine();
+
+ /**
+ * Get the associated {@link Process}
+ */
+ Process getProcess();
+
+ /**
+ * Get the unique token identity
+ */
+ ObjectName getKey();
+
+ /**
+ * Get the token status
+ */
+ TokenStatus getTokenStatus();
+
+ /**
+ * Get the associated {@link Attachments}
+ */
+ Attachments getAttachments();
+
+ /**
+ * Get the last {@link SequenceFlow}
+ */
+ SequenceFlow getLastFlow();
+
+ /**
+ * Get the current {@link Node}
+ */
+ Node getCurrentNode();
+
+ /**
+ * Get the root token that his Token is associated with
+ */
+ Token getRootToken();
+
+ /**
+ * Get the parent token that his Token is associated with
+ * @return null if this is the root token
+ */
+ Token getParentToken();
+
+ /**
+ * Get the set of child tokens
+ * @return An empty set if there are none
+ */
+ Set<Token> getChildTokens();
+
+ /**
+ * Signal the Token, which takes it to the next wait state
+ */
+ void signal();
+
+ /**
+ * Signal the Token, which takes it to the next wait state
+ * @param name A transition or target name
+ */
+ void signal(String name);
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/client/PersistenceToken.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/client/PersistenceToken.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/client/PersistenceToken.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -24,7 +24,7 @@
// $Id$
import org.hibernate.Session;
-import org.jboss.bpm.api.client.Token;
+import org.jboss.bpm.api.runtime.Token;
/**
* A Token that gives access to the persistence context
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/ExecutionHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/ExecutionHandler.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/ExecutionHandler.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -23,8 +23,8 @@
//$Id$
-import org.jboss.bpm.api.client.Token;
import org.jboss.bpm.api.model.Node;
+import org.jboss.bpm.api.runtime.Token;
/**
* The ProcessEngine invokes the ExecutionHandler on a
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/FlowHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/FlowHandler.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/FlowHandler.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -24,8 +24,8 @@
// $Id$
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.runtime.Token;
/**
* The {@link ProcessEngine} invokes the FlowHandler on a {@link Node}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/SignalHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/SignalHandler.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/SignalHandler.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -24,8 +24,8 @@
// $Id$
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.runtime.Token;
import org.jboss.bpm.incubator.model.Signal;
/**
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/TokenExecutor.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/TokenExecutor.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/incubator/runtime/TokenExecutor.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -23,8 +23,8 @@
//$Id$
-import org.jboss.bpm.api.client.Token;
import org.jboss.bpm.api.model.SequenceFlow;
+import org.jboss.bpm.api.runtime.Token;
/**
* The {@link FlowHandler} invokes the TokenExecutor to move {@link Token}s along the {@link SequenceFlow}s in the
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -25,8 +25,6 @@
import java.io.IOException;
-import org.jboss.bpm.api.client.Token;
-import org.jboss.bpm.api.client.Token.TokenStatus;
import org.jboss.bpm.api.model.Process;
import org.jboss.bpm.api.model.ProcessDefinition;
import org.jboss.bpm.api.model.Expression.ExpressionLanguage;
@@ -35,6 +33,8 @@
import org.jboss.bpm.api.model.builder.GatewayBuilder;
import org.jboss.bpm.api.model.builder.ProcessBuilder;
import org.jboss.bpm.api.runtime.BasicAttachments;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.runtime.Token.TokenStatus;
import org.jboss.bpm.api.service.ProcessBuilderService;
import org.jboss.bpm.api.test.CTSTestCase;
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/task/waitstate/WaitStateTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/task/waitstate/WaitStateTest.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/cts/task/waitstate/WaitStateTest.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -25,13 +25,13 @@
import java.io.IOException;
-import org.jboss.bpm.api.client.Token;
-import org.jboss.bpm.api.client.Token.TokenStatus;
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.model.Task.TaskType;
import org.jboss.bpm.api.model.builder.ProcessBuilder;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.runtime.Token.TokenStatus;
import org.jboss.bpm.api.service.ProcessBuilderService;
import org.jboss.bpm.api.test.CTSTestCase;
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/task/java/JavaTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/task/java/JavaTaskTest.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/task/java/JavaTaskTest.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -25,10 +25,10 @@
import java.io.IOException;
-import org.jboss.bpm.api.client.Token;
import org.jboss.bpm.api.model.ProcessDefinition;
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.service.ProcessBuilderService;
import org.jboss.bpm.api.test.CTSTestCase;
import org.jboss.bpm.incubator.client.ProcessExt;
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/transaction/TxRequiredTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/transaction/TxRequiredTest.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/test/incubator/transaction/TxRequiredTest.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -28,11 +28,11 @@
import org.jboss.bpm.api.Constants;
import org.jboss.bpm.api.Constants.TxType;
-import org.jboss.bpm.api.client.Token;
import org.jboss.bpm.api.model.Node;
import org.jboss.bpm.api.model.ProcessDefinition;
import org.jboss.bpm.api.model.Task.TaskType;
import org.jboss.bpm.api.runtime.BasicAttachments;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.api.service.ProcessBuilderService;
import org.jboss.bpm.api.test.CTSTestCase;
import org.jboss.bpm.incubator.client.ProcessExt;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ComplexGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ComplexGatewayImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ComplexGatewayImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -62,9 +62,4 @@
{
throw new NotImplementedException("JBPM-1637", "ComplexGateway outgoing condition");
}
-
- public String toString()
- {
- return "ComplexGateway[" + getName() + "]";
- }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/EndEventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/EndEventImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/EndEventImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -29,12 +29,12 @@
import org.jboss.bpm.api.Constants;
import org.jboss.bpm.api.InvalidProcessException;
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.ProcessStructure;
import org.jboss.bpm.api.model.SequenceFlow;
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.incubator.model.EndEventExt;
import org.jboss.bpm.incubator.model.Signal;
import org.jboss.bpm.incubator.runtime.FlowHandler;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/EventImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/EventImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -33,12 +33,12 @@
import org.jboss.bpm.api.Constants;
import org.jboss.bpm.api.InvalidProcessException;
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.ProcessDefinition;
import org.jboss.bpm.api.model.ProcessStructure;
import org.jboss.bpm.api.model.builder.ObjectNameFactory;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.model.EventExt;
import org.jboss.bpm.incubator.model.Message;
import org.jboss.bpm.incubator.model.Signal;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ExclusiveGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ExclusiveGatewayImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ExclusiveGatewayImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -29,13 +29,13 @@
import javax.persistence.Entity;
import javax.persistence.Transient;
-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.Node;
import org.jboss.bpm.api.model.ProcessStructure;
import org.jboss.bpm.api.model.SequenceFlow;
import org.jboss.bpm.api.model.SequenceFlow.ConditionType;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.runtime.ExecutionHandler;
import org.jboss.bpm.incubator.runtime.FlowHandler;
import org.jboss.bpm.incubator.runtime.TokenExecutor;
@@ -218,9 +218,4 @@
return selectedGate;
}
-
- public String toString()
- {
- return "ExclusiveGateway[" + getName() + "]";
- }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/GatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/GatewayImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/GatewayImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -35,13 +35,13 @@
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.model.Gateway;
import org.jboss.bpm.api.model.Node;
import org.jboss.bpm.api.model.ProcessStructure;
import org.jboss.bpm.api.model.SequenceFlow;
import org.jboss.bpm.api.model.SequenceFlow.ConditionType;
import org.jboss.bpm.api.model.builder.ObjectNameFactory;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.model.Signal;
import org.jboss.bpm.incubator.runtime.ExecutionHandler;
import org.jboss.bpm.incubator.runtime.SignalHandler;
@@ -230,4 +230,9 @@
}
};
}
+
+ public String toString()
+ {
+ return getGatewayType() + "Gateway[" + getName() + "]";
+ }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/InclusiveGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/InclusiveGatewayImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/InclusiveGatewayImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -30,7 +30,6 @@
import javax.persistence.Entity;
-import org.jboss.bpm.api.client.Token;
import org.jboss.bpm.api.model.Expression;
import org.jboss.bpm.api.model.Node;
import org.jboss.bpm.api.model.ProcessStructure;
@@ -38,6 +37,7 @@
import org.jboss.bpm.api.model.Expression.ExpressionLanguage;
import org.jboss.bpm.api.model.SequenceFlow.ConditionType;
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.incubator.model.InclusiveGateway;
import org.jboss.bpm.incubator.runtime.FlowHandler;
@@ -189,9 +189,4 @@
return applicableGates;
}
-
- public String toString()
- {
- return "InclusiveGateway[" + getName() + "]";
- }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/NodeImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/NodeImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -44,8 +44,6 @@
import org.jboss.bpm.api.InvalidProcessException;
import org.jboss.bpm.api.NameNotUniqueException;
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.EndEvent;
import org.jboss.bpm.api.model.Node;
import org.jboss.bpm.api.model.Process;
@@ -53,6 +51,8 @@
import org.jboss.bpm.api.model.ProcessStructure;
import org.jboss.bpm.api.model.SequenceFlow;
import org.jboss.bpm.api.model.StartEvent;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.runtime.Token.TokenStatus;
import org.jboss.bpm.incubator.model.Assignment;
import org.jboss.bpm.incubator.model.Group;
import org.jboss.bpm.incubator.model.NodeExt;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ParallelGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ParallelGatewayImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ParallelGatewayImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -31,10 +31,10 @@
import javax.persistence.Entity;
import javax.persistence.Transient;
-import org.jboss.bpm.api.client.Token;
import org.jboss.bpm.api.model.Node;
import org.jboss.bpm.api.model.ProcessStructure;
import org.jboss.bpm.api.model.SequenceFlow;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.model.ParallelGateway;
import org.jboss.bpm.incubator.runtime.ExecutionHandler;
import org.jboss.bpm.incubator.runtime.FlowHandler;
@@ -207,9 +207,4 @@
}
return mergedToken;
}
-
- public String toString()
- {
- return "ParallelGateway[" + getName() + "]";
- }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ProcessImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ProcessImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -43,8 +43,6 @@
import org.jboss.bpm.api.Constants;
import org.jboss.bpm.api.InvalidProcessException;
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;
@@ -52,6 +50,8 @@
import org.jboss.bpm.api.model.Event.EventDetailType;
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.Token.TokenStatus;
import org.jboss.bpm.api.service.ProcessService;
import org.jboss.bpm.incubator.client.ProcessExt;
import org.jboss.bpm.incubator.model.Assignment;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ReceiveTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ReceiveTaskImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/ReceiveTaskImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -31,11 +31,11 @@
import org.jboss.bpm.api.InvalidProcessException;
import org.jboss.bpm.api.NotImplementedException;
-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.ProcessStructure;
import org.jboss.bpm.api.runtime.Attachments;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.client.MessageListener;
import org.jboss.bpm.incubator.model.Message;
import org.jboss.bpm.incubator.model.ReceiveTask;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/SendTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/SendTaskImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/SendTaskImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -27,11 +27,11 @@
import javax.persistence.Transient;
import org.jboss.bpm.api.InvalidProcessException;
-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.ProcessDefinition;
import org.jboss.bpm.api.model.ProcessStructure;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.model.Message;
import org.jboss.bpm.incubator.model.SendTask;
import org.jboss.bpm.incubator.runtime.ExecutionHandler;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/StartEventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/StartEventImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/StartEventImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -30,7 +30,6 @@
import org.jboss.bpm.api.Constants;
import org.jboss.bpm.api.InvalidProcessException;
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.ProcessDefinition;
@@ -38,6 +37,7 @@
import org.jboss.bpm.api.model.SequenceFlow;
import org.jboss.bpm.api.model.StartEvent;
import org.jboss.bpm.api.model.builder.ObjectNameFactory;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.client.SignalListener;
import org.jboss.bpm.incubator.model.Signal;
import org.jboss.bpm.incubator.model.StartEventExt;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/TaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/TaskImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/TaskImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -40,13 +40,13 @@
import org.jboss.bpm.api.InvalidProcessException;
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.Expression;
import org.jboss.bpm.api.model.Node;
import org.jboss.bpm.api.model.ProcessStructure;
import org.jboss.bpm.api.model.SequenceFlow;
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.incubator.model.InputSet;
import org.jboss.bpm.incubator.model.OutputSet;
import org.jboss.bpm.incubator.model.Property;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/UserTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/UserTaskImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/UserTaskImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -33,11 +33,11 @@
import javax.persistence.Transient;
import org.jboss.bpm.api.InvalidProcessException;
-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.ProcessStructure;
import org.jboss.bpm.api.runtime.Attachments;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.client.MessageListener;
import org.jboss.bpm.incubator.client.UserTaskCallback;
import org.jboss.bpm.incubator.model.Message;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/WaitStateImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/WaitStateImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/WaitStateImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -25,10 +25,10 @@
import javax.persistence.Entity;
-import org.jboss.bpm.api.client.Token;
import org.jboss.bpm.api.model.Node;
import org.jboss.bpm.api.model.ProcessStructure;
import org.jboss.bpm.api.model.WaitState;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.runtime.FlowHandler;
import org.jboss.bpm.incubator.runtime.TokenExecutor;
import org.jboss.bpm.ri.model.builder.SingleInFlowSupport;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/AssignmentInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/AssignmentInterceptor.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/AssignmentInterceptor.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -23,9 +23,9 @@
//$Id$
-import org.jboss.bpm.api.client.Token;
import org.jboss.bpm.api.model.Expression;
import org.jboss.bpm.api.runtime.Attachments;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.model.Assignment;
import org.jboss.bpm.incubator.model.NodeExt;
import org.jboss.bpm.incubator.model.Assignment.AssignTime;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/DelegatingToken.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/DelegatingToken.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/DelegatingToken.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -29,11 +29,11 @@
import org.hibernate.Session;
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.runtime.Attachments;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.model.NodeExt;
/**
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ExitSignalInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ExitSignalInterceptor.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ExitSignalInterceptor.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.bpm.api.client.Token;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.model.NodeExt;
import org.jboss.bpm.incubator.runtime.SignalHandler;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ExpressionEvaluator.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ExpressionEvaluator.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ExpressionEvaluator.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -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: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/FlowHandlerInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/FlowHandlerInterceptor.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/FlowHandlerInterceptor.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.bpm.api.client.Token;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.model.NodeExt;
import org.jboss.bpm.incubator.runtime.FlowHandler;
import org.jboss.bpm.incubator.runtime.TokenExecutor;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/InProcessTokenExecutor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/InProcessTokenExecutor.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/InProcessTokenExecutor.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -23,10 +23,10 @@
//$Id$
-import org.jboss.bpm.api.client.Token;
-import org.jboss.bpm.api.client.Token.TokenStatus;
import org.jboss.bpm.api.model.Process;
import org.jboss.bpm.api.model.SequenceFlow;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.runtime.Token.TokenStatus;
import org.jboss.bpm.incubator.runtime.TokenExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/MessageSender.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/MessageSender.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/MessageSender.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -26,9 +26,9 @@
import javax.management.ObjectName;
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.runtime.Attachments;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.model.Message;
import org.jboss.bpm.incubator.model.Participant;
import org.jboss.bpm.incubator.model.Property;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/MutableToken.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/MutableToken.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/MutableToken.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -24,8 +24,8 @@
//$Id$
import org.hibernate.Session;
-import org.jboss.bpm.api.client.Token;
import org.jboss.bpm.api.model.SequenceFlow;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.client.PersistenceToken;
/**
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/NodeExecuteInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/NodeExecuteInterceptor.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/NodeExecuteInterceptor.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.bpm.api.client.Token;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.ri.model.NodeImpl;
/**
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/PersistenceSessionInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/PersistenceSessionInterceptor.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/PersistenceSessionInterceptor.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -25,7 +25,7 @@
import org.hibernate.Session;
import org.jboss.bpm.api.client.ProcessEngine;
-import org.jboss.bpm.api.client.Token.TokenStatus;
+import org.jboss.bpm.api.runtime.Token.TokenStatus;
import org.jboss.bpm.api.service.PersistenceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/RunnableToken.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/RunnableToken.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/RunnableToken.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -21,11 +21,11 @@
*/
package org.jboss.bpm.ri.runtime;
-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.Process.ProcessStatus;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.runtime.Token.TokenStatus;
import org.jboss.bpm.api.service.ProcessService;
import org.jboss.bpm.ri.model.ProcessImpl;
import org.jboss.bpm.ri.service.ProcessServiceImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/RuntimeContext.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/RuntimeContext.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/RuntimeContext.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -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;
import org.jboss.bpm.incubator.runtime.TokenExecutor;
/**
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/SignalHandlerInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/SignalHandlerInterceptor.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/SignalHandlerInterceptor.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.bpm.api.client.Token;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.incubator.model.NodeExt;
import org.jboss.bpm.incubator.runtime.SignalHandler;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ThreadingTokenExecutor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ThreadingTokenExecutor.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/ThreadingTokenExecutor.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -33,10 +33,10 @@
import javax.management.ObjectName;
-import org.jboss.bpm.api.client.Token;
-import org.jboss.bpm.api.client.Token.TokenStatus;
import org.jboss.bpm.api.model.SequenceFlow;
import org.jboss.bpm.api.model.Process.ProcessStatus;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.runtime.Token.TokenStatus;
import org.jboss.bpm.incubator.runtime.FlowHandler;
import org.jboss.bpm.incubator.runtime.TokenExecutor;
import org.slf4j.Logger;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/TokenImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/TokenImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/runtime/TokenImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -33,7 +33,6 @@
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;
@@ -42,6 +41,7 @@
import org.jboss.bpm.api.model.builder.ObjectNameFactory;
import org.jboss.bpm.api.runtime.Attachments;
import org.jboss.bpm.api.runtime.BasicAttachments;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.api.runtime.Attachments.Key;
import org.jboss.bpm.api.service.ProcessService;
import org.jboss.bpm.incubator.runtime.TokenExecutor;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/service/ThreadingServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/service/ThreadingServiceImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/service/ThreadingServiceImpl.java 2008-11-27 13:26:37 UTC (rev 3125)
@@ -31,12 +31,12 @@
import org.jboss.bpm.api.BPMException;
import org.jboss.bpm.api.ProcessTimeoutException;
import org.jboss.bpm.api.client.ProcessEngine;
-import org.jboss.bpm.api.client.Token;
import org.jboss.bpm.api.model.Expression;
import org.jboss.bpm.api.model.Process;
import org.jboss.bpm.api.model.StartEvent;
import org.jboss.bpm.api.model.Process.ProcessStatus;
import org.jboss.bpm.api.runtime.Attachments;
+import org.jboss.bpm.api.runtime.Token;
import org.jboss.bpm.api.service.ProcessService;
import org.jboss.bpm.incubator.client.ProcessExt;
import org.jboss.bpm.incubator.model.Assignment;
17 years, 5 months
JBoss JBPM SVN: r3124 - projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/spec.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-27 08:24:44 -0500 (Thu, 27 Nov 2008)
New Revision: 3124
Modified:
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/spec/ProcessManagementImpl.java
Log:
Move spec Token to runtime
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/spec/ProcessManagementImpl.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/spec/ProcessManagementImpl.java 2008-11-27 13:22:32 UTC (rev 3123)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/spec/ProcessManagementImpl.java 2008-11-27 13:24:44 UTC (rev 3124)
@@ -31,15 +31,14 @@
import org.apache.commons.logging.LogFactory;
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.client.Token.TokenStatus;
import org.jboss.bpm.api.model.Gateway;
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.SequenceFlow;
import org.jboss.bpm.api.model.SingleOutFlowSupport;
-import org.jboss.bpm.api.model.Process.ProcessStatus;
+import org.jboss.bpm.api.runtime.Token;
+import org.jboss.bpm.api.runtime.Token.TokenStatus;
import org.jboss.bpm.api.service.ProcessDefinitionService;
import org.jboss.bpm.api.service.ProcessService;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
17 years, 5 months
JBoss JBPM SVN: r3123 - in jbpm3/trunk/modules/integration/spec/src: main/java/org/jbpm/integration/model and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)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(a)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(a)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(a)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(a)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(a)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;
17 years, 5 months
JBoss JBPM SVN: r3122 - in projects/gwt-console/trunk/server: src/main/java/org/jboss/bpm/console/server/integration and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-27 07:57:32 -0500 (Thu, 27 Nov 2008)
New Revision: 3122
Modified:
projects/gwt-console/trunk/server/deploy.sh
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/jbpm3/Transform.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/spec/ProcessManagementImpl.java
Log:
Enabple spec integration for process management
Modified: projects/gwt-console/trunk/server/deploy.sh
===================================================================
--- projects/gwt-console/trunk/server/deploy.sh 2008-11-27 12:09:28 UTC (rev 3121)
+++ projects/gwt-console/trunk/server/deploy.sh 2008-11-27 12:57:32 UTC (rev 3122)
@@ -1,3 +1,10 @@
#! /bin/bash
-cp target/gwt-console-server.war $JBOSS422/server/default/deploy/jbpm
+mvn -o install
+
+SRC=target/gwt-console-server.war
+DEST=$JBOSS422/server/default/deploy/jbpm
+
+echo
+echo "cp $SRC $DEST"
+cp $SRC $DEST
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java 2008-11-27 12:09:28 UTC (rev 3121)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/ManagementFactory.java 2008-11-27 12:57:32 UTC (rev 3122)
@@ -36,8 +36,8 @@
{
public static ManagementFactory newInstance()
{
- // return new ManagementFactoryImpl();
- return new JBPM3ManagementFactory();
+ return new ManagementFactoryImpl();
+ //return new JBPM3ManagementFactory();
}
public abstract ProcessManagement createProcessManagement();
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/jbpm3/Transform.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/jbpm3/Transform.java 2008-11-27 12:09:28 UTC (rev 3121)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/jbpm3/Transform.java 2008-11-27 12:57:32 UTC (rev 3122)
@@ -61,7 +61,7 @@
private static TokenReference tokenReference(Token t0)
{
- TokenReference token = new TokenReference(t0.getId(), t0.getName(), t0.getNode().getName());
+ TokenReference token = new TokenReference(t0.getId(), null, t0.getNode().getName());
if(t0.hasActiveChildren() || t0.isTerminatedImplicitly())
token.setCanBeSignaled(false);
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/spec/ProcessManagementImpl.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/spec/ProcessManagementImpl.java 2008-11-27 12:09:28 UTC (rev 3121)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/integration/spec/ProcessManagementImpl.java 2008-11-27 12:57:32 UTC (rev 3122)
@@ -32,13 +32,19 @@
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.client.Token.TokenStatus;
+import org.jboss.bpm.api.model.Gateway;
+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.SequenceFlow;
+import org.jboss.bpm.api.model.SingleOutFlowSupport;
import org.jboss.bpm.api.model.Process.ProcessStatus;
import org.jboss.bpm.api.service.ProcessDefinitionService;
import org.jboss.bpm.api.service.ProcessService;
import org.jboss.bpm.console.client.model.ProcessDefinitionRef;
import org.jboss.bpm.console.client.model.ProcessInstanceRef;
+import org.jboss.bpm.console.client.model.jbpm3.TokenReference;
import org.jboss.bpm.console.server.integration.ProcessManagement;
/**
@@ -50,11 +56,11 @@
public class ProcessManagementImpl implements ProcessManagement
{
private static final Log log = LogFactory.getLog(ProcessManagementImpl.class);
-
+
public List<ProcessDefinitionRef> getProcessDefinitions()
{
log.info("getProcessDefinitions");
-
+
List<ProcessDefinitionRef> results = new ArrayList<ProcessDefinitionRef>();
ProcessDefinitionService pdService = getProcessDefinitionService();
Iterator<ObjectName> itKey = pdService.getProcessDefinitions().iterator();
@@ -62,9 +68,9 @@
{
ObjectName procDefKey = itKey.next();
ProcessDefinition procDef = pdService.getProcessDefinition(procDefKey);
-
+
log.info(procDef);
-
+
ProcessDefinitionRef pdRef = adaptProcessDefinition(procDef);
results.add(pdRef);
}
@@ -75,7 +81,7 @@
{
ProcessDefinition procDef = getProcessDefinitionInternal(procDefId);
log.info("getProcessDefinition: " + procDef);
-
+
return procDef != null ? new ProcessDefinitionRef(procDefId, procDef.getName(), procDef.getVersion()) : null;
}
@@ -83,7 +89,7 @@
{
ProcessDefinition procDef = getProcessDefinitionInternal(procDefId);
log.info("removeDefinition: " + procDef);
-
+
if (procDef != null)
{
ProcessDefinitionService pdService = getProcessDefinitionService();
@@ -96,15 +102,15 @@
{
ProcessDefinition procDef = getProcessDefinitionInternal(procDefId);
log.info("newInstance: " + procDef);
-
+
if (procDef == null)
throw new IllegalStateException("Cannot obtain process definition: " + procDefId);
Process proc = procDef.newInstance();
proc.startProcess();
-
+
log.info("Started: " + proc);
-
+
ProcessInstanceRef procRef = adaptProcess(proc);
return procRef;
}
@@ -117,16 +123,16 @@
throw new IllegalStateException("Cannot obtain process definition: " + procDefId);
log.info("getProcessInstances: " + procDef);
-
+
ProcessService procService = getProcessService();
Iterator<ObjectName> itProc = procService.getProcesses(procDef.getKey(), null).iterator();
while (itProc.hasNext())
{
ObjectName procID = itProc.next();
Process proc = procService.getProcess(procID);
-
+
log.info(proc);
-
+
results.add(adaptProcess(proc));
}
@@ -137,7 +143,7 @@
{
Process proc = getProcessById(procID);
log.info("getProcessInstance: " + proc);
-
+
ProcessInstanceRef procRef = adaptProcess(proc);
return procRef;
}
@@ -161,12 +167,12 @@
}
}
}
-
+
if (token == null)
throw new IllegalStateException("Cannot obtain token: " + tokenId);
log.info("signalToken: " + token);
-
+
// Signal the token
token.signal(name);
}
@@ -233,14 +239,53 @@
Long procDefID = apaptKey(proc.getProcessDefinition().getKey());
Long procID = apaptKey(proc.getKey());
- // [TODO] clarify process status
- ProcessStatus status = proc.getProcessStatus();
- boolean suspended = ProcessStatus.Active != status;
+ // The BPM Spec does not (yet) have the notion of a suspended Process
+ boolean suspended = false;
+
+ ProcessInstanceRef procRef = new ProcessInstanceRef(procID, procDefID, proc.getStartDate(), proc.getEndDate(), suspended);
- ProcessInstanceRef procRef = new ProcessInstanceRef(procID, procDefID, proc.getStartDate(), proc.getEndDate(), suspended);
+ Token rootToken = proc.getRootToken();
+ procRef.setRootToken(adaptToken(rootToken));
+
return procRef;
}
+ private TokenReference adaptToken(Token token)
+ {
+ Long tokenId = apaptKey(token.getKey());
+ token.getKey();
+
+ Node currNode = token.getCurrentNode();
+ TokenReference tokenRef = new TokenReference(tokenId, null, currNode.getName());
+
+ TokenStatus tokenStatus = token.getTokenStatus();
+ tokenRef.setCanBeSignaled(tokenStatus == TokenStatus.Suspended);
+
+ for (Token child : token.getChildTokens())
+ tokenRef.getChildren().add(adaptToken(child));
+
+ if (currNode instanceof SingleOutFlowSupport)
+ {
+ SingleOutFlowSupport flowSupport = (SingleOutFlowSupport)currNode;
+ String targetRef = flowSupport.getOutFlow().getTargetRef();
+ tokenRef.getAvailableSignals().add(targetRef);
+ }
+ if (currNode instanceof Gateway)
+ {
+ Gateway gateway = (Gateway)currNode;
+ for (SequenceFlow gate : gateway.getGates())
+ {
+ String sigName = gate.getName();
+ if (sigName == null)
+ sigName = gate.getTargetRef();
+
+ tokenRef.getAvailableSignals().add(sigName);
+ }
+ }
+
+ return tokenRef;
+ }
+
private Long apaptKey(ObjectName key)
{
String id = key.getKeyProperty("id");
17 years, 5 months
JBoss JBPM SVN: r3121 - in jbpm3/trunk/modules: core/src/main/java/org/jbpm/graph/exe and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)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;
17 years, 5 months
JBoss JBPM SVN: r3120 - in projects/spec/trunk/modules: ri/src/main/java/org/jboss/bpm/ri/model and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-27 06:52:47 -0500 (Thu, 27 Nov 2008)
New Revision: 3120
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SequenceFlow.java
projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/SequenceFlowImpl.java
Log:
Add SequenceFlow.getName()
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SequenceFlow.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SequenceFlow.java 2008-11-27 11:38:47 UTC (rev 3119)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SequenceFlow.java 2008-11-27 11:52:47 UTC (rev 3120)
@@ -23,9 +23,6 @@
import java.io.Serializable;
-
-
-
//$Id$
/**
@@ -49,6 +46,11 @@
}
/**
+ * Name is an optional attribute that is text description of the Connecting Object.
+ */
+ String getName();
+
+ /**
* SourceRef is an attribute that identifies which Graphical Element the Connecting
* Object is connected from. Note: there are restrictions as to what objects Sequence
* Flow and Message Flow can connect.
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/SequenceFlowImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/SequenceFlowImpl.java 2008-11-27 11:38:47 UTC (rev 3119)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/ri/model/SequenceFlowImpl.java 2008-11-27 11:52:47 UTC (rev 3120)
@@ -52,6 +52,9 @@
protected Integer id;
@Basic
+ private String name;
+
+ @Basic
private int sourceIndex;
@Basic
@@ -86,6 +89,12 @@
{
}
+ @Override
+ public String getName()
+ {
+ return name;
+ }
+
public int getSourceIndex()
{
return sourceIndex;
17 years, 5 months
JBoss JBPM SVN: r3119 - in jbpm3/trunk/modules: integration/spec/src/main/java/org/jbpm/integration/model and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-27 06:38:47 -0500 (Thu, 27 Nov 2008)
New Revision: 3119
Modified:
jbpm3/trunk/modules/distribution/src/main/resources/installer/user-input-spec.xml
jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EndEventImpl.java
Log:
Add support for SingleInFlowSupport
Modified: jbpm3/trunk/modules/distribution/src/main/resources/installer/user-input-spec.xml
===================================================================
--- jbpm3/trunk/modules/distribution/src/main/resources/installer/user-input-spec.xml 2008-11-27 11:19:47 UTC (rev 3118)
+++ jbpm3/trunk/modules/distribution/src/main/resources/installer/user-input-spec.xml 2008-11-27 11:38:47 UTC (rev 3119)
@@ -17,8 +17,8 @@
<field type="radio" variable="dbSelection">
<description align="left" txt="Please choose your target database" />
<spec>
- <choice txt="Hypersonic" value="hsqldb" set="true"/>
- <choice txt="MySQL" value="mysql"/>
+ <choice txt="Hypersonic" value="hsqldb"/>
+ <choice txt="MySQL" value="mysql" set="true"/>
<!-- choice txt="PostgreSQL" value="postgresql"/-->
<choice txt="Sybase" value="sybase"/>
</spec>
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 11:19:47 UTC (rev 3118)
+++ jbpm3/trunk/modules/integration/spec/src/main/java/org/jbpm/integration/model/EndEventImpl.java 2008-11-27 11:38:47 UTC (rev 3119)
@@ -21,8 +21,10 @@
*/
package org.jbpm.integration.model;
+import org.jboss.bpm.api.NotImplementedException;
import org.jboss.bpm.api.model.EndEvent;
import org.jboss.bpm.api.model.ProcessDefinition;
+import org.jboss.bpm.api.model.SequenceFlow;
import org.jbpm.graph.node.EndState;
/**
@@ -54,4 +56,9 @@
{
return EventType.End;
}
+
+ public SequenceFlow getInFlow()
+ {
+ throw new NotImplementedException();
+ }
}
17 years, 5 months
JBoss JBPM SVN: r3118 - projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-27 06:19:47 -0500 (Thu, 27 Nov 2008)
New Revision: 3118
Added:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SingleInFlowSupport.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SingleOutFlowSupport.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/EndEvent.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/StartEvent.java
projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/Task.java
Log:
Add Single In/Out FlowSupport
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/EndEvent.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/EndEvent.java 2008-11-27 11:08:40 UTC (rev 3117)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/EndEvent.java 2008-11-27 11:19:47 UTC (rev 3118)
@@ -34,7 +34,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface EndEvent extends Event
+public interface EndEvent extends Event, SingleInFlowSupport
{
/**
* Get the type od end result
Added: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SingleInFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SingleInFlowSupport.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SingleInFlowSupport.java 2008-11-27 11:19:47 UTC (rev 3118)
@@ -0,0 +1,38 @@
+/*
+ * 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.jboss.bpm.api.model;
+
+//$Id$
+
+/**
+ * Implemented by Nodes that support a single incomming flow.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SingleInFlowSupport
+{
+ /**
+ * Get the incomming SequenceFlow
+ */
+ SequenceFlow getInFlow();
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SingleInFlowSupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SingleOutFlowSupport.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SingleOutFlowSupport.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SingleOutFlowSupport.java 2008-11-27 11:19:47 UTC (rev 3118)
@@ -0,0 +1,38 @@
+/*
+ * 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.jboss.bpm.api.model;
+
+// $Id$
+
+/**
+ * Implemented by Nodes that support a single outgoing flow.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SingleOutFlowSupport
+{
+ /**
+ * Get the outgoing SequenceFlow
+ */
+ SequenceFlow getOutFlow();
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/SingleOutFlowSupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/StartEvent.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/StartEvent.java 2008-11-27 11:08:40 UTC (rev 3117)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/StartEvent.java 2008-11-27 11:19:47 UTC (rev 3118)
@@ -36,14 +36,9 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface StartEvent extends Event
+public interface StartEvent extends Event, SingleOutFlowSupport
{
/**
- * Get the outgoing SequenceFlow
- */
- SequenceFlow getOutFlow();
-
- /**
* Get the detail type fopr this event
*/
EventDetailType getTriggerType();
Modified: projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/Task.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/Task.java 2008-11-27 11:08:40 UTC (rev 3117)
+++ projects/spec/trunk/modules/api/src/main/java/org/jboss/bpm/api/model/Task.java 2008-11-27 11:19:47 UTC (rev 3118)
@@ -32,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Task extends Node
+public interface Task extends Node, SingleOutFlowSupport, SingleInFlowSupport
{
/**
* The TaskType
@@ -52,14 +52,4 @@
* The TaskType list MAY be extended to include new types.
*/
TaskType getTaskType();
-
- /**
- * Get the incomming SequenceFlow
- */
- SequenceFlow getInFlow();
-
- /**
- * Get the outgoing SequenceFlow
- */
- SequenceFlow getOutFlow();
}
\ No newline at end of file
17 years, 5 months