JBoss JBPM SVN: r2894 - in projects/spec/trunk: modules/api/src/main/java/org/jbpm/api/client and 5 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-12 11:51:13 -0500 (Wed, 12 Nov 2008)
New Revision: 2894
Added:
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/WaitTaskImpl.java
Modified:
projects/spec/trunk/eclipse/jBPMCodeStyle.xml
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Token.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/waitstate/WaitStateTest.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
Log:
WIP
Modified: projects/spec/trunk/eclipse/jBPMCodeStyle.xml
===================================================================
--- projects/spec/trunk/eclipse/jBPMCodeStyle.xml 2008-11-12 14:28:34 UTC (rev 2893)
+++ projects/spec/trunk/eclipse/jBPMCodeStyle.xml 2008-11-12 16:51:13 UTC (rev 2894)
@@ -70,7 +70,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
+<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="164"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Token.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Token.java 2008-11-12 14:28:34 UTC (rev 2893)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Token.java 2008-11-12 16:51:13 UTC (rev 2894)
@@ -79,5 +79,5 @@
/**
* Signal the Token, which takes it to the next wait state
*/
- void signal();
+ Token signal();
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/waitstate/WaitStateTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/waitstate/WaitStateTest.java 2008-11-12 14:28:34 UTC (rev 2893)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/waitstate/WaitStateTest.java 2008-11-12 16:51:13 UTC (rev 2894)
@@ -28,6 +28,8 @@
import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.Token;
+import org.jbpm.api.client.Token.TokenStatus;
+import org.jbpm.api.model.Task.TaskType;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -47,14 +49,31 @@
// Start the Process
Token tok = proc.startProcess();
- tok.signal();
+ String nodeName = tok.getCurrentNode().getName();
+ assertEquals(TokenStatus.Suspended, tok.getTokenStatus());
+ assertEquals("TaskA", nodeName);
+
+ nodeName = tok.signal().getCurrentNode().getName();
+ assertEquals(TokenStatus.Suspended, tok.getTokenStatus());
+ assertEquals("TaskB", nodeName);
+
+ nodeName = tok.signal().getCurrentNode().getName();
+ assertEquals(TokenStatus.Suspended, tok.getTokenStatus());
+ assertEquals("TaskC", nodeName);
+
+ nodeName = tok.signal().getCurrentNode().getName();
+ assertEquals(TokenStatus.Destroyed, tok.getTokenStatus());
+ assertEquals("End", nodeName);
}
public ProcessDefinition getProcessDefinition() throws IOException
{
ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
- builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
- builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
+ builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("TaskA");
+ builder.addTask("TaskA", TaskType.Wait).addSequenceFlow("TaskB");
+ builder.addTask("TaskB", TaskType.Wait).addSequenceFlow("TaskC");
+ builder.addTask("TaskC", TaskType.Wait).addSequenceFlow("End");
+ builder.addEndEvent("End");
return builder.getProcessDefinition();
}
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-11-12 16:51:13 UTC (rev 2894)
@@ -241,9 +241,8 @@
private Token startProcessInternal(Attachments att)
{
- ProcessStatus status = getProcessStatus();
- if (status != ProcessStatus.Ready)
- throw new IllegalStateException("Cannot start process in state: " + status);
+ // Prepare the process to start
+ startProcessPrepare();
TokenImpl token = new TokenImpl(this, att);
return token;
@@ -261,6 +260,9 @@
private ObjectName startProcessAsyncInternal(Attachments att)
{
+ // Prepare the process to start
+ startProcessPrepare();
+
ProcessEngine engine = getProcessEngine();
ExecutionService exService = engine.getService(ExecutionService.class);
try
@@ -277,6 +279,20 @@
}
}
+ private void startProcessPrepare()
+ {
+ // Veriy the process state
+ ProcessStatus procStatus = getProcessStatus();
+ if (procStatus != ProcessStatus.None && procStatus != ProcessStatus.Ready)
+ throw new IllegalStateException("Cannot start process in state: " + procStatus);
+
+ // Register the process if needed
+ ProcessEngine engine = getProcessEngine();
+ ProcessInstanceService procService = engine.getService(ProcessInstanceService.class);
+ if (procService.getProcess(getKey()) == null)
+ procService.registerProcess(this);
+ }
+
public ProcessStatus waitForEnd()
{
return waitForEndInternal(0);
Added: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/WaitTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/WaitTaskImpl.java (rev 0)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/WaitTaskImpl.java 2008-11-12 16:51:13 UTC (rev 2894)
@@ -0,0 +1,92 @@
+/*
+ * 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.ri.model;
+
+//$Id$
+
+import javax.persistence.Entity;
+
+import org.jbpm.api.client.Token;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessStructure;
+import org.jbpm.api.model.WaitState;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.TokenExecutor;
+import org.jbpm.ri.model.builder.SingleInFlowSupport;
+import org.jbpm.ri.model.builder.SingleOutFlowSupport;
+
+/**
+ * A WaitTask is an Atomic Activity that suspends the Token.
+ *
+ * If the Process is executed in the Thread of the calling client, this will return
+ * control to the client.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 11-Nov-2008
+ */
+@Entity(name = "BPMWaitTask")
+public class WaitTaskImpl extends TaskImpl implements WaitState, SingleOutFlowSupport, SingleInFlowSupport
+{
+ // provide serial version UID
+ private static final long serialVersionUID = 1L;
+
+ public WaitTaskImpl(ProcessStructure procStruct, String name)
+ {
+ super(procStruct, TaskType.Wait, name);
+ }
+
+ // Persistence ctor
+ protected WaitTaskImpl()
+ {
+ }
+
+ @Override
+ protected FlowHandler getDefaultFlowHandler()
+ {
+ final Node thisNode = this;
+ return new FlowHandler()
+ {
+ private static final long serialVersionUID = 1L;
+
+ public void execute(TokenExecutor tokenExecutor, Token token)
+ {
+ tokenExecutor.suspend(token);
+ }
+
+ @Override
+ public Node getNode()
+ {
+ return thisNode;
+ }
+
+ @Override
+ public void setNode(Node node)
+ {
+ }
+ };
+ }
+
+ public String toString()
+ {
+ return "Task[" + getTaskType() + "," + getName() + "]";
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/WaitTaskImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-11-12 16:51:13 UTC (rev 2894)
@@ -61,6 +61,7 @@
import org.jbpm.ri.model.StartEventImpl;
import org.jbpm.ri.model.TaskImpl;
import org.jbpm.ri.model.UserTaskImpl;
+import org.jbpm.ri.model.WaitTaskImpl;
/**
* The ProcessBuilder can be used to dynamically build a {@link Process}.
@@ -179,6 +180,10 @@
{
node = new UserTaskImpl(procStruct, name);
}
+ else if (type == TaskType.Wait)
+ {
+ node = new WaitTaskImpl(procStruct, name);
+ }
else if (type == TaskType.Script)
{
throw new NotImplementedException("JBPM-1654", "Task Type Script");
@@ -193,7 +198,7 @@
}
else
{
- throw new IllegalStateException("Task type: " + type);
+ throw new NotImplementedException("Task type: " + type);
}
addNode(node);
return new TaskBuilderImpl(this);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java 2008-11-12 16:51:13 UTC (rev 2894)
@@ -116,8 +116,9 @@
}
@Override
- public void signal()
+ public Token signal()
{
+ return this;
}
@Override
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-11-12 16:51:13 UTC (rev 2894)
@@ -106,9 +106,6 @@
private synchronized void startProcessInternal(Process proc, StartEvent start, Attachments att)
{
- // Prepare the process to start
- startProcessPrepare(proc);
-
@SuppressWarnings("serial")
class InitialFlow extends SequenceFlowImpl
{
@@ -159,20 +156,6 @@
tokenExecutor.start(initialToken);
}
- private void startProcessPrepare(Process proc)
- {
- // Veriy the process state
- ProcessStatus procStatus = proc.getProcessStatus();
- if (procStatus != ProcessStatus.None && procStatus != ProcessStatus.Ready)
- throw new IllegalStateException("Cannot start process in state: " + procStatus);
-
- // Register the process if needed
- ProcessEngine engine = getProcessEngine();
- ProcessInstanceService procService = engine.getService(ProcessInstanceService.class);
- if (procService.getProcess(proc.getKey()) == null)
- procService.registerProcess(proc);
- }
-
// Evaluate the Start time assignments
private void startTimeAssignments(Process proc, Token token)
{
17 years, 5 months
JBoss JBPM SVN: r2893 - in projects/spec/trunk/modules: api/src/main/java/org/jbpm/api/runtime/preview and 8 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-12 09:28:34 -0500 (Wed, 12 Nov 2008)
New Revision: 2893
Added:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/PersistenceToken.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Token.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/waitstate/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/waitstate/WaitStateTest.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/InProcessTokenExecutor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ThreadingTokenExecutor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
Removed:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Execution.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExecutionImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableExecution.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Process.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/FlowHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/SignalHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/TokenExecutor.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredTest.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/NodeExecuteInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java
Log:
Add startProcess() and startProcessAsync()
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Execution.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Execution.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Execution.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-// $Id$
-
-import org.hibernate.Session;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.runtime.preview.ExecutionContext;
-
-/**
- * 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 Execution
-{
- public enum ExecutionStatus
- {
- Created, Started, Stoped, Destroyed, Suspended
- }
-
- /**
- * Get the unique token identity
- */
- String getExecutionID();
-
- /**
- * Get the token status
- */
- ExecutionStatus getExecutionStatus();
-
- /**
- * Get the associated {@link Process}
- */
- Process getProcess();
-
- /**
- * Get the associated {@link ExecutionContext}
- */
- ExecutionContext getExecutionContext();
-
- /**
- * Get the current {@link SequenceFlow}
- */
- SequenceFlow getSequenceFlow();
-
- /**
- * Get the associated persistence session
- */
- Session getSession();
-}
\ No newline at end of file
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/PersistenceToken.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/PersistenceToken.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/PersistenceToken.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client;
+
+// $Id$
+
+import org.hibernate.Session;
+
+/**
+ * A Token that gives access to the persistence context
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface PersistenceToken extends Token
+{
+ /**
+ * Get the associated persistence session
+ */
+ Session getSession();
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/PersistenceToken.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Process.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Process.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Process.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -57,11 +57,21 @@
/**
* Start the process
*/
- ObjectName startProcessAsync();
+ Token startProcess();
/**
* Start the process, with a given execution context
*/
+ Token startProcess(Attachments att);
+
+ /**
+ * Start the process asynchronously
+ */
+ ObjectName startProcessAsync();
+
+ /**
+ * Start the process asynchronously, with a given execution context
+ */
ObjectName startProcessAsync(Attachments att);
/**
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Token.java (from rev 2891, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Execution.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Token.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Token.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client;
+
+// $Id$
+
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.runtime.preview.ExecutionContext;
+
+/**
+ * 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 unique token identity
+ */
+ String getTokenID();
+
+ /**
+ * Get the token status
+ */
+ TokenStatus getTokenStatus();
+
+ /**
+ * Get the associated {@link Process}
+ */
+ Process getProcess();
+
+ /**
+ * Get the associated {@link ExecutionContext}
+ */
+ ExecutionContext getExecutionContext();
+
+ /**
+ * Get the last {@link SequenceFlow}
+ */
+ SequenceFlow getLastFlow();
+
+ /**
+ * Get the current {@link Node}
+ */
+ Node getCurrentNode();
+
+ /**
+ * Signal the Token, which takes it to the next wait state
+ */
+ void signal();
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionHandler.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionHandler.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -23,7 +23,7 @@
//$Id$
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.Node;
/**
@@ -38,6 +38,6 @@
/**
* Execute the associated business logic.
*/
- void execute(Execution token);
+ void execute(Token token);
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/FlowHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/FlowHandler.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/FlowHandler.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -23,13 +23,13 @@
// $Id$
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
/**
* The {@link ProcessEngine} invokes the FlowHandler on a {@link Node}
- * to move the {@link Execution} to the next {@link Node}.
+ * to move the {@link Token} to the next {@link Node}.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -40,8 +40,8 @@
* Execute the FlowHandler.
* <p/>
* The FlowHandler typically invoves one of the {@link TokenExecutor}
- * methods to move the {@link Execution} to the next {@link Node}.
+ * methods to move the {@link Token} to the next {@link Node}.
*/
- void execute(TokenExecutor tokenExecutor, Execution token);
+ void execute(TokenExecutor tokenExecutor, Token token);
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/SignalHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/SignalHandler.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/SignalHandler.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -23,7 +23,7 @@
// $Id$
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.preview.Signal;
@@ -40,10 +40,10 @@
/**
* Get signal for enter
*/
- void throwEnterSignal(Execution token);
+ void throwEnterSignal(Token token);
/**
* Get signal for exit
*/
- void throwExitSignal(Execution token);
+ void throwExitSignal(Token token);
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/TokenExecutor.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/TokenExecutor.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/TokenExecutor.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -23,14 +23,12 @@
//$Id$
-import java.util.Set;
-
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.SequenceFlow;
/**
- * The {@link FlowHandler} invokes the TokenExecutor to move {@link Execution}s
- * along the {@link SequenceFlow}s in the {@link Process}.
+ * The {@link FlowHandler} invokes the TokenExecutor to move {@link Token}s along the {@link SequenceFlow}s in the
+ * {@link Process}.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -38,47 +36,37 @@
public interface TokenExecutor
{
/**
- * Get the set of active tokens
+ * Create a {@link Token} with an initial flow
*/
- Set<Execution> getRunnableTokens();
-
+ void create(Token token, SequenceFlow flow);
+
/**
- * True if there are active tokens
+ * Start a {@link Token}
*/
- boolean hasRunnableTokens();
-
+ void start(Token token);
+
/**
- * Create a {@link Execution} with an initial flow
+ * Stop a {@link Token}
*/
- void create(Execution token, SequenceFlow flow);
-
+ void stop(Token token);
+
/**
- * Start a {@link Execution}
+ * Destroy a {@link Token}
*/
- void start(Execution token);
-
+ void destroy(Token token);
+
/**
- * Stop a {@link Execution}
+ * Suspend a {@link Token}
*/
- void stop(Execution token);
-
+ String suspend(Token token);
+
/**
- * Destroy a {@link Execution}
+ * Activate a {@link Token}
*/
- void destroy(Execution token);
-
+ Token activate(String tokenID);
+
/**
- * Suspend a {@link Execution}
+ * Move a given {@link Token} along a given flow.
*/
- String suspend(Execution token);
-
- /**
- * Activate a {@link Execution}
- */
- Execution activate(String tokenID);
-
- /**
- * Move a given {@link Execution} along a given flow.
- */
- void move(Execution token, SequenceFlow flow);
+ void move(Token token, SequenceFlow flow);
}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -25,7 +25,7 @@
import java.io.IOException;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Expression.ExpressionLanguage;
@@ -89,7 +89,7 @@
* - The result of start time activity assignments
*/
@Override
- public void execute(Execution token)
+ public void execute(Token token)
{
ExecutionContext exContext = token.getExecutionContext();
procProp = (String)exContext.getAttachment("TaskExecutionHandlerTest.procProp");
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredTest.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredTest.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -29,7 +29,7 @@
import org.hibernate.Transaction;
import org.jbpm.api.Constants;
import org.jbpm.api.Constants.TxType;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Node;
@@ -110,7 +110,7 @@
private Node node;
@Override
- public void execute(Execution token)
+ public void execute(Token token)
{
Transaction tx = TransactionAssociation.getTransaction();
Boolean doRollback = token.getExecutionContext().getAttachment(Boolean.class, "rollback");
Added: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/waitstate/WaitStateTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/waitstate/WaitStateTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/waitstate/WaitStateTest.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -0,0 +1,60 @@
+/*
+ * 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.test.cts.task.waitstate;
+
+// $Id$
+
+import java.io.IOException;
+
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
+import org.jbpm.api.client.Token;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.service.ProcessBuilderService;
+import org.jbpm.api.test.CTSTestCase;
+
+/**
+ * Test the basic execution sequence
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 03-Jul-2008
+ */
+public class WaitStateTest extends CTSTestCase
+{
+ public void testSequence() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ Process proc = procDef.newInstance();
+
+ // Start the Process
+ Token tok = proc.startProcess();
+ tok.signal();
+ }
+
+ public ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
+ builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
+ builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
+ return builder.getProcessDefinition();
+ }
+}
Property changes on: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/waitstate/WaitStateTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -28,7 +28,7 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Node;
@@ -117,13 +117,13 @@
ProcessEngine engine = getProcessDefinition().getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
- public void throwEnterSignal(Execution token)
+ public void throwEnterSignal(Token token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_END_EVENT_ENTER, getKey());
sigService.throwSignal(signal);
}
- public void throwExitSignal(Execution token)
+ public void throwExitSignal(Token token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_END_EVENT_EXIT, getKey());
sigService.throwSignal(signal);
@@ -155,7 +155,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(TokenExecutor tokenExecutor, Execution token)
+ public void execute(TokenExecutor tokenExecutor, Token token)
{
log.debug("End reached in: " + getName());
ExecutionContext exContext = token.getExecutionContext();
@@ -186,7 +186,7 @@
this.tokenExecutor = tokenExecutor;
}
- void destroyToken(Execution token)
+ void destroyToken(Token token)
{
tokenExecutor.destroy(token);
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -32,7 +32,7 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
@@ -133,7 +133,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Execution token)
+ public void execute(Token token)
{
if (detailType == EventDetailType.Message && getMessageRef() != null)
{
@@ -166,13 +166,13 @@
ProcessEngine engine = getProcessDefinition().getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
- public void throwEnterSignal(Execution token)
+ public void throwEnterSignal(Token token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_EVENT_ENTER, getKey());
sigService.throwSignal(signal);
}
- public void throwExitSignal(Execution token)
+ public void throwExitSignal(Token token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_EVENT_EXIT, getKey());
sigService.throwSignal(signal);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -29,7 +29,7 @@
import javax.persistence.Entity;
import javax.persistence.Transient;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.ExclusiveGateway;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
@@ -88,7 +88,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Execution token)
+ public void execute(Token token)
{
// Call the super default handler
superExecHandler.execute(token);
@@ -97,7 +97,7 @@
if (outstandingFlows == null)
outstandingFlows = new HashSet<SequenceFlow>(inFlows);
- SequenceFlow flow = token.getSequenceFlow();
+ SequenceFlow flow = token.getLastFlow();
outstandingFlows.remove(flow);
}
@@ -122,9 +122,9 @@
{
private static final long serialVersionUID = 1L;
- public void execute(TokenExecutor tokenExecutor, Execution token)
+ public void execute(TokenExecutor tokenExecutor, Token token)
{
- String sourceRef = token.getSequenceFlow().getSourceRef();
+ String sourceRef = token.getLastFlow().getSourceRef();
// Schedule the first token that arrives
if (token == receivedTokens.get(0))
@@ -170,7 +170,7 @@
// Get a single selected gate which' condition evaluates to TRUE
// Fall back to the default gate if there is one
// Choke if there is no selected gate
- private SequenceFlow getSelectedGate(Execution token)
+ private SequenceFlow getSelectedGate(Token token)
{
SequenceFlow selectedGate = null;
for (SequenceFlow auxGate : getGates())
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -34,7 +34,7 @@
import javax.persistence.Transient;
import org.jbpm.api.Constants;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Gateway;
import org.jbpm.api.model.Node;
@@ -71,7 +71,7 @@
// The list of received tokens
@Transient
- protected List<Execution> receivedTokens;
+ protected List<Token> receivedTokens;
public GatewayImpl(ProcessStructure procStruct, String name, GatewayType gatewayType)
{
@@ -162,17 +162,17 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Execution token)
+ public void execute(Token token)
{
// Initialize the gateway
if (expectedFlows == null)
{
expectedFlows = new ArrayList<SequenceFlow>(inFlows);
- receivedTokens = new ArrayList<Execution>();
+ receivedTokens = new ArrayList<Token>();
}
// Check that token from flow is valid
- SequenceFlow flow = token.getSequenceFlow();
+ SequenceFlow flow = token.getLastFlow();
if (expectedFlows.contains(flow) == false)
throw new IllegalStateException("Unexpected token from: " + flow);
@@ -207,13 +207,13 @@
ProcessEngine engine = getProcessDefinition().getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
- public void throwEnterSignal(Execution token)
+ public void throwEnterSignal(Token token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_GATEWAY_ENTER, getKey());
sigService.throwSignal(signal);
}
- public void throwExitSignal(Execution token)
+ public void throwExitSignal(Token token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_GATEWAY_EXIT, getKey());
sigService.throwSignal(signal);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -30,7 +30,7 @@
import javax.persistence.Entity;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.ProcessStructure;
@@ -42,7 +42,7 @@
import org.jbpm.api.runtime.preview.ExecutionContext;
import org.jbpm.api.runtime.preview.FlowHandler;
import org.jbpm.api.runtime.preview.TokenExecutor;
-import org.jbpm.ri.runtime.MutableExecution;
+import org.jbpm.ri.runtime.MutableToken;
import org.mvel.MVEL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -81,10 +81,10 @@
{
private static final long serialVersionUID = 1L;
- public void execute(TokenExecutor tokenExecutor, Execution token)
+ public void execute(TokenExecutor tokenExecutor, Token token)
{
- MutableExecution mutableToken = (MutableExecution)token;
- String sourceRef = token.getSequenceFlow().getSourceRef();
+ MutableToken mutableToken = (MutableToken)token;
+ String sourceRef = token.getLastFlow().getSourceRef();
log.debug("Propagate token comming from: " + sourceRef);
// Get the applicable gates
@@ -98,15 +98,15 @@
}
else
{
- List<Execution> outTokens = new ArrayList<Execution>();
+ List<Token> outTokens = new ArrayList<Token>();
for (SequenceFlow auxGate : applicableGates)
{
SequenceFlow outFlow = auxGate;
- Execution outToken = mutableToken.copyToken();
+ Token outToken = mutableToken.copyToken();
tokenExecutor.create(outToken, outFlow);
outTokens.add(outToken);
}
- for (Execution outToken : outTokens)
+ for (Token outToken : outTokens)
{
tokenExecutor.start(outToken);
}
@@ -134,7 +134,7 @@
// Get applicable gates which' condition evaluates to TRUE.
// Fall back to the default gate if there is one.
// Choke if there is no applicable gate.
- private List<SequenceFlow> getApplicableGates(Execution token)
+ private List<SequenceFlow> getApplicableGates(Token token)
{
List<SequenceFlow> applicableGates = new ArrayList<SequenceFlow>();
for (SequenceFlow auxGate : getGates())
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -43,10 +43,10 @@
import org.hibernate.annotations.IndexColumn;
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NameNotUniqueException;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessDefinition;
-import org.jbpm.api.client.Execution.ExecutionStatus;
+import org.jbpm.api.client.Token.TokenStatus;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.ProcessStructure;
@@ -248,7 +248,7 @@
public void execute(RuntimeContext rtContext)
{
- Execution token = rtContext.getToken();
+ Token token = rtContext.getToken();
// The default implementation calls the ExecutionHandler
ExecutionHandler execHandler = getExecutionHandler();
@@ -289,7 +289,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Execution token)
+ public void execute(Token token)
{
// nothing to do
}
@@ -340,12 +340,12 @@
{
private static final long serialVersionUID = 1L;
- public void execute(TokenExecutor tokenExecutor, Execution token)
+ public void execute(TokenExecutor tokenExecutor, Token token)
{
if (getOutFlows().size() == 1)
{
SequenceFlow outFlow = getOutFlows().get(0);
- if (token.getExecutionStatus() == ExecutionStatus.Started)
+ if (token.getTokenStatus() == TokenStatus.Started)
tokenExecutor.move(token, outFlow);
}
else
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -31,7 +31,7 @@
import javax.persistence.Entity;
import javax.persistence.Transient;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
@@ -39,8 +39,8 @@
import org.jbpm.api.runtime.preview.ExecutionHandler;
import org.jbpm.api.runtime.preview.FlowHandler;
import org.jbpm.api.runtime.preview.TokenExecutor;
-import org.jbpm.ri.runtime.MutableExecution;
-import org.jbpm.ri.runtime.ExecutionImpl;
+import org.jbpm.ri.runtime.MutableToken;
+import org.jbpm.ri.runtime.TokenImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -63,7 +63,7 @@
private Set<SequenceFlow> outstandingFlows;
@Transient
- private Set<Execution> mergeTokens;
+ private Set<Token> mergeTokens;
public ParallelGatewayImpl(ProcessStructure procStruct, String name)
{
@@ -85,7 +85,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Execution token)
+ public void execute(Token token)
{
// Call the super default handler
superExecHandler.execute(token);
@@ -94,10 +94,10 @@
if (outstandingFlows == null)
{
outstandingFlows = new HashSet<SequenceFlow>(inFlows);
- mergeTokens = new HashSet<Execution>();
+ mergeTokens = new HashSet<Token>();
}
- SequenceFlow flow = token.getSequenceFlow();
+ SequenceFlow flow = token.getLastFlow();
outstandingFlows.remove(flow);
mergeTokens.add(token);
}
@@ -123,13 +123,13 @@
{
private static final long serialVersionUID = 1L;
- public void execute(TokenExecutor tokenExecutor, Execution token)
+ public void execute(TokenExecutor tokenExecutor, Token token)
{
// In any case, the incomming token is not propagated
tokenExecutor.suspend(token);
// If the gateway has a single incomming flow the outgoing token is the incomming token
- MutableExecution outToken = (getInFlows().size() == 1 ? (MutableExecution)token : null);
+ MutableToken outToken = (getInFlows().size() == 1 ? (MutableToken)token : null);
// The outgoing token is the merge of all incomming tokens
if (outToken == null)
@@ -152,7 +152,7 @@
if (outToken != null)
{
// Start a copy of the outgoing token for every gate
- List<Execution> outTokens = new ArrayList<Execution>();
+ List<Token> outTokens = new ArrayList<Token>();
for(SequenceFlow auxGate : getGates())
{
SequenceFlow outFlow = auxGate;
@@ -160,13 +160,13 @@
tokenExecutor.create(outToken, outFlow);
outTokens.add(outToken);
}
- for (Execution auxToken : outTokens)
+ for (Token auxToken : outTokens)
{
tokenExecutor.start(auxToken);
}
// Destroy the received tokens
- for (Execution auxToken : receivedTokens)
+ for (Token auxToken : receivedTokens)
{
tokenExecutor.destroy(auxToken);
}
@@ -197,10 +197,10 @@
mergeTokens = null;
}
- private ExecutionImpl getMergedTokens()
+ private TokenImpl getMergedTokens()
{
- ExecutionImpl mergedToken = new ExecutionImpl(getProcess(), null);
- for (Execution auxToken : mergeTokens)
+ TokenImpl mergedToken = new TokenImpl(getProcess(), null);
+ for (Token auxToken : mergeTokens)
{
log.debug("mergeToken: " + auxToken);
mergedToken.mergeToken(auxToken);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -41,6 +41,7 @@
import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.model.preview.Assignment;
@@ -50,6 +51,7 @@
import org.jbpm.api.runtime.Attachments;
import org.jbpm.api.service.ExecutionService;
import org.jbpm.api.service.ProcessInstanceService;
+import org.jbpm.ri.runtime.TokenImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -225,18 +227,40 @@
setProcessStatus(ProcessStatus.Aborted);
}
- public ObjectName startProcessAsync()
+ @Override
+ public Token startProcess()
{
return startProcessInternal(null);
}
- public ObjectName startProcessAsync(Attachments att)
+ @Override
+ public Token startProcess(Attachments att)
{
return startProcessInternal(att);
}
- private ObjectName startProcessInternal(Attachments att)
+ private Token startProcessInternal(Attachments att)
{
+ ProcessStatus status = getProcessStatus();
+ if (status != ProcessStatus.Ready)
+ throw new IllegalStateException("Cannot start process in state: " + status);
+
+ TokenImpl token = new TokenImpl(this, att);
+ return token;
+ }
+
+ public ObjectName startProcessAsync()
+ {
+ return startProcessAsyncInternal(null);
+ }
+
+ public ObjectName startProcessAsync(Attachments att)
+ {
+ return startProcessAsyncInternal(att);
+ }
+
+ private ObjectName startProcessAsyncInternal(Attachments att)
+ {
ProcessEngine engine = getProcessEngine();
ExecutionService exService = engine.getService(ExecutionService.class);
try
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -31,7 +31,7 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.preview.MessageListener;
@@ -65,7 +65,7 @@
private List<Message> receivedMessages = new ArrayList<Message>();
@Transient
- private transient Execution suspendedToken;
+ private transient Token suspendedToken;
@Transient
private transient TokenExecutor tokenExecutor;
@@ -100,7 +100,7 @@
@Override
public void execute(RuntimeContext rtContext)
{
- Execution token = rtContext.getToken();
+ Token token = rtContext.getToken();
tokenExecutor = rtContext.getTokenExecutor();
if (receivedMessages.size() > 0)
@@ -142,7 +142,7 @@
// Activate the suspended token
if (suspendedToken != null)
{
- tokenExecutor.activate(suspendedToken.getExecutionID());
+ tokenExecutor.activate(suspendedToken.getTokenID());
suspendedToken = null;
}
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -27,7 +27,7 @@
import javax.persistence.Transient;
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Node;
@@ -83,7 +83,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Execution token)
+ public void execute(Token token)
{
Message messageRef = thisNode.getMessageRef();
MessageSender messageSender = new MessageSender(thisNode, messageRef);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -29,7 +29,7 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
@@ -123,13 +123,13 @@
ProcessEngine engine = getProcessDefinition().getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
- public void throwEnterSignal(Execution token)
+ public void throwEnterSignal(Token token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_START_EVENT_ENTER, getKey());
sigService.throwSignal(signal);
}
- public void throwExitSignal(Execution token)
+ public void throwExitSignal(Token token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_START_EVENT_EXIT, getKey());
sigService.throwSignal(signal);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -39,7 +39,7 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
@@ -187,7 +187,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Execution token)
+ public void execute(Token token)
{
superExecHandler.execute(token);
processOutputSet(token);
@@ -209,7 +209,7 @@
/**
* Select and validate active inputSet
*/
- protected InputSet getActiveInputSet(Execution token)
+ protected InputSet getActiveInputSet(Token token)
{
InputSetImpl inputSet = null;
ExecutionContext exContext = token.getExecutionContext();
@@ -280,7 +280,7 @@
/**
* Transfer data from outputSet to Token
*/
- protected void processOutputSet(Execution token)
+ protected void processOutputSet(Token token)
{
ExecutionContext exContext = token.getExecutionContext();
@@ -308,13 +308,13 @@
ProcessEngine engine = getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
- public void throwEnterSignal(Execution token)
+ public void throwEnterSignal(Token token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_TASK_ENTER, getKey());
sigService.throwSignal(signal);
}
- public void throwExitSignal(Execution token)
+ public void throwExitSignal(Token token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_TASK_EXIT, getKey());
sigService.throwSignal(signal);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -33,7 +33,7 @@
import javax.persistence.Transient;
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.preview.MessageListener;
@@ -71,7 +71,7 @@
private List<Message> receivedMessages = new ArrayList<Message>();
@Transient
- private transient Execution suspendedToken;
+ private transient Token suspendedToken;
@Transient
private transient TokenExecutor tokenExecutor;
@@ -126,7 +126,7 @@
@Override
public void execute(RuntimeContext rtContext)
{
- Execution token = rtContext.getToken();
+ Token token = rtContext.getToken();
tokenExecutor = rtContext.getTokenExecutor();
if (receivedMessages.size() == 0)
@@ -176,7 +176,7 @@
// Activate the suspended token
if (suspendedToken != null)
{
- tokenExecutor.activate(suspendedToken.getExecutionID());
+ tokenExecutor.activate(suspendedToken.getTokenID());
suspendedToken = null;
}
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -23,7 +23,7 @@
//$Id$
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.preview.Assignment;
@@ -41,8 +41,8 @@
@Override
public void execute(RuntimeContext rtContext)
{
- Node node = rtContext.getNode();
- Execution token = rtContext.getToken();
+ Token token = rtContext.getToken();
+ Node node = token.getCurrentNode();
// Do start time assignments
for (Assignment ass : node.getAssignments())
@@ -62,7 +62,7 @@
}
}
- protected void anyTimeAssignment(Assignment ass, Execution token)
+ protected void anyTimeAssignment(Assignment ass, Token token)
{
Expression expr = ass.getFrom();
ExpressionEvaluator exprEvaluator = new ExpressionEvaluator(expr);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -24,29 +24,28 @@
//$Id$
import org.hibernate.Session;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.Process;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.runtime.preview.ExecutionContext;
/**
- * A {@link Execution} that includes properties from the current {@link Node}
+ * A {@link Token} that includes properties from the current {@link Node}
*
* @author Thomas.Diesler(a)jboss.com
* @since 15-Aug-2008
*/
-public class DelegatingToken implements MutableExecution
+public class DelegatingToken implements MutableToken
{
- private MutableExecution delegateToken;
+ private MutableToken delegateToken;
private ExecutionContext delegateContext;
- public DelegatingToken(MutableExecution token)
+ public DelegatingToken(MutableToken token)
{
this.delegateToken = token;
- String targetRef = token.getSequenceFlow().getTargetRef();
- Node targetNode = token.getProcess().getNode(targetRef);
+ Node targetNode = token.getCurrentNode();
ExecutionContext exContext = token.getExecutionContext();
this.delegateContext = new DelegatingExecutionContext(targetNode, exContext);
}
@@ -58,27 +57,27 @@
}
@Override
- public MutableExecution copyToken()
+ public MutableToken copyToken()
{
return delegateToken.copyToken();
}
@Override
- public SequenceFlow getSequenceFlow()
+ public SequenceFlow getLastFlow()
{
- return delegateToken.getSequenceFlow();
+ return delegateToken.getLastFlow();
}
@Override
- public String getExecutionID()
+ public String getTokenID()
{
- return delegateToken.getExecutionID();
+ return delegateToken.getTokenID();
}
@Override
- public ExecutionStatus getExecutionStatus()
+ public TokenStatus getTokenStatus()
{
- return delegateToken.getExecutionStatus();
+ return delegateToken.getTokenStatus();
}
@Override
@@ -88,21 +87,27 @@
}
@Override
- public void mergeToken(Execution token)
+ public Node getCurrentNode()
{
+ return delegateToken.getCurrentNode();
+ }
+
+ @Override
+ public void mergeToken(Token token)
+ {
delegateToken.mergeToken(token);
}
@Override
- public void setSequenceFlow(SequenceFlow flow)
+ public void setLastFlow(SequenceFlow flow)
{
- delegateToken.setSequenceFlow(flow);
+ delegateToken.setLastFlow(flow);
}
@Override
- public void setExecutionStatus(ExecutionStatus status)
+ public void setTokenStatus(TokenStatus status)
{
- delegateToken.setExecutionStatus(status);
+ delegateToken.setTokenStatus(status);
}
@Override
@@ -117,6 +122,12 @@
delegateToken.setSession(session);
}
+ @Override
+ public void signal()
+ {
+ delegateToken.signal();
+ }
+
public String toString()
{
return delegateToken.toString();
Deleted: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExecutionImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExecutionImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExecutionImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -1,147 +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.ri.runtime;
-
-//$Id$
-
-import org.hibernate.Session;
-import org.jboss.util.id.UID;
-import org.jbpm.api.client.Execution;
-import org.jbpm.api.client.Process;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.Attachments.Key;
-import org.jbpm.api.runtime.preview.BasicExecutionContext;
-import org.jbpm.api.runtime.preview.ExecutionContext;
-
-/**
- * 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 class ExecutionImpl implements MutableExecution
-{
- private String id;
- private SequenceFlow flow;
- private ExecutionContext context;
- private ExecutionStatus status;
- private Process process;
- private Session session;
-
- /**
- * Construct a Token with given {@link Attachments}
- */
- public ExecutionImpl(Process process, Attachments att)
- {
- this.context = new BasicExecutionContext(att);
- this.id = new UID().toString();
- this.status = ExecutionStatus.Created;
- this.process = process;
- }
-
- @Override
- public String getExecutionID()
- {
- return id;
- }
-
- @Override
- public ExecutionStatus getExecutionStatus()
- {
- return status;
- }
-
- @Override
- public void setExecutionStatus(ExecutionStatus status)
- {
- this.status = status;
- }
-
- @Override
- public Process getProcess()
- {
- return process;
- }
-
- @Override
- public ExecutionContext getExecutionContext()
- {
- return context;
- }
-
- @Override
- public SequenceFlow getSequenceFlow()
- {
- return flow;
- }
-
- @Override
- public void setSequenceFlow(SequenceFlow flow)
- {
- this.flow = flow;
- }
-
- @Override
- public Session getSession()
- {
- return session;
- }
-
- @Override
- public void setSession(Session session)
- {
- this.session = session;
- }
-
- @Override
- public MutableExecution copyToken()
- {
- return new ExecutionImpl(process, context);
- }
-
- @Override
- public void mergeToken(Execution token)
- {
- ExecutionContext mergeContext = token.getExecutionContext();
- for(Key key : mergeContext.getAttachmentKeys())
- {
- Object mergeValue = mergeContext.getAttachment(key.getClassPart(), key.getNamePart());
- Object existValue = context.getAttachment(key.getClassPart(), key.getNamePart());
- if (existValue != null && existValue.equals(mergeValue) == false)
- throw new IllegalStateException("Cannot merge the same key with different values: " + key);
-
- context.addAttachment(key.getClassPart(), key.getNamePart(), mergeValue);
- }
- }
-
- public String toString()
- {
- return "[sf=" + getSequenceFlow() + ",status=" + getExecutionStatus() + ",ctx=" + getExecutionContext() + ",id=" + id + "]";
- }
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -23,7 +23,7 @@
//$Id$
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.Node;
import org.jbpm.api.runtime.preview.SignalHandler;
@@ -38,8 +38,8 @@
@Override
public void execute(RuntimeContext rtContext)
{
- Node node = rtContext.getNode();
- Execution token = rtContext.getToken();
+ Token token = rtContext.getToken();
+ Node node = token.getCurrentNode();
SignalHandler sigHandler = node.getSignalHandler();
sigHandler.throwExitSignal(token);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -26,7 +26,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.runtime.Attachments.Key;
@@ -52,7 +52,7 @@
* Evaluate an expression for a given token. <p/> Note that <code>propName.replace(".", "_")</code> applies to
* property names for MVEL expressions, because the dot notation has special meaning in MVEL.
*/
- public Object evaluateExpression(Execution token)
+ public Object evaluateExpression(Token token)
{
ExpressionLanguage exprLang = expr.getExpressionLanguage();
if (exprLang == ExpressionLanguage.MVEL)
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -23,7 +23,7 @@
//$Id$
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.Node;
import org.jbpm.api.runtime.preview.FlowHandler;
import org.jbpm.api.runtime.preview.TokenExecutor;
@@ -40,8 +40,8 @@
public void execute(RuntimeContext rtContext)
{
TokenExecutor tokenExecutor = rtContext.getTokenExecutor();
- Node node = rtContext.getNode();
- Execution token = rtContext.getToken();
+ Token token = rtContext.getToken();
+ Node node = token.getCurrentNode();
// Call the next Interceptor
rtContext.next();
Added: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/InProcessTokenExecutor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/InProcessTokenExecutor.java (rev 0)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/InProcessTokenExecutor.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.runtime;
+
+//$Id$
+
+import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.Token;
+import org.jbpm.api.client.Process.ProcessStatus;
+import org.jbpm.api.client.Token.TokenStatus;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.runtime.preview.TokenExecutor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A TokenExecutor that works in the Thread of the calling client
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Nov-2008
+ */
+public class InProcessTokenExecutor implements TokenExecutor
+{
+ // provide logging
+ final static Logger log = LoggerFactory.getLogger(InProcessTokenExecutor.class);
+
+ private Process proc;
+
+ public InProcessTokenExecutor(Process proc)
+ {
+ this.proc = proc;
+ }
+
+ public void create(Token token, SequenceFlow initialFlow)
+ {
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Created);
+ mutableToken.setLastFlow(initialFlow);
+
+ log.debug("Create Token: " + token);
+ }
+
+ public void start(Token token)
+ {
+ ProcessStatus procStatus = proc.getProcessStatus();
+ if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
+ throw new IllegalStateException("Cannot start token to process in state: " + procStatus);
+
+ log.debug("Start Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Started);
+ }
+
+ public void move(Token token, SequenceFlow flow)
+ {
+ if (flow == null)
+ throw new IllegalArgumentException("Flow cannot be null");
+
+ if (token.getTokenStatus() != TokenStatus.Started)
+ throw new IllegalStateException("Cannot move token in state: " + token.getTokenStatus());
+
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setLastFlow(flow);
+ }
+
+ public void stop(Token token)
+ {
+ log.debug("Stop Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Stoped);
+ }
+
+ public void destroy(Token token)
+ {
+ log.debug("Destroy Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Destroyed);
+ }
+
+ public String suspend(Token token)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Token activate(String tokenID)
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/InProcessTokenExecutor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -25,7 +25,7 @@
import javax.management.ObjectName;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.builder.preview.MessageBuilder;
@@ -65,7 +65,7 @@
* Extract message content from the token and send the message
* to it's recipient.
*/
- public void sendMessage(Execution token)
+ public void sendMessage(Token token)
{
ExecutionContext exContext = token.getExecutionContext();
MessageBuilder msgBuilder = new MessageBuilderImpl();
Deleted: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableExecution.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableExecution.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableExecution.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -1,63 +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.ri.runtime;
-
-//$Id$
-
-import org.hibernate.Session;
-import org.jbpm.api.client.Execution;
-import org.jbpm.api.model.SequenceFlow;
-
-/**
- * A mutable extension to the Token.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public interface MutableExecution extends Execution
-{
- /**
- * Set the token status
- */
- void setExecutionStatus(ExecutionStatus status);
-
- /**
- * Set the associated session
- */
- void setSession(Session session);
-
- /**
- * Set the current SequenceFlow
- */
- void setSequenceFlow(SequenceFlow flow);
-
- /**
- * Create a schallow copy of this Token.
- * The content in the ExecutionContext will be copied by reference.
- */
- MutableExecution copyToken();
-
- /**
- * Merge this Token with another token.
- */
- void mergeToken(Execution token);
-}
\ No newline at end of file
Copied: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java (from rev 2891, projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableExecution.java)
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java (rev 0)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -0,0 +1,64 @@
+/*
+ * 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.ri.runtime;
+
+//$Id$
+
+import org.hibernate.Session;
+import org.jbpm.api.client.PersistenceToken;
+import org.jbpm.api.client.Token;
+import org.jbpm.api.model.SequenceFlow;
+
+/**
+ * A mutable extension to the Token.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface MutableToken extends PersistenceToken
+{
+ /**
+ * Set the token status
+ */
+ void setTokenStatus(TokenStatus status);
+
+ /**
+ * Set the associated session
+ */
+ void setSession(Session session);
+
+ /**
+ * Set the current SequenceFlow
+ */
+ void setLastFlow(SequenceFlow flow);
+
+ /**
+ * Create a schallow copy of this Token.
+ * The content in the ExecutionContext will be copied by reference.
+ */
+ MutableToken copyToken();
+
+ /**
+ * Merge this Token with another token.
+ */
+ void mergeToken(Token token);
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/NodeExecuteInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/NodeExecuteInterceptor.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/NodeExecuteInterceptor.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -23,6 +23,7 @@
//$Id$
+import org.jbpm.api.client.Token;
import org.jbpm.ri.model.NodeImpl;
/**
@@ -36,7 +37,8 @@
@Override
public void execute(RuntimeContext rtContext)
{
- NodeImpl nodeImpl = (NodeImpl)rtContext.getNode();
+ Token token = rtContext.getToken();
+ NodeImpl nodeImpl = (NodeImpl)token.getCurrentNode();
nodeImpl.execute(rtContext);
}
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -25,7 +25,7 @@
import org.hibernate.Session;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.Execution.ExecutionStatus;
+import org.jbpm.api.client.Token.TokenStatus;
import org.jbpm.api.model.Node;
import org.jbpm.api.service.preview.PersistenceService;
import org.slf4j.Logger;
@@ -44,8 +44,8 @@
@Override
public void execute(RuntimeContext rtContext)
{
- Node node = rtContext.getNode();
- MutableExecution token = (MutableExecution)rtContext.getToken();
+ MutableToken token = (MutableToken)rtContext.getToken();
+ Node node = token.getCurrentNode();
Session session = token.getSession();
try
@@ -64,8 +64,8 @@
}
finally
{
- ExecutionStatus status = token.getExecutionStatus();
- if (status == ExecutionStatus.Destroyed || status == ExecutionStatus.Suspended)
+ TokenStatus status = token.getTokenStatus();
+ if (status == TokenStatus.Destroyed || status == TokenStatus.Suspended)
{
session.close();
token.setSession(null);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -21,13 +21,11 @@
*/
package org.jbpm.ri.runtime;
-import org.jbpm.api.client.Execution;
import org.jbpm.api.client.Process;
-import org.jbpm.api.client.Execution.ExecutionStatus;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.Process.ProcessStatus;
+import org.jbpm.api.client.Token.TokenStatus;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.runtime.preview.TokenExecutor;
import org.jbpm.api.service.ProcessInstanceService;
import org.jbpm.ri.model.ProcessImpl;
import org.jbpm.ri.service.ProcessServiceImpl;
@@ -46,18 +44,18 @@
final static Logger log = LoggerFactory.getLogger(RunnableToken.class);
private RuntimeProcess rtProc;
- private TokenExecutor tokenExecutor;
- private MutableExecution token;
+ private ThreadingTokenExecutor tokenExecutor;
+ private MutableToken token;
private boolean releaseThread;
- public RunnableToken(TokenExecutorImpl tokenExecutorImpl, RuntimeProcess rtProc, MutableExecution token)
+ public RunnableToken(ThreadingTokenExecutor tokenExecutor, RuntimeProcess rtProc, MutableToken token)
{
- this.tokenExecutor = rtProc.getTokenExecutor();
+ this.tokenExecutor = tokenExecutor;
this.rtProc = rtProc;
this.token = token;
}
- public Execution getToken()
+ public Token getToken()
{
return token;
}
@@ -72,28 +70,29 @@
Process proc = rtProc.getProcess();
try
{
- SequenceFlow flow = token.getSequenceFlow();
- if (flow == null)
- throw new IllegalStateException("Cannot obtain initial flow");
+ Node node = token.getCurrentNode();
+ if (node == null)
+ throw new IllegalStateException("Cannot obtain initial node");
- while (continueTokenThread())
+ RuntimeContext rtContext = new RuntimeContext(tokenExecutor);
+
+ // Add the interceptors that are defined on the ProcessService
+ ProcessServiceImpl procService = (ProcessServiceImpl)node.getProcessEngine().getService(ProcessInstanceService.class);
+ for (NodeInterceptor itor : procService.getNodeInterceptors())
+ rtContext.addInterceptor(itor);
+
+ while (continueTokenExecution())
{
// Get the target node
- String targetRef = token.getSequenceFlow().getTargetRef();
- Node node = proc.getNode(targetRef);
+ node = token.getCurrentNode();
// Synchronize on the target Node
synchronized (node)
{
// Create a Token that includes node properties
DelegatingToken tokCopy = new DelegatingToken(token);
- RuntimeContext rtContext = new RuntimeContext(tokenExecutor, tokCopy);
+ rtContext.setToken(tokCopy);
- // Add the interceptors that are defined on the ProcessService
- ProcessServiceImpl procService = (ProcessServiceImpl)node.getProcessEngine().getService(ProcessInstanceService.class);
- for (NodeInterceptor itor : procService.getNodeInterceptors())
- rtContext.addInterceptor(itor);
-
// Call the interceptor chain
rtContext.next();
}
@@ -105,9 +104,9 @@
((ProcessImpl)proc).setRuntimeException(rte);
log.debug("Terminate all suspended tokens");
- for (Execution auxToken : tokenExecutor.getRunnableTokens())
+ for (Token auxToken : tokenExecutor.getRunnableTokens())
{
- if (auxToken.getExecutionStatus() == ExecutionStatus.Suspended)
+ if (auxToken.getTokenStatus() == TokenStatus.Suspended)
tokenExecutor.destroy(auxToken);
}
@@ -121,11 +120,11 @@
}
}
- private boolean continueTokenThread()
+ private boolean continueTokenExecution()
{
- ExecutionStatus tokStatus = token.getExecutionStatus();
+ TokenStatus tokStatus = token.getTokenStatus();
ProcessStatus procStatus = rtProc.getProcess().getProcessStatus();
- return releaseThread == false && procStatus == ProcessStatus.Active && tokStatus == ExecutionStatus.Started;
+ return releaseThread == false && procStatus == ProcessStatus.Active && tokStatus == TokenStatus.Started;
}
private void notifyRuntimeProcess()
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -26,8 +26,7 @@
import java.util.ArrayList;
import java.util.List;
-import org.jbpm.api.client.Execution;
-import org.jbpm.api.model.Node;
+import org.jbpm.api.client.Token;
import org.jbpm.api.runtime.preview.TokenExecutor;
/**
@@ -38,16 +37,15 @@
*/
public class RuntimeContext
{
- List<NodeInterceptor> interceptors = new ArrayList<NodeInterceptor>();
- int itorIndex;
+ private List<NodeInterceptor> interceptors = new ArrayList<NodeInterceptor>();
+ private int itorIndex;
- TokenExecutor tokenExecutor;
- MutableExecution token;
+ private TokenExecutor tokenExecutor;
+ private MutableToken token;
- public RuntimeContext(TokenExecutor tokenExecutor, MutableExecution token)
+ public RuntimeContext(TokenExecutor tokenExecutor)
{
this.tokenExecutor = tokenExecutor;
- this.token = token;
}
public TokenExecutor getTokenExecutor()
@@ -55,17 +53,17 @@
return tokenExecutor;
}
- public Node getNode()
+ public Token getToken()
{
- String targetRef = token.getSequenceFlow().getTargetRef();
- return token.getProcess().getNode(targetRef);
+ return token;
}
- public Execution getToken()
+ public void setToken(MutableToken token)
{
- return token;
+ this.token = token;
+ this.itorIndex = 0;
}
-
+
void addInterceptor(NodeInterceptor itor)
{
interceptors.add(itor);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -27,8 +27,9 @@
import org.jbpm.api.runtime.preview.TokenExecutor;
/**
- * A RuntimeProcess add runtime behaviour to the {@link Process} <p/> To protect the engine from maligious user code it
- * does not extend {@link Process} directly.
+ * A RuntimeProcess add runtime behaviour to the {@link Process}
+ * <p/>
+ * To protect the engine from maligious user code it does not extend {@link Process} directly.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -43,5 +44,5 @@
/**
* Get the {@link TokenExecutor} for this {@link Process}
*/
- TokenExecutor getTokenExecutor();
+ ThreadingTokenExecutor getTokenExecutor();
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -24,7 +24,6 @@
//$Id$
import org.jbpm.api.client.Process;
-import org.jbpm.api.runtime.preview.TokenExecutor;
/**
* A RuntimeProcess add runtime behaviour to the {@link Process}
@@ -35,12 +34,12 @@
public class RuntimeProcessImpl implements RuntimeProcess
{
private Process proc;
- private TokenExecutor tokenExecutor;
+ private ThreadingTokenExecutor tokenExecutor;
public RuntimeProcessImpl(Process proc)
{
this.proc = proc;
- this.tokenExecutor = new TokenExecutorImpl(this);
+ this.tokenExecutor = new ThreadingTokenExecutor(this);
}
public Process getProcess()
@@ -48,7 +47,7 @@
return proc;
}
- public TokenExecutor getTokenExecutor()
+ public ThreadingTokenExecutor getTokenExecutor()
{
return tokenExecutor;
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -23,7 +23,7 @@
//$Id$
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.Node;
import org.jbpm.api.runtime.preview.SignalHandler;
@@ -38,8 +38,8 @@
@Override
public void execute(RuntimeContext rtContext)
{
- Node node = rtContext.getNode();
- Execution token = rtContext.getToken();
+ Token token = rtContext.getToken();
+ Node node = token.getCurrentNode();
try
{
Added: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ThreadingTokenExecutor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ThreadingTokenExecutor.java (rev 0)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ThreadingTokenExecutor.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -0,0 +1,194 @@
+/*
+ * 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.ri.runtime;
+
+//$Id$
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.jbpm.api.client.Token;
+import org.jbpm.api.client.Token.TokenStatus;
+import org.jbpm.api.client.Process.ProcessStatus;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.TokenExecutor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The {@link FlowHandler} invokes the TokenExecutor to schedule {@link SequenceFlow} objects together with their
+ * associated {@link Token}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class ThreadingTokenExecutor implements TokenExecutor
+{
+ // provide logging
+ final static Logger log = LoggerFactory.getLogger(ThreadingTokenExecutor.class);
+
+ private RuntimeProcess rtProc;
+ private ExecutorService executor = Executors.newCachedThreadPool();
+ Map<String, RunnableToken> runnableTokens = new HashMap<String, RunnableToken>();
+
+ public ThreadingTokenExecutor(RuntimeProcess rtProc)
+ {
+ this.rtProc = rtProc;
+ }
+
+ public Set<Token> getRunnableTokens()
+ {
+ synchronized (runnableTokens)
+ {
+ Set<Token> tokenSet = new HashSet<Token>();
+ for (RunnableToken rt : runnableTokens.values())
+ tokenSet.add(rt.getToken());
+
+ return Collections.unmodifiableSet(tokenSet);
+ }
+ }
+
+ public boolean hasRunnableTokens()
+ {
+ synchronized (runnableTokens)
+ {
+ return runnableTokens.size() > 0;
+ }
+ }
+
+ public void create(Token token, SequenceFlow initialFlow)
+ {
+ synchronized (runnableTokens)
+ {
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Created);
+ mutableToken.setLastFlow(initialFlow);
+
+ log.debug("Create Token: " + token);
+
+ RunnableToken rtToken = new RunnableToken(this, rtProc, mutableToken);
+ runnableTokens.put(token.getTokenID(), rtToken);
+ }
+ }
+
+ public void start(Token token)
+ {
+ synchronized (runnableTokens)
+ {
+ ProcessStatus procStatus = rtProc.getProcess().getProcessStatus();
+ if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
+ throw new IllegalStateException("Cannot start token to process in state: " + procStatus);
+
+ log.debug("Start Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Started);
+
+ RunnableToken rtToken = runnableTokens.get(token.getTokenID());
+ executor.submit(rtToken);
+ }
+ }
+
+ public void move(Token token, SequenceFlow flow)
+ {
+ synchronized (runnableTokens)
+ {
+ if (flow == null)
+ throw new IllegalArgumentException("Flow cannot be null");
+
+ if (token.getTokenStatus() != TokenStatus.Started)
+ throw new IllegalStateException("Cannot move token in state: " + token.getTokenStatus());
+
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setLastFlow(flow);
+ }
+ }
+
+ public void stop(Token token)
+ {
+ synchronized (runnableTokens)
+ {
+ log.debug("Stop Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Stoped);
+ }
+ }
+
+ public void destroy(Token token)
+ {
+ synchronized (runnableTokens)
+ {
+ log.debug("Destroy Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Destroyed);
+ runnableTokens.remove(token.getTokenID());
+ }
+ }
+
+ public String suspend(Token token)
+ {
+ synchronized (runnableTokens)
+ {
+ RunnableToken rtToken = runnableTokens.get(token.getTokenID());
+ if (rtToken == null)
+ throw new IllegalStateException("Not a runnable token: " + token);
+
+ log.debug("Suspend Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Suspended);
+
+ // Release the thread for a suspended token
+ rtToken.releaseThread();
+
+ return token.getTokenID();
+ }
+ }
+
+ public Token activate(String tokenID)
+ {
+ synchronized (runnableTokens)
+ {
+ RunnableToken rtToken = runnableTokens.get(tokenID);
+ if (rtToken == null)
+ throw new IllegalStateException("Not a runnable token: " + tokenID);
+
+ Token token = rtToken.getToken();
+ if (token.getTokenStatus() != TokenStatus.Suspended)
+ throw new IllegalStateException("Activate token in state: " + token.getTokenStatus());
+
+ log.debug("Activate Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Started);
+
+ rtToken = new RunnableToken(this, rtProc, mutableToken);
+ runnableTokens.put(token.getTokenID(), rtToken);
+ executor.submit(rtToken);
+
+ return token;
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ThreadingTokenExecutor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -1,194 +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.ri.runtime;
-
-//$Id$
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import org.jbpm.api.client.Execution;
-import org.jbpm.api.client.Execution.ExecutionStatus;
-import org.jbpm.api.client.Process.ProcessStatus;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.runtime.preview.FlowHandler;
-import org.jbpm.api.runtime.preview.TokenExecutor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The {@link FlowHandler} invokes the TokenExecutor to schedule {@link SequenceFlow} objects together with their
- * associated {@link Execution}.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public class TokenExecutorImpl implements TokenExecutor
-{
- // provide logging
- final static Logger log = LoggerFactory.getLogger(TokenExecutorImpl.class);
-
- private RuntimeProcess rtProc;
- private ExecutorService executor = Executors.newCachedThreadPool();
- Map<String, RunnableToken> runnableTokens = new HashMap<String, RunnableToken>();
-
- public TokenExecutorImpl(RuntimeProcess rtProc)
- {
- this.rtProc = rtProc;
- }
-
- public Set<Execution> getRunnableTokens()
- {
- synchronized (runnableTokens)
- {
- Set<Execution> tokenSet = new HashSet<Execution>();
- for (RunnableToken rt : runnableTokens.values())
- tokenSet.add(rt.getToken());
-
- return Collections.unmodifiableSet(tokenSet);
- }
- }
-
- public boolean hasRunnableTokens()
- {
- synchronized (runnableTokens)
- {
- return runnableTokens.size() > 0;
- }
- }
-
- public void create(Execution token, SequenceFlow initialFlow)
- {
- synchronized (runnableTokens)
- {
- MutableExecution mutableToken = (MutableExecution)token;
- mutableToken.setExecutionStatus(ExecutionStatus.Created);
- mutableToken.setSequenceFlow(initialFlow);
-
- log.debug("Create Token: " + token);
-
- RunnableToken rtToken = new RunnableToken(this, rtProc, mutableToken);
- runnableTokens.put(token.getExecutionID(), rtToken);
- }
- }
-
- public void start(Execution token)
- {
- synchronized (runnableTokens)
- {
- ProcessStatus procStatus = rtProc.getProcess().getProcessStatus();
- if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
- throw new IllegalStateException("Cannot start token to process in state: " + procStatus);
-
- log.debug("Start Token: " + token);
- MutableExecution mutableToken = (MutableExecution)token;
- mutableToken.setExecutionStatus(ExecutionStatus.Started);
-
- RunnableToken rtToken = runnableTokens.get(token.getExecutionID());
- executor.submit(rtToken);
- }
- }
-
- public void move(Execution token, SequenceFlow flow)
- {
- synchronized (runnableTokens)
- {
- if (flow == null)
- throw new IllegalArgumentException("Flow cannot be null");
-
- if (token.getExecutionStatus() != ExecutionStatus.Started)
- throw new IllegalStateException("Cannot move token in state: " + token.getExecutionStatus());
-
- MutableExecution mutableToken = (MutableExecution)token;
- mutableToken.setSequenceFlow(flow);
- }
- }
-
- public void stop(Execution token)
- {
- synchronized (runnableTokens)
- {
- log.debug("Stop Token: " + token);
- MutableExecution mutableToken = (MutableExecution)token;
- mutableToken.setExecutionStatus(ExecutionStatus.Stoped);
- }
- }
-
- public void destroy(Execution token)
- {
- synchronized (runnableTokens)
- {
- log.debug("Destroy Token: " + token);
- MutableExecution mutableToken = (MutableExecution)token;
- mutableToken.setExecutionStatus(ExecutionStatus.Destroyed);
- runnableTokens.remove(token.getExecutionID());
- }
- }
-
- public String suspend(Execution token)
- {
- synchronized (runnableTokens)
- {
- RunnableToken rtToken = runnableTokens.get(token.getExecutionID());
- if (rtToken == null)
- throw new IllegalStateException("Not a runnable token: " + token);
-
- log.debug("Suspend Token: " + token);
- MutableExecution mutableToken = (MutableExecution)token;
- mutableToken.setExecutionStatus(ExecutionStatus.Suspended);
-
- // Release the thread for a suspended token
- rtToken.releaseThread();
-
- return token.getExecutionID();
- }
- }
-
- public Execution activate(String tokenID)
- {
- synchronized (runnableTokens)
- {
- RunnableToken rtToken = runnableTokens.get(tokenID);
- if (rtToken == null)
- throw new IllegalStateException("Not a runnable token: " + tokenID);
-
- Execution token = rtToken.getToken();
- if (token.getExecutionStatus() != ExecutionStatus.Suspended)
- throw new IllegalStateException("Activate token in state: " + token.getExecutionStatus());
-
- log.debug("Activate Token: " + token);
- MutableExecution mutableToken = (MutableExecution)token;
- mutableToken.setExecutionStatus(ExecutionStatus.Started);
-
- rtToken = new RunnableToken(this, rtProc, mutableToken);
- runnableTokens.put(token.getExecutionID(), rtToken);
- executor.submit(rtToken);
-
- return token;
- }
- }
-}
\ No newline at end of file
Copied: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java (from rev 2891, projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExecutionImpl.java)
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java (rev 0)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -0,0 +1,160 @@
+/*
+ * 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.ri.runtime;
+
+//$Id$
+
+import org.hibernate.Session;
+import org.jboss.util.id.UID;
+import org.jbpm.api.client.Token;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.Attachments.Key;
+import org.jbpm.api.runtime.preview.BasicExecutionContext;
+import org.jbpm.api.runtime.preview.ExecutionContext;
+
+/**
+ * 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 class TokenImpl implements MutableToken
+{
+ private String id;
+ private SequenceFlow flow;
+ private ExecutionContext context;
+ private TokenStatus status;
+ private Process process;
+ private Session session;
+
+ /**
+ * Construct a Token with given {@link Attachments}
+ */
+ public TokenImpl(Process process, Attachments att)
+ {
+ this.context = new BasicExecutionContext(att);
+ this.id = new UID().toString();
+ this.status = TokenStatus.Created;
+ this.process = process;
+ }
+
+ @Override
+ public String getTokenID()
+ {
+ return id;
+ }
+
+ @Override
+ public TokenStatus getTokenStatus()
+ {
+ return status;
+ }
+
+ @Override
+ public void setTokenStatus(TokenStatus status)
+ {
+ this.status = status;
+ }
+
+ @Override
+ public Process getProcess()
+ {
+ return process;
+ }
+
+ @Override
+ public ExecutionContext getExecutionContext()
+ {
+ return context;
+ }
+
+ @Override
+ public Node getCurrentNode()
+ {
+ String targetRef = flow.getTargetRef();
+ return getProcess().getNode(targetRef);
+ }
+
+ @Override
+ public SequenceFlow getLastFlow()
+ {
+ return flow;
+ }
+
+ @Override
+ public void setLastFlow(SequenceFlow flow)
+ {
+ this.flow = flow;
+ }
+
+ @Override
+ public void signal()
+ {
+ }
+
+ @Override
+ public Session getSession()
+ {
+ return session;
+ }
+
+ @Override
+ public void setSession(Session session)
+ {
+ this.session = session;
+ }
+
+ @Override
+ public MutableToken copyToken()
+ {
+ return new TokenImpl(process, context);
+ }
+
+ @Override
+ public void mergeToken(Token token)
+ {
+ ExecutionContext mergeContext = token.getExecutionContext();
+ for(Key key : mergeContext.getAttachmentKeys())
+ {
+ Object mergeValue = mergeContext.getAttachment(key.getClassPart(), key.getNamePart());
+ Object existValue = context.getAttachment(key.getClassPart(), key.getNamePart());
+ if (existValue != null && existValue.equals(mergeValue) == false)
+ throw new IllegalStateException("Cannot merge the same key with different values: " + key);
+
+ context.addAttachment(key.getClassPart(), key.getNamePart(), mergeValue);
+ }
+ }
+
+ public String toString()
+ {
+ return "[sf=" + getLastFlow() + ",status=" + getTokenStatus() + ",ctx=" + getExecutionContext() + ",id=" + id + "]";
+ }
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -28,7 +28,6 @@
import org.jbpm.api.Constants;
import org.jbpm.api.NotImplementedException;
import org.jbpm.api.Constants.TxType;
-import org.jbpm.api.client.Execution;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.preview.Group;
@@ -51,8 +50,10 @@
@Override
public void execute(RuntimeContext rtContext)
{
- Node node = rtContext.getNode();
- Execution token = rtContext.getToken();
+ MutableToken token = (MutableToken)rtContext.getToken();
+ Node node = token.getCurrentNode();
+
+ // Get persistence session
Session session = token.getSession();
// Get the Thread associated Tx
@@ -92,10 +93,9 @@
service.saveNode(session, node);
// Get TxType of the next node
- String targetRef = token.getSequenceFlow().getTargetRef();
- if (targetRef != null)
+ Node nextNode = token.getCurrentNode();
+ if (nextNode != null)
{
- Node nextNode = node.getProcess().getNode(targetRef);
txTypeNext = getTxType(nextNode);
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -32,7 +32,7 @@
import org.jbpm.api.BPMException;
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.ProcessTimeoutException;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.client.Process.ProcessStatus;
@@ -53,10 +53,11 @@
import org.jbpm.ri.model.SignalImpl;
import org.jbpm.ri.runtime.DelegatingToken;
import org.jbpm.ri.runtime.ExpressionEvaluator;
-import org.jbpm.ri.runtime.MutableExecution;
+import org.jbpm.ri.runtime.MutableToken;
import org.jbpm.ri.runtime.RuntimeProcess;
import org.jbpm.ri.runtime.RuntimeProcessImpl;
-import org.jbpm.ri.runtime.ExecutionImpl;
+import org.jbpm.ri.runtime.ThreadingTokenExecutor;
+import org.jbpm.ri.runtime.TokenImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -121,9 +122,9 @@
boolean startProcessThread = (rtProc == null);
// Create initial Token
- ExecutionImpl initialToken = new ExecutionImpl(proc, att);
+ TokenImpl initialToken = new TokenImpl(proc, att);
InitialFlow initialFlow = new InitialFlow(start);
- initialToken.setSequenceFlow(initialFlow);
+ initialToken.setLastFlow(initialFlow);
// Register the initial Token
rtProc = getRuntimeProcess(proc, true);
@@ -173,9 +174,9 @@
}
// Evaluate the Start time assignments
- private void startTimeAssignments(Process proc, Execution token)
+ private void startTimeAssignments(Process proc, Token token)
{
- DelegatingToken delegatingToken = new DelegatingToken((MutableExecution)token);
+ DelegatingToken delegatingToken = new DelegatingToken((MutableToken)token);
ExecutionContext exContext = token.getExecutionContext();
for (Assignment ass : proc.getAssignments())
{
@@ -320,7 +321,7 @@
public void run()
{
- TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
+ ThreadingTokenExecutor tokenExecutor = rtProc.getTokenExecutor();
ProcessImpl procImpl = (ProcessImpl)rtProc.getProcess();
Process proc = rtProc.getProcess();
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java 2008-11-12 11:37:11 UTC (rev 2892)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java 2008-11-12 14:28:34 UTC (rev 2893)
@@ -28,7 +28,7 @@
import javax.management.ObjectName;
-import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Token;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
@@ -165,7 +165,7 @@
private static final long serialVersionUID = 1L;
@Override
- public void execute(Execution token)
+ public void execute(Token token)
{
}
@@ -213,12 +213,12 @@
}
@Override
- public void throwEnterSignal(Execution token)
+ public void throwEnterSignal(Token token)
{
}
@Override
- public void throwExitSignal(Execution token)
+ public void throwExitSignal(Token token)
{
}
}
@@ -255,7 +255,7 @@
}
@Override
- public void execute(TokenExecutor tokenExecutor, Execution token)
+ public void execute(TokenExecutor tokenExecutor, Token token)
{
}
}
17 years, 5 months
JBoss JBPM SVN: r2892 - in projects/gwt-console/trunk: rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3 and 5 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-11-12 06:37:11 -0500 (Wed, 12 Nov 2008)
New Revision: 2892
Added:
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java
Modified:
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java
projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateParser.java
projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/Transform.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java
Log:
Added token references to process instance DTO
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java 2008-11-12 11:00:17 UTC (rev 2891)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/ProcessInstance.java 2008-11-12 11:37:11 UTC (rev 2892)
@@ -22,6 +22,8 @@
package org.jboss.bpm.console.client.model;
+import org.jboss.bpm.console.client.model.jbpm3.TokenReference;
+
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.Date;
@@ -47,6 +49,8 @@
private transient Lifecycle lifecycle;
+ private TokenReference rootToken;
+
public ProcessInstance()
{
initLifecycle();
@@ -244,4 +248,14 @@
super("Illegal transition current " + current + " next " + next);
}
}
+
+ public TokenReference getRootToken()
+ {
+ return rootToken;
+ }
+
+ public void setRootToken(TokenReference rootToken)
+ {
+ this.rootToken = rootToken;
+ }
}
Added: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java (rev 0)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/jbpm3/TokenReference.java 2008-11-12 11:37:11 UTC (rev 2892)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.console.client.model.jbpm3;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+@XmlRootElement(name = "tokenReference")
+public class TokenReference
+{
+ private long id;
+ private Set<TokenReference> children = new HashSet<TokenReference>();
+
+ public TokenReference(long id)
+ {
+ this.id = id;
+ }
+
+ public Set<TokenReference> getChildren()
+ {
+ return children;
+ }
+}
Modified: projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateParser.java
===================================================================
--- projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateParser.java 2008-11-12 11:00:17 UTC (rev 2891)
+++ projects/gwt-console/trunk/rpc/src/main/java/org/jboss/bpm/console/client/model/util/SimpleDateParser.java 2008-11-12 11:37:11 UTC (rev 2892)
@@ -77,7 +77,7 @@
private String instructions = "";
- private static void _parse(String format, String[] args) {
+ private static void _parse(String format, String[] args) {
if (format.length() == 0)
return;
if (format.startsWith("'")){
Modified: projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/Transform.java
===================================================================
--- projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/Transform.java 2008-11-12 11:00:17 UTC (rev 2891)
+++ projects/gwt-console/trunk/server/src/main/java/org/jboss/bpm/console/server/dao/internal/Transform.java 2008-11-12 11:37:11 UTC (rev 2892)
@@ -24,12 +24,15 @@
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessInstance;
import org.jboss.bpm.console.client.model.TaskReference;
+import org.jboss.bpm.console.client.model.jbpm3.TokenReference;
import org.jbpm.graph.def.Transition;
+import org.jbpm.graph.exe.Token;
import org.jbpm.taskmgmt.exe.PooledActor;
import java.util.Date;
import java.util.List;
import java.util.Set;
+import java.util.Map;
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
@@ -48,9 +51,30 @@
boolean suspended = i0.isSuspended();
long processId = i0.getProcessDefinition().getId();
long instanceId = i0.getId();
- return new ProcessInstance(instanceId, processId, start, end, suspended);
+ ProcessInstance processInstance = new ProcessInstance(instanceId, processId, start, end, suspended);
+
+ // token
+ Token t0 = i0.getRootToken();
+ processInstance.setRootToken(Transform.tokenReference(t0));
+ return processInstance;
}
+ private static TokenReference tokenReference(Token t0)
+ {
+ TokenReference rootToken = new TokenReference(t0.getId());
+
+ Map children = t0.getChildren();
+ if(children!=null)
+ {
+ for(Object o : children.values())
+ {
+ Token t1 = (Token)o;
+ rootToken.getChildren().add( Transform.tokenReference(t1) );
+ }
+ }
+ return rootToken;
+ }
+
public static void doTransition(org.jbpm.graph.exe.ProcessInstance p0, String nextState)
{
ProcessInstance instance = Transform.processInstance(p0);
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-11-12 11:00:17 UTC (rev 2891)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/model/DTOParser.java 2008-11-12 11:37:11 UTC (rev 2892)
@@ -22,12 +22,12 @@
package org.jboss.bpm.console.client.model;
import com.google.gwt.json.client.*;
-import com.allen_sauer.gwt.log.client.Log;
import org.jboss.bpm.console.client.model.forms.FieldDef;
import org.jboss.bpm.console.client.model.forms.FormDef;
import org.jboss.bpm.console.client.util.JSONWalk;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -177,4 +177,24 @@
return formDef;
}
+ public static ProcessInstance parseProcessInstance(JSONObject root)
+ {
+
+ long id = JSONWalk.on(root).next("instanceId").asLong();
+ long parentId = JSONWalk.on(root).next("parentId").asLong();
+ Date start = JSONWalk.on(root).next("startDate").asDate();
+
+ JSONWalk.JSONWrapper endDateJSON = JSONWalk.on(root).next("endDate");
+ Date end = null;
+ if(endDateJSON!=null)
+ end = endDateJSON.asDate();
+
+ boolean suspended = JSONWalk.on(root).next("suspended").asBool();
+
+ return new ProcessInstance(
+ id, parentId,
+ start, end,
+ suspended
+ );
+ }
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-11-12 11:00:17 UTC (rev 2891)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceList.java 2008-11-12 11:37:11 UTC (rev 2892)
@@ -22,6 +22,8 @@
package org.jboss.bpm.console.client.process;
import com.google.gwt.http.client.*;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.json.client.JSONObject;
import com.gwtext.client.data.*;
import com.gwtext.client.widgets.MessageBox;
import com.gwtext.client.widgets.MessageBoxConfig;
@@ -32,6 +34,7 @@
import org.jboss.bpm.console.client.util.DateRenderer;
import org.jboss.bpm.console.client.model.ProcessDefinition;
import org.jboss.bpm.console.client.model.ProcessInstance;
+import org.jboss.bpm.console.client.model.DTOParser;
import org.jboss.bpm.console.client.widgets.RemoteListView;
import java.util.HashMap;
@@ -175,13 +178,26 @@
public static ProcessInstance transform(Record r)
{
- ProcessInstance pd = new ProcessInstance(
+ /*ProcessInstance processInstance = new ProcessInstance(
Long.valueOf(r.getAsString("instanceId")),
Long.valueOf( r.getAsString("parentId")),
r.getAsDate("startDate"),
r.getAsDate("endDate"),
- r.getAsBoolean("suspended"));
- return pd;
+ r.getAsBoolean("suspended"));*/
+
+ ProcessInstance processInstance = null;
+ try
+ {
+ JavaScriptObject js = r.getDataAsJsObject();
+ JSONObject jso = new JSONObject(js);
+ processInstance = DTOParser.parseProcessInstance(jso);
+ }
+ catch (Throwable t)
+ {
+ Log.error("Failed to parse process instance", t);
+ }
+
+ return processInstance;
}
protected ColumnModel createColumnModel()
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-11-12 11:00:17 UTC (rev 2891)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-11-12 11:37:11 UTC (rev 2892)
@@ -95,10 +95,11 @@
PaddedPanel tabPadding = new PaddedPanel(tabPanel, 0,10,0,10);
+ // ----------------------------------------
+
Panel detailsForm = assembleDetailsForm();
+
- // ----------------------------------------
-
tabPanel.add(detailsForm);
tabPanel.add( new Panel("Advanced") );
// ----------------------------------
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java 2008-11-12 11:00:17 UTC (rev 2891)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/util/JSONWalk.java 2008-11-12 11:37:11 UTC (rev 2892)
@@ -27,7 +27,10 @@
import com.google.gwt.json.client.JSONArray;
import java.util.Iterator;
+import java.util.Date;
+import org.jboss.bpm.console.client.model.util.SimpleDateParser;
+
/**
* @author Heiko.Braun <heiko.braun(a)jboss.com>
*/
@@ -141,6 +144,19 @@
}
}
+ public Date asDate()
+ {
+ if(value.isString()!=null)
+ {
+ return SimpleDateParser.parse(value.isString().stringValue(), "dd-MM-yy HH:mm:ss");
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not a date string: " + value);
+ }
+ }
+
+
public JSONArray asArray()
{
if(value.isArray()!=null)
17 years, 5 months
JBoss JBPM SVN: r2891 - in projects/spec/trunk/modules: api/src/main/java/org/jbpm/api/client/preview and 44 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-12 06:00:17 -0500 (Wed, 12 Nov 2008)
New Revision: 2891
Added:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Execution.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Process.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/ProcessDefinition.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessStructure.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/WaitState.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/PropertySupport.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/BasicExecutionContext.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/BasicNodeHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionContext.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/FlowHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/NodeHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/SignalHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/TokenExecutor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExecutionImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableExecution.java
Removed:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicNodeHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/NodeHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/Deployment.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Group.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InputSet.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Message.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/OutputSet.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessInstanceService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/PersistenceService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java
projects/spec/trunk/modules/cts/pom.xml
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/endevent/EndEventMessageTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/executioncontext/ExecutionContextTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeInputSetTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeOutputSetTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodePropertyTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/process/ProcessPropertyTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/startevent/StartEventSignalTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/receive/ReceiveTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/send/SendTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskCallbackTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequencePersistenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java
projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/DialectHandlerImpl.java
projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java
projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java
projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/DialectHandlerImpl.java
projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/ProcessDefinitionAdapter.java
projects/spec/trunk/modules/dialects/stp/src/main/java/org/jbpm/dialect/stp/DialectHandlerImpl.java
projects/spec/trunk/modules/dialects/stp/src/main/java/org/jbpm/dialect/stp/ProcessUnmarshaller.java
projects/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jbpm/dialect/xpdl21/DialectHandlerImpl.java
projects/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jbpm/dialect/xpdl21/WorkflowProcessAdapter.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GroupImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InputSetImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MessageImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/OutputSetImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertySupportImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessDefinitionServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect/stp/sequence/SequenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java
projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java
projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java
projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
Log:
Refactor API
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Execution.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Execution.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Execution.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client;
+
+// $Id$
+
+import org.hibernate.Session;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.runtime.preview.ExecutionContext;
+
+/**
+ * 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 Execution
+{
+ public enum ExecutionStatus
+ {
+ Created, Started, Stoped, Destroyed, Suspended
+ }
+
+ /**
+ * Get the unique token identity
+ */
+ String getExecutionID();
+
+ /**
+ * Get the token status
+ */
+ ExecutionStatus getExecutionStatus();
+
+ /**
+ * Get the associated {@link Process}
+ */
+ Process getProcess();
+
+ /**
+ * Get the associated {@link ExecutionContext}
+ */
+ ExecutionContext getExecutionContext();
+
+ /**
+ * Get the current {@link SequenceFlow}
+ */
+ SequenceFlow getSequenceFlow();
+
+ /**
+ * Get the associated persistence session
+ */
+ Session getSession();
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Execution.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Process.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Process.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Process.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.ProcessStructure;
+import org.jbpm.api.runtime.Attachments;
+
+/**
+ * A Process is any Activity performed within a company or organization.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Process extends ProcessStructure
+{
+ /**
+ * Defines the status a {@link Process} can be in
+ */
+ public enum ProcessStatus
+ {
+ None, Ready, Active, Cancelled, Aborting, Aborted, Completing, Completed
+ }
+
+ /**
+ * Get the associated ProcessDefinition
+ */
+ ProcessDefinition getProcessDefinition();
+
+ /**
+ * Get the process state
+ */
+ ProcessStatus getProcessStatus();
+
+ /**
+ * Start the process
+ */
+ ObjectName startProcessAsync();
+
+ /**
+ * Start the process, with a given execution context
+ */
+ ObjectName startProcessAsync(Attachments att);
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
+ * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends without
+ * timeout.
+ */
+ ProcessStatus waitForEnd();
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
+ * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends with a
+ * given timeout.
+ */
+ ProcessStatus waitForEnd(long timeout);
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Process.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/ProcessDefinition.java (from rev 2889, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/ProcessDefinition.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/ProcessDefinition.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client;
+
+//$Id$
+
+import org.jbpm.api.model.ProcessStructure;
+
+/**
+ * A ProcessDefinition defines the structure of an activity performed within a company or organization.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ProcessDefinition extends ProcessStructure
+{
+ /**
+ * Create a new instance of this process definition
+ */
+ Process newInstance();
+
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/Deployment.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/Deployment.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/Deployment.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -32,8 +32,8 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.service.DialectHandler;
import org.jbpm.api.service.DialectHandlerService;
import org.jbpm.api.service.ProcessInstanceService;
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/AbstractElement.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import java.io.Serializable;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.client.ProcessEngine;
+
+/**
+ * The parrent of all Elements
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface AbstractElement extends Serializable
+{
+ /**
+ * Get the ID of this element
+ */
+ ObjectName getKey();
+
+ /**
+ * Get the associated ProcessEngine
+ */
+ ProcessEngine getProcessEngine();
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,13 +25,14 @@
import java.util.List;
-import org.jbpm.api.model.internal.AbstractElement;
-import org.jbpm.api.model.internal.PropertySupport;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.preview.Assignment;
import org.jbpm.api.model.preview.Group;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.model.preview.PropertySupport;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.SignalHandler;
/**
* A Node is an abstract element with a name and an associated process
@@ -49,7 +50,7 @@
/**
* Get the associated process
*/
- ProcessInstance getProcess();
+ Process getProcess();
/**
* Get the unique name.
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import org.jbpm.api.model.internal.ProcessStructure;
-
-/**
- * A ProcessDefinition defines the structure of an activity performed within a company or organization.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface ProcessDefinition extends ProcessStructure
-{
- /**
- * Create a new instance of this process definition
- */
- ProcessInstance newInstance();
-
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.Attachments;
-
-/**
- * A Process is any Activity performed within a company or organization.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface ProcessInstance extends ProcessStructure
-{
- /**
- * Defines the status a {@link ProcessInstance} can be in
- */
- public enum ProcessStatus
- {
- None, Ready, Active, Cancelled, Aborting, Aborted, Completing, Completed
- }
-
- /**
- * Get the associated ProcessDefinition
- */
- ProcessDefinition getProcessDefinition();
-
- /**
- * Get the process state
- */
- ProcessStatus getProcessStatus();
-
- /**
- * Start the process
- */
- ObjectName startProcess();
-
- /**
- * Start the process, with a given execution context
- */
- ObjectName startProcess(Attachments att);
-
- /**
- * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
- * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends without
- * timeout.
- */
- ProcessStatus waitForEnd();
-
- /**
- * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
- * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends with a
- * given timeout.
- */
- ProcessStatus waitForEnd(long timeout);
-}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessStructure.java (from rev 2889, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/ProcessStructure.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessStructure.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessStructure.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import java.util.List;
+
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.PropertySupport;
+
+/**
+ * A ProcessStructure defines the structure of a Process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ProcessStructure extends AbstractElement, PropertySupport
+{
+ /**
+ * Get the unique name.
+ */
+ String getName();
+
+ /**
+ * Get the list of nodes
+ */
+ List<Node> getNodes();
+
+ /**
+ * Get a list of nodes of a given type.
+ */
+ <T extends Node> List<T> getNodes(Class<T> clazz);
+
+ /**
+ * Get a node of a given type and name
+ */
+ <T extends Node> T getNode(Class<T> clazz, String name);
+
+ /**
+ * Get a node by name.
+ * @return null if not found
+ */
+ Node getNode(String name);
+
+ /**
+ * One or more assignment expressions MAY be made for the object. The Assignment SHALL be performed as defined by the
+ * AssignTime attribute.
+ */
+ List<Assignment> getAssignments();
+
+ /**
+ * Get the list of associated {@link Message} objects.
+ * @return An empty list if there are none
+ */
+ List<Message> getMessages();
+
+ /**
+ * Get an associated {@link Message} by name.
+ * @return null if not found
+ */
+ Message getMessage(String msgName);
+
+ /**
+ * Get the list of associated {@link Group} objects.
+ * @return An empty list if there are none
+ */
+ List<Group> getGroups();
+
+ /**
+ * Get an associated {@link Group} by name.
+ * @return null if not found
+ */
+ Group getGroup(String grpName);
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -45,7 +45,7 @@
*/
public enum TaskType
{
- Service, Receive, Send, User, Script, Manual, Reference, None
+ Service, Receive, Send, User, Script, Manual, Reference, None, Wait
}
/**
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/WaitState.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/WaitState.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/WaitState.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+
+
+/**
+ * A WaitState is a Task that returns control to Thread that signalled the Execution
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 12-Nov-2008
+ */
+public interface WaitState extends Task
+{
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/WaitState.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -23,9 +23,9 @@
//$Id$
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
@@ -38,12 +38,12 @@
import org.jbpm.api.model.preview.Property;
import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.model.preview.Group.GroupType;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.SignalHandler;
/**
- * The ProcessBuilder can be used to build a {@link ProcessInstance} dynamically.
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -51,7 +51,7 @@
public interface ProcessBuilder
{
/**
- * Add a {@link ProcessInstance} with a given name
+ * Add a {@link Process} with a given name
*/
ProcessBuilder addProcess(String name);
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Group.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Group.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Group.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,7 +25,6 @@
import java.io.Serializable;
-import org.jbpm.api.model.internal.PropertySupport;
/**
* The Group object is an Artifact that provides a visual mechanism to group elements of a diagram informally. The
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InputSet.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InputSet.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InputSet.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -21,7 +21,6 @@
*/
package org.jbpm.api.model.preview;
-import org.jbpm.api.model.internal.PropertySupport;
//$Id$
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Message.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Message.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Message.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -23,7 +23,6 @@
import java.io.Serializable;
-import org.jbpm.api.model.internal.PropertySupport;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/OutputSet.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/OutputSet.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/OutputSet.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -21,7 +21,6 @@
*/
package org.jbpm.api.model.preview;
-import org.jbpm.api.model.internal.PropertySupport;
//$Id$
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/PropertySupport.java (from rev 2889, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/PropertySupport.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/PropertySupport.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/PropertySupport.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+//$Id$
+
+import java.io.Serializable;
+import java.util.Set;
+
+
+/**
+ * Property support
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface PropertySupport extends Serializable
+{
+ /**
+ * Get a Property with a given name.
+ */
+ Property getProperty(String name);
+
+ /**
+ * Get the set of properties
+ */
+ Set<Property> getProperties();
+
+ /**
+ * Get the set of property names
+ */
+ Set<String> getPropertyNames();
+
+ /**
+ * Add a property
+ */
+ void addProperty(Property prop);
+
+ /**
+ * Add a property
+ */
+ void addProperty(String name, Object value);
+
+ /**
+ * Remove a property
+ */
+ Property removeProperty(String name);
+}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.runtime;
-
-//$Id$
-
-/**
- * A basic ExecutionContext.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class BasicExecutionContext extends BasicAttachments implements ExecutionContext
-{
- public BasicExecutionContext()
- {
- }
-
- public BasicExecutionContext(Attachments att)
- {
- super(att);
- }
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicNodeHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicNodeHandler.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicNodeHandler.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.runtime;
-
-import org.jbpm.api.model.Node;
-
-/**
- * A handler that is associated with a node
- *
- * @author thomas.diesler(a)jboss.com
- * @since 30-Sep-2008
- */
-public abstract class BasicNodeHandler implements NodeHandler
-{
- private static final long serialVersionUID = 1L;
-
- private Node node;
-
- @Override
- public Node getNode()
- {
- return node;
- }
-
- @Override
- public void setNode(Node node)
- {
- this.node = node;
- }
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.runtime;
-
-// $Id$
-
-
-/**
- * An execution context that can take attachments.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public interface ExecutionContext extends Attachments
-{
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.runtime;
-
-//$Id$
-
-import org.jbpm.api.model.Node;
-
-/**
- * The ProcessEngine invokes the ExecutionHandler on a
- * {@link Node} to execute user provided business logic.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface ExecutionHandler extends NodeHandler
-{
- /**
- * Execute the associated business logic.
- */
- void execute(Token token);
-
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.runtime;
-
-// $Id$
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Node;
-
-/**
- * The {@link ProcessEngine} invokes the FlowHandler on a {@link Node}
- * to move the {@link Token} to the next {@link Node}.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface FlowHandler extends NodeHandler
-{
- /**
- * Execute the FlowHandler.
- * <p/>
- * The FlowHandler typically invoves one of the {@link TokenExecutor}
- * methods to move the {@link Token} to the next {@link Node}.
- */
- void execute(TokenExecutor tokenExecutor, Token token);
-
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/NodeHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/NodeHandler.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/NodeHandler.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.runtime;
-
-import java.io.Serializable;
-
-//$Id$
-
-import org.jbpm.api.model.Node;
-
-/**
- * A handler that is associated with a node
- *
- * @author thomas.diesler(a)jboss.com
- * @since 30-Sep-2008
- */
-public interface NodeHandler extends Serializable
-{
- /**
- * Get the associated node.
- */
- Node getNode();
-
- /**
- * Set the associated node.
- */
- void setNode(Node node);
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.runtime;
-
-// $Id$
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Node;
-import org.jbpm.api.model.preview.Signal;
-
-/**
- * The {@link ProcessEngine} invokes the SignalHandler on a {@link Node}
- * to send {@link Signal}s.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface SignalHandler extends NodeHandler
-{
- /**
- * Get signal for enter
- */
- void throwEnterSignal(Token token);
-
- /**
- * Get signal for exit
- */
- void throwExitSignal(Token token);
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.runtime;
-
-// $Id$
-
-import org.hibernate.Session;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.SequenceFlow;
-
-/**
- * A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
- *
- * By tracking how the Token traverses the Flow Objects, gets diverted through alternative paths, and gets split into
- * parallel paths, the normal Sequence Flow should be completely definable.
- *
- * A Token will have a unique identity that can be used to separate multiple Tokens that may exist because of concurrent
- * process instances or the splitting of the Token for parallel processing within a single process instance.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public interface Token
-{
- public enum TokenStatus
- {
- Created, Started, Stoped, Destroyed, Suspended
- }
-
- /**
- * Get the unique token identity
- */
- String getTokenID();
-
- /**
- * Get the token status
- */
- TokenStatus getTokenStatus();
-
- /**
- * Get the associated {@link ProcessInstance}
- */
- ProcessInstance getProcess();
-
- /**
- * Get the associated {@link ExecutionContext}
- */
- ExecutionContext getExecutionContext();
-
- /**
- * Get the current {@link SequenceFlow}
- */
- SequenceFlow getSequenceFlow();
-
- /**
- * Get the associated persistence session
- */
- Session getSession();
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,83 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.runtime;
-
-//$Id$
-
-import java.util.Set;
-
-import org.jbpm.api.model.SequenceFlow;
-
-/**
- * The {@link FlowHandler} invokes the TokenExecutor to move {@link Token}s
- * along the {@link SequenceFlow}s in the {@link Process}.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface TokenExecutor
-{
- /**
- * Get the set of active tokens
- */
- Set<Token> getRunnableTokens();
-
- /**
- * True if there are active tokens
- */
- boolean hasRunnableTokens();
-
- /**
- * Create a {@link Token} with an initial flow
- */
- void create(Token token, SequenceFlow flow);
-
- /**
- * Start a {@link Token}
- */
- void start(Token token);
-
- /**
- * Stop a {@link Token}
- */
- void stop(Token token);
-
- /**
- * Destroy a {@link Token}
- */
- void destroy(Token token);
-
- /**
- * Suspend a {@link Token}
- */
- String suspend(Token token);
-
- /**
- * Activate a {@link Token}
- */
- Token activate(String tokenID);
-
- /**
- * Move a given {@link Token} along a given flow.
- */
- void move(Token token, SequenceFlow flow);
-}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/BasicExecutionContext.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/BasicExecutionContext.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/BasicExecutionContext.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime.preview;
+
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.BasicAttachments;
+
+//$Id$
+
+/**
+ * A basic ExecutionContext.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 15-Aug-2008
+ */
+public class BasicExecutionContext extends BasicAttachments implements ExecutionContext
+{
+ public BasicExecutionContext()
+ {
+ }
+
+ public BasicExecutionContext(Attachments att)
+ {
+ super(att);
+ }
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/BasicNodeHandler.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/BasicNodeHandler.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/BasicNodeHandler.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/BasicNodeHandler.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime.preview;
+
+import org.jbpm.api.model.Node;
+
+/**
+ * A handler that is associated with a node
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 30-Sep-2008
+ */
+public abstract class BasicNodeHandler implements NodeHandler
+{
+ private static final long serialVersionUID = 1L;
+
+ private Node node;
+
+ @Override
+ public Node getNode()
+ {
+ return node;
+ }
+
+ @Override
+ public void setNode(Node node)
+ {
+ this.node = node;
+ }
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionContext.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionContext.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionContext.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime.preview;
+
+import org.jbpm.api.runtime.Attachments;
+
+// $Id$
+
+
+/**
+ * An execution context that can take attachments.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface ExecutionContext extends Attachments
+{
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionHandler.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionHandler.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/ExecutionHandler.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime.preview;
+
+//$Id$
+
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.model.Node;
+
+/**
+ * The ProcessEngine invokes the ExecutionHandler on a
+ * {@link Node} to execute user provided business logic.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ExecutionHandler extends NodeHandler
+{
+ /**
+ * Execute the associated business logic.
+ */
+ void execute(Execution token);
+
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/FlowHandler.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/FlowHandler.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/FlowHandler.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime.preview;
+
+// $Id$
+
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
+
+/**
+ * The {@link ProcessEngine} invokes the FlowHandler on a {@link Node}
+ * to move the {@link Execution} to the next {@link Node}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface FlowHandler extends NodeHandler
+{
+ /**
+ * Execute the FlowHandler.
+ * <p/>
+ * The FlowHandler typically invoves one of the {@link TokenExecutor}
+ * methods to move the {@link Execution} to the next {@link Node}.
+ */
+ void execute(TokenExecutor tokenExecutor, Execution token);
+
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/NodeHandler.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/NodeHandler.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/NodeHandler.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/NodeHandler.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime.preview;
+
+import java.io.Serializable;
+
+//$Id$
+
+import org.jbpm.api.model.Node;
+
+/**
+ * A handler that is associated with a node
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 30-Sep-2008
+ */
+public interface NodeHandler extends Serializable
+{
+ /**
+ * Get the associated node.
+ */
+ Node getNode();
+
+ /**
+ * Set the associated node.
+ */
+ void setNode(Node node);
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/SignalHandler.java (from rev 2889, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/SignalHandler.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/SignalHandler.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime.preview;
+
+// $Id$
+
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.preview.Signal;
+
+/**
+ * The {@link ProcessEngine} invokes the SignalHandler on a {@link Node}
+ * to send {@link Signal}s.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalHandler extends NodeHandler
+{
+ /**
+ * Get signal for enter
+ */
+ void throwEnterSignal(Execution token);
+
+ /**
+ * Get signal for exit
+ */
+ void throwExitSignal(Execution token);
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/TokenExecutor.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/TokenExecutor.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/preview/TokenExecutor.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime.preview;
+
+//$Id$
+
+import java.util.Set;
+
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.model.SequenceFlow;
+
+/**
+ * The {@link FlowHandler} invokes the TokenExecutor to move {@link Execution}s
+ * along the {@link SequenceFlow}s in the {@link Process}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface TokenExecutor
+{
+ /**
+ * Get the set of active tokens
+ */
+ Set<Execution> getRunnableTokens();
+
+ /**
+ * True if there are active tokens
+ */
+ boolean hasRunnableTokens();
+
+ /**
+ * Create a {@link Execution} with an initial flow
+ */
+ void create(Execution token, SequenceFlow flow);
+
+ /**
+ * Start a {@link Execution}
+ */
+ void start(Execution token);
+
+ /**
+ * Stop a {@link Execution}
+ */
+ void stop(Execution token);
+
+ /**
+ * Destroy a {@link Execution}
+ */
+ void destroy(Execution token);
+
+ /**
+ * Suspend a {@link Execution}
+ */
+ String suspend(Execution token);
+
+ /**
+ * Activate a {@link Execution}
+ */
+ Execution activate(String tokenID);
+
+ /**
+ * Move a given {@link Execution} along a given flow.
+ */
+ void move(Execution token, SequenceFlow flow);
+}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -28,7 +28,7 @@
import java.net.URI;
import java.net.URL;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.ProcessDefinition;
/**
* The DialectHandler converts a supported dialect to the ProcessDefinition model.
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,9 +26,9 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.Process.ProcessStatus;
import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.ProcessInstance.ProcessStatus;
import org.jbpm.api.runtime.Attachments;
/**
@@ -60,7 +60,7 @@
* @param proc The Process to start
* @param att The Attachments in the ExecutionContext
*/
- public abstract void startProcess(ProcessInstance proc, Attachments att);
+ public abstract void startProcess(Process proc, Attachments att);
/**
* Start the Process from a given start event
@@ -68,19 +68,19 @@
* @param start The StartEvent that triggers the process
* @param att The Attachments in the ExecutionContext
*/
- public abstract void startProcess(ProcessInstance proc, StartEvent start, Attachments att);
+ public abstract void startProcess(Process proc, StartEvent start, Attachments att);
/**
* All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
* Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends without
* timeout.
*/
- public abstract ProcessStatus waitForEnd(ProcessInstance proc);
+ public abstract ProcessStatus waitForEnd(Process proc);
/**
* All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
* Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends with a
* given timeout.
*/
- public abstract ProcessStatus waitForEnd(ProcessInstance proc, long timeout);
+ public abstract ProcessStatus waitForEnd(Process proc, long timeout);
}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -23,12 +23,12 @@
//$Id$
+import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.builder.ProcessBuilder;
/**
- * The ProcessBuilder can be used to build a {@link ProcessInstance} dynamically.
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -37,9 +37,9 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.client.preview.Deployment;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.service.preview.PersistenceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessInstanceService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessInstanceService.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessInstanceService.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -31,10 +31,10 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessInstance.ProcessStatus;
+import org.jbpm.api.client.Process.ProcessStatus;
import org.jbpm.api.service.preview.PersistenceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -51,7 +51,7 @@
final static Logger log = LoggerFactory.getLogger(ProcessInstanceService.class);
// The set of registered processes
- private Map<ObjectName, ProcessInstance> registeredProcs = new HashMap<ObjectName, ProcessInstance>();
+ private Map<ObjectName, Process> registeredProcs = new HashMap<ObjectName, Process>();
// Hide public constructor
protected ProcessInstanceService()
@@ -70,7 +70,7 @@
/**
* Register a Process.
*/
- public ObjectName registerProcess(ProcessInstance proc)
+ public ObjectName registerProcess(Process proc)
{
log.debug("registerProcess: " + proc);
@@ -102,7 +102,7 @@
public boolean unregisterProcess(ObjectName procID)
{
boolean removed = false;
- ProcessInstance proc = registeredProcs.get(procID);
+ Process proc = registeredProcs.get(procID);
if (proc != null)
{
log.debug("unregisterProcess: " + proc);
@@ -119,9 +119,9 @@
/**
* Get a Process for a given id
*/
- public ProcessInstance getProcess(ObjectName procID)
+ public Process getProcess(ObjectName procID)
{
- ProcessInstance proc = registeredProcs.get(procID);
+ Process proc = registeredProcs.get(procID);
return proc;
}
@@ -143,7 +143,7 @@
public Set<ObjectName> getProcesses(String name, ProcessStatus status)
{
Set<ObjectName> procSet = new HashSet<ObjectName>();
- for (ProcessInstance auxProc : registeredProcs.values())
+ for (Process auxProc : registeredProcs.values())
{
if (auxProc.getName().equals(name))
{
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageService.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageService.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -31,11 +31,11 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.client.preview.MessageListener;
import org.jbpm.api.model.Event;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.Task;
import org.jbpm.api.model.preview.Message;
import org.jbpm.api.model.preview.Participant;
@@ -136,7 +136,7 @@
public void sendMessage(ObjectName procID, String targetName, Message msg)
{
ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
- ProcessInstance proc = procService.getProcess(procID);
+ Process proc = procService.getProcess(procID);
if (proc == null)
throw new IllegalStateException("Cannot obtain registered process: " + procID);
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/PersistenceService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/PersistenceService.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/PersistenceService.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,10 +26,10 @@
import javax.management.ObjectName;
import org.hibernate.Session;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.service.AbstractService;
/**
@@ -72,17 +72,17 @@
/**
* Save the Process to persistent storage
*/
- public abstract ObjectName saveProcess(ProcessInstance proc);
+ public abstract ObjectName saveProcess(Process proc);
/**
* Load the Process from persistent storage
*/
- public abstract ProcessInstance loadProcess(ObjectName procID);
+ public abstract Process loadProcess(ObjectName procID);
/**
* Delete the Process from persistent storage
*/
- public abstract void deleteProcess(ProcessInstance proc);
+ public abstract void deleteProcess(Process proc);
/**
* Save the Node to persistent storage
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -35,10 +35,10 @@
import javax.management.ObjectName;
import org.jbpm.api.BPMException;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.client.preview.MessageListener;
import org.jbpm.api.client.preview.SignalListener;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.builder.preview.SignalBuilder;
import org.jbpm.api.model.preview.Message;
import org.jbpm.api.model.preview.Signal;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,10 +25,10 @@
import junit.framework.TestCase;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
Modified: projects/spec/trunk/modules/cts/pom.xml
===================================================================
--- projects/spec/trunk/modules/cts/pom.xml 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/pom.xml 2008-11-12 11:00:17 UTC (rev 2891)
@@ -46,8 +46,8 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
- <exclude>org/jbpm/test/cts/preview/**</exclude>
- <exclude>org/jbpm/test/cts/pattern/**</exclude>
+ <exclude>org/jbpm/test/cts/preview/**/*Test.java</exclude>
+ <exclude>org/jbpm/test/pattern/**/*Test.java</exclude>
</excludes>
</configuration>
</plugin>
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,8 +26,8 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.preview.Signal;
@@ -47,10 +47,10 @@
public void testMerge() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
// Start the process
- proc.startProcess();
+ proc.startProcessAsync();
// Wait for the process to end
proc.waitForEnd(5000);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,8 +26,8 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -49,11 +49,11 @@
public void testGateA() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "5");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd(5000);
List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
@@ -64,11 +64,11 @@
public void testGateB() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "15");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd(5000);
List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
@@ -79,11 +79,11 @@
public void testInvalidGate() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "10");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
try
{
proc.waitForEnd(5000);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/endevent/EndEventMessageTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/endevent/EndEventMessageTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/endevent/EndEventMessageTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import java.io.IOException;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.preview.MessageBuilder;
@@ -46,12 +46,12 @@
public void testStart() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
// Start the process
BasicAttachments att = new BasicAttachments();
att.addAttachment("kermit", "the frog");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
// Wait for the process to end
proc.waitForEnd(5000);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/executioncontext/ExecutionContextTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/executioncontext/ExecutionContextTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/executioncontext/ExecutionContextTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -23,8 +23,8 @@
// $Id$
-import org.jbpm.api.runtime.BasicExecutionContext;
-import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.runtime.preview.BasicExecutionContext;
+import org.jbpm.api.runtime.preview.ExecutionContext;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewayMergeTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewayMergeTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,8 +26,8 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.preview.Signal;
@@ -46,10 +46,10 @@
public void testSimpleMerge() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
// Start the process
- proc.startProcess();
+ proc.startProcessAsync();
// Wait for the process to end
proc.waitForEnd(5000);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewaySplitTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewaySplitTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,8 +26,8 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -49,11 +49,11 @@
public void testGateA() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "5");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd(5000);
List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
@@ -63,11 +63,11 @@
public void testGateB() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "15");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd(5000);
List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewayMergeTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewayMergeTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import java.io.IOException;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
@@ -50,10 +50,10 @@
public void testParallelMerge() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
// Start the process
- proc.startProcess();
+ proc.startProcessAsync();
// Wait for the process to end
proc.waitForEnd(5000);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewaySplitTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewaySplitTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -28,8 +28,8 @@
import javax.management.ObjectName;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.preview.Signal;
@@ -49,9 +49,9 @@
public void testParallelSplit() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd(5000);
// Validate received signals
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeInputSetTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeInputSetTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeInputSetTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import java.io.IOException;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.TaskBuilder;
@@ -51,11 +51,11 @@
public void testValidProps() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("frog", "kermit");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd(5000);
Message endMessage = getMessages().get(0);
@@ -66,11 +66,11 @@
public void testInvalidProps() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("pig", "piggy");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
try
{
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeOutputSetTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeOutputSetTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeOutputSetTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import java.io.IOException;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.TaskBuilder;
@@ -51,9 +51,9 @@
public void testValidProps() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd(5000);
Message endMessage = getMessages().get(0);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodePropertyTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodePropertyTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodePropertyTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import java.io.IOException;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -52,9 +52,9 @@
public void testActivityPropertyRead() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd(5000);
Message endMessage = getMessages().get(0);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/process/ProcessPropertyTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/process/ProcessPropertyTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/process/ProcessPropertyTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import java.io.IOException;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -57,9 +57,9 @@
public void testProcessProperties() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd(5000);
Message endMessage = getMessages().get(0);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/startevent/StartEventSignalTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/startevent/StartEventSignalTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/startevent/StartEventSignalTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -28,9 +28,9 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.preview.SignalListener;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -63,10 +63,10 @@
ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
procDefService.registerProcessDefinition(procDef);
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
try
{
- proc.startProcess();
+ proc.startProcessAsync();
fail("Cannot obtain StartEvent.None to start the process explicitly");
}
catch (IllegalStateException ex)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,16 +25,16 @@
import java.io.IOException;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.TaskBuilder;
import org.jbpm.api.model.preview.Assignment.AssignTime;
-import org.jbpm.api.runtime.BasicNodeHandler;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.BasicNodeHandler;
+import org.jbpm.api.runtime.preview.ExecutionContext;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -49,9 +49,9 @@
public void testExecutionHandler() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd(5000);
assertEquals("kermit", TaskExecutionHandler.procProp);
@@ -89,7 +89,7 @@
* - The result of start time activity assignments
*/
@Override
- public void execute(Token token)
+ public void execute(Execution token)
{
ExecutionContext exContext = token.getExecutionContext();
procProp = (String)exContext.getAttachment("TaskExecutionHandlerTest.procProp");
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/receive/ReceiveTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/receive/ReceiveTaskTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/receive/ReceiveTaskTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -28,9 +28,9 @@
import javax.management.ObjectName;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.preview.SignalListener;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Task.TaskType;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -74,7 +74,7 @@
public void testUnregisteredProcess() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
MessageService msgService = MessageService.locateMessageService();
try
@@ -94,7 +94,7 @@
ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
ObjectName procID = procService.registerProcess(proc);
try
@@ -103,7 +103,7 @@
MessageService msgService = MessageService.locateMessageService();
msgService.sendMessage(procID, "TaskA", getMessage());
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd(5000);
}
finally
@@ -119,7 +119,7 @@
public void testSuspendedToken() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- final ProcessInstance proc = procDef.newInstance();
+ final Process proc = procDef.newInstance();
SignalListener sigListener = new SignalListener()
{
private boolean sendMessage = true;
@@ -145,7 +145,7 @@
try
{
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd(5000);
}
finally
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/send/SendTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/send/SendTaskTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/send/SendTaskTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -27,8 +27,8 @@
import java.util.List;
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Task.TaskType;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.preview.MessageBuilder;
@@ -48,11 +48,11 @@
public void testSendTask() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "bar");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd(5000);
List<Message> messages = getMessages();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskCallbackTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskCallbackTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskCallbackTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,9 +26,9 @@
import java.io.IOException;
import java.util.List;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.preview.UserTaskCallback;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Task.TaskType;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -50,7 +50,7 @@
public void testUserTask() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
// Attach the callback to the UserTask
UserTask userTask = proc.getNode(UserTask.class, "UserTask");
@@ -58,7 +58,7 @@
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "xxx");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd(5000);
List<Message> messages = getMessages();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -29,9 +29,9 @@
import javax.management.ObjectName;
import org.jbpm.api.Constants;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.preview.MessageListener;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Task.TaskType;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -58,7 +58,7 @@
public void testUserTask() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
// Register the process - this assigns the procID
ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
@@ -72,7 +72,7 @@
{
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "xxx");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd(5000);
List<Message> messages = getMessages();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredMarshallerTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredMarshallerTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredMarshallerTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,7 +25,7 @@
import java.io.IOException;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.service.ProcessDefinitionService;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -29,17 +29,17 @@
import org.hibernate.Transaction;
import org.jbpm.api.Constants;
import org.jbpm.api.Constants.TxType;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Task.TaskType;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.preview.Group;
import org.jbpm.api.model.preview.Message;
import org.jbpm.api.model.preview.Group.GroupType;
import org.jbpm.api.runtime.BasicAttachments;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
import org.jbpm.ri.runtime.TransactionAssociation;
@@ -66,9 +66,9 @@
assertSame("Group same", group, groupA);
assertSame("Group same", group, groupB);
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd();
List<Message> messages = getMessages();
@@ -78,12 +78,12 @@
public void testRollback() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment(Boolean.class, "rollback", Boolean.TRUE);
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd(5000);
List<Message> messages = getMessages();
@@ -110,7 +110,7 @@
private Node node;
@Override
- public void execute(Token token)
+ public void execute(Execution token)
{
Transaction tx = TransactionAssociation.getTransaction();
Boolean doRollback = token.getExecutionContext().getAttachment(Boolean.class, "rollback");
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessBuilderTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -24,7 +24,7 @@
// $Id$
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -27,9 +27,9 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.service.ProcessDefinitionService;
import org.jbpm.api.service.ProcessInstanceService;
import org.jbpm.api.test.CTSTestCase;
@@ -66,7 +66,7 @@
ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
ProcessInstanceService procService = engine.getService(ProcessInstanceService.class);
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
assertNotNull("Process not null", proc);
assertNull("Process not automatically registered", procService.getProcess(proc.getKey()));
assertNull("ProcessDefinition not automatically registered", procDefService.getProcessDefinition(procDef.getKey()));
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,9 +25,9 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.preview.SignalListener;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.model.preview.Signal.SignalType;
@@ -51,7 +51,7 @@
ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
ProcessDefinition procDef = getProcessDefinition();
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
assertNull("ProcessDefinition not registered automatically", procDefService.getProcessDefinition(procDef.getKey()));
assertNull("Process not registered automatically", procService.getProcess(proc.getKey()));
@@ -77,7 +77,7 @@
final ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
final ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- final ProcessInstance proc = procDef.newInstance();
+ final Process proc = procDef.newInstance();
assertNull("Process not registered automatically", procService.getProcess(proc.getKey()));
SignalListener sigListener = new SignalListener()
@@ -99,7 +99,7 @@
try
{
// Start the process, which automatically adds it to the registry
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd(5000);
}
finally
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,9 +26,9 @@
import java.io.IOException;
import java.util.List;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.preview.GatewayBuilder;
@@ -49,11 +49,11 @@
public void testGateA() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "5");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd();
List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
@@ -64,11 +64,11 @@
public void testGateB() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "15");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd();
List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
@@ -79,11 +79,11 @@
public void testInvalidGate() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "10");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
try
{
proc.waitForEnd();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,9 +26,9 @@
import java.io.IOException;
import java.util.List;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.preview.GatewayBuilder;
@@ -49,11 +49,11 @@
public void testGateA() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "5");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd();
List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
@@ -63,11 +63,11 @@
public void testGateB() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "15");
- proc.startProcess(att);
+ proc.startProcessAsync(att);
proc.waitForEnd();
List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -28,9 +28,9 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.model.preview.Signal.SignalType;
@@ -49,9 +49,9 @@
public void testParallelSplit() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd();
// Validate received signals
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequencePersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequencePersistenceTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequencePersistenceTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -27,7 +27,7 @@
import javax.management.ObjectName;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.service.preview.PersistenceService;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,8 +26,8 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.model.preview.Signal.SignalType;
@@ -46,10 +46,10 @@
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
// Start the Process
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd();
// Validate received signals
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,8 +26,8 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.preview.Signal;
@@ -46,10 +46,10 @@
public void testSimpleMerge() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
// Start the process
- proc.startProcess();
+ proc.startProcessAsync();
// Wait for the process to end
proc.waitForEnd(5000);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import java.io.IOException;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
@@ -50,10 +50,10 @@
public void testParallelMerge() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
// Start the process
- proc.startProcess();
+ proc.startProcessAsync();
// Wait for the process to end
proc.waitForEnd();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import java.io.IOException;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -50,9 +50,9 @@
public void testCaseProperties() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd();
Message endMessage = getMessages().get(0);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import java.io.IOException;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -51,9 +51,9 @@
public void testTaskDataRead() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
- proc.startProcess();
+ proc.startProcessAsync();
proc.waitForEnd();
Message endMessage = getMessages().get(0);
Modified: projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/DialectHandlerImpl.java
===================================================================
--- projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/DialectHandlerImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/DialectHandlerImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -33,7 +33,7 @@
import javax.xml.bind.JAXBException;
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.service.DialectHandler;
/**
Modified: projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java
===================================================================
--- projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -31,13 +31,13 @@
import javax.xml.bind.Marshaller;
import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Event;
import org.jbpm.api.model.ExclusiveGateway;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Gateway;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
@@ -56,9 +56,9 @@
import org.jbpm.api.model.preview.ReceiveTask;
import org.jbpm.api.model.preview.SendTask;
import org.jbpm.api.model.preview.Signal;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.SignalHandler;
import org.jbpm.dialect.api10.model.JAXBAssignment;
import org.jbpm.dialect.api10.model.JAXBComplexGateway;
import org.jbpm.dialect.api10.model.JAXBEndEvent;
Modified: projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java
===================================================================
--- projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -32,8 +32,8 @@
import javax.xml.bind.Unmarshaller;
import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.SequenceFlow.ConditionType;
import org.jbpm.api.model.Task.TaskType;
import org.jbpm.api.model.builder.ProcessBuilder;
@@ -43,10 +43,10 @@
import org.jbpm.api.model.builder.preview.GroupBuilder;
import org.jbpm.api.model.builder.preview.MessageBuilder;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.NodeHandler;
-import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.NodeHandler;
+import org.jbpm.api.runtime.preview.SignalHandler;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.dialect.api10.model.JAXBAssignment;
import org.jbpm.dialect.api10.model.JAXBCancelEventDetail;
Modified: projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/DialectHandlerImpl.java
===================================================================
--- projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/DialectHandlerImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/DialectHandlerImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -34,7 +34,7 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.service.DialectHandler;
import org.jbpm.dialect.jpdl32.model.JPDL32ProcessDefinition;
Modified: projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/ProcessDefinitionAdapter.java
===================================================================
--- projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/ProcessDefinitionAdapter.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jbpm/dialect/jpdl32/ProcessDefinitionAdapter.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,11 +26,11 @@
import java.util.List;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Task;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.runtime.ExecutionHandler;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.dialect.jpdl32.model.JPDL32Action;
import org.jbpm.dialect.jpdl32.model.JPDL32EndState;
Modified: projects/spec/trunk/modules/dialects/stp/src/main/java/org/jbpm/dialect/stp/DialectHandlerImpl.java
===================================================================
--- projects/spec/trunk/modules/dialects/stp/src/main/java/org/jbpm/dialect/stp/DialectHandlerImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/dialects/stp/src/main/java/org/jbpm/dialect/stp/DialectHandlerImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -33,7 +33,7 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.service.DialectHandler;
/**
Modified: projects/spec/trunk/modules/dialects/stp/src/main/java/org/jbpm/dialect/stp/ProcessUnmarshaller.java
===================================================================
--- projects/spec/trunk/modules/dialects/stp/src/main/java/org/jbpm/dialect/stp/ProcessUnmarshaller.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/dialects/stp/src/main/java/org/jbpm/dialect/stp/ProcessUnmarshaller.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -37,8 +37,8 @@
import org.jboss.util.xml.DOMUtils;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Task;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.service.ProcessBuilderService;
Modified: projects/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jbpm/dialect/xpdl21/DialectHandlerImpl.java
===================================================================
--- projects/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jbpm/dialect/xpdl21/DialectHandlerImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jbpm/dialect/xpdl21/DialectHandlerImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -34,7 +34,7 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.service.DialectHandler;
import org.jbpm.dialect.xpdl21.model.XPDLWorkflowProcess;
Modified: projects/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jbpm/dialect/xpdl21/WorkflowProcessAdapter.java
===================================================================
--- projects/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jbpm/dialect/xpdl21/WorkflowProcessAdapter.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jbpm/dialect/xpdl21/WorkflowProcessAdapter.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -24,7 +24,7 @@
// $Id$
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.dialect.xpdl21.model.XPDLActivities;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -31,10 +31,10 @@
import org.hibernate.Session;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.internal.AbstractElement;
+import org.jbpm.api.model.AbstractElement;
/**
* The parrent of all Elements
@@ -105,22 +105,22 @@
// nothing to do
}
- protected void create(ProcessInstance proc)
+ protected void create(Process proc)
{
// nothing to do
}
- protected void register(ProcessInstance proc)
+ protected void register(Process proc)
{
// nothing to do
}
- protected void unregister(ProcessInstance proc)
+ protected void unregister(Process proc)
{
// nothing to do
}
- protected void destroy(ProcessInstance proc)
+ protected void destroy(Process proc)
{
// nothing to do
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -27,7 +27,7 @@
import org.jbpm.api.NotImplementedException;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.preview.ComplexGateway;
/**
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -28,18 +28,18 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.Execution;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
-import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.model.preview.Signal;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.preview.ExecutionContext;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.SignalHandler;
+import org.jbpm.api.runtime.preview.TokenExecutor;
import org.jbpm.api.service.preview.SignalService;
import org.jbpm.ri.model.builder.SingleInFlowSupport;
import org.slf4j.Logger;
@@ -117,13 +117,13 @@
ProcessEngine engine = getProcessDefinition().getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
- public void throwEnterSignal(Token token)
+ public void throwEnterSignal(Execution token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_END_EVENT_ENTER, getKey());
sigService.throwSignal(signal);
}
- public void throwExitSignal(Token token)
+ public void throwExitSignal(Execution token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_END_EVENT_EXIT, getKey());
sigService.throwSignal(signal);
@@ -155,7 +155,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(TokenExecutor tokenExecutor, Token token)
+ public void execute(TokenExecutor tokenExecutor, Execution token)
{
log.debug("End reached in: " + getName());
ExecutionContext exContext = token.getExecutionContext();
@@ -186,7 +186,7 @@
this.tokenExecutor = tokenExecutor;
}
- void destroyToken(Token token)
+ void destroyToken(Execution token)
{
tokenExecutor.destroy(token);
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -32,18 +32,18 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Event;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
-import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.model.preview.Message;
import org.jbpm.api.model.preview.Signal;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.SignalHandler;
import org.jbpm.api.service.preview.SignalService;
import org.jbpm.ri.runtime.MessageSender;
@@ -133,7 +133,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Token token)
+ public void execute(Execution token)
{
if (detailType == EventDetailType.Message && getMessageRef() != null)
{
@@ -166,13 +166,13 @@
ProcessEngine engine = getProcessDefinition().getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
- public void throwEnterSignal(Token token)
+ public void throwEnterSignal(Execution token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_EVENT_ENTER, getKey());
sigService.throwSignal(signal);
}
- public void throwExitSignal(Token token)
+ public void throwExitSignal(Execution token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_EVENT_EXIT, getKey());
sigService.throwSignal(signal);
@@ -214,7 +214,7 @@
}
@Override
- protected void create(ProcessInstance proc)
+ protected void create(Process proc)
{
super.create(proc);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ExclusiveGatewayImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -29,16 +29,16 @@
import javax.persistence.Entity;
import javax.persistence.Transient;
+import org.jbpm.api.client.Execution;
import org.jbpm.api.model.ExclusiveGateway;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.SequenceFlow.ConditionType;
-import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.TokenExecutor;
import org.jbpm.ri.runtime.ExpressionEvaluator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -88,7 +88,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Token token)
+ public void execute(Execution token)
{
// Call the super default handler
superExecHandler.execute(token);
@@ -122,7 +122,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(TokenExecutor tokenExecutor, Token token)
+ public void execute(TokenExecutor tokenExecutor, Execution token)
{
String sourceRef = token.getSequenceFlow().getSourceRef();
@@ -170,7 +170,7 @@
// Get a single selected gate which' condition evaluates to TRUE
// Fall back to the default gate if there is one
// Choke if there is no selected gate
- private SequenceFlow getSelectedGate(Token token)
+ private SequenceFlow getSelectedGate(Execution token)
{
SequenceFlow selectedGate = null;
for (SequenceFlow auxGate : getGates())
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -34,17 +34,17 @@
import javax.persistence.Transient;
import org.jbpm.api.Constants;
+import org.jbpm.api.client.Execution;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Gateway;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.SequenceFlow.ConditionType;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
-import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.model.preview.Signal;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.SignalHandler;
import org.jbpm.api.service.preview.SignalService;
import org.jbpm.ri.model.builder.MultipleInFlowSupport;
import org.jbpm.ri.model.builder.MultipleOutFlowSupport;
@@ -71,7 +71,7 @@
// The list of received tokens
@Transient
- protected List<Token> receivedTokens;
+ protected List<Execution> receivedTokens;
public GatewayImpl(ProcessStructure procStruct, String name, GatewayType gatewayType)
{
@@ -162,13 +162,13 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Token token)
+ public void execute(Execution token)
{
// Initialize the gateway
if (expectedFlows == null)
{
expectedFlows = new ArrayList<SequenceFlow>(inFlows);
- receivedTokens = new ArrayList<Token>();
+ receivedTokens = new ArrayList<Execution>();
}
// Check that token from flow is valid
@@ -207,13 +207,13 @@
ProcessEngine engine = getProcessDefinition().getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
- public void throwEnterSignal(Token token)
+ public void throwEnterSignal(Execution token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_GATEWAY_ENTER, getKey());
sigService.throwSignal(signal);
}
- public void throwExitSignal(Token token)
+ public void throwExitSignal(Execution token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_GATEWAY_EXIT, getKey());
sigService.throwSignal(signal);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GroupImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GroupImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GroupImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -34,9 +34,9 @@
import javax.persistence.Id;
import javax.persistence.OneToOne;
-import org.jbpm.api.model.internal.PropertySupport;
import org.jbpm.api.model.preview.Group;
import org.jbpm.api.model.preview.Property;
+import org.jbpm.api.model.preview.PropertySupport;
/**
* A Flow Object is one of the set of following graphical objects: Event, Activity, and
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -30,19 +30,19 @@
import javax.persistence.Entity;
+import org.jbpm.api.client.Execution;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.SequenceFlow.ConditionType;
-import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.model.preview.InclusiveGateway;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
import org.jbpm.api.runtime.Attachments.Key;
-import org.jbpm.ri.runtime.MutableToken;
+import org.jbpm.api.runtime.preview.ExecutionContext;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.TokenExecutor;
+import org.jbpm.ri.runtime.MutableExecution;
import org.mvel.MVEL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -81,9 +81,9 @@
{
private static final long serialVersionUID = 1L;
- public void execute(TokenExecutor tokenExecutor, Token token)
+ public void execute(TokenExecutor tokenExecutor, Execution token)
{
- MutableToken mutableToken = (MutableToken)token;
+ MutableExecution mutableToken = (MutableExecution)token;
String sourceRef = token.getSequenceFlow().getSourceRef();
log.debug("Propagate token comming from: " + sourceRef);
@@ -98,15 +98,15 @@
}
else
{
- List<Token> outTokens = new ArrayList<Token>();
+ List<Execution> outTokens = new ArrayList<Execution>();
for (SequenceFlow auxGate : applicableGates)
{
SequenceFlow outFlow = auxGate;
- Token outToken = mutableToken.copyToken();
+ Execution outToken = mutableToken.copyToken();
tokenExecutor.create(outToken, outFlow);
outTokens.add(outToken);
}
- for (Token outToken : outTokens)
+ for (Execution outToken : outTokens)
{
tokenExecutor.start(outToken);
}
@@ -134,7 +134,7 @@
// Get applicable gates which' condition evaluates to TRUE.
// Fall back to the default gate if there is one.
// Choke if there is no applicable gate.
- private List<SequenceFlow> getApplicableGates(Token token)
+ private List<SequenceFlow> getApplicableGates(Execution token)
{
List<SequenceFlow> applicableGates = new ArrayList<SequenceFlow>();
for (SequenceFlow auxGate : getGates())
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InputSetImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InputSetImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InputSetImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -32,9 +32,9 @@
import javax.persistence.Id;
import javax.persistence.OneToOne;
-import org.jbpm.api.model.internal.PropertySupport;
import org.jbpm.api.model.preview.InputSet;
import org.jbpm.api.model.preview.Property;
+import org.jbpm.api.model.preview.PropertySupport;
/**
* An InputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MessageImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MessageImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MessageImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -33,10 +33,10 @@
import javax.persistence.Id;
import javax.persistence.OneToOne;
-import org.jbpm.api.model.internal.PropertySupport;
import org.jbpm.api.model.preview.Message;
import org.jbpm.api.model.preview.Participant;
import org.jbpm.api.model.preview.Property;
+import org.jbpm.api.model.preview.PropertySupport;
/**
* A Message, which is used in the definition of attributes for a @{link StartEvent},
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -43,24 +43,24 @@
import org.hibernate.annotations.IndexColumn;
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NameNotUniqueException;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
+import org.jbpm.api.client.Execution.ExecutionStatus;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.model.internal.PropertySupport;
import org.jbpm.api.model.preview.Assignment;
import org.jbpm.api.model.preview.Group;
import org.jbpm.api.model.preview.Property;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.NodeHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
-import org.jbpm.api.runtime.Token.TokenStatus;
+import org.jbpm.api.model.preview.PropertySupport;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.NodeHandler;
+import org.jbpm.api.runtime.preview.SignalHandler;
+import org.jbpm.api.runtime.preview.TokenExecutor;
import org.jbpm.ri.model.builder.MultipleInFlowSupport;
import org.jbpm.ri.model.builder.MultipleOutFlowSupport;
import org.jbpm.ri.model.builder.SingleInFlowSupport;
@@ -129,7 +129,7 @@
private ProcessDefinition procDef;
@ManyToOne(targetEntity = ProcessImpl.class)
- private ProcessInstance proc;
+ private Process proc;
@ManyToOne(targetEntity = GroupImpl.class)
private Group groupRef;
@@ -152,7 +152,7 @@
}
@Override
- public ProcessInstance getProcess()
+ public Process getProcess()
{
return proc;
}
@@ -248,7 +248,7 @@
public void execute(RuntimeContext rtContext)
{
- Token token = rtContext.getToken();
+ Execution token = rtContext.getToken();
// The default implementation calls the ExecutionHandler
ExecutionHandler execHandler = getExecutionHandler();
@@ -289,7 +289,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Token token)
+ public void execute(Execution token)
{
// nothing to do
}
@@ -340,12 +340,12 @@
{
private static final long serialVersionUID = 1L;
- public void execute(TokenExecutor tokenExecutor, Token token)
+ public void execute(TokenExecutor tokenExecutor, Execution token)
{
if (getOutFlows().size() == 1)
{
SequenceFlow outFlow = getOutFlows().get(0);
- if (token.getTokenStatus() == TokenStatus.Started)
+ if (token.getExecutionStatus() == ExecutionStatus.Started)
tokenExecutor.move(token, outFlow);
}
else
@@ -396,7 +396,7 @@
}
@Override
- protected void create(ProcessInstance proc)
+ protected void create(Process proc)
{
super.create(proc);
this.proc = proc;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/OutputSetImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/OutputSetImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/OutputSetImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -32,9 +32,9 @@
import javax.persistence.Id;
import javax.persistence.OneToOne;
-import org.jbpm.api.model.internal.PropertySupport;
import org.jbpm.api.model.preview.OutputSet;
import org.jbpm.api.model.preview.Property;
+import org.jbpm.api.model.preview.PropertySupport;
/**
* An OutputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -31,16 +31,16 @@
import javax.persistence.Entity;
import javax.persistence.Transient;
+import org.jbpm.api.client.Execution;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.model.preview.ParallelGateway;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
-import org.jbpm.ri.runtime.MutableToken;
-import org.jbpm.ri.runtime.TokenImpl;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.TokenExecutor;
+import org.jbpm.ri.runtime.MutableExecution;
+import org.jbpm.ri.runtime.ExecutionImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -63,7 +63,7 @@
private Set<SequenceFlow> outstandingFlows;
@Transient
- private Set<Token> mergeTokens;
+ private Set<Execution> mergeTokens;
public ParallelGatewayImpl(ProcessStructure procStruct, String name)
{
@@ -85,7 +85,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Token token)
+ public void execute(Execution token)
{
// Call the super default handler
superExecHandler.execute(token);
@@ -94,7 +94,7 @@
if (outstandingFlows == null)
{
outstandingFlows = new HashSet<SequenceFlow>(inFlows);
- mergeTokens = new HashSet<Token>();
+ mergeTokens = new HashSet<Execution>();
}
SequenceFlow flow = token.getSequenceFlow();
@@ -123,13 +123,13 @@
{
private static final long serialVersionUID = 1L;
- public void execute(TokenExecutor tokenExecutor, Token token)
+ public void execute(TokenExecutor tokenExecutor, Execution token)
{
// In any case, the incomming token is not propagated
tokenExecutor.suspend(token);
// If the gateway has a single incomming flow the outgoing token is the incomming token
- MutableToken outToken = (getInFlows().size() == 1 ? (MutableToken)token : null);
+ MutableExecution outToken = (getInFlows().size() == 1 ? (MutableExecution)token : null);
// The outgoing token is the merge of all incomming tokens
if (outToken == null)
@@ -152,7 +152,7 @@
if (outToken != null)
{
// Start a copy of the outgoing token for every gate
- List<Token> outTokens = new ArrayList<Token>();
+ List<Execution> outTokens = new ArrayList<Execution>();
for(SequenceFlow auxGate : getGates())
{
SequenceFlow outFlow = auxGate;
@@ -160,13 +160,13 @@
tokenExecutor.create(outToken, outFlow);
outTokens.add(outToken);
}
- for (Token auxToken : outTokens)
+ for (Execution auxToken : outTokens)
{
tokenExecutor.start(auxToken);
}
// Destroy the received tokens
- for (Token auxToken : receivedTokens)
+ for (Execution auxToken : receivedTokens)
{
tokenExecutor.destroy(auxToken);
}
@@ -197,10 +197,10 @@
mergeTokens = null;
}
- private TokenImpl getMergedTokens()
+ private ExecutionImpl getMergedTokens()
{
- TokenImpl mergedToken = new TokenImpl(getProcess(), null);
- for (Token auxToken : mergeTokens)
+ ExecutionImpl mergedToken = new ExecutionImpl(getProcess(), null);
+ for (Execution auxToken : mergeTokens)
{
log.debug("mergeToken: " + auxToken);
mergedToken.mergeToken(auxToken);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -41,12 +41,12 @@
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.jbpm.api.Constants;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
-import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.model.preview.Assignment;
import org.jbpm.api.model.preview.Group;
import org.jbpm.api.model.preview.Message;
@@ -87,7 +87,7 @@
}
@Override
- public ProcessInstance newInstance()
+ public Process newInstance()
{
// Create a copy of the process structure from raw data
ProcessStructureImpl procStructCopy;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -38,10 +38,10 @@
import org.hibernate.Hibernate;
import org.hibernate.Session;
import org.jbpm.api.Constants;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.model.preview.Assignment;
import org.jbpm.api.model.preview.Group;
@@ -60,7 +60,7 @@
* @since 08-Jul-2008
*/
@Entity(name = "BPMProcess")
-public class ProcessImpl extends AbstractElementImpl implements ProcessInstance
+public class ProcessImpl extends AbstractElementImpl implements Process
{
private static final long serialVersionUID = 1L;
@@ -225,12 +225,12 @@
setProcessStatus(ProcessStatus.Aborted);
}
- public ObjectName startProcess()
+ public ObjectName startProcessAsync()
{
return startProcessInternal(null);
}
- public ObjectName startProcess(Attachments att)
+ public ObjectName startProcessAsync(Attachments att)
{
return startProcessInternal(att);
}
@@ -284,28 +284,28 @@
}
@Override
- protected void create(ProcessInstance proc)
+ protected void create(Process proc)
{
super.create(proc);
procStruct.create(proc);
}
@Override
- public void register(ProcessInstance proc)
+ public void register(Process proc)
{
super.register(proc);
procStruct.register(proc);
}
@Override
- public void unregister(ProcessInstance proc)
+ public void unregister(Process proc)
{
super.unregister(proc);
procStruct.unregister(proc);
}
@Override
- protected void destroy(ProcessInstance proc)
+ protected void destroy(Process proc)
{
super.destroy(proc);
procStruct.destroy(proc);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -41,19 +41,19 @@
import org.hibernate.annotations.IndexColumn;
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
-import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.model.internal.PropertySupport;
import org.jbpm.api.model.preview.Assignment;
import org.jbpm.api.model.preview.Group;
import org.jbpm.api.model.preview.Message;
import org.jbpm.api.model.preview.Property;
+import org.jbpm.api.model.preview.PropertySupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -359,7 +359,7 @@
}
@Override
- protected void create(ProcessInstance proc)
+ protected void create(Process proc)
{
super.create(proc);
for (Node node : getNodes())
@@ -370,7 +370,7 @@
}
@Override
- protected void register(ProcessInstance proc)
+ protected void register(Process proc)
{
super.register(proc);
for (Node node : getNodes())
@@ -381,7 +381,7 @@
}
@Override
- protected void unregister(ProcessInstance proc)
+ protected void unregister(Process proc)
{
super.unregister(proc);
for (Node node : getNodes())
@@ -392,7 +392,7 @@
}
@Override
- protected void destroy(ProcessInstance proc)
+ protected void destroy(Process proc)
{
super.destroy(proc);
for (Node node : getNodes())
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertySupportImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertySupportImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertySupportImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -37,8 +37,8 @@
import javax.persistence.MapKey;
import javax.persistence.OneToMany;
-import org.jbpm.api.model.internal.PropertySupport;
import org.jbpm.api.model.preview.Property;
+import org.jbpm.api.model.preview.PropertySupport;
/**
* Basic property support
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -31,15 +31,15 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.preview.MessageListener;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.preview.Message;
import org.jbpm.api.model.preview.ReceiveTask;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.preview.ExecutionContext;
+import org.jbpm.api.runtime.preview.TokenExecutor;
import org.jbpm.ri.runtime.RuntimeContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -65,7 +65,7 @@
private List<Message> receivedMessages = new ArrayList<Message>();
@Transient
- private transient Token suspendedToken;
+ private transient Execution suspendedToken;
@Transient
private transient TokenExecutor tokenExecutor;
@@ -100,7 +100,7 @@
@Override
public void execute(RuntimeContext rtContext)
{
- Token token = rtContext.getToken();
+ Execution token = rtContext.getToken();
tokenExecutor = rtContext.getTokenExecutor();
if (receivedMessages.size() > 0)
@@ -142,7 +142,7 @@
// Activate the suspended token
if (suspendedToken != null)
{
- tokenExecutor.activate(suspendedToken.getTokenID());
+ tokenExecutor.activate(suspendedToken.getExecutionID());
suspendedToken = null;
}
}
@@ -165,7 +165,7 @@
}
@Override
- protected void create(ProcessInstance proc)
+ protected void create(Process proc)
{
super.create(proc);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -27,14 +27,14 @@
import javax.persistence.Transient;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.preview.Message;
import org.jbpm.api.model.preview.SendTask;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
import org.jbpm.ri.runtime.MessageSender;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -83,7 +83,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Token token)
+ public void execute(Execution token)
{
Message messageRef = thisNode.getMessageRef();
MessageSender messageSender = new MessageSender(thisNode, messageRef);
@@ -119,7 +119,7 @@
}
@Override
- protected void create(ProcessInstance proc)
+ protected void create(Process proc)
{
super.create(proc);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -29,19 +29,19 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.client.preview.SignalListener;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
-import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.model.preview.Signal.SignalType;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.SignalHandler;
import org.jbpm.api.service.ExecutionService;
import org.jbpm.api.service.preview.SignalService;
import org.jbpm.ri.model.builder.SingleOutFlowSupport;
@@ -123,13 +123,13 @@
ProcessEngine engine = getProcessDefinition().getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
- public void throwEnterSignal(Token token)
+ public void throwEnterSignal(Execution token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_START_EVENT_ENTER, getKey());
sigService.throwSignal(signal);
}
- public void throwExitSignal(Token token)
+ public void throwExitSignal(Execution token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_START_EVENT_EXIT, getKey());
sigService.throwSignal(signal);
@@ -187,7 +187,7 @@
// There MAY be multiple Start Events for a given Process level. Each Start Event is an independent event.
// That is, a Process Instance SHALL be generated when the Start Event is triggered.
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
StartEvent startEvent = proc.getNode(StartEvent.class, startEventName);
ExecutionService execService = engine.getService(ExecutionService.class);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -39,21 +39,21 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.client.Execution;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.Task;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
-import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.model.preview.InputSet;
import org.jbpm.api.model.preview.OutputSet;
import org.jbpm.api.model.preview.Property;
import org.jbpm.api.model.preview.Signal;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.ExecutionContext;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.SignalHandler;
import org.jbpm.api.service.preview.SignalService;
import org.jbpm.ri.model.builder.SingleInFlowSupport;
import org.jbpm.ri.model.builder.SingleOutFlowSupport;
@@ -187,7 +187,7 @@
{
private static final long serialVersionUID = 1L;
- public void execute(Token token)
+ public void execute(Execution token)
{
superExecHandler.execute(token);
processOutputSet(token);
@@ -209,7 +209,7 @@
/**
* Select and validate active inputSet
*/
- protected InputSet getActiveInputSet(Token token)
+ protected InputSet getActiveInputSet(Execution token)
{
InputSetImpl inputSet = null;
ExecutionContext exContext = token.getExecutionContext();
@@ -280,7 +280,7 @@
/**
* Transfer data from outputSet to Token
*/
- protected void processOutputSet(Token token)
+ protected void processOutputSet(Execution token)
{
ExecutionContext exContext = token.getExecutionContext();
@@ -308,13 +308,13 @@
ProcessEngine engine = getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
- public void throwEnterSignal(Token token)
+ public void throwEnterSignal(Execution token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_TASK_ENTER, getKey());
sigService.throwSignal(signal);
}
- public void throwExitSignal(Token token)
+ public void throwExitSignal(Execution token)
{
Signal signal = new SignalImpl(Signal.SignalType.SYSTEM_TASK_EXIT, getKey());
sigService.throwSignal(signal);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -33,16 +33,16 @@
import javax.persistence.Transient;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.preview.MessageListener;
import org.jbpm.api.client.preview.UserTaskCallback;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.ProcessStructure;
import org.jbpm.api.model.preview.Message;
import org.jbpm.api.model.preview.UserTask;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.preview.ExecutionContext;
+import org.jbpm.api.runtime.preview.TokenExecutor;
import org.jbpm.ri.runtime.MessageSender;
import org.jbpm.ri.runtime.RuntimeContext;
import org.slf4j.Logger;
@@ -71,7 +71,7 @@
private List<Message> receivedMessages = new ArrayList<Message>();
@Transient
- private transient Token suspendedToken;
+ private transient Execution suspendedToken;
@Transient
private transient TokenExecutor tokenExecutor;
@@ -126,7 +126,7 @@
@Override
public void execute(RuntimeContext rtContext)
{
- Token token = rtContext.getToken();
+ Execution token = rtContext.getToken();
tokenExecutor = rtContext.getTokenExecutor();
if (receivedMessages.size() == 0)
@@ -176,7 +176,7 @@
// Activate the suspended token
if (suspendedToken != null)
{
- tokenExecutor.activate(suspendedToken.getTokenID());
+ tokenExecutor.activate(suspendedToken.getExecutionID());
suspendedToken = null;
}
}
@@ -202,7 +202,7 @@
}
@Override
- protected void create(ProcessInstance proc)
+ protected void create(Process proc)
{
super.create(proc);
@@ -212,7 +212,7 @@
}
@Override
- protected void register(ProcessInstance proc)
+ protected void register(Process proc)
{
super.register(proc);
@@ -227,7 +227,7 @@
}
@Override
- protected void unregister(ProcessInstance proc)
+ protected void unregister(Process proc)
{
super.unregister(proc);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -24,9 +24,9 @@
//$Id$
import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
@@ -39,9 +39,9 @@
import org.jbpm.api.model.builder.preview.MessageBuilder;
import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.model.preview.Group.GroupType;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.SignalHandler;
import org.jbpm.ri.model.AssignmentImpl;
import org.jbpm.ri.model.ComplexGatewayImpl;
import org.jbpm.ri.model.EndEventImpl;
@@ -63,7 +63,7 @@
import org.jbpm.ri.model.UserTaskImpl;
/**
- * The ProcessBuilder can be used to dynamically build a {@link ProcessInstance}.
+ * The ProcessBuilder can be used to dynamically build a {@link Process}.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -23,12 +23,12 @@
//$Id$
+import org.jbpm.api.client.Execution;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.preview.Assignment;
import org.jbpm.api.model.preview.Assignment.AssignTime;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.ExecutionContext;
/**
* An interceptor that invokes the ExecutionHandler.execute
@@ -42,7 +42,7 @@
public void execute(RuntimeContext rtContext)
{
Node node = rtContext.getNode();
- Token token = rtContext.getToken();
+ Execution token = rtContext.getToken();
// Do start time assignments
for (Assignment ass : node.getAssignments())
@@ -62,7 +62,7 @@
}
}
- protected void anyTimeAssignment(Assignment ass, Token token)
+ protected void anyTimeAssignment(Assignment ass, Execution token)
{
Expression expr = ass.getFrom();
ExpressionEvaluator exprEvaluator = new ExpressionEvaluator(expr);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -28,14 +28,14 @@
import java.util.HashMap;
import java.util.Map;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.preview.Property;
-import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.runtime.preview.ExecutionContext;
/**
- * An ExecutionContext that delegates to the current {@link Node} or {@link ProcessInstance} for property rerieval.
+ * An ExecutionContext that delegates to the current {@link Node} or {@link Process} for property rerieval.
*
* @author Thomas.Diesler(a)jboss.com
* @since 15-Aug-2008
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -24,24 +24,24 @@
//$Id$
import org.hibernate.Session;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.ExecutionContext;
/**
- * A {@link Token} that includes properties from the current {@link Node}
+ * A {@link Execution} that includes properties from the current {@link Node}
*
* @author Thomas.Diesler(a)jboss.com
* @since 15-Aug-2008
*/
-public class DelegatingToken implements MutableToken
+public class DelegatingToken implements MutableExecution
{
- private MutableToken delegateToken;
+ private MutableExecution delegateToken;
private ExecutionContext delegateContext;
- public DelegatingToken(MutableToken token)
+ public DelegatingToken(MutableExecution token)
{
this.delegateToken = token;
@@ -58,7 +58,7 @@
}
@Override
- public MutableToken copyToken()
+ public MutableExecution copyToken()
{
return delegateToken.copyToken();
}
@@ -70,25 +70,25 @@
}
@Override
- public String getTokenID()
+ public String getExecutionID()
{
- return delegateToken.getTokenID();
+ return delegateToken.getExecutionID();
}
@Override
- public TokenStatus getTokenStatus()
+ public ExecutionStatus getExecutionStatus()
{
- return delegateToken.getTokenStatus();
+ return delegateToken.getExecutionStatus();
}
@Override
- public ProcessInstance getProcess()
+ public Process getProcess()
{
return delegateToken.getProcess();
}
@Override
- public void mergeToken(Token token)
+ public void mergeToken(Execution token)
{
delegateToken.mergeToken(token);
}
@@ -100,9 +100,9 @@
}
@Override
- public void setTokenStatus(TokenStatus status)
+ public void setExecutionStatus(ExecutionStatus status)
{
- delegateToken.setTokenStatus(status);
+ delegateToken.setExecutionStatus(status);
}
@Override
Copied: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExecutionImpl.java (from rev 2889, projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java)
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExecutionImpl.java (rev 0)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExecutionImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,147 @@
+/*
+ * 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.ri.runtime;
+
+//$Id$
+
+import org.hibernate.Session;
+import org.jboss.util.id.UID;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.Attachments.Key;
+import org.jbpm.api.runtime.preview.BasicExecutionContext;
+import org.jbpm.api.runtime.preview.ExecutionContext;
+
+/**
+ * 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 class ExecutionImpl implements MutableExecution
+{
+ private String id;
+ private SequenceFlow flow;
+ private ExecutionContext context;
+ private ExecutionStatus status;
+ private Process process;
+ private Session session;
+
+ /**
+ * Construct a Token with given {@link Attachments}
+ */
+ public ExecutionImpl(Process process, Attachments att)
+ {
+ this.context = new BasicExecutionContext(att);
+ this.id = new UID().toString();
+ this.status = ExecutionStatus.Created;
+ this.process = process;
+ }
+
+ @Override
+ public String getExecutionID()
+ {
+ return id;
+ }
+
+ @Override
+ public ExecutionStatus getExecutionStatus()
+ {
+ return status;
+ }
+
+ @Override
+ public void setExecutionStatus(ExecutionStatus status)
+ {
+ this.status = status;
+ }
+
+ @Override
+ public Process getProcess()
+ {
+ return process;
+ }
+
+ @Override
+ public ExecutionContext getExecutionContext()
+ {
+ return context;
+ }
+
+ @Override
+ public SequenceFlow getSequenceFlow()
+ {
+ return flow;
+ }
+
+ @Override
+ public void setSequenceFlow(SequenceFlow flow)
+ {
+ this.flow = flow;
+ }
+
+ @Override
+ public Session getSession()
+ {
+ return session;
+ }
+
+ @Override
+ public void setSession(Session session)
+ {
+ this.session = session;
+ }
+
+ @Override
+ public MutableExecution copyToken()
+ {
+ return new ExecutionImpl(process, context);
+ }
+
+ @Override
+ public void mergeToken(Execution token)
+ {
+ ExecutionContext mergeContext = token.getExecutionContext();
+ for(Key key : mergeContext.getAttachmentKeys())
+ {
+ Object mergeValue = mergeContext.getAttachment(key.getClassPart(), key.getNamePart());
+ Object existValue = context.getAttachment(key.getClassPart(), key.getNamePart());
+ if (existValue != null && existValue.equals(mergeValue) == false)
+ throw new IllegalStateException("Cannot merge the same key with different values: " + key);
+
+ context.addAttachment(key.getClassPart(), key.getNamePart(), mergeValue);
+ }
+ }
+
+ public String toString()
+ {
+ return "[sf=" + getSequenceFlow() + ",status=" + getExecutionStatus() + ",ctx=" + getExecutionContext() + ",id=" + id + "]";
+ }
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExitSignalInterceptor.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -23,9 +23,9 @@
//$Id$
+import org.jbpm.api.client.Execution;
import org.jbpm.api.model.Node;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.SignalHandler;
/**
* An interceptor that invokes the SignalHandler.throwExitSignal
@@ -39,7 +39,7 @@
public void execute(RuntimeContext rtContext)
{
Node node = rtContext.getNode();
- Token token = rtContext.getToken();
+ Execution token = rtContext.getToken();
SignalHandler sigHandler = node.getSignalHandler();
sigHandler.throwExitSignal(token);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/ExpressionEvaluator.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,11 +26,11 @@
import java.util.HashMap;
import java.util.Map;
+import org.jbpm.api.client.Execution;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.Attachments.Key;
+import org.jbpm.api.runtime.preview.ExecutionContext;
import org.mvel.MVEL;
/**
@@ -52,7 +52,7 @@
* Evaluate an expression for a given token. <p/> Note that <code>propName.replace(".", "_")</code> applies to
* property names for MVEL expressions, because the dot notation has special meaning in MVEL.
*/
- public Object evaluateExpression(Token token)
+ public Object evaluateExpression(Execution token)
{
ExpressionLanguage exprLang = expr.getExpressionLanguage();
if (exprLang == ExpressionLanguage.MVEL)
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/FlowHandlerInterceptor.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -23,10 +23,10 @@
//$Id$
+import org.jbpm.api.client.Execution;
import org.jbpm.api.model.Node;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.TokenExecutor;
/**
* An interceptor that invokes the FlowHandler.execute
@@ -41,7 +41,7 @@
{
TokenExecutor tokenExecutor = rtContext.getTokenExecutor();
Node node = rtContext.getNode();
- Token token = rtContext.getToken();
+ Execution token = rtContext.getToken();
// Call the next Interceptor
rtContext.next();
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,14 +25,14 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Execution;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.builder.preview.MessageBuilder;
import org.jbpm.api.model.preview.Message;
import org.jbpm.api.model.preview.Participant;
import org.jbpm.api.model.preview.Property;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.ExecutionContext;
import org.jbpm.api.service.preview.MessageService;
import org.jbpm.ri.model.MessageImpl;
import org.jbpm.ri.model.ParticipantImpl;
@@ -65,7 +65,7 @@
* Extract message content from the token and send the message
* to it's recipient.
*/
- public void sendMessage(Token token)
+ public void sendMessage(Execution token)
{
ExecutionContext exContext = token.getExecutionContext();
MessageBuilder msgBuilder = new MessageBuilderImpl();
Copied: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableExecution.java (from rev 2888, projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java)
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableExecution.java (rev 0)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableExecution.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -0,0 +1,63 @@
+/*
+ * 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.ri.runtime;
+
+//$Id$
+
+import org.hibernate.Session;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.model.SequenceFlow;
+
+/**
+ * A mutable extension to the Token.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface MutableExecution extends Execution
+{
+ /**
+ * Set the token status
+ */
+ void setExecutionStatus(ExecutionStatus status);
+
+ /**
+ * Set the associated session
+ */
+ void setSession(Session session);
+
+ /**
+ * Set the current SequenceFlow
+ */
+ void setSequenceFlow(SequenceFlow flow);
+
+ /**
+ * Create a schallow copy of this Token.
+ * The content in the ExecutionContext will be copied by reference.
+ */
+ MutableExecution copyToken();
+
+ /**
+ * Merge this Token with another token.
+ */
+ void mergeToken(Execution token);
+}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MutableToken.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,63 +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.ri.runtime;
-
-//$Id$
-
-import org.hibernate.Session;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.runtime.Token;
-
-/**
- * A mutable extension to the Token.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public interface MutableToken extends Token
-{
- /**
- * Set the token status
- */
- void setTokenStatus(TokenStatus status);
-
- /**
- * Set the associated session
- */
- void setSession(Session session);
-
- /**
- * Set the current SequenceFlow
- */
- void setSequenceFlow(SequenceFlow flow);
-
- /**
- * Create a schallow copy of this Token.
- * The content in the ExecutionContext will be copied by reference.
- */
- MutableToken copyToken();
-
- /**
- * Merge this Token with another token.
- */
- void mergeToken(Token token);
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import org.hibernate.Session;
import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.Execution.ExecutionStatus;
import org.jbpm.api.model.Node;
-import org.jbpm.api.runtime.Token.TokenStatus;
import org.jbpm.api.service.preview.PersistenceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,7 +45,7 @@
public void execute(RuntimeContext rtContext)
{
Node node = rtContext.getNode();
- MutableToken token = (MutableToken)rtContext.getToken();
+ MutableExecution token = (MutableExecution)rtContext.getToken();
Session session = token.getSession();
try
@@ -64,8 +64,8 @@
}
finally
{
- TokenStatus status = token.getTokenStatus();
- if (status == TokenStatus.Destroyed || status == TokenStatus.Suspended)
+ ExecutionStatus status = token.getExecutionStatus();
+ if (status == ExecutionStatus.Destroyed || status == ExecutionStatus.Suspended)
{
session.close();
token.setSession(null);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -21,13 +21,13 @@
*/
package org.jbpm.ri.runtime;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.Execution.ExecutionStatus;
+import org.jbpm.api.client.Process.ProcessStatus;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.ProcessInstance.ProcessStatus;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
-import org.jbpm.api.runtime.Token.TokenStatus;
+import org.jbpm.api.runtime.preview.TokenExecutor;
import org.jbpm.api.service.ProcessInstanceService;
import org.jbpm.ri.model.ProcessImpl;
import org.jbpm.ri.service.ProcessServiceImpl;
@@ -47,17 +47,17 @@
private RuntimeProcess rtProc;
private TokenExecutor tokenExecutor;
- private MutableToken token;
+ private MutableExecution token;
private boolean releaseThread;
- public RunnableToken(TokenExecutorImpl tokenExecutorImpl, RuntimeProcess rtProc, MutableToken token)
+ public RunnableToken(TokenExecutorImpl tokenExecutorImpl, RuntimeProcess rtProc, MutableExecution token)
{
this.tokenExecutor = rtProc.getTokenExecutor();
this.rtProc = rtProc;
this.token = token;
}
- public Token getToken()
+ public Execution getToken()
{
return token;
}
@@ -69,7 +69,7 @@
public void run()
{
- ProcessInstance proc = rtProc.getProcess();
+ Process proc = rtProc.getProcess();
try
{
SequenceFlow flow = token.getSequenceFlow();
@@ -105,9 +105,9 @@
((ProcessImpl)proc).setRuntimeException(rte);
log.debug("Terminate all suspended tokens");
- for (Token auxToken : tokenExecutor.getRunnableTokens())
+ for (Execution auxToken : tokenExecutor.getRunnableTokens())
{
- if (auxToken.getTokenStatus() == TokenStatus.Suspended)
+ if (auxToken.getExecutionStatus() == ExecutionStatus.Suspended)
tokenExecutor.destroy(auxToken);
}
@@ -123,9 +123,9 @@
private boolean continueTokenThread()
{
- TokenStatus tokStatus = token.getTokenStatus();
+ ExecutionStatus tokStatus = token.getExecutionStatus();
ProcessStatus procStatus = rtProc.getProcess().getProcessStatus();
- return releaseThread == false && procStatus == ProcessStatus.Active && tokStatus == TokenStatus.Started;
+ return releaseThread == false && procStatus == ProcessStatus.Active && tokStatus == ExecutionStatus.Started;
}
private void notifyRuntimeProcess()
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeContext.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,9 +26,9 @@
import java.util.ArrayList;
import java.util.List;
+import org.jbpm.api.client.Execution;
import org.jbpm.api.model.Node;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.preview.TokenExecutor;
/**
* A runtime context that passes through a chain of interceptors.
@@ -42,9 +42,9 @@
int itorIndex;
TokenExecutor tokenExecutor;
- MutableToken token;
+ MutableExecution token;
- public RuntimeContext(TokenExecutor tokenExecutor, MutableToken token)
+ public RuntimeContext(TokenExecutor tokenExecutor, MutableExecution token)
{
this.tokenExecutor = tokenExecutor;
this.token = token;
@@ -61,7 +61,7 @@
return token.getProcess().getNode(targetRef);
}
- public Token getToken()
+ public Execution getToken()
{
return token;
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -23,12 +23,12 @@
//$Id$
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.runtime.preview.TokenExecutor;
/**
- * A RuntimeProcess add runtime behaviour to the {@link ProcessInstance} <p/> To protect the engine from maligious user code it
- * does not extend {@link ProcessInstance} directly.
+ * A RuntimeProcess add runtime behaviour to the {@link Process} <p/> To protect the engine from maligious user code it
+ * does not extend {@link Process} directly.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -36,12 +36,12 @@
public interface RuntimeProcess
{
/**
- * Get the associated {@link ProcessInstance}
+ * Get the associated {@link Process}
*/
- ProcessInstance getProcess();
+ Process getProcess();
/**
- * Get the {@link TokenExecutor} for this {@link ProcessInstance}
+ * Get the {@link TokenExecutor} for this {@link Process}
*/
TokenExecutor getTokenExecutor();
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -23,27 +23,27 @@
//$Id$
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.runtime.preview.TokenExecutor;
/**
- * A RuntimeProcess add runtime behaviour to the {@link ProcessInstance}
+ * A RuntimeProcess add runtime behaviour to the {@link Process}
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
public class RuntimeProcessImpl implements RuntimeProcess
{
- private ProcessInstance proc;
+ private Process proc;
private TokenExecutor tokenExecutor;
- public RuntimeProcessImpl(ProcessInstance proc)
+ public RuntimeProcessImpl(Process proc)
{
this.proc = proc;
this.tokenExecutor = new TokenExecutorImpl(this);
}
- public ProcessInstance getProcess()
+ public Process getProcess()
{
return proc;
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/SignalHandlerInterceptor.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -23,9 +23,9 @@
//$Id$
+import org.jbpm.api.client.Execution;
import org.jbpm.api.model.Node;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.preview.SignalHandler;
/**
* An interceptor that invokes the SignalHandler.throwEnterSignal
@@ -39,7 +39,7 @@
public void execute(RuntimeContext rtContext)
{
Node node = rtContext.getNode();
- Token token = rtContext.getToken();
+ Execution token = rtContext.getToken();
try
{
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -31,18 +31,18 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Execution.ExecutionStatus;
+import org.jbpm.api.client.Process.ProcessStatus;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.ProcessInstance.ProcessStatus;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
-import org.jbpm.api.runtime.Token.TokenStatus;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.TokenExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The {@link FlowHandler} invokes the TokenExecutor to schedule {@link SequenceFlow} objects together with their
- * associated {@link Token}.
+ * associated {@link Execution}.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -61,11 +61,11 @@
this.rtProc = rtProc;
}
- public Set<Token> getRunnableTokens()
+ public Set<Execution> getRunnableTokens()
{
synchronized (runnableTokens)
{
- Set<Token> tokenSet = new HashSet<Token>();
+ Set<Execution> tokenSet = new HashSet<Execution>();
for (RunnableToken rt : runnableTokens.values())
tokenSet.add(rt.getToken());
@@ -81,22 +81,22 @@
}
}
- public void create(Token token, SequenceFlow initialFlow)
+ public void create(Execution token, SequenceFlow initialFlow)
{
synchronized (runnableTokens)
{
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setTokenStatus(TokenStatus.Created);
+ MutableExecution mutableToken = (MutableExecution)token;
+ mutableToken.setExecutionStatus(ExecutionStatus.Created);
mutableToken.setSequenceFlow(initialFlow);
log.debug("Create Token: " + token);
RunnableToken rtToken = new RunnableToken(this, rtProc, mutableToken);
- runnableTokens.put(token.getTokenID(), rtToken);
+ runnableTokens.put(token.getExecutionID(), rtToken);
}
}
- public void start(Token token)
+ public void start(Execution token)
{
synchronized (runnableTokens)
{
@@ -105,70 +105,70 @@
throw new IllegalStateException("Cannot start token to process in state: " + procStatus);
log.debug("Start Token: " + token);
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setTokenStatus(TokenStatus.Started);
+ MutableExecution mutableToken = (MutableExecution)token;
+ mutableToken.setExecutionStatus(ExecutionStatus.Started);
- RunnableToken rtToken = runnableTokens.get(token.getTokenID());
+ RunnableToken rtToken = runnableTokens.get(token.getExecutionID());
executor.submit(rtToken);
}
}
- public void move(Token token, SequenceFlow flow)
+ public void move(Execution token, SequenceFlow flow)
{
synchronized (runnableTokens)
{
if (flow == null)
throw new IllegalArgumentException("Flow cannot be null");
- if (token.getTokenStatus() != TokenStatus.Started)
- throw new IllegalStateException("Cannot move token in state: " + token.getTokenStatus());
+ if (token.getExecutionStatus() != ExecutionStatus.Started)
+ throw new IllegalStateException("Cannot move token in state: " + token.getExecutionStatus());
- MutableToken mutableToken = (MutableToken)token;
+ MutableExecution mutableToken = (MutableExecution)token;
mutableToken.setSequenceFlow(flow);
}
}
- public void stop(Token token)
+ public void stop(Execution token)
{
synchronized (runnableTokens)
{
log.debug("Stop Token: " + token);
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setTokenStatus(TokenStatus.Stoped);
+ MutableExecution mutableToken = (MutableExecution)token;
+ mutableToken.setExecutionStatus(ExecutionStatus.Stoped);
}
}
- public void destroy(Token token)
+ public void destroy(Execution token)
{
synchronized (runnableTokens)
{
log.debug("Destroy Token: " + token);
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setTokenStatus(TokenStatus.Destroyed);
- runnableTokens.remove(token.getTokenID());
+ MutableExecution mutableToken = (MutableExecution)token;
+ mutableToken.setExecutionStatus(ExecutionStatus.Destroyed);
+ runnableTokens.remove(token.getExecutionID());
}
}
- public String suspend(Token token)
+ public String suspend(Execution token)
{
synchronized (runnableTokens)
{
- RunnableToken rtToken = runnableTokens.get(token.getTokenID());
+ RunnableToken rtToken = runnableTokens.get(token.getExecutionID());
if (rtToken == null)
throw new IllegalStateException("Not a runnable token: " + token);
log.debug("Suspend Token: " + token);
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setTokenStatus(TokenStatus.Suspended);
+ MutableExecution mutableToken = (MutableExecution)token;
+ mutableToken.setExecutionStatus(ExecutionStatus.Suspended);
// Release the thread for a suspended token
rtToken.releaseThread();
- return token.getTokenID();
+ return token.getExecutionID();
}
}
- public Token activate(String tokenID)
+ public Execution activate(String tokenID)
{
synchronized (runnableTokens)
{
@@ -176,16 +176,16 @@
if (rtToken == null)
throw new IllegalStateException("Not a runnable token: " + tokenID);
- Token token = rtToken.getToken();
- if (token.getTokenStatus() != TokenStatus.Suspended)
- throw new IllegalStateException("Activate token in state: " + token.getTokenStatus());
+ Execution token = rtToken.getToken();
+ if (token.getExecutionStatus() != ExecutionStatus.Suspended)
+ throw new IllegalStateException("Activate token in state: " + token.getExecutionStatus());
log.debug("Activate Token: " + token);
- MutableToken mutableToken = (MutableToken)token;
- mutableToken.setTokenStatus(TokenStatus.Started);
+ MutableExecution mutableToken = (MutableExecution)token;
+ mutableToken.setExecutionStatus(ExecutionStatus.Started);
rtToken = new RunnableToken(this, rtProc, mutableToken);
- runnableTokens.put(token.getTokenID(), rtToken);
+ runnableTokens.put(token.getExecutionID(), rtToken);
executor.submit(rtToken);
return token;
Deleted: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -1,147 +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.ri.runtime;
-
-//$Id$
-
-import org.hibernate.Session;
-import org.jboss.util.id.UID;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.BasicExecutionContext;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.Attachments.Key;
-
-/**
- * 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 class TokenImpl implements MutableToken
-{
- private String id;
- private SequenceFlow flow;
- private ExecutionContext context;
- private TokenStatus status;
- private ProcessInstance process;
- private Session session;
-
- /**
- * Construct a Token with given {@link Attachments}
- */
- public TokenImpl(ProcessInstance process, Attachments att)
- {
- this.context = new BasicExecutionContext(att);
- this.id = new UID().toString();
- this.status = TokenStatus.Created;
- this.process = process;
- }
-
- @Override
- public String getTokenID()
- {
- return id;
- }
-
- @Override
- public TokenStatus getTokenStatus()
- {
- return status;
- }
-
- @Override
- public void setTokenStatus(TokenStatus status)
- {
- this.status = status;
- }
-
- @Override
- public ProcessInstance getProcess()
- {
- return process;
- }
-
- @Override
- public ExecutionContext getExecutionContext()
- {
- return context;
- }
-
- @Override
- public SequenceFlow getSequenceFlow()
- {
- return flow;
- }
-
- @Override
- public void setSequenceFlow(SequenceFlow flow)
- {
- this.flow = flow;
- }
-
- @Override
- public Session getSession()
- {
- return session;
- }
-
- @Override
- public void setSession(Session session)
- {
- this.session = session;
- }
-
- @Override
- public MutableToken copyToken()
- {
- return new TokenImpl(process, context);
- }
-
- @Override
- public void mergeToken(Token token)
- {
- ExecutionContext mergeContext = token.getExecutionContext();
- for(Key key : mergeContext.getAttachmentKeys())
- {
- Object mergeValue = mergeContext.getAttachment(key.getClassPart(), key.getNamePart());
- Object existValue = context.getAttachment(key.getClassPart(), key.getNamePart());
- if (existValue != null && existValue.equals(mergeValue) == false)
- throw new IllegalStateException("Cannot merge the same key with different values: " + key);
-
- context.addAttachment(key.getClassPart(), key.getNamePart(), mergeValue);
- }
- }
-
- public String toString()
- {
- return "[sf=" + getSequenceFlow() + ",status=" + getTokenStatus() + ",ctx=" + getExecutionContext() + ",id=" + id + "]";
- }
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -28,12 +28,12 @@
import org.jbpm.api.Constants;
import org.jbpm.api.NotImplementedException;
import org.jbpm.api.Constants.TxType;
+import org.jbpm.api.client.Execution;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.preview.Group;
import org.jbpm.api.model.preview.Property;
import org.jbpm.api.model.preview.Group.GroupType;
-import org.jbpm.api.runtime.Token;
import org.jbpm.api.service.preview.PersistenceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -52,7 +52,7 @@
public void execute(RuntimeContext rtContext)
{
Node node = rtContext.getNode();
- Token token = rtContext.getToken();
+ Execution token = rtContext.getToken();
Session session = token.getSession();
// Get the Thread associated Tx
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -32,19 +32,19 @@
import org.jbpm.api.BPMException;
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.ProcessTimeoutException;
+import org.jbpm.api.client.Execution;
+import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.Process.ProcessStatus;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Event.EventDetailType;
-import org.jbpm.api.model.ProcessInstance.ProcessStatus;
import org.jbpm.api.model.preview.Assignment;
import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.preview.ExecutionContext;
+import org.jbpm.api.runtime.preview.TokenExecutor;
import org.jbpm.api.service.ExecutionService;
import org.jbpm.api.service.ProcessInstanceService;
import org.jbpm.api.service.preview.SignalService;
@@ -53,10 +53,10 @@
import org.jbpm.ri.model.SignalImpl;
import org.jbpm.ri.runtime.DelegatingToken;
import org.jbpm.ri.runtime.ExpressionEvaluator;
-import org.jbpm.ri.runtime.MutableToken;
+import org.jbpm.ri.runtime.MutableExecution;
import org.jbpm.ri.runtime.RuntimeProcess;
import org.jbpm.ri.runtime.RuntimeProcessImpl;
-import org.jbpm.ri.runtime.TokenImpl;
+import org.jbpm.ri.runtime.ExecutionImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -81,7 +81,7 @@
}
@Override
- public void startProcess(ProcessInstance proc, Attachments att)
+ public void startProcess(Process proc, Attachments att)
{
// Get the None Start Event if there is one and start the initial flow
StartEvent start = getNoneStartEvent(proc);
@@ -98,12 +98,12 @@
}
@Override
- public void startProcess(ProcessInstance proc, StartEvent start, Attachments att)
+ public void startProcess(Process proc, StartEvent start, Attachments att)
{
startProcessInternal(proc, start, att);
}
- private synchronized void startProcessInternal(ProcessInstance proc, StartEvent start, Attachments att)
+ private synchronized void startProcessInternal(Process proc, StartEvent start, Attachments att)
{
// Prepare the process to start
startProcessPrepare(proc);
@@ -121,7 +121,7 @@
boolean startProcessThread = (rtProc == null);
// Create initial Token
- TokenImpl initialToken = new TokenImpl(proc, att);
+ ExecutionImpl initialToken = new ExecutionImpl(proc, att);
InitialFlow initialFlow = new InitialFlow(start);
initialToken.setSequenceFlow(initialFlow);
@@ -158,7 +158,7 @@
tokenExecutor.start(initialToken);
}
- private void startProcessPrepare(ProcessInstance proc)
+ private void startProcessPrepare(Process proc)
{
// Veriy the process state
ProcessStatus procStatus = proc.getProcessStatus();
@@ -173,9 +173,9 @@
}
// Evaluate the Start time assignments
- private void startTimeAssignments(ProcessInstance proc, Token token)
+ private void startTimeAssignments(Process proc, Execution token)
{
- DelegatingToken delegatingToken = new DelegatingToken((MutableToken)token);
+ DelegatingToken delegatingToken = new DelegatingToken((MutableExecution)token);
ExecutionContext exContext = token.getExecutionContext();
for (Assignment ass : proc.getAssignments())
{
@@ -190,12 +190,12 @@
}
}
- public ProcessStatus waitForEnd(ProcessInstance proc)
+ public ProcessStatus waitForEnd(Process proc)
{
return waitForEndInternal(proc, 0);
}
- public ProcessStatus waitForEnd(ProcessInstance proc, long timeout)
+ public ProcessStatus waitForEnd(Process proc, long timeout)
{
return waitForEndInternal(proc, timeout);
}
@@ -205,7 +205,7 @@
* arrive at an End Event. The Process will be in a running state until all Tokens are consumed. If the process was
* aborted this method throws the causing RuntimeException if avaialable.
*/
- private ProcessStatus waitForEndInternal(ProcessInstance proc, long timeout)
+ private ProcessStatus waitForEndInternal(Process proc, long timeout)
{
ProcessImpl procImpl = (ProcessImpl)proc;
@@ -270,13 +270,13 @@
return status;
}
- private boolean isProcessTerminated(ProcessInstance proc)
+ private boolean isProcessTerminated(Process proc)
{
ProcessStatus status = proc.getProcessStatus();
return status == ProcessStatus.Cancelled || status == ProcessStatus.Completed || status == ProcessStatus.Aborted;
}
- private StartEvent getNoneStartEvent(ProcessInstance proc)
+ private StartEvent getNoneStartEvent(Process proc)
{
StartEvent start = null;
for (StartEvent aux : proc.getNodes(StartEvent.class))
@@ -291,7 +291,7 @@
return start;
}
- private RuntimeProcess getRuntimeProcess(ProcessInstance proc, boolean createNew)
+ private RuntimeProcess getRuntimeProcess(Process proc, boolean createNew)
{
RuntimeProcess rtProcess;
synchronized (runtimeProcesses)
@@ -322,7 +322,7 @@
{
TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
ProcessImpl procImpl = (ProcessImpl)rtProc.getProcess();
- ProcessInstance proc = rtProc.getProcess();
+ Process proc = rtProc.getProcess();
ProcessEngine engine = getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -36,10 +36,10 @@
import org.hibernate.cfg.AnnotationConfiguration;
import org.jbpm.api.NodeNotFoundException;
import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.service.Service;
import org.jbpm.api.service.preview.PersistenceService;
import org.jbpm.ri.model.AbstractElementImpl;
@@ -151,7 +151,7 @@
}
@Override
- public ObjectName saveProcess(ProcessInstance proc)
+ public ObjectName saveProcess(Process proc)
{
log.debug("START saveProcess: " + proc.getKey());
Session session = getSessionFactory().openSession();
@@ -170,15 +170,15 @@
}
@Override
- public ProcessInstance loadProcess(ObjectName procID)
+ public Process loadProcess(ObjectName procID)
{
log.debug("START loadProcess: " + procID);
- ProcessInstance proc = null;
+ Process proc = null;
Session session = getSessionFactory().openSession();
try
{
Integer id = Integer.valueOf(procID.getKeyProperty("id"));
- proc = (ProcessInstance)session.load(ProcessImpl.class, id);
+ proc = (Process)session.load(ProcessImpl.class, id);
AbstractElementImpl elImpl = (AbstractElementImpl)proc;
elImpl.initialize(session);
}
@@ -195,7 +195,7 @@
}
@Override
- public void deleteProcess(ProcessInstance proc)
+ public void deleteProcess(Process proc)
{
log.debug("START deleteProcess: " + proc);
Session session = getSessionFactory().openSession();
@@ -204,7 +204,7 @@
{
ObjectName procID = proc.getKey();
Integer id = Integer.valueOf(procID.getKeyProperty("id"));
- proc = (ProcessInstance)session.load(ProcessImpl.class, id);
+ proc = (Process)session.load(ProcessImpl.class, id);
session.delete(proc);
tx.commit();
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -30,10 +30,10 @@
import org.hibernate.Session;
import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.service.preview.PersistenceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -50,7 +50,7 @@
final Logger log = LoggerFactory.getLogger(InMemoryPersistenceServiceImpl.class);
private Map<ObjectName, ProcessDefinition> procDefs = new HashMap<ObjectName, ProcessDefinition>();
- private Map<ObjectName, ProcessInstance> procs = new HashMap<ObjectName, ProcessInstance>();
+ private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
private Map<ObjectName, Node> nodes = new HashMap<ObjectName, Node>();
@Override
@@ -89,7 +89,7 @@
}
@Override
- public ObjectName saveProcess(ProcessInstance proc)
+ public ObjectName saveProcess(Process proc)
{
procs.put(proc.getKey(), proc);
@@ -100,9 +100,9 @@
}
@Override
- public ProcessInstance loadProcess(ObjectName procID)
+ public Process loadProcess(ObjectName procID)
{
- ProcessInstance proc = procs.get(procID);
+ Process proc = procs.get(procID);
if (proc == null)
throw new ProcessNotFoundException("Cannot find process: " + procID);
@@ -110,7 +110,7 @@
}
@Override
- public void deleteProcess(ProcessInstance proc)
+ public void deleteProcess(Process proc)
{
procs.remove(proc.getKey());
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -23,14 +23,14 @@
// $Id$
+import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.ri.model.builder.ProcessBuilderImpl;
/**
- * The ProcessBuilder can be used to build a {@link ProcessInstance} dynamically.
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
*
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessDefinitionServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessDefinitionServiceImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessDefinitionServiceImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.service.ProcessDefinitionService;
import org.jbpm.ri.model.ProcessDefinitionImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -29,9 +29,9 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Process;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessInstance.ProcessStatus;
+import org.jbpm.api.client.Process.ProcessStatus;
import org.jbpm.api.service.ProcessInstanceService;
import org.jbpm.api.service.preview.PersistenceService;
import org.jbpm.ri.model.ProcessImpl;
@@ -73,7 +73,7 @@
}
@Override
- public ObjectName registerProcess(ProcessInstance proc)
+ public ObjectName registerProcess(Process proc)
{
ObjectName procID = super.registerProcess(proc);
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect/stp/sequence/SequenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect/stp/sequence/SequenceTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/dialect/stp/sequence/SequenceTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,7 +25,7 @@
import java.net.URL;
-import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.service.ProcessDefinitionService;
import org.jbpm.api.test.APITestCase;
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,9 +26,9 @@
import javax.management.ObjectName;
import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
import org.jbpm.api.service.preview.PersistenceService;
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -26,10 +26,10 @@
import javax.management.ObjectName;
import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
import org.jbpm.api.service.ProcessDefinitionService;
@@ -59,12 +59,12 @@
procDefService.registerProcessDefinition(procDef);
// Create and save the Process
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
service.saveProcess(proc);
// Load the process
ObjectName procID = proc.getKey();
- ProcessInstance loadProc = service.loadProcess(procID);
+ Process loadProc = service.loadProcess(procID);
ProcessCatalog.validateDefaultProcess(loadProc.getProcessDefinition());
StartEvent start = loadProc.getNode(StartEvent.class, "Start");
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -28,6 +28,7 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Execution;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
@@ -38,11 +39,10 @@
import org.jbpm.api.model.preview.InputSet;
import org.jbpm.api.model.preview.OutputSet;
import org.jbpm.api.model.preview.Assignment.AssignTime;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.FlowHandler;
-import org.jbpm.api.runtime.SignalHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.preview.ExecutionHandler;
+import org.jbpm.api.runtime.preview.FlowHandler;
+import org.jbpm.api.runtime.preview.SignalHandler;
+import org.jbpm.api.runtime.preview.TokenExecutor;
import org.jbpm.ri.model.AssignmentImpl;
import org.jbpm.ri.model.ExpressionImpl;
import org.jbpm.ri.model.InputSetImpl;
@@ -165,7 +165,7 @@
private static final long serialVersionUID = 1L;
@Override
- public void execute(Token token)
+ public void execute(Execution token)
{
}
@@ -213,12 +213,12 @@
}
@Override
- public void throwEnterSignal(Token token)
+ public void throwEnterSignal(Execution token)
{
}
@Override
- public void throwExitSignal(Token token)
+ public void throwExitSignal(Execution token)
{
}
}
@@ -255,7 +255,7 @@
}
@Override
- public void execute(TokenExecutor tokenExecutor, Token token)
+ public void execute(TokenExecutor tokenExecutor, Execution token)
{
}
}
Modified: projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,8 +25,8 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.Task.TaskType;
Modified: projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -15,10 +15,10 @@
import org.jboss.bpm.samples.airticket.client.OfferMessage;
import org.jboss.bpm.samples.airticket.client.OrderMessage;
import org.jboss.bpm.samples.airticket.client.RequestMessage;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.preview.MessageListener;
import org.jbpm.api.client.preview.SignalListener;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.builder.preview.MessageBuilder;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.model.preview.Message;
@@ -65,9 +65,9 @@
System.out.println("Create new Process");
AirticketProcessBuilder procBuilder = new AirticketProcessBuilder(sampleID);
ProcessDefinition procDef = procBuilder.buildProcessDefinition();
- ProcessInstance proc = procDef.newInstance();
+ Process proc = procDef.newInstance();
procService.registerProcess(proc);
- procID = proc.startProcess();
+ procID = proc.startProcessAsync();
httpSession.setAttribute("procID", procID);
}
Modified: projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-11-12 10:17:13 UTC (rev 2890)
+++ projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-11-12 11:00:17 UTC (rev 2891)
@@ -25,10 +25,10 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Process;
+import org.jbpm.api.client.ProcessDefinition;
import org.jbpm.api.client.preview.MessageListener;
import org.jbpm.api.client.preview.UserTaskCallback;
-import org.jbpm.api.model.ProcessInstance;
-import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.builder.preview.MessageBuilder;
import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.model.preview.Message;
@@ -53,7 +53,7 @@
private MessageService messageManager = MessageService.locateMessageService();
private AirticketMessageListener msgListener;
- private ProcessInstance proc;
+ private Process proc;
public void testValidData() throws Exception
{
@@ -68,7 +68,7 @@
userTask.setUserTaskCallback(new UserTaskCallbackImpl());
// Start the process and send the request message
- proc.startProcess();
+ proc.startProcessAsync();
Message reqMessage = getValidRequestMessage();
messageManager.sendMessage(proc.getKey(), AirticketProcessBuilder.TASK_RECEIVE_REQUEST, reqMessage);
@@ -94,7 +94,7 @@
userTask.setUserTaskCallback(new UserTaskCallbackImpl());
// Start the process and send the request message
- proc.startProcess();
+ proc.startProcessAsync();
Message reqMessage = getInvalidRequestMessage();
messageManager.sendMessage(proc.getKey(), AirticketProcessBuilder.TASK_RECEIVE_REQUEST, reqMessage);
17 years, 5 months
JBoss JBPM SVN: r2890 - in projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client: task and 1 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-11-12 05:17:13 -0500 (Wed, 12 Nov 2008)
New Revision: 2890
Modified:
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java
projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
Log:
Fix row selection models in instance list and task list
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-11-12 10:08:22 UTC (rev 2889)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/process/ProcessInstanceListEditor.java 2008-11-12 10:17:13 UTC (rev 2890)
@@ -29,6 +29,7 @@
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.PaddedPanel;
import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.TabPanel;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.form.DateField;
import com.gwtext.client.widgets.form.FieldSet;
@@ -38,6 +39,7 @@
import com.gwtext.client.widgets.grid.event.RowSelectionListenerAdapter;
import com.gwtext.client.widgets.layout.ColumnLayout;
import com.gwtext.client.widgets.layout.ColumnLayoutData;
+import com.gwtext.client.widgets.layout.FormLayout;
import org.jboss.bpm.console.client.Editor;
import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.UIConstants;
@@ -85,40 +87,65 @@
// ---------------
+ TabPanel tabPanel = new TabPanel();
+ tabPanel.setPaddings(10);
+ tabPanel.setPlain(true);
+ tabPanel.setActiveTab(0);
+ tabPanel.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
+
+ PaddedPanel tabPadding = new PaddedPanel(tabPanel, 0,10,0,10);
+
+ Panel detailsForm = assembleDetailsForm();
+
+ // ----------------------------------------
+
+ tabPanel.add(detailsForm);
+ tabPanel.add( new Panel("Advanced") );
+ // ----------------------------------
+
+ HelpPanel help = new HelpPanel(UIConstants.TEASER_PANEL_WIDTH, 200, "Managing process instances");
+
+ TeaserPanel teaserPanel = new TeaserPanel();
+ teaserPanel.add(help);
+
+ // ----------------------------------
+
+ leftHand.add(instanceList);
+ leftHand.add(tabPadding);
+
+ this.add(leftHand, new ColumnLayoutData(0.7) );
+ this.add(teaserPanel , new ColumnLayoutData(0.3) );
+
+ }
+
+ private Panel assembleDetailsForm()
+ {
+ // ---------------
+
Panel outerFormPanel = new Panel();
+ outerFormPanel.setTitle("Instance Details");
outerFormPanel.setBorder(false);
outerFormPanel.setFrame(false);
- outerFormPanel.setPaddings(10);
// ---------------
- final FormPanel formPanel = new FormPanel();
- formPanel.setLabelAlign(Position.LEFT);
- formPanel.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
- formPanel.setHeader(false);
- formPanel.setFrame(false);
- formPanel.setPaddings(5, 5, 5, 0);
- formPanel.setLabelWidth(120);
+ final FormPanel detailsForm = new FormPanel();
+ detailsForm.setLabelAlign(Position.LEFT);
+ detailsForm.setWidth(UIConstants.EDITOR_PANEL_WIDTH);
+ detailsForm.setHeader(false);
+ detailsForm.setFrame(false);
+ detailsForm.setBorder(false);
+ detailsForm.setPaddings(5, 5, 5, 0);
+ detailsForm.setLabelWidth(120);
// ---------------
- FieldSet fieldSet = new FieldSet();
- fieldSet.setLabelWidth(90);
- fieldSet.setTitle("Process Instance Details");
- fieldSet.setAutoHeight(true);
- fieldSet.setBorder(false);
+ detailsForm.add(new TextField("Id", "instanceId", 230));
+ detailsForm.add(new TextField("Key", "key", 230));
+ detailsForm.add(new TextField("State", "state", 230));
+ detailsForm.add(new DateField("Start Date", "startDate", 230));
+ detailsForm.add(new DateField("End Date", "endDate", 230));
- // ---------------
- //the field names must match the data field values from the Store
- fieldSet.add(new TextField("Id", "instanceId", 230));
- fieldSet.add(new TextField("Key", "key", 230));
- fieldSet.add(new TextField("State", "state", 230));
- fieldSet.add(new DateField("Start Date", "startDate", 230));
- fieldSet.add(new DateField("End Date", "endDate", 230));
- Panel inner = new PaddedPanel(fieldSet, 0, 10, 0, 0);
-
- formPanel.add(inner);
-
final Button suspendButton = new Button("Suspend",
new ButtonListenerAdapter()
{
@@ -128,9 +155,8 @@
selectedInstance.setState(ProcessInstance.STATE.SUSPENDED);
persistStateChange();
}
- }
- );
- //suspendButton.setIcon("images/icons/pause.png");
+ }
+ );
final Button resumeButton = new Button("Resume",
new ButtonListenerAdapter()
@@ -143,11 +169,10 @@
}
}
);
- //resumeButton.setIcon("images/icons/play.png");
-
- formPanel.addButton(suspendButton);
- formPanel.addButton(resumeButton);
+ detailsForm.addButton(suspendButton);
+ detailsForm.addButton(resumeButton);
+
// ----------------
final RowSelectionModel sm = new RowSelectionModel(true);
@@ -168,30 +193,15 @@
suspendButton.enable();
}
- formPanel.getForm().loadRecord(record);
- formPanel.doLayout();
+ detailsForm.getForm().loadRecord(record);
+ detailsForm.doLayout();
}
}
);
instanceList.setRowSelectionModel(sm);
-
- outerFormPanel.add(formPanel);
- // ----------------------------------
-
- HelpPanel help = new HelpPanel(UIConstants.TEASER_PANEL_WIDTH, 200, "Managing process instances");
-
- TeaserPanel teaserPanel = new TeaserPanel();
- teaserPanel.add(help);
-
- // ----------------------------------
-
- leftHand.add(instanceList);
- leftHand.add(outerFormPanel);
-
- this.add(leftHand, new ColumnLayoutData(0.7) );
- this.add(teaserPanel , new ColumnLayoutData(0.3) );
-
+ outerFormPanel.add(detailsForm);
+ return outerFormPanel;
}
private void persistStateChange()
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java 2008-11-12 10:08:22 UTC (rev 2889)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/task/TaskList.java 2008-11-12 10:17:13 UTC (rev 2890)
@@ -34,6 +34,7 @@
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.grid.*;
+import com.gwtext.client.widgets.grid.event.GridCellListener;
import org.jboss.bpm.console.client.MainView;
import org.jboss.bpm.console.client.UIConstants;
import org.jboss.bpm.console.client.model.DTOParser;
@@ -56,7 +57,8 @@
private String title;
private RowSelectionModel rowSelectionModel;
public static final int PAGE_SIZE = 15;
-
+ private int selectedRowIndex = -1;
+
public TaskList(String titleName, final MainView view)
{
this.mainView = view;
@@ -305,8 +307,12 @@
{
grid.setSelectionModel(rowSelectionModel);
grid.doOnRender(new Function() {
- public void execute() {
- rowSelectionModel.selectFirstRow();
+ public void execute()
+ {
+ if(-1==selectedRowIndex)
+ rowSelectionModel.selectFirstRow();
+ else
+ rowSelectionModel.selectRow(selectedRowIndex);
}
}, 10);
}
@@ -317,7 +323,7 @@
grid.setEnableHdMenu(false);
grid.setBottomToolbar(createToolbar(store));
-
+
return grid;
}
@@ -327,7 +333,7 @@
pagingToolbar.setPageSize(PAGE_SIZE);
pagingToolbar.setDisplayInfo(true);
pagingToolbar.setDisplayMsg("{0} - {1} of {2}");
-
+
pagingToolbar.addSeparator();
pagingToolbar.addSpacer();
@@ -350,4 +356,23 @@
{
this.rowSelectionModel = model;
}
+
+ public class ListViewCellListener implements GridCellListener
+ {
+ public void onCellClick(GridPanel grid, int rowIndex, int colindex, EventObject e)
+ {
+ selectedRowIndex = rowIndex;
+ }
+
+
+ public void onCellContextMenu(GridPanel gridPanel, int i, int i1, EventObject eventObject)
+ {
+
+ }
+
+ public void onCellDblClick(GridPanel gridPanel, int i, int i1, EventObject eventObject)
+ {
+
+ }
+ }
}
Modified: projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java
===================================================================
--- projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2008-11-12 10:08:22 UTC (rev 2889)
+++ projects/gwt-console/trunk/war/src/main/java/org/jboss/bpm/console/client/widgets/RemoteListView.java 2008-11-12 10:17:13 UTC (rev 2890)
@@ -22,6 +22,7 @@
package org.jboss.bpm.console.client.widgets;
import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.Function;
import com.gwtext.client.data.*;
import com.gwtext.client.data.event.StoreListenerAdapter;
import com.gwtext.client.widgets.*;
@@ -124,6 +125,18 @@
grid.stripeRows(true);
grid.setLoadMask(true);
+ if(rowSelectionModel!=null)
+ {
+ grid.setSelectionModel(rowSelectionModel);
+ grid.doOnRender(new Function() {
+ public void execute() {
+ if(-1==selectedRowIndex)
+ rowSelectionModel.selectFirstRow();
+ else
+ rowSelectionModel.selectRow(selectedRowIndex);
+ }
+ }, 10);
+ }
grid.addGridCellListener( new ListViewCellListener() );
return grid;
17 years, 5 months
JBoss JBPM SVN: r2889 - in projects/spec/trunk/modules: api/src/main/java/org/jbpm/api/client and 55 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-12 05:08:22 -0500 (Wed, 12 Nov 2008)
New Revision: 2889
Added:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Configuration.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/internal/
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/internal/MicrocontainerConfiguration.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/Deployment.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/MessageListener.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/SignalListener.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/UserTaskCallback.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/EventBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/GatewayBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/GroupBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/MessageBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/ObjectNameFactory.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/SignalBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Assignment.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ComplexGateway.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Group.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InclusiveGateway.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InputSet.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Message.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/OutputSet.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ParallelGateway.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Participant.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Property.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ReceiveTask.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/SendTask.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Signal.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/UserTask.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessInstanceService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/DeploymentService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/PersistenceService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/ProcessEngineRegistry.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/SignalBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/SignalService.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/endevent/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/executioncontext/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/process/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/service/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/service/signal/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/startevent/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/receive/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/receive/ReceiveTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/send/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/send/SendTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskCallbackTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/
projects/spec/trunk/modules/ri/src/main/resources/org.jbpm.api.client.Configuration
Removed:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Deployment.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/config/
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ComplexGateway.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Group.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InclusiveGateway.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InputSet.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Message.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/OutputSet.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ParallelGateway.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Property.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ReceiveTask.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/SendTask.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Signal.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/EventBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GroupBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ObjectNameFactory.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SignalBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/transaction/
projects/spec/trunk/modules/ri/src/main/resources/org.jbpm.api.config.Configuration
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gate.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/ProcessStructure.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/PropertySupport.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestCase.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestHelper.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java
projects/spec/trunk/modules/cts/pom.xml
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/endevent/EndEventMessageTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/executioncontext/ExecutionContextTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeInputSetTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeOutputSetTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodePropertyTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/process/ProcessPropertyTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/service/signal/SignalMultithreadTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/service/signal/SignalServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/startevent/StartEventSignalTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequencePersistenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java
projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java
projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java
projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBAssignment.java
projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBGroup.java
projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBSignal.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AssignmentImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GateImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GroupImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InputSetImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MessageImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/OutputSetImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParticipantImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertyImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertySupportImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SignalImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/EventBuilderImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/GatewayBuilderImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/GroupBuilderImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MessageBuilderImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SignalBuilderImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/MessageBuilderServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/SignalBuilderServiceImpl.java
projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/SignalServiceImpl.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ComplexGatewayPersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/EndEventPersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/InclusiveGatewayPersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/NodePersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ParallelGatewayPersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/StartEventPersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java
projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/UserTaskPersistenceTest.java
projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java
projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java
projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
Log:
Add API preview packages
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Configuration.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Configuration.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Configuration.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client;
+
+
+// $Id$
+
+/**
+ * The Configuration provides a ProcessEngine through a given
+ * configuration method
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public interface Configuration
+{
+ /**
+ * Create a new instance of ProcessEngine for this configuration
+ * @return The configured instance of a process engine
+ */
+ ProcessEngine getProcessEngine();
+
+ /**
+ * Get a ProcessEngine with a given name from this configuration
+ * @return The configured instance of a process engine
+ */
+ ProcessEngine getProcessEngine(String engineName);
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Configuration.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Deployment.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Deployment.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Deployment.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,125 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.service.DialectHandler;
-import org.jbpm.api.service.DialectHandlerService;
-import org.jbpm.api.service.ProcessService;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * A deployment, containing all information to create a process that will be deployed to the {@link ProcessService}
- *
- * @author Tom Baeyens
- * @author thomas.diesler(a)jboss.com
- * @since 25-Sep-2008
- */
-public class Deployment implements Serializable
-{
- private static final long serialVersionUID = 1L;
-
- private String procXML;
- private ProcessDefinition process;
-
- public Deployment(String procXML)
- {
- if (procXML == null)
- throw new IllegalArgumentException("Null process definition");
-
- this.procXML = procXML;
- }
-
- public Deployment(URL procURL) throws IOException
- {
- if (procURL == null)
- throw new IllegalArgumentException("Null process definition");
-
- StringBuilder strBuilder = new StringBuilder();
- BufferedReader br = new BufferedReader(new InputStreamReader(procURL.openStream()));
- String line = br.readLine();
- while (line != null)
- {
- strBuilder.append(line);
- line = br.readLine();
- }
- procXML = strBuilder.toString();
- }
-
- public Deployment(ProcessDefinition procDef)
- {
- this.process = procDef;
- }
-
- public ProcessDefinition getProcessDefinition(ProcessEngine engine)
- {
- if (process == null)
- {
- DialectHandlerService dhService = engine.getService(DialectHandlerService.class);
- if (dhService == null)
- throw new IllegalStateException("DialectHandlerService not registered");
-
- URI nsURI = getNamespaceURI();
- DialectHandler dialectHandler = dhService.getDialectHandler(nsURI);
- if (dialectHandler == null)
- throw new IllegalStateException("Cannot obtain DialectHandler for: " + nsURI);
-
- process = dialectHandler.createProcess(procXML);
- }
- return process;
- }
-
- private URI getNamespaceURI()
- {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
- Document doc;
- try
- {
- DocumentBuilder db = dbf.newDocumentBuilder();
- doc = db.parse(new ByteArrayInputStream(procXML.getBytes()));
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot parse process descriptor", ex);
- }
-
- Element root = doc.getDocumentElement();
- String nsURI = root.getNamespaceURI();
- if (nsURI == null)
- throw new IllegalStateException("Cannot get namespace URI from root element");
-
- return URI.create(nsURI);
- }
-}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.model.Message;
-
-//$Id$
-
-/**
- * A MessageListener that can be registered with the ProcessEngine
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface MessageListener
-{
- /**
- * Get the id for this listener
- */
- ObjectName getKey();
-
- /**
- * Catch a message from the process that this listener is registered with
- */
- void catchMessage(Message message);
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -29,10 +29,9 @@
import java.util.HashSet;
import java.util.Set;
-import org.jbpm.api.config.Configuration;
-import org.jbpm.api.config.MicrocontainerConfiguration;
-import org.jbpm.api.service.ProcessEngineRegistry;
+import org.jbpm.api.client.internal.MicrocontainerConfiguration;
import org.jbpm.api.service.Service;
+import org.jbpm.api.service.preview.ProcessEngineRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-//$Id$
-
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.service.SignalService;
-
-/**
- * A signal listener that can be registered with the {@link SignalService}
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface SignalListener
-{
- /**
- * Returns true if the listener accepts a given signal
- */
- boolean acceptSignal(Signal signal);
-
- /**
- * Catch a previously accepted signal
- */
- void catchSignal(Signal signal);
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,132 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.UserTask;
-import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.model.builder.ObjectNameFactory;
-import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.BasicAttachments;
-import org.jbpm.api.service.MessageBuilderService;
-import org.jbpm.api.service.MessageService;
-
-/**
- * A callback that can be attached to a {@link UserTask} to facilitate message handling;
- *
- * The callback registers a {@link MessageListener}, extracts the data from the received message
- * and calls the user provided 'callback' method. The response message is then constructed from
- * the user provided data and automatically sent back to the {@link UserTask}.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Oct-2008
- */
-public abstract class UserTaskCallback
-{
- private MessageListener messageListener;
-
- /**
- * Get the associated MessageListener
- */
- public MessageListener getMessageListener()
- {
- return messageListener;
- }
-
- /**
- * Attached this callback to the user task
- */
- public void attach(UserTask userTask)
- {
- userTask.setUserTaskCallback(this);
-
- messageListener = new CallbackMessageListener(userTask);
-
- MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
- msgService.addMessageListener(messageListener);
- }
-
- /**
- * Detach this callback from the user task
- */
- public void detach(UserTask userTask)
- {
- MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
- msgService.removeMessageListener(messageListener.getKey());
- }
-
- public abstract void callback(Attachments att);
-
- class CallbackMessageListener implements MessageListener
- {
- private UserTask userTask;
-
- public CallbackMessageListener(UserTask userTask)
- {
- this.userTask = userTask;
- }
-
- @Override
- public void catchMessage(Message msg)
- {
- // Get the message data
- Attachments att = new BasicAttachments();
- for (String propName : msg.getPropertyNames())
- {
- String value = msg.getProperty(propName).getValue();
- att.addAttachment(propName, value);
- }
-
- // Call the user callback
- callback(att);
-
- // Build the response message
- Message msgRef = userTask.getInMessageRef();
- MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
- msgBuilder.newMessage(msgRef.getName());
- for (String propName : msgRef.getPropertyNames())
- {
- Object value = att.getAttachment(propName);
- if (value == null)
- throw new IllegalStateException("Cannot obtain required property: " + propName);
- msgBuilder.addProperty(propName, value);
- }
- Message resMessage = msgBuilder.getMessage();
-
- MessageService msgService = MessageService.locateMessageService();
-
- ObjectName procID = userTask.getProcess().getKey();
- msgService.sendMessage(procID, userTask.getName(), resMessage);
- }
-
- @Override
- public ObjectName getKey()
- {
- String oname = userTask.getKey().getCanonicalName();
- return ObjectNameFactory.create(oname + ",msgListener=UserTaskCallback");
- }
- }
-}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client.internal;
+
+// $Id$
+
+import java.net.URL;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
+import org.jboss.kernel.plugins.util.KernelLocator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Boostrap the Microcontainer
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-Jun-2008
+ */
+public class EmbeddedBeansDeployer extends BasicBootstrap
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(EmbeddedBeansDeployer.class);
+
+ private Kernel kernel;
+ private BasicXMLDeployer deployer;
+
+ public EmbeddedBeansDeployer()
+ {
+ // Get or bootstrap the kernel
+ kernel = KernelLocator.getKernel();
+ if (kernel == null)
+ {
+ try
+ {
+ super.bootstrap();
+ kernel = super.getKernel();
+ log.debug("bootstrap kernel: " + kernel);
+ }
+ catch (Throwable e)
+ {
+ throw new IllegalStateException("Cannot bootstrap kernel", e);
+ }
+ }
+ deployer = new BasicXMLDeployer(kernel);
+ }
+
+ /**
+ * Deploy MC beans from URL
+ */
+ public void deploy(URL url)
+ {
+ log.debug("deploy: " + url);
+ try
+ {
+ deployer.deploy(url);
+ deployer.validate();
+
+ // The KernelLocator is expected to get deployed as a bean
+ if (KernelLocator.getKernel() == null)
+ throw new IllegalStateException("KernelLocator not deployed as MC bean");
+
+ }
+ catch (Throwable e)
+ {
+ throw new IllegalStateException("Cannot deploy beans from: " + url, e);
+ }
+ }
+
+ /**
+ * Undeploy MC beans from URL
+ */
+ public void undeploy(URL url)
+ {
+ log.debug("undeploy: " + url);
+ try
+ {
+ deployer.undeploy(url);
+ }
+ catch (Throwable e)
+ {
+ throw new IllegalStateException("Cannot undeploy beans from: " + url, e);
+ }
+ }
+}
\ No newline at end of file
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/internal/MicrocontainerConfiguration.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/internal/MicrocontainerConfiguration.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/internal/MicrocontainerConfiguration.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client.internal;
+
+//$Id$
+
+import java.net.URL;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.util.KernelLocator;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jbpm.api.client.Configuration;
+import org.jbpm.api.client.ProcessEngine;
+
+/**
+ * The ProcessEngineProvider provides a ProcessEngine through a given configuration method
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class MicrocontainerConfiguration implements Configuration
+{
+ /** The process engine bean name - jBPMEngine */
+ public static final String BEAN_NAME = "jBPMProcessEngine";
+ /** The default bean config: jbpm-cfg-beans.xml */
+ public static final String JBPM_ENGINE_CONFIG = "jbpm-cfg-beans.xml";
+
+ // Everything gets deployed through one deployer
+ private static EmbeddedBeansDeployer beansDeployer = new EmbeddedBeansDeployer();
+
+ public Configuration deployDefaultConfig()
+ {
+ URL cfgURL = getDefaultConfigURL();
+ beansDeployer.deploy(cfgURL);
+ return this;
+ }
+
+ public void undeployDefaultConfig()
+ {
+ URL cfgURL = getDefaultConfigURL();
+ beansDeployer.undeploy(cfgURL);
+ }
+
+ public Configuration deployBeansConfig(URL cfgURL)
+ {
+ beansDeployer.deploy(cfgURL);
+ return this;
+ }
+
+ public void undeployBeansConfig(URL cfgURL)
+ {
+ beansDeployer.undeploy(cfgURL);
+ }
+
+ /**
+ * Get the default ProcessEngine from this configuration
+ * @return The configured instance of a process engine
+ */
+ public ProcessEngine getProcessEngine()
+ {
+ return getProcessEngine(BEAN_NAME);
+ }
+
+ /**
+ * Get a ProcessEngine with a given name from this configuration
+ * @return The configured instance of a process engine
+ */
+ @SuppressWarnings("deprecation")
+ public ProcessEngine getProcessEngine(String beanName)
+ {
+ Kernel kernel = KernelLocator.getKernel();
+ if (kernel == null)
+ {
+ deployDefaultConfig();
+ kernel = KernelLocator.getKernel();
+ }
+
+ KernelRegistryEntry entry = kernel.getRegistry().getEntry(beanName);
+ ProcessEngine engine = (ProcessEngine)entry.getTarget();
+ return engine;
+ }
+
+ private URL getDefaultConfigURL()
+ {
+ URL cfgURL = Thread.currentThread().getContextClassLoader().getResource(JBPM_ENGINE_CONFIG);
+ if (cfgURL == null)
+ throw new IllegalStateException("Cannot find resource: " + JBPM_ENGINE_CONFIG);
+ return cfgURL;
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/internal/MicrocontainerConfiguration.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/Deployment.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Deployment.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/Deployment.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/Deployment.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client.preview;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Serializable;
+import java.net.URI;
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.service.DialectHandler;
+import org.jbpm.api.service.DialectHandlerService;
+import org.jbpm.api.service.ProcessInstanceService;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * A deployment, containing all information to create a process that will be deployed to the {@link ProcessInstanceService}
+ *
+ * @author Tom Baeyens
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Sep-2008
+ */
+public class Deployment implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private String procXML;
+ private ProcessDefinition process;
+
+ public Deployment(String procXML)
+ {
+ if (procXML == null)
+ throw new IllegalArgumentException("Null process definition");
+
+ this.procXML = procXML;
+ }
+
+ public Deployment(URL procURL) throws IOException
+ {
+ if (procURL == null)
+ throw new IllegalArgumentException("Null process definition");
+
+ StringBuilder strBuilder = new StringBuilder();
+ BufferedReader br = new BufferedReader(new InputStreamReader(procURL.openStream()));
+ String line = br.readLine();
+ while (line != null)
+ {
+ strBuilder.append(line);
+ line = br.readLine();
+ }
+ procXML = strBuilder.toString();
+ }
+
+ public Deployment(ProcessDefinition procDef)
+ {
+ this.process = procDef;
+ }
+
+ public ProcessDefinition getProcessDefinition(ProcessEngine engine)
+ {
+ if (process == null)
+ {
+ DialectHandlerService dhService = engine.getService(DialectHandlerService.class);
+ if (dhService == null)
+ throw new IllegalStateException("DialectHandlerService not registered");
+
+ URI nsURI = getNamespaceURI();
+ DialectHandler dialectHandler = dhService.getDialectHandler(nsURI);
+ if (dialectHandler == null)
+ throw new IllegalStateException("Cannot obtain DialectHandler for: " + nsURI);
+
+ process = dialectHandler.createProcess(procXML);
+ }
+ return process;
+ }
+
+ private URI getNamespaceURI()
+ {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ Document doc;
+ try
+ {
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ doc = db.parse(new ByteArrayInputStream(procXML.getBytes()));
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot parse process descriptor", ex);
+ }
+
+ Element root = doc.getDocumentElement();
+ String nsURI = root.getNamespaceURI();
+ if (nsURI == null)
+ throw new IllegalStateException("Cannot get namespace URI from root element");
+
+ return URI.create(nsURI);
+ }
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/MessageListener.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/MessageListener.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/MessageListener.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client.preview;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.preview.Message;
+
+//$Id$
+
+/**
+ * A MessageListener that can be registered with the ProcessEngine
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MessageListener
+{
+ /**
+ * Get the id for this listener
+ */
+ ObjectName getKey();
+
+ /**
+ * Catch a message from the process that this listener is registered with
+ */
+ void catchMessage(Message message);
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/SignalListener.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/SignalListener.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/SignalListener.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client.preview;
+
+//$Id$
+
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.service.preview.SignalService;
+
+/**
+ * A signal listener that can be registered with the {@link SignalService}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalListener
+{
+ /**
+ * Returns true if the listener accepts a given signal
+ */
+ boolean acceptSignal(Signal signal);
+
+ /**
+ * Catch a previously accepted signal
+ */
+ void catchSignal(Signal signal);
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/UserTaskCallback.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/UserTaskCallback.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/UserTaskCallback.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/preview/UserTaskCallback.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,132 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client.preview;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.UserTask;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.preview.MessageBuilderService;
+import org.jbpm.api.service.preview.MessageService;
+
+/**
+ * A callback that can be attached to a {@link UserTask} to facilitate message handling;
+ *
+ * The callback registers a {@link MessageListener}, extracts the data from the received message
+ * and calls the user provided 'callback' method. The response message is then constructed from
+ * the user provided data and automatically sent back to the {@link UserTask}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Oct-2008
+ */
+public abstract class UserTaskCallback
+{
+ private MessageListener messageListener;
+
+ /**
+ * Get the associated MessageListener
+ */
+ public MessageListener getMessageListener()
+ {
+ return messageListener;
+ }
+
+ /**
+ * Attached this callback to the user task
+ */
+ public void attach(UserTask userTask)
+ {
+ userTask.setUserTaskCallback(this);
+
+ messageListener = new CallbackMessageListener(userTask);
+
+ MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
+ msgService.addMessageListener(messageListener);
+ }
+
+ /**
+ * Detach this callback from the user task
+ */
+ public void detach(UserTask userTask)
+ {
+ MessageService msgService = userTask.getProcessEngine().getService(MessageService.class);
+ msgService.removeMessageListener(messageListener.getKey());
+ }
+
+ public abstract void callback(Attachments att);
+
+ class CallbackMessageListener implements MessageListener
+ {
+ private UserTask userTask;
+
+ public CallbackMessageListener(UserTask userTask)
+ {
+ this.userTask = userTask;
+ }
+
+ @Override
+ public void catchMessage(Message msg)
+ {
+ // Get the message data
+ Attachments att = new BasicAttachments();
+ for (String propName : msg.getPropertyNames())
+ {
+ String value = msg.getProperty(propName).getValue();
+ att.addAttachment(propName, value);
+ }
+
+ // Call the user callback
+ callback(att);
+
+ // Build the response message
+ Message msgRef = userTask.getInMessageRef();
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
+ msgBuilder.newMessage(msgRef.getName());
+ for (String propName : msgRef.getPropertyNames())
+ {
+ Object value = att.getAttachment(propName);
+ if (value == null)
+ throw new IllegalStateException("Cannot obtain required property: " + propName);
+ msgBuilder.addProperty(propName, value);
+ }
+ Message resMessage = msgBuilder.getMessage();
+
+ MessageService msgService = MessageService.locateMessageService();
+
+ ObjectName procID = userTask.getProcess().getKey();
+ msgService.sendMessage(procID, userTask.getName(), resMessage);
+ }
+
+ @Override
+ public ObjectName getKey()
+ {
+ String oname = userTask.getKey().getCanonicalName();
+ return ObjectNameFactory.create(oname + ",msgListener=UserTaskCallback");
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-import java.io.Serializable;
-
-
-//$Id$
-
-/**
- * An Assignment, which is used in the definition of attributes for Process,
- * Activity, Event, Gateway, and Gate.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface Assignment extends Serializable
-{
- public enum AssignTime
- {
- Start, End
- }
-
- /**
- * The target for the Assignment MUST be a Property of the Process or the activity
- * itself.
- */
- Property getTo();
-
- /**
- * The Expression MUST be made up of a combination of Values, Properties, and
- * Attributes, which are separated by operators such as add or multiply. The expression
- * language is defined in the ExpressionLanguage attribute of the Business Process
- * Diagram
- */
- Expression getFrom();
-
- /**
- * An Assignment MAY have a AssignTime setting. If the Object is an activity (Task,
- * Sub-Process, or Process), then the Assignment MUST have an AssignTime.
- * A value of Start means that the assignment SHALL occur at the start of the activity.
- * This can be used to assign the higher-level (global) Properties of the Process to the
- * (local) Properties of the activity as an input to the activity.
- * A value of End means that the assignment SHALL occur at the end of the activity.
- * This can be used to assign the (local) Properties of the activity to the higher-level
- * (global) Properties of the Process as an output to the activity.
- */
- AssignTime getAssignTime();
-}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ComplexGateway.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ComplexGateway.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ComplexGateway.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-// $Id$
-
-/**
- * A Complex Gateway handles situations that are not easily handled through the other types of Gateways. Complex
- * Gateways can also be used to combine a set of linked simple Gateways into a single, more compact situation. Modelers
- * can provide complex expressions that determine the merging and/or splitting behavior of the Gateway.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface ComplexGateway extends Gateway
-{
- /**
- * If there are multiple incoming Sequence Flow, an IncomingCondition expression
- * MUST be set by the modeler. This will consist of an expression that can reference
- * Sequence Flow names and/or Process Properties (Data).
- */
- Expression getIncommingCondition();
-
- /**
- * If there are multiple outgoing Sequence Flow, an OutgoingCondition expression
- * MUST be set by the modeler. This will consist of an expression that can reference
- * (outgoing) Sequence Flow Ids and/or Process Properties (Data).
- */
- Expression getOutgoingCondition();
-
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Event.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -21,7 +21,10 @@
*/
package org.jbpm.api.model;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Signal;
+
//$Id$
/**
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gate.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gate.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Gate.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,6 +25,8 @@
import java.util.List;
+import org.jbpm.api.model.preview.Assignment;
+
/**
* There MAY be zero or more Gates (except where noted below). Zero Gates are
* allowed if the Gateway is last object in a Process flow and there are no Start or
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Group.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Group.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Group.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import java.io.Serializable;
-
-import org.jbpm.api.model.internal.PropertySupport;
-
-/**
- * The Group object is an Artifact that provides a visual mechanism to group elements of a diagram informally. The
- * grouping is tied to the Category supporting element (which is an attribute of all BPMN elements). That is, a Group is a
- * visual depiction of a single Category. The graphical elements within the Group will be assigned the Category of the
- * Group.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 30-Oct-2008
- */
-public interface Group extends PropertySupport, Serializable
-{
- /**
- * The supported group types
- */
- enum GroupType { None, Transaction };
-
- /**
- * Name is an attribute that is text description of the Group.
- */
- String getName();
-
- /**
- * Get the group type for this group
- */
- GroupType getGroupType();
-}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InclusiveGateway.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InclusiveGateway.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InclusiveGateway.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-/**
- * This Decision represents a branching point where Alternatives are based on conditional expressions contained within
- * outgoing Sequence Flow. However, in this case, the True evaluation of one condition expression does not exclude the
- * evaluation of other condition expressions. All Sequence Flow with a True evaluation will be traversed by a Token. In
- * some sense it’s like a grouping of related independent Binary (Yes/No) Decisions--and can be modeled that way. Since
- * each path is independent, all combinations of the paths may be taken, from zero to all. However, it should be
- * designed so that at least one path is taken.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface InclusiveGateway extends Gateway
-{
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InputSet.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InputSet.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InputSet.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-import org.jbpm.api.model.internal.PropertySupport;
-
-
-//$Id$
-
-/**
- * An InputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
- *
- * @author thomas.diesler(a)jboss.com
- * @since 21-Jul-2008
- */
-public interface InputSet extends PropertySupport
-{
-}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Message.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Message.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Message.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-import java.io.Serializable;
-
-import org.jbpm.api.model.internal.PropertySupport;
-
-
-
-//$Id$
-
-/**
- * A Message, which is used in the definition of attributes for a StartEvent,
- * EndEvent, IntermediateEvent, Task, and MessageFlow
- *
- * @author thomas.diesler(a)jboss.com
- * @since 21-Jul-2008
- */
-public interface Message extends PropertySupport, Serializable
-{
- /**
- * Name is an attribute that is text description of the Message.
- */
- String getName();
-
- /**
- * This defines the source of the Message.
- */
- Participant getFromRef();
-
- /**
- * This defines the target of the Message.
- */
- Participant getToRef();
-}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -27,6 +27,8 @@
import org.jbpm.api.model.internal.AbstractElement;
import org.jbpm.api.model.internal.PropertySupport;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Group;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.SignalHandler;
@@ -47,7 +49,7 @@
/**
* Get the associated process
*/
- Process getProcess();
+ ProcessInstance getProcess();
/**
* Get the unique name.
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/OutputSet.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/OutputSet.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/OutputSet.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-import org.jbpm.api.model.internal.PropertySupport;
-
-
-//$Id$
-
-/**
- * An OuputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
- *
- * @author thomas.diesler(a)jboss.com
- * @since 21-Jul-2008
- */
-public interface OutputSet extends PropertySupport
-{
-}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ParallelGateway.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ParallelGateway.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ParallelGateway.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-// $Id$
-
-/**
- * Parallel Gateway is required when two or more Activities need to be executed in parallel.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface ParallelGateway extends Gateway
-{
-
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import java.io.Serializable;
-
-import javax.management.ObjectName;
-
-
-/**
- * A Participant, which is used in the definition of attributes for a Pool, {@link Message}, and WebService
- *
- * @author thomas.diesler(a)jboss.com
- * @since 21-Jul-2008
- */
-public interface Participant extends Serializable
-{
- /**
- * The name of this participant
- */
- ObjectName getName();
-}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.model.internal.ProcessStructure;
-import org.jbpm.api.runtime.Attachments;
-
-/**
- * A Process is any Activity performed within a company or organization.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface Process extends ProcessStructure
-{
- /**
- * Defines the status a {@link Process} can be in
- */
- public enum ProcessStatus
- {
- None, Ready, Active, Cancelled, Aborting, Aborted, Completing, Completed
- }
-
- /**
- * Get the associated ProcessDefinition
- */
- ProcessDefinition getProcessDefinition();
-
- /**
- * Get the process state
- */
- ProcessStatus getProcessStatus();
-
- /**
- * Start the process
- */
- ObjectName startProcess();
-
- /**
- * Start the process, with a given execution context
- */
- ObjectName startProcess(Attachments att);
-
- /**
- * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
- * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends without
- * timeout.
- */
- ProcessStatus waitForEnd();
-
- /**
- * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
- * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends with a
- * given timeout.
- */
- ProcessStatus waitForEnd(long timeout);
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessDefinition.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -36,6 +36,6 @@
/**
* Create a new instance of this process definition
*/
- Process newInstance();
+ ProcessInstance newInstance();
}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ProcessInstance.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.runtime.Attachments;
+
+/**
+ * A Process is any Activity performed within a company or organization.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ProcessInstance extends ProcessStructure
+{
+ /**
+ * Defines the status a {@link ProcessInstance} can be in
+ */
+ public enum ProcessStatus
+ {
+ None, Ready, Active, Cancelled, Aborting, Aborted, Completing, Completed
+ }
+
+ /**
+ * Get the associated ProcessDefinition
+ */
+ ProcessDefinition getProcessDefinition();
+
+ /**
+ * Get the process state
+ */
+ ProcessStatus getProcessStatus();
+
+ /**
+ * Start the process
+ */
+ ObjectName startProcess();
+
+ /**
+ * Start the process, with a given execution context
+ */
+ ObjectName startProcess(Attachments att);
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
+ * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends without
+ * timeout.
+ */
+ ProcessStatus waitForEnd();
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
+ * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends with a
+ * given timeout.
+ */
+ ProcessStatus waitForEnd(long timeout);
+}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Property.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Property.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Property.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-import java.io.Serializable;
-
-// $Id$
-
-/**
- * A Property, which is used in the definition of attributes for a Process and common activity attributes
- *
- * @author thomas.diesler(a)jboss.com
- * @since 21-Jul-2008
- */
-public interface Property extends Serializable
-{
- /**
- * Each Property has a Name (e.g., name=”Customer Name”).
- */
- String getName();
-
- /**
- * Get the property value.
- */
- String getValue();
-
- /**
- * If the Correlation attribute is set to True, then the Property is marked to be used for
- * correlation (e.g., for incoming Messages).
- */
- boolean isCorrelation();
-}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ReceiveTask.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ReceiveTask.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ReceiveTask.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-/**
- * A Receive Task is a simple Task that is designed to wait for a message to arrive from an external participant
- * (relative to the Business Process). Once the message has been received, the Task is completed.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface ReceiveTask extends Task
-{
- /**
- * A Message for the MessageRef attribute MUST be entered. This indicates that the Message will be received by the
- * Task. The Message in this context is equivalent to an in-only message pattern (Web service). One or more
- * corresponding incoming Message Flows MAY be shown on the diagram. However, the display of the Message Flow is not
- * required. The Message is applied to all incoming Message Flow, but can arrive for only one of the incoming Message
- * Flow for a single instance of the Task.
- */
- Message getMessageRef();
-
- /**
- * Receive Tasks can be defined as the instantiation mechanism for the Process with the Instantiate attribute. This
- * attribute MAY be set to true if the Task is the first activity after the Start Event or a starting Task if there is
- * no Start Event (i.e., there are no incoming Sequence Flow). Multiple Tasks MAY have this attribute set to True.
- */
- boolean isInstantiate();
-
- /**
- * This attribute specifies the technology that will be used to send or receive the message. A Web service is the
- * default technology.
- */
- //Implementation getImplementation();
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/SendTask.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/SendTask.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/SendTask.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-/**
- * A Send Task.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface SendTask extends Task
-{
- /**
- * A Message for the MessageRef attribute MUST be entered. This indicates that the Message will be sent by the Task. The Message in this context is equivalent to an
- * out-only message pattern (Web service). One or more corresponding outgoing Message Flow MAY be shown on the diagram. However, the display of the Message Flow is
- * not required. The Message is applied to all outgoing Message Flow and the Message will be sent down all outgoing Message Flow at the completion of a single
- * instance of the Task.
- */
- Message getMessageRef();
-
- /**
- * This attribute specifies the technology that will be used to send or receive the message. A Web service is the default technology.
- */
- // Implementation getImplementation();
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Signal.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Signal.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Signal.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-//$Id$
-
-import java.io.Serializable;
-
-import javax.management.ObjectName;
-
-/**
- * A Signal is like an undirected flare shot up
- * into the air.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface Signal extends Serializable
-{
- /**
- * Defines the types of supported Signals
- */
- enum SignalType
- {
- SYSTEM_START_EVENT_ENTER, SYSTEM_START_EVENT_EXIT, SYSTEM_START_TRIGGER,
- SYSTEM_EVENT_ENTER, SYSTEM_EVENT_EXIT, SYSTEM_EVENT_TRIGGER,
- SYSTEM_END_EVENT_ENTER, SYSTEM_END_EVENT_EXIT, SYSTEM_END_TRIGGER,
- SYSTEM_GATEWAY_ENTER, SYSTEM_GATEWAY_EXIT,
- SYSTEM_PROCESS_ENTER, SYSTEM_PROCESS_EXIT,
- SYSTEM_TASK_ENTER, SYSTEM_TASK_EXIT, SYSTEM_TASK_TRIGGER,
- USER_SIGNAL
- }
-
- /**
- * Get the signal type of this signal
- */
- SignalType getSignalType();
-
- /**
- * Get the sending participant for this signal
- */
- ObjectName getFromRef();
-
- /**
- * Get the optional message associated with this signal
- */
- public String getMessage();
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Task.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,7 +25,10 @@
import java.util.List;
+import org.jbpm.api.model.preview.InputSet;
+import org.jbpm.api.model.preview.OutputSet;
+
/**
* A Task is an Atomic Activity that is included within a Process.
*
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model;
-
-import org.jbpm.api.client.UserTaskCallback;
-
-//$Id$
-
-/**
- * A User Task is a typical “workflow” task where a human performer performs the Task with the assistance of a software
- * application and is scheduled through a task list manager of some sort.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface UserTask extends Task
-{
- /**
- * Get the associated callback
- */
- UserTaskCallback getUserTaskCallback();
-
- /**
- * Set the associated callback
- */
- void setUserTaskCallback(UserTaskCallback callback);
-
- /**
- * A Message for the OutMessageRef attribute MUST be entered. The sending
- * of this message marks the completion of the Task, which may cause the
- * production of an OutputSet. One or more corresponding outgoing Message
- * Flow MAY be shown on the diagram. However, the display of the Message
- * Flow is not required. The Message is applied to all outgoing Message Flow
- * and the Message will be sent down all outgoing Message Flow at the
- * completion of a single instance of the
- */
- Message getOutMessageRef();
-
- /**
- * A Message for the InMessageRef attribute MUST be entered. This indicates
- * that the Message will be received at the start of the Task, after the
- * availability of any defined InputSets. One or more corresponding incoming
- * Message Flows MAY be shown on the diagram. However, the display of the
- * Message Flow is not required. The Message is applied to all incoming
- * Message Flow, but can arrive for only one of the incoming Message Flow
- * for a single instance of the
- */
- Message getInMessageRef();
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/EventBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/EventBuilder.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/EventBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model.builder;
-
-//$Id$
-
-import org.jbpm.api.model.Signal.SignalType;
-
-/**
- * The EventBuilder can be used to build an Event dynamically.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface EventBuilder extends ProcessBuilder
-{
- /**
- * Add a signal ref to the last added EventDetail
- */
- EventBuilder addSignalRef(SignalType signalType, String signalMessage);
-
- /**
- * Add a message ref to the last added EventDetail
- */
- EventBuilder addMessageRef(String msgName);
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model.builder;
-
-import org.jbpm.api.model.Gate;
-import org.jbpm.api.model.Expression.ExpressionLanguage;
-
-
-//$Id$
-
-/**
- * The GatewayBuilder can be used to build a Gateway dynamically.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface GatewayBuilder extends ProcessBuilder
-{
- /**
- * Add the default {@link Gate}
- */
- GatewayBuilder addDefaultGate(String targetName);
-
- /**
- * Add a conditional {@link Gate}
- */
- GatewayBuilder addConditionalGate(String targetName, ExpressionLanguage exprLang, String exprBody);
-
- /**
- * Add an unconditional {@link Gate}
- */
- GatewayBuilder addGate(String targetName);
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GroupBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GroupBuilder.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GroupBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model.builder;
-
-//$Id$
-
-import org.jbpm.api.model.Group;
-import org.jbpm.api.model.Group.GroupType;
-
-
-/**
- * A GroupBuilder can be used to build a {@link Group} dynamically.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface GroupBuilder
-{
- /** Add a new Group*/
- GroupBuilder newGroup(GroupType type, String name);
-
- /**
- * Add a message property
- */
- GroupBuilder addProperty(String name, Object value);
-
- /**
- * Get the Group
- */
- Group getGroup();
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilder.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model.builder;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.model.Message;
-
-
-/**
- * A MessageBuilder can be used to build a {@link Message} dynamically.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface MessageBuilder
-{
- /**
- * Create a {@link Message} with a given name
- */
- MessageBuilder newMessage(String msgName);
-
- /**
- * Add a message destination
- */
- MessageBuilder addToRef(ObjectName toRef);
-
- /**
- * Add a message source
- */
- MessageBuilder addFromRef(ObjectName fromRef);
-
- /**
- * Add a message property
- */
- MessageBuilder addProperty(String name, Object value);
-
- /**
- * Add a message property
- */
- MessageBuilder addProperty(String name, Object value, boolean isCorrelation);
-
- /**
- * Get the Message
- */
- Message getMessage();
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ObjectNameFactory.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ObjectNameFactory.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ObjectNameFactory.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model.builder;
-
-// $Id$
-
-import java.util.Hashtable;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-/**
- * A simple factory for creating safe object names.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 08-May-2006
- */
-public class ObjectNameFactory
-{
- public static ObjectName create(String name)
- {
- try
- {
- return new ObjectName(name);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + name + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, String key, String value)
- {
- try
- {
- return new ObjectName(domain, key, value);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," + key + "," + value + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, Hashtable<String, String> table)
- {
- try
- {
- return new ObjectName(domain, table);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," + table + "; " + e);
- }
- }
-}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -23,23 +23,27 @@
//$Id$
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Property;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
-import org.jbpm.api.model.Group.GroupType;
import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.builder.preview.EventBuilder;
+import org.jbpm.api.model.builder.preview.GatewayBuilder;
+import org.jbpm.api.model.builder.preview.GroupBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Property;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
+import org.jbpm.api.model.preview.Group.GroupType;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.SignalHandler;
/**
- * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ * The ProcessBuilder can be used to build a {@link ProcessInstance} dynamically.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -47,7 +51,7 @@
public interface ProcessBuilder
{
/**
- * Add a {@link Process} with a given name
+ * Add a {@link ProcessInstance} with a given name
*/
ProcessBuilder addProcess(String name);
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SignalBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SignalBuilder.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SignalBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.model.builder;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.Signal.SignalType;
-
-
-/**
- * A SignalBuilder can be used to build a {@link Signal} dynamically.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface SignalBuilder
-{
- /**
- * Create a Signal
- */
- Signal newSignal(SignalType signalType, ObjectName fromRef, String message);
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -23,8 +23,8 @@
//$Id$
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.preview.Message;
/**
* The TaskBuilder can be used to build a Task dynamically.
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/EventBuilder.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/EventBuilder.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/EventBuilder.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/EventBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.builder.preview;
+
+//$Id$
+
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.preview.Signal.SignalType;
+
+/**
+ * The EventBuilder can be used to build an Event dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface EventBuilder extends ProcessBuilder
+{
+ /**
+ * Add a signal ref to the last added EventDetail
+ */
+ EventBuilder addSignalRef(SignalType signalType, String signalMessage);
+
+ /**
+ * Add a message ref to the last added EventDetail
+ */
+ EventBuilder addMessageRef(String msgName);
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/GatewayBuilder.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/GatewayBuilder.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/GatewayBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.builder.preview;
+
+import org.jbpm.api.model.Gate;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.builder.ProcessBuilder;
+
+
+//$Id$
+
+/**
+ * The GatewayBuilder can be used to build a Gateway dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface GatewayBuilder extends ProcessBuilder
+{
+ /**
+ * Add the default {@link Gate}
+ */
+ GatewayBuilder addDefaultGate(String targetName);
+
+ /**
+ * Add a conditional {@link Gate}
+ */
+ GatewayBuilder addConditionalGate(String targetName, ExpressionLanguage exprLang, String exprBody);
+
+ /**
+ * Add an unconditional {@link Gate}
+ */
+ GatewayBuilder addGate(String targetName);
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/GroupBuilder.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GroupBuilder.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/GroupBuilder.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/GroupBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.builder.preview;
+
+//$Id$
+
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.Group.GroupType;
+
+
+/**
+ * A GroupBuilder can be used to build a {@link Group} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface GroupBuilder
+{
+ /** Add a new Group*/
+ GroupBuilder newGroup(GroupType type, String name);
+
+ /**
+ * Add a message property
+ */
+ GroupBuilder addProperty(String name, Object value);
+
+ /**
+ * Get the Group
+ */
+ Group getGroup();
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/MessageBuilder.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilder.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/MessageBuilder.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/MessageBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.builder.preview;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.preview.Message;
+
+
+/**
+ * A MessageBuilder can be used to build a {@link Message} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MessageBuilder
+{
+ /**
+ * Create a {@link Message} with a given name
+ */
+ MessageBuilder newMessage(String msgName);
+
+ /**
+ * Add a message destination
+ */
+ MessageBuilder addToRef(ObjectName toRef);
+
+ /**
+ * Add a message source
+ */
+ MessageBuilder addFromRef(ObjectName fromRef);
+
+ /**
+ * Add a message property
+ */
+ MessageBuilder addProperty(String name, Object value);
+
+ /**
+ * Add a message property
+ */
+ MessageBuilder addProperty(String name, Object value, boolean isCorrelation);
+
+ /**
+ * Get the Message
+ */
+ Message getMessage();
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/ObjectNameFactory.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ObjectNameFactory.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/ObjectNameFactory.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/ObjectNameFactory.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.builder.preview;
+
+// $Id$
+
+import java.util.Hashtable;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+/**
+ * A simple factory for creating safe object names.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 08-May-2006
+ */
+public class ObjectNameFactory
+{
+ public static ObjectName create(String name)
+ {
+ try
+ {
+ return new ObjectName(name);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + name + "; " + e);
+ }
+ }
+
+ public static ObjectName create(String domain, String key, String value)
+ {
+ try
+ {
+ return new ObjectName(domain, key, value);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + domain + "," + key + "," + value + "; " + e);
+ }
+ }
+
+ public static ObjectName create(String domain, Hashtable<String, String> table)
+ {
+ try
+ {
+ return new ObjectName(domain, table);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + domain + "," + table + "; " + e);
+ }
+ }
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/SignalBuilder.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/SignalBuilder.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/SignalBuilder.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/preview/SignalBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.builder.preview;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
+
+
+/**
+ * A SignalBuilder can be used to build a {@link Signal} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalBuilder
+{
+ /**
+ * Create a Signal
+ */
+ Signal newSignal(SignalType signalType, ObjectName fromRef, String message);
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/ProcessStructure.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/ProcessStructure.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/ProcessStructure.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,10 +25,10 @@
import java.util.List;
-import org.jbpm.api.model.Assignment;
-import org.jbpm.api.model.Group;
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.Message;
/**
* A ProcessStructure defines the structure of a Process
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/PropertySupport.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/PropertySupport.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/internal/PropertySupport.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,7 +26,7 @@
import java.io.Serializable;
import java.util.Set;
-import org.jbpm.api.model.Property;
+import org.jbpm.api.model.preview.Property;
/**
* Property support
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Assignment.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Assignment.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Assignment.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Assignment.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+import java.io.Serializable;
+
+import org.jbpm.api.model.Expression;
+
+
+//$Id$
+
+/**
+ * An Assignment, which is used in the definition of attributes for Process,
+ * Activity, Event, Gateway, and Gate.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Assignment extends Serializable
+{
+ public enum AssignTime
+ {
+ Start, End
+ }
+
+ /**
+ * The target for the Assignment MUST be a Property of the Process or the activity
+ * itself.
+ */
+ Property getTo();
+
+ /**
+ * The Expression MUST be made up of a combination of Values, Properties, and
+ * Attributes, which are separated by operators such as add or multiply. The expression
+ * language is defined in the ExpressionLanguage attribute of the Business Process
+ * Diagram
+ */
+ Expression getFrom();
+
+ /**
+ * An Assignment MAY have a AssignTime setting. If the Object is an activity (Task,
+ * Sub-Process, or Process), then the Assignment MUST have an AssignTime.
+ * A value of Start means that the assignment SHALL occur at the start of the activity.
+ * This can be used to assign the higher-level (global) Properties of the Process to the
+ * (local) Properties of the activity as an input to the activity.
+ * A value of End means that the assignment SHALL occur at the end of the activity.
+ * This can be used to assign the (local) Properties of the activity to the higher-level
+ * (global) Properties of the Process as an output to the activity.
+ */
+ AssignTime getAssignTime();
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ComplexGateway.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ComplexGateway.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ComplexGateway.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ComplexGateway.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+import org.jbpm.api.model.Expression;
+import org.jbpm.api.model.Gateway;
+
+// $Id$
+
+/**
+ * A Complex Gateway handles situations that are not easily handled through the other types of Gateways. Complex
+ * Gateways can also be used to combine a set of linked simple Gateways into a single, more compact situation. Modelers
+ * can provide complex expressions that determine the merging and/or splitting behavior of the Gateway.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ComplexGateway extends Gateway
+{
+ /**
+ * If there are multiple incoming Sequence Flow, an IncomingCondition expression
+ * MUST be set by the modeler. This will consist of an expression that can reference
+ * Sequence Flow names and/or Process Properties (Data).
+ */
+ Expression getIncommingCondition();
+
+ /**
+ * If there are multiple outgoing Sequence Flow, an OutgoingCondition expression
+ * MUST be set by the modeler. This will consist of an expression that can reference
+ * (outgoing) Sequence Flow Ids and/or Process Properties (Data).
+ */
+ Expression getOutgoingCondition();
+
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Group.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Group.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Group.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Group.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+//$Id$
+
+import java.io.Serializable;
+
+import org.jbpm.api.model.internal.PropertySupport;
+
+/**
+ * The Group object is an Artifact that provides a visual mechanism to group elements of a diagram informally. The
+ * grouping is tied to the Category supporting element (which is an attribute of all BPMN elements). That is, a Group is a
+ * visual depiction of a single Category. The graphical elements within the Group will be assigned the Category of the
+ * Group.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 30-Oct-2008
+ */
+public interface Group extends PropertySupport, Serializable
+{
+ /**
+ * The supported group types
+ */
+ enum GroupType { None, Transaction };
+
+ /**
+ * Name is an attribute that is text description of the Group.
+ */
+ String getName();
+
+ /**
+ * Get the group type for this group
+ */
+ GroupType getGroupType();
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InclusiveGateway.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InclusiveGateway.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InclusiveGateway.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InclusiveGateway.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+import org.jbpm.api.model.Gateway;
+
+//$Id$
+
+/**
+ * This Decision represents a branching point where Alternatives are based on conditional expressions contained within
+ * outgoing Sequence Flow. However, in this case, the True evaluation of one condition expression does not exclude the
+ * evaluation of other condition expressions. All Sequence Flow with a True evaluation will be traversed by a Token. In
+ * some sense it’s like a grouping of related independent Binary (Yes/No) Decisions--and can be modeled that way. Since
+ * each path is independent, all combinations of the paths may be taken, from zero to all. However, it should be
+ * designed so that at least one path is taken.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface InclusiveGateway extends Gateway
+{
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InputSet.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/InputSet.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InputSet.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/InputSet.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+import org.jbpm.api.model.internal.PropertySupport;
+
+
+//$Id$
+
+/**
+ * An InputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface InputSet extends PropertySupport
+{
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Message.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Message.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Message.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Message.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+import java.io.Serializable;
+
+import org.jbpm.api.model.internal.PropertySupport;
+
+
+
+//$Id$
+
+/**
+ * A Message, which is used in the definition of attributes for a StartEvent,
+ * EndEvent, IntermediateEvent, Task, and MessageFlow
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Message extends PropertySupport, Serializable
+{
+ /**
+ * Name is an attribute that is text description of the Message.
+ */
+ String getName();
+
+ /**
+ * This defines the source of the Message.
+ */
+ Participant getFromRef();
+
+ /**
+ * This defines the target of the Message.
+ */
+ Participant getToRef();
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/OutputSet.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/OutputSet.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/OutputSet.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/OutputSet.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+import org.jbpm.api.model.internal.PropertySupport;
+
+
+//$Id$
+
+/**
+ * An OuputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface OutputSet extends PropertySupport
+{
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ParallelGateway.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ParallelGateway.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ParallelGateway.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ParallelGateway.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+import org.jbpm.api.model.Gateway;
+
+// $Id$
+
+/**
+ * Parallel Gateway is required when two or more Activities need to be executed in parallel.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ParallelGateway extends Gateway
+{
+
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Participant.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Participant.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Participant.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Participant.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+//$Id$
+
+import java.io.Serializable;
+
+import javax.management.ObjectName;
+
+
+
+/**
+ * A Participant, which is used in the definition of attributes for a Pool, {@link Message}, and WebService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Participant extends Serializable
+{
+ /**
+ * The name of this participant
+ */
+ ObjectName getName();
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Property.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Property.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Property.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Property.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+import java.io.Serializable;
+
+// $Id$
+
+/**
+ * A Property, which is used in the definition of attributes for a Process and common activity attributes
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Property extends Serializable
+{
+ /**
+ * Each Property has a Name (e.g., name=”Customer Name”).
+ */
+ String getName();
+
+ /**
+ * Get the property value.
+ */
+ String getValue();
+
+ /**
+ * If the Correlation attribute is set to True, then the Property is marked to be used for
+ * correlation (e.g., for incoming Messages).
+ */
+ boolean isCorrelation();
+}
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ReceiveTask.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/ReceiveTask.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ReceiveTask.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/ReceiveTask.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+import org.jbpm.api.model.Task;
+
+//$Id$
+
+/**
+ * A Receive Task is a simple Task that is designed to wait for a message to arrive from an external participant
+ * (relative to the Business Process). Once the message has been received, the Task is completed.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ReceiveTask extends Task
+{
+ /**
+ * A Message for the MessageRef attribute MUST be entered. This indicates that the Message will be received by the
+ * Task. The Message in this context is equivalent to an in-only message pattern (Web service). One or more
+ * corresponding incoming Message Flows MAY be shown on the diagram. However, the display of the Message Flow is not
+ * required. The Message is applied to all incoming Message Flow, but can arrive for only one of the incoming Message
+ * Flow for a single instance of the Task.
+ */
+ Message getMessageRef();
+
+ /**
+ * Receive Tasks can be defined as the instantiation mechanism for the Process with the Instantiate attribute. This
+ * attribute MAY be set to true if the Task is the first activity after the Start Event or a starting Task if there is
+ * no Start Event (i.e., there are no incoming Sequence Flow). Multiple Tasks MAY have this attribute set to True.
+ */
+ boolean isInstantiate();
+
+ /**
+ * This attribute specifies the technology that will be used to send or receive the message. A Web service is the
+ * default technology.
+ */
+ //Implementation getImplementation();
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/SendTask.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/SendTask.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/SendTask.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/SendTask.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+import org.jbpm.api.model.Task;
+
+//$Id$
+
+/**
+ * A Send Task.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SendTask extends Task
+{
+ /**
+ * A Message for the MessageRef attribute MUST be entered. This indicates that the Message will be sent by the Task. The Message in this context is equivalent to an
+ * out-only message pattern (Web service). One or more corresponding outgoing Message Flow MAY be shown on the diagram. However, the display of the Message Flow is
+ * not required. The Message is applied to all outgoing Message Flow and the Message will be sent down all outgoing Message Flow at the completion of a single
+ * instance of the Task.
+ */
+ Message getMessageRef();
+
+ /**
+ * This attribute specifies the technology that will be used to send or receive the message. A Web service is the default technology.
+ */
+ // Implementation getImplementation();
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Signal.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Signal.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Signal.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/Signal.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+//$Id$
+
+import java.io.Serializable;
+
+import javax.management.ObjectName;
+
+/**
+ * A Signal is like an undirected flare shot up
+ * into the air.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Signal extends Serializable
+{
+ /**
+ * Defines the types of supported Signals
+ */
+ enum SignalType
+ {
+ SYSTEM_START_EVENT_ENTER, SYSTEM_START_EVENT_EXIT, SYSTEM_START_TRIGGER,
+ SYSTEM_EVENT_ENTER, SYSTEM_EVENT_EXIT, SYSTEM_EVENT_TRIGGER,
+ SYSTEM_END_EVENT_ENTER, SYSTEM_END_EVENT_EXIT, SYSTEM_END_TRIGGER,
+ SYSTEM_GATEWAY_ENTER, SYSTEM_GATEWAY_EXIT,
+ SYSTEM_PROCESS_ENTER, SYSTEM_PROCESS_EXIT,
+ SYSTEM_TASK_ENTER, SYSTEM_TASK_EXIT, SYSTEM_TASK_TRIGGER,
+ USER_SIGNAL
+ }
+
+ /**
+ * Get the signal type of this signal
+ */
+ SignalType getSignalType();
+
+ /**
+ * Get the sending participant for this signal
+ */
+ ObjectName getFromRef();
+
+ /**
+ * Get the optional message associated with this signal
+ */
+ public String getMessage();
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/UserTask.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/UserTask.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/UserTask.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/preview/UserTask.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.preview;
+
+import org.jbpm.api.client.preview.UserTaskCallback;
+import org.jbpm.api.model.Task;
+
+//$Id$
+
+/**
+ * A User Task is a typical “workflow” task where a human performer performs the Task with the assistance of a software
+ * application and is scheduled through a task list manager of some sort.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface UserTask extends Task
+{
+ /**
+ * Get the associated callback
+ */
+ UserTaskCallback getUserTaskCallback();
+
+ /**
+ * Set the associated callback
+ */
+ void setUserTaskCallback(UserTaskCallback callback);
+
+ /**
+ * A Message for the OutMessageRef attribute MUST be entered. The sending
+ * of this message marks the completion of the Task, which may cause the
+ * production of an OutputSet. One or more corresponding outgoing Message
+ * Flow MAY be shown on the diagram. However, the display of the Message
+ * Flow is not required. The Message is applied to all outgoing Message Flow
+ * and the Message will be sent down all outgoing Message Flow at the
+ * completion of a single instance of the
+ */
+ Message getOutMessageRef();
+
+ /**
+ * A Message for the InMessageRef attribute MUST be entered. This indicates
+ * that the Message will be received at the start of the Task, after the
+ * availability of any defined InputSets. One or more corresponding incoming
+ * Message Flows MAY be shown on the diagram. However, the display of the
+ * Message Flow is not required. The Message is applied to all incoming
+ * Message Flow, but can arrive for only one of the incoming Message Flow
+ * for a single instance of the
+ */
+ Message getInMessageRef();
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,7 +25,7 @@
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.preview.Signal;
/**
* The {@link ProcessEngine} invokes the SignalHandler on a {@link Node}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/Token.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -24,7 +24,7 @@
// $Id$
import org.hibernate.Session;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.SequenceFlow;
/**
@@ -57,9 +57,9 @@
TokenStatus getTokenStatus();
/**
- * Get the associated {@link Process}
+ * Get the associated {@link ProcessInstance}
*/
- Process getProcess();
+ ProcessInstance getProcess();
/**
* Get the associated {@link ExecutionContext}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.service;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.client.Deployment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The marker interface for all Services
- *
- * @author thomas.diesler(a)jboss.com
- * @since 25-Sep-2008
- */
-public abstract class DeploymentService implements Service
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(DeploymentService.class);
-
- /**
- * Deploy a new process to the process service.
- */
- ObjectName deploy(Deployment deployment)
- {
- return null;
- }
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,9 +26,9 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
import org.jbpm.api.runtime.Attachments;
/**
@@ -60,7 +60,7 @@
* @param proc The Process to start
* @param att The Attachments in the ExecutionContext
*/
- public abstract void startProcess(Process proc, Attachments att);
+ public abstract void startProcess(ProcessInstance proc, Attachments att);
/**
* Start the Process from a given start event
@@ -68,19 +68,19 @@
* @param start The StartEvent that triggers the process
* @param att The Attachments in the ExecutionContext
*/
- public abstract void startProcess(Process proc, StartEvent start, Attachments att);
+ public abstract void startProcess(ProcessInstance proc, StartEvent start, Attachments att);
/**
* All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
* Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends without
* timeout.
*/
- public abstract ProcessStatus waitForEnd(Process proc);
+ public abstract ProcessStatus waitForEnd(ProcessInstance proc);
/**
* All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
* Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends with a
* given timeout.
*/
- public abstract ProcessStatus waitForEnd(Process proc, long timeout);
+ public abstract ProcessStatus waitForEnd(ProcessInstance proc, long timeout);
}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageBuilderService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageBuilderService.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageBuilderService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.service;
-
-//$Id$
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.builder.MessageBuilder;
-
-/**
- * The MessageBuilder can be used to build a {@link Message} dynamically.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public abstract class MessageBuilderService extends AbstractService
-{
- /**
- * Locate the default MessageBuilder
- */
- public static MessageBuilder locateMessageBuilder()
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- MessageBuilderService builderService = engine.getService(MessageBuilderService.class);
- return builderService.getMessageBuilder();
- }
-
- /**
- * Get the MessageBuilder
- */
- public abstract MessageBuilder getMessageBuilder();
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,168 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software{} you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation{} either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY{} without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software{} if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.service;
-
-//$Id$
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.client.MessageListener;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Event;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Participant;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.Task;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The ProcessEngine sends messages through the MessageService.
- * <p/>
- * A {@link Message} has an ID and is targeted to a
- * specific Participant. A component can register a {@link MessageListener} with the MessageService.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class MessageService extends AbstractService
-{
- // Provide logging
- final Logger log = LoggerFactory.getLogger(MessageService.class);
-
- // The set of registered message listeners
- private Map<ObjectName, MessageListener> listeners = new HashMap<ObjectName, MessageListener>();
-
- /**
- * Locate the default MessageService
- */
- public static MessageService locateMessageService()
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- return engine.getService(MessageService.class);
- }
-
- /**
- * Add a MessageListener
- */
- public void addMessageListener(MessageListener listener)
- {
- synchronized (listeners)
- {
- if (hasMessageListener(listener.getKey()))
- throw new IllegalStateException("Listener already registered: " + listener.getKey());
-
- log.debug("addMessageListener: " + listener.getKey());
- listeners.put(listener.getKey(), listener);
- }
- }
-
- /**
- * Get the set of registered MessageListeners
- */
- public Set<MessageListener> getMessageListeners()
- {
- synchronized (listeners)
- {
- HashSet<MessageListener> set = new HashSet<MessageListener>(listeners.values());
- return Collections.unmodifiableSet(set);
- }
- }
-
- /**
- * Get a MessageListener for a given ID
- *
- * @return null if there is none
- */
- public MessageListener getMessageListener(ObjectName listenerID)
- {
- synchronized (listeners)
- {
- return listeners.get(listenerID);
- }
- }
-
- /**
- * True if there is a MessageListener for a given ID
- */
- public boolean hasMessageListener(ObjectName listenerID)
- {
- return getMessageListener(listenerID) != null;
- }
-
- /**
- * Remove an MessageListener
- */
- public void removeMessageListener(ObjectName listenerID)
- {
- synchronized (listeners)
- {
- log.debug("removeMessageListener: " + listenerID);
- listeners.remove(listenerID);
- }
- }
-
- /**
- * Send a message to a given {@link Task} or {@link Event}
- */
- public void sendMessage(ObjectName procID, String targetName, Message msg)
- {
- ProcessService procService = ProcessService.locateProcessService();
- Process proc = procService.getProcess(procID);
- if (proc == null)
- throw new IllegalStateException("Cannot obtain registered process: " + procID);
-
- Node targetNode = proc.getNode(targetName);
- if (targetNode == null)
- throw new IllegalArgumentException("Cannot find message target: " + targetName);
- if (targetNode instanceof MessageListener == false)
- throw new IllegalArgumentException("Message target is not a valid message receiver: " + targetName);
-
- log.debug("sendMessage to " + targetNode + " => " + msg);
- MessageListener msgListener = (MessageListener)targetNode;
- msgListener.catchMessage(msg);
- }
-
- /**
- * Send a message to a given {@link MessageListener}
- */
- public void sendMessage(Message msg)
- {
- Participant toRef = msg.getToRef();
- if (toRef == null)
- throw new IllegalArgumentException("Target entity cannot be null");
-
- MessageListener msgListener = getMessageListener(toRef.getName());
- if (msgListener == null)
- throw new IllegalStateException("No message listener registered for: " + toRef);
-
- log.debug("sendMessage to '" + toRef + "' => " + msg);
- msgListener.catchMessage(msg);
- }
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,95 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.service;
-
-// $Id$
-
-import javax.management.ObjectName;
-
-import org.hibernate.Session;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Process;
-
-/**
- * The persistence service.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 17-Sep-2008
- */
-public abstract class PersistenceService extends AbstractService
-{
- /**
- * Locate the default PersistenceService
- */
- public static PersistenceService locatePersistenceService()
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- return engine.getService(PersistenceService.class);
- }
-
- /**
- * Create a new persistence session
- */
- public abstract Session createSession();
-
- /**
- * Save the ProcessDefinition to persistent storage
- */
- public abstract ObjectName saveProcessDefinition(ProcessDefinition procDef);
-
- /**
- * Load the ProcessDefinition from persistent storage
- */
- public abstract ProcessDefinition loadProcessDefinition(ObjectName procDefID);
-
- /**
- * Delete the ProcessDefinition from persistent storage
- */
- public abstract void deleteProcessDefinition(ProcessDefinition procDef);
-
- /**
- * Save the Process to persistent storage
- */
- public abstract ObjectName saveProcess(Process proc);
-
- /**
- * Load the Process from persistent storage
- */
- public abstract Process loadProcess(ObjectName procID);
-
- /**
- * Delete the Process from persistent storage
- */
- public abstract void deleteProcess(Process proc);
-
- /**
- * Save the Node to persistent storage
- */
- public abstract ObjectName saveNode(Session session, Node node);
-
- /**
- * Load the Node from persistent storage
- */
- public abstract <T extends Node> T loadNode(Session session, Class<T> clazz, ObjectName nodeID);
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessBuilderService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -24,11 +24,11 @@
//$Id$
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.builder.ProcessBuilder;
/**
- * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ * The ProcessBuilder can be used to build a {@link ProcessInstance} dynamically.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessDefinitionService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -37,9 +37,10 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import org.jbpm.api.client.Deployment;
import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.preview.Deployment;
import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.service.preview.PersistenceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
@@ -151,7 +152,7 @@
ProcessEngine engine = getProcessEngine();
// Unregister the associated process instances
- ProcessService procService = engine.getService(ProcessService.class);
+ ProcessInstanceService procService = engine.getService(ProcessInstanceService.class);
for (ObjectName procID : procService.getProcesses(procDef.getName(), null))
procService.unregisterProcess(procID);
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,94 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.service;
-
-//$Id$
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.jbpm.api.client.ProcessEngine;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A registry of ProcessEngine instances per VM
- *
- * @author thomas.diesler(a)jboss.com
- * @since 25-Sep-2008
- */
-public final class ProcessEngineRegistry
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(ProcessEngineRegistry.class);
-
- // The process engine registry
- static Map<String, ProcessEngine> engineRegistry = new HashMap<String, ProcessEngine>();
-
- // Hide constructor
- private ProcessEngineRegistry()
- {
- }
-
- /**
- * Get the set of registered engine names
- */
- public static Set<String> getEngineNames()
- {
- return engineRegistry.keySet();
- }
-
- /**
- * Get a process engine by name
- * @return null, if there is no engine registered under the given name
- */
- public static ProcessEngine getEngine(String engineName)
- {
- return engineRegistry.get(engineName);
- }
-
- /**
- * Register a ProcessEngine
- * @throws IllegalStateException If a ProcessEngine with that name is already registered
- */
- public static void registerEngine(ProcessEngine engine)
- {
- if (engineRegistry.get(engine.getName()) != null)
- throw new IllegalStateException("Process engine already registered: " + engine.getName());
-
- log.debug("Register: " + engine);
- engineRegistry.put(engine.getName(), engine);
- }
-
- /**
- * Unregister a ProcessEngine for a given name
- */
- public static ProcessEngine unregisterEngine(String name)
- {
- ProcessEngine pe = engineRegistry.remove(name);
- log.debug("Unregister: " + name + "=" + pe);
- return pe;
- }
-
-
-}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessInstanceService.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessInstanceService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessInstanceService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
+import org.jbpm.api.service.preview.PersistenceService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The ProcessService is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Sep-2008
+ */
+public abstract class ProcessInstanceService extends AbstractService
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(ProcessInstanceService.class);
+
+ // The set of registered processes
+ private Map<ObjectName, ProcessInstance> registeredProcs = new HashMap<ObjectName, ProcessInstance>();
+
+ // Hide public constructor
+ protected ProcessInstanceService()
+ {
+ }
+
+ /**
+ * Locate the default ProcessService
+ */
+ public static ProcessInstanceService locateProcessService()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ return engine.getService(ProcessInstanceService.class);
+ }
+
+ /**
+ * Register a Process.
+ */
+ public ObjectName registerProcess(ProcessInstance proc)
+ {
+ log.debug("registerProcess: " + proc);
+
+ if (getProcess(proc.getKey()) != null)
+ throw new IllegalStateException("Process already registered: " + proc);
+
+ ProcessStatus procStatus = proc.getProcessStatus();
+ ProcessDefinition procDef = proc.getProcessDefinition();
+ ProcessEngine engine = getProcessEngine();
+
+ if (procStatus != ProcessStatus.None)
+ throw new IllegalStateException("Cannot register process in state: " + procStatus);
+
+ // Register the process definition if needed
+ ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
+ if (procDefService.getProcessDefinition(procDef.getKey()) == null)
+ procDefService.registerProcessDefinition(procDef);
+
+ // Save the process through the PersistenceService
+ PersistenceService persService = getProcessEngine().getService(PersistenceService.class);
+ ObjectName procID = persService.saveProcess(proc);
+ registeredProcs.put(procID, proc);
+ return procID;
+ }
+
+ /**
+ * Unregister a Process.
+ */
+ public boolean unregisterProcess(ObjectName procID)
+ {
+ boolean removed = false;
+ ProcessInstance proc = registeredProcs.get(procID);
+ if (proc != null)
+ {
+ log.debug("unregisterProcess: " + proc);
+
+ // Delete the process through the PersistenceService
+ PersistenceService persService = getProcessEngine().getService(PersistenceService.class);
+ persService.deleteProcess(proc);
+ registeredProcs.remove(procID);
+ removed = true;
+ }
+ return removed;
+ }
+
+ /**
+ * Get a Process for a given id
+ */
+ public ProcessInstance getProcess(ObjectName procID)
+ {
+ ProcessInstance proc = registeredProcs.get(procID);
+ return proc;
+ }
+
+ /**
+ * Get the set of registered Processes
+ */
+ public Set<ObjectName> getProcesses()
+ {
+ return Collections.unmodifiableSet(registeredProcs.keySet());
+ }
+
+ /**
+ * Find the set of Processes for a given name
+ *
+ * @param name The process name
+ * @param status The optional process status
+ * @return An empty set if the process cannot be found
+ */
+ public Set<ObjectName> getProcesses(String name, ProcessStatus status)
+ {
+ Set<ObjectName> procSet = new HashSet<ObjectName>();
+ for (ProcessInstance auxProc : registeredProcs.values())
+ {
+ if (auxProc.getName().equals(name))
+ {
+ if (status == null || auxProc.getProcessStatus() == status)
+ procSet.add(auxProc.getKey());
+ }
+ }
+ return procSet;
+ }
+}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,155 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.service;
-
-//$Id$
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Process.ProcessStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The ProcessService is the entry point to create, find and otherwise manage processes.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 25-Sep-2008
- */
-public abstract class ProcessService extends AbstractService
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(ProcessService.class);
-
- // The set of registered processes
- private Map<ObjectName, Process> registeredProcs = new HashMap<ObjectName, Process>();
-
- // Hide public constructor
- protected ProcessService()
- {
- }
-
- /**
- * Locate the default ProcessService
- */
- public static ProcessService locateProcessService()
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- return engine.getService(ProcessService.class);
- }
-
- /**
- * Register a Process.
- */
- public ObjectName registerProcess(Process proc)
- {
- log.debug("registerProcess: " + proc);
-
- if (getProcess(proc.getKey()) != null)
- throw new IllegalStateException("Process already registered: " + proc);
-
- ProcessStatus procStatus = proc.getProcessStatus();
- ProcessDefinition procDef = proc.getProcessDefinition();
- ProcessEngine engine = getProcessEngine();
-
- if (procStatus != ProcessStatus.None)
- throw new IllegalStateException("Cannot register process in state: " + procStatus);
-
- // Register the process definition if needed
- ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
- if (procDefService.getProcessDefinition(procDef.getKey()) == null)
- procDefService.registerProcessDefinition(procDef);
-
- // Save the process through the PersistenceService
- PersistenceService persService = getProcessEngine().getService(PersistenceService.class);
- ObjectName procID = persService.saveProcess(proc);
- registeredProcs.put(procID, proc);
- return procID;
- }
-
- /**
- * Unregister a Process.
- */
- public boolean unregisterProcess(ObjectName procID)
- {
- boolean removed = false;
- Process proc = registeredProcs.get(procID);
- if (proc != null)
- {
- log.debug("unregisterProcess: " + proc);
-
- // Delete the process through the PersistenceService
- PersistenceService persService = getProcessEngine().getService(PersistenceService.class);
- persService.deleteProcess(proc);
- registeredProcs.remove(procID);
- removed = true;
- }
- return removed;
- }
-
- /**
- * Get a Process for a given id
- */
- public Process getProcess(ObjectName procID)
- {
- Process proc = registeredProcs.get(procID);
- return proc;
- }
-
- /**
- * Get the set of registered Processes
- */
- public Set<ObjectName> getProcesses()
- {
- return Collections.unmodifiableSet(registeredProcs.keySet());
- }
-
- /**
- * Find the set of Processes for a given name
- *
- * @param name The process name
- * @param status The optional process status
- * @return An empty set if the process cannot be found
- */
- public Set<ObjectName> getProcesses(String name, ProcessStatus status)
- {
- Set<ObjectName> procSet = new HashSet<ObjectName>();
- for (Process auxProc : registeredProcs.values())
- {
- if (auxProc.getName().equals(name))
- {
- if (status == null || auxProc.getProcessStatus() == status)
- procSet.add(auxProc.getKey());
- }
- }
- return procSet;
- }
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalBuilderService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalBuilderService.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalBuilderService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.service;
-
-//$Id$
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.builder.SignalBuilder;
-
-/**
- * The SignalBuilder can be used to build a {@link Signal} dynamically.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public abstract class SignalBuilderService extends AbstractService
-{
- /**
- * Locate the default SignalBuilder
- */
- public static SignalBuilder locateSignalBuilder()
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- SignalBuilderService builderService = engine.getService(SignalBuilderService.class);
- return builderService.getSignalBuilder();
- }
-
- /**
- * Get the SignalBuilder
- */
- public abstract SignalBuilder getSignalBuilder();
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,135 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.service;
-
-//$Id$
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.SignalListener;
-import org.jbpm.api.model.Signal;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A {@link Signal} is like an undirected flare shot up
- * into the air. A component can register a {@link SignalListener} with the SignalService.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class SignalService extends AbstractService
-{
- // provide logging
- final static Logger log = LoggerFactory.getLogger(SignalService.class);
-
- // The map of registered signal listeners
- private Set<SignalListener> listeners = new HashSet<SignalListener>();
-
- /**
- * Locate the default SignalService
- */
- public static SignalService locateSignalService()
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- return engine.getService(SignalService.class);
- }
-
- /**
- * Add a SignalListener for a given source
- */
- public void addSignalListener(SignalListener listener)
- {
- synchronized (listeners)
- {
- log.debug("addSignalListener: " + listener);
- listeners.add(listener);
- }
- }
-
- /**
- * Get the set of registered SignalListeners
- */
- public Set<SignalListener> getSignalListeners()
- {
- synchronized (listeners)
- {
- HashSet<SignalListener> set = new HashSet<SignalListener>(listeners);
- return Collections.unmodifiableSet(set);
- }
- }
-
- /**
- * Remove a SignalListener for a given source
- */
- public void removeSignalListener(SignalListener listener)
- {
- synchronized (listeners)
- {
- log.debug("removeSignalListener: " + listener);
- listeners.remove(listener);
- }
- }
-
- /**
- * Throw a signal to all registered listeners
- */
- public void throwSignal(Signal signal)
- {
- log.debug("throwSignal: " + signal);
- Set<SignalListener> currentSet = getSignalListeners();
- for (SignalListener listener : currentSet)
- {
- if (failsafeAccept(listener, signal))
- failsafeThrow(listener, signal);
- }
- }
-
- private boolean failsafeAccept(SignalListener listener, Signal signal)
- {
- try
- {
- boolean accept = listener.acceptSignal(signal);
- return accept;
- }
- catch (RuntimeException rte)
- {
- log.error("Signal processing error", rte);
- return false;
- }
- }
-
- private void failsafeThrow(SignalListener listener, Signal signal)
- {
- try
- {
- listener.catchSignal(signal);
- }
- catch (RuntimeException rte)
- {
- log.error("Signal processing error", rte);
- }
- }
-}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/DeploymentService.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/DeploymentService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/DeploymentService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service.preview;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.client.preview.Deployment;
+import org.jbpm.api.service.Service;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The marker interface for all Services
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Sep-2008
+ */
+public abstract class DeploymentService implements Service
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(DeploymentService.class);
+
+ /**
+ * Deploy a new process to the process service.
+ */
+ ObjectName deploy(Deployment deployment)
+ {
+ return null;
+ }
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageBuilderService.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageBuilderService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageBuilderService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageBuilderService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service.preview;
+
+//$Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.service.AbstractService;
+
+/**
+ * The MessageBuilder can be used to build a {@link Message} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class MessageBuilderService extends AbstractService
+{
+ /**
+ * Locate the default MessageBuilder
+ */
+ public static MessageBuilder locateMessageBuilder()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ MessageBuilderService builderService = engine.getService(MessageBuilderService.class);
+ return builderService.getMessageBuilder();
+ }
+
+ /**
+ * Get the MessageBuilder
+ */
+ public abstract MessageBuilder getMessageBuilder();
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageService.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/MessageService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,170 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software{} you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation{} either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY{} without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software{} if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service.preview;
+
+//$Id$
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.preview.MessageListener;
+import org.jbpm.api.model.Event;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.model.Task;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Participant;
+import org.jbpm.api.service.AbstractService;
+import org.jbpm.api.service.ProcessInstanceService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The ProcessEngine sends messages through the MessageService.
+ * <p/>
+ * A {@link Message} has an ID and is targeted to a
+ * specific Participant. A component can register a {@link MessageListener} with the MessageService.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public abstract class MessageService extends AbstractService
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(MessageService.class);
+
+ // The set of registered message listeners
+ private Map<ObjectName, MessageListener> listeners = new HashMap<ObjectName, MessageListener>();
+
+ /**
+ * Locate the default MessageService
+ */
+ public static MessageService locateMessageService()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ return engine.getService(MessageService.class);
+ }
+
+ /**
+ * Add a MessageListener
+ */
+ public void addMessageListener(MessageListener listener)
+ {
+ synchronized (listeners)
+ {
+ if (hasMessageListener(listener.getKey()))
+ throw new IllegalStateException("Listener already registered: " + listener.getKey());
+
+ log.debug("addMessageListener: " + listener.getKey());
+ listeners.put(listener.getKey(), listener);
+ }
+ }
+
+ /**
+ * Get the set of registered MessageListeners
+ */
+ public Set<MessageListener> getMessageListeners()
+ {
+ synchronized (listeners)
+ {
+ HashSet<MessageListener> set = new HashSet<MessageListener>(listeners.values());
+ return Collections.unmodifiableSet(set);
+ }
+ }
+
+ /**
+ * Get a MessageListener for a given ID
+ *
+ * @return null if there is none
+ */
+ public MessageListener getMessageListener(ObjectName listenerID)
+ {
+ synchronized (listeners)
+ {
+ return listeners.get(listenerID);
+ }
+ }
+
+ /**
+ * True if there is a MessageListener for a given ID
+ */
+ public boolean hasMessageListener(ObjectName listenerID)
+ {
+ return getMessageListener(listenerID) != null;
+ }
+
+ /**
+ * Remove an MessageListener
+ */
+ public void removeMessageListener(ObjectName listenerID)
+ {
+ synchronized (listeners)
+ {
+ log.debug("removeMessageListener: " + listenerID);
+ listeners.remove(listenerID);
+ }
+ }
+
+ /**
+ * Send a message to a given {@link Task} or {@link Event}
+ */
+ public void sendMessage(ObjectName procID, String targetName, Message msg)
+ {
+ ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
+ ProcessInstance proc = procService.getProcess(procID);
+ if (proc == null)
+ throw new IllegalStateException("Cannot obtain registered process: " + procID);
+
+ Node targetNode = proc.getNode(targetName);
+ if (targetNode == null)
+ throw new IllegalArgumentException("Cannot find message target: " + targetName);
+ if (targetNode instanceof MessageListener == false)
+ throw new IllegalArgumentException("Message target is not a valid message receiver: " + targetName);
+
+ log.debug("sendMessage to " + targetNode + " => " + msg);
+ MessageListener msgListener = (MessageListener)targetNode;
+ msgListener.catchMessage(msg);
+ }
+
+ /**
+ * Send a message to a given {@link MessageListener}
+ */
+ public void sendMessage(Message msg)
+ {
+ Participant toRef = msg.getToRef();
+ if (toRef == null)
+ throw new IllegalArgumentException("Target entity cannot be null");
+
+ MessageListener msgListener = getMessageListener(toRef.getName());
+ if (msgListener == null)
+ throw new IllegalStateException("No message listener registered for: " + toRef);
+
+ log.debug("sendMessage to '" + toRef + "' => " + msg);
+ msgListener.catchMessage(msg);
+ }
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/PersistenceService.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/PersistenceService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/PersistenceService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service.preview;
+
+// $Id$
+
+import javax.management.ObjectName;
+
+import org.hibernate.Session;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.service.AbstractService;
+
+/**
+ * The persistence service.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Sep-2008
+ */
+public abstract class PersistenceService extends AbstractService
+{
+ /**
+ * Locate the default PersistenceService
+ */
+ public static PersistenceService locatePersistenceService()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ return engine.getService(PersistenceService.class);
+ }
+
+ /**
+ * Create a new persistence session
+ */
+ public abstract Session createSession();
+
+ /**
+ * Save the ProcessDefinition to persistent storage
+ */
+ public abstract ObjectName saveProcessDefinition(ProcessDefinition procDef);
+
+ /**
+ * Load the ProcessDefinition from persistent storage
+ */
+ public abstract ProcessDefinition loadProcessDefinition(ObjectName procDefID);
+
+ /**
+ * Delete the ProcessDefinition from persistent storage
+ */
+ public abstract void deleteProcessDefinition(ProcessDefinition procDef);
+
+ /**
+ * Save the Process to persistent storage
+ */
+ public abstract ObjectName saveProcess(ProcessInstance proc);
+
+ /**
+ * Load the Process from persistent storage
+ */
+ public abstract ProcessInstance loadProcess(ObjectName procID);
+
+ /**
+ * Delete the Process from persistent storage
+ */
+ public abstract void deleteProcess(ProcessInstance proc);
+
+ /**
+ * Save the Node to persistent storage
+ */
+ public abstract ObjectName saveNode(Session session, Node node);
+
+ /**
+ * Load the Node from persistent storage
+ */
+ public abstract <T extends Node> T loadNode(Session session, Class<T> clazz, ObjectName nodeID);
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/ProcessEngineRegistry.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/ProcessEngineRegistry.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/ProcessEngineRegistry.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service.preview;
+
+//$Id$
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A registry of ProcessEngine instances per VM
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Sep-2008
+ */
+public final class ProcessEngineRegistry
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(ProcessEngineRegistry.class);
+
+ // The process engine registry
+ static Map<String, ProcessEngine> engineRegistry = new HashMap<String, ProcessEngine>();
+
+ // Hide constructor
+ private ProcessEngineRegistry()
+ {
+ }
+
+ /**
+ * Get the set of registered engine names
+ */
+ public static Set<String> getEngineNames()
+ {
+ return engineRegistry.keySet();
+ }
+
+ /**
+ * Get a process engine by name
+ * @return null, if there is no engine registered under the given name
+ */
+ public static ProcessEngine getEngine(String engineName)
+ {
+ return engineRegistry.get(engineName);
+ }
+
+ /**
+ * Register a ProcessEngine
+ * @throws IllegalStateException If a ProcessEngine with that name is already registered
+ */
+ public static void registerEngine(ProcessEngine engine)
+ {
+ if (engineRegistry.get(engine.getName()) != null)
+ throw new IllegalStateException("Process engine already registered: " + engine.getName());
+
+ log.debug("Register: " + engine);
+ engineRegistry.put(engine.getName(), engine);
+ }
+
+ /**
+ * Unregister a ProcessEngine for a given name
+ */
+ public static ProcessEngine unregisterEngine(String name)
+ {
+ ProcessEngine pe = engineRegistry.remove(name);
+ log.debug("Unregister: " + name + "=" + pe);
+ return pe;
+ }
+
+
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/SignalBuilderService.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalBuilderService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/SignalBuilderService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/SignalBuilderService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service.preview;
+
+//$Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.builder.preview.SignalBuilder;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.service.AbstractService;
+
+/**
+ * The SignalBuilder can be used to build a {@link Signal} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class SignalBuilderService extends AbstractService
+{
+ /**
+ * Locate the default SignalBuilder
+ */
+ public static SignalBuilder locateSignalBuilder()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ SignalBuilderService builderService = engine.getService(SignalBuilderService.class);
+ return builderService.getSignalBuilder();
+ }
+
+ /**
+ * Get the SignalBuilder
+ */
+ public abstract SignalBuilder getSignalBuilder();
+}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/SignalService.java (from rev 2888, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/SignalService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/preview/SignalService.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service.preview;
+
+//$Id$
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.preview.SignalListener;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.service.AbstractService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link Signal} is like an undirected flare shot up
+ * into the air. A component can register a {@link SignalListener} with the SignalService.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public abstract class SignalService extends AbstractService
+{
+ // provide logging
+ final static Logger log = LoggerFactory.getLogger(SignalService.class);
+
+ // The map of registered signal listeners
+ private Set<SignalListener> listeners = new HashSet<SignalListener>();
+
+ /**
+ * Locate the default SignalService
+ */
+ public static SignalService locateSignalService()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ return engine.getService(SignalService.class);
+ }
+
+ /**
+ * Add a SignalListener for a given source
+ */
+ public void addSignalListener(SignalListener listener)
+ {
+ synchronized (listeners)
+ {
+ log.debug("addSignalListener: " + listener);
+ listeners.add(listener);
+ }
+ }
+
+ /**
+ * Get the set of registered SignalListeners
+ */
+ public Set<SignalListener> getSignalListeners()
+ {
+ synchronized (listeners)
+ {
+ HashSet<SignalListener> set = new HashSet<SignalListener>(listeners);
+ return Collections.unmodifiableSet(set);
+ }
+ }
+
+ /**
+ * Remove a SignalListener for a given source
+ */
+ public void removeSignalListener(SignalListener listener)
+ {
+ synchronized (listeners)
+ {
+ log.debug("removeSignalListener: " + listener);
+ listeners.remove(listener);
+ }
+ }
+
+ /**
+ * Throw a signal to all registered listeners
+ */
+ public void throwSignal(Signal signal)
+ {
+ log.debug("throwSignal: " + signal);
+ Set<SignalListener> currentSet = getSignalListeners();
+ for (SignalListener listener : currentSet)
+ {
+ if (failsafeAccept(listener, signal))
+ failsafeThrow(listener, signal);
+ }
+ }
+
+ private boolean failsafeAccept(SignalListener listener, Signal signal)
+ {
+ try
+ {
+ boolean accept = listener.acceptSignal(signal);
+ return accept;
+ }
+ catch (RuntimeException rte)
+ {
+ log.error("Signal processing error", rte);
+ return false;
+ }
+ }
+
+ private void failsafeThrow(SignalListener listener, Signal signal)
+ {
+ try
+ {
+ listener.catchSignal(signal);
+ }
+ catch (RuntimeException rte)
+ {
+ log.error("Signal processing error", rte);
+ }
+ }
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestCase.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestCase.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/APITestCase.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -30,7 +30,7 @@
import junit.framework.TestCase;
import org.jbpm.api.Constants;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -35,20 +35,20 @@
import javax.management.ObjectName;
import org.jbpm.api.BPMException;
-import org.jbpm.api.client.MessageListener;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.SignalListener;
-import org.jbpm.api.model.Message;
+import org.jbpm.api.client.preview.MessageListener;
+import org.jbpm.api.client.preview.SignalListener;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.Signal.SignalType;
-import org.jbpm.api.model.builder.SignalBuilder;
+import org.jbpm.api.model.builder.preview.SignalBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.api.service.DialectHandler;
import org.jbpm.api.service.DialectHandlerService;
-import org.jbpm.api.service.MessageService;
import org.jbpm.api.service.ProcessDefinitionService;
-import org.jbpm.api.service.SignalBuilderService;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.service.preview.MessageService;
+import org.jbpm.api.service.preview.SignalBuilderService;
+import org.jbpm.api.service.preview.SignalService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -24,8 +24,8 @@
import java.net.URL;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.config.MicrocontainerConfiguration;
-import org.jbpm.api.service.ProcessEngineRegistry;
+import org.jbpm.api.client.internal.MicrocontainerConfiguration;
+import org.jbpm.api.service.preview.ProcessEngineRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestHelper.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestHelper.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestHelper.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -31,7 +31,7 @@
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
/**
* An integration test helper that deals with test deployment/undeployment, etc.
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/ProcessCatalog.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,16 +26,16 @@
import junit.framework.TestCase;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Assignment;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.service.ProcessBuilderService;
/**
Modified: projects/spec/trunk/modules/cts/pom.xml
===================================================================
--- projects/spec/trunk/modules/cts/pom.xml 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/pom.xml 2008-11-12 10:08:22 UTC (rev 2889)
@@ -46,6 +46,8 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
+ <exclude>org/jbpm/test/cts/preview/**</exclude>
+ <exclude>org/jbpm/test/cts/pattern/**</exclude>
</excludes>
</configuration>
</plugin>
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,11 +26,11 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -47,7 +47,7 @@
public void testMerge() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
// Start the process
proc.startProcess();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,13 +26,13 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
-import org.jbpm.api.model.builder.GatewayBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.GatewayBuilder;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.runtime.BasicAttachments;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -49,7 +49,7 @@
public void testGateA() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "5");
@@ -64,7 +64,7 @@
public void testGateB() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "15");
@@ -79,7 +79,7 @@
public void testInvalidGate() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "10");
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/endevent (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/endevent/EndEventMessageTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/endevent/EndEventMessageTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,18 +19,18 @@
* 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.test.cts.endevent;
+package org.jbpm.test.cts.preview.endevent;
// $Id$
import java.io.IOException;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
-import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
import org.jbpm.api.runtime.BasicAttachments;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -46,7 +46,7 @@
public void testStart() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
// Start the process
BasicAttachments att = new BasicAttachments();
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/executioncontext (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/executioncontext/ExecutionContextTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext/ExecutionContextTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/executioncontext/ExecutionContextTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,7 +19,7 @@
* 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.test.cts.executioncontext;
+package org.jbpm.test.cts.preview.executioncontext;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewayMergeTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,18 +19,18 @@
* 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.test.cts.gateway.inclusive;
+package org.jbpm.test.cts.preview.gateway.inclusive;
// $Id$
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -46,7 +46,7 @@
public void testSimpleMerge() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
// Start the process
proc.startProcess();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/inclusive/InclusiveGatewaySplitTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,20 +19,20 @@
* 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.test.cts.gateway.inclusive;
+package org.jbpm.test.cts.preview.gateway.inclusive;
// $Id$
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
-import org.jbpm.api.model.builder.GatewayBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.GatewayBuilder;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.runtime.BasicAttachments;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -49,7 +49,7 @@
public void testGateA() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "5");
@@ -63,7 +63,7 @@
public void testGateB() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "15");
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewayMergeTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,21 +19,21 @@
* 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.test.cts.gateway.parallel;
+package org.jbpm.test.cts.preview.gateway.parallel;
// $Id$
import java.io.IOException;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
-import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -50,7 +50,7 @@
public void testParallelMerge() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
// Start the process
proc.startProcess();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/gateway/parallel/ParallelGatewaySplitTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,7 +19,7 @@
* 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.test.cts.gateway.parallel;
+package org.jbpm.test.cts.preview.gateway.parallel;
// $Id$
@@ -28,12 +28,12 @@
import javax.management.ObjectName;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Gateway.GatewayType;
-import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -49,7 +49,7 @@
public void testParallelSplit() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
proc.startProcess();
proc.waitForEnd(5000);
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeInputSetTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeInputSetTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeInputSetTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,19 +19,19 @@
* 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.test.cts.node;
+package org.jbpm.test.cts.preview.node;
// $Id$
import java.io.IOException;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
-import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
import org.jbpm.api.runtime.BasicAttachments;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -51,7 +51,7 @@
public void testValidProps() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("frog", "kermit");
@@ -66,7 +66,7 @@
public void testInvalidProps() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("pig", "piggy");
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeOutputSetTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodeOutputSetTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodeOutputSetTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,19 +19,19 @@
* 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.test.cts.node;
+package org.jbpm.test.cts.preview.node;
// $Id$
import java.io.IOException;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.Event.EventDetailType;
-import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -51,7 +51,7 @@
public void testValidProps() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
proc.startProcess();
proc.waitForEnd(5000);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodePropertyTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/node/NodePropertyTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/node/NodePropertyTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,21 +19,21 @@
* 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.test.cts.node;
+package org.jbpm.test.cts.preview.node;
// $Id$
import java.io.IOException;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -52,7 +52,7 @@
public void testActivityPropertyRead() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
proc.startProcess();
proc.waitForEnd(5000);
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/process (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/process/ProcessPropertyTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/process/ProcessPropertyTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,20 +19,20 @@
* 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.test.cts.process;
+package org.jbpm.test.cts.preview.process;
// $Id$
import java.io.IOException;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -57,7 +57,7 @@
public void testProcessProperties() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
proc.startProcess();
proc.waitForEnd(5000);
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/service/signal (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/service/signal/SignalMultithreadTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalMultithreadTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/service/signal/SignalMultithreadTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,14 +19,14 @@
* 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.test.cts.service.signal;
+package org.jbpm.test.cts.preview.service.signal;
// $Id$
-import org.jbpm.api.client.SignalListener;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.Signal.SignalType;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.client.preview.SignalListener;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
+import org.jbpm.api.service.preview.SignalService;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/service/signal/SignalServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/service/signal/SignalServiceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,15 +19,15 @@
* 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.test.cts.service.signal;
+package org.jbpm.test.cts.preview.service.signal;
// $Id$
import java.util.List;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.Signal.SignalType;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
+import org.jbpm.api.service.preview.SignalService;
import org.jbpm.api.test.CTSTestCase;
/**
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/startevent (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/startevent/StartEventSignalTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/startevent/StartEventSignalTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,7 +19,7 @@
* 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.test.cts.startevent;
+package org.jbpm.test.cts.preview.startevent;
// $Id$
@@ -28,23 +28,23 @@
import javax.management.ObjectName;
-import org.jbpm.api.client.SignalListener;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.client.preview.SignalListener;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.model.Signal.SignalType;
-import org.jbpm.api.model.builder.EventBuilder;
-import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.model.builder.preview.EventBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.service.ProcessDefinitionService;
-import org.jbpm.api.service.ProcessService;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.service.ProcessInstanceService;
+import org.jbpm.api.service.preview.SignalService;
import org.jbpm.api.test.CTSTestCase;
/**
@@ -63,7 +63,7 @@
ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
procDefService.registerProcessDefinition(procDef);
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
try
{
proc.startProcess();
@@ -79,7 +79,7 @@
sigService.throwSignal(newSignal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
// Get the just started process
- ProcessService procService = ProcessService.locateProcessService();
+ ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
Set<ObjectName> procIDs = procService.getProcesses("StartEventSignal", null);
proc = procService.getProcess(procIDs.iterator().next());
Added: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,101 @@
+/*
+ * 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.test.cts.preview.task.java;
+
+// $Id$
+
+import java.io.IOException;
+
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
+import org.jbpm.api.runtime.BasicNodeHandler;
+import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.runtime.ExecutionHandler;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.service.ProcessBuilderService;
+import org.jbpm.api.test.CTSTestCase;
+
+/**
+ * Test ExecutionHandler attached to Task
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 03-Jul-2008
+ */
+public class JavaTaskTest extends CTSTestCase
+{
+ public void testExecutionHandler() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstance proc = procDef.newInstance();
+
+ proc.startProcess();
+ proc.waitForEnd(5000);
+
+ assertEquals("kermit", TaskExecutionHandler.procProp);
+ assertEquals("piggy", TaskExecutionHandler.taskProp);
+ assertEquals(Boolean.TRUE, TaskExecutionHandler.procAssign);
+ assertEquals(Boolean.TRUE, TaskExecutionHandler.taskAssign);
+ }
+
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ procBuilder.addProcess("TaskExecutionHandlerTest").addProcessProperty("procProp", "kermit");
+ procBuilder.addProcessAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "TaskExecutionHandlerTest_procProp == 'kermit'", "procAssign");
+ procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
+ TaskBuilder taskBuilder = procBuilder.addTask("TaskA");
+ taskBuilder.addNodeProperty("taskProp", "piggy").addExecutionHandler(TaskExecutionHandler.class).addSequenceFlow("End");
+ taskBuilder.addNodeAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "TaskExecutionHandlerTest_TaskA_taskProp == 'piggy'", "taskAssign");
+ procBuilder.addEndEvent("End");
+ return procBuilder.getProcessDefinition();
+ }
+
+ @SuppressWarnings("serial")
+ public static class TaskExecutionHandler extends BasicNodeHandler implements ExecutionHandler
+ {
+ static String procProp;
+ static String taskProp;
+ static Object procAssign;
+ static Object taskAssign;
+
+ /**
+ * This ExecutionHandler is supposed to see
+ * - Process properties
+ * - The result of start time process assignments
+ * - Activity properties
+ * - The result of start time activity assignments
+ */
+ @Override
+ public void execute(Token token)
+ {
+ ExecutionContext exContext = token.getExecutionContext();
+ procProp = (String)exContext.getAttachment("TaskExecutionHandlerTest.procProp");
+ taskProp = (String)exContext.getAttachment("TaskExecutionHandlerTest.TaskA.taskProp");
+ procAssign = exContext.getAttachment("procAssign");
+ taskAssign = exContext.getAttachment("taskAssign");
+ }
+ }
+}
Property changes on: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/java/JavaTaskTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/receive/ReceiveTaskTest.java (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/receive/ReceiveTaskTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/receive/ReceiveTaskTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,180 @@
+/*
+ * 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.test.cts.preview.task.receive;
+
+// $Id$
+
+import java.io.IOException;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.preview.SignalListener;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.Event.EventDetailType;
+import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.EventBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
+import org.jbpm.api.service.ProcessBuilderService;
+import org.jbpm.api.service.ProcessDefinitionService;
+import org.jbpm.api.service.ProcessInstanceService;
+import org.jbpm.api.service.preview.MessageBuilderService;
+import org.jbpm.api.service.preview.MessageService;
+import org.jbpm.api.service.preview.SignalService;
+import org.jbpm.api.test.CTSTestCase;
+
+/**
+ * Test Receive Task
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 03-Jul-2008
+ */
+public class ReceiveTaskTest extends CTSTestCase
+{
+ public void testReceiveTaskWithNoMessage() throws Exception
+ {
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ procBuilder.addProcess("ReceiveTaskTest").addStartEvent("Start").addSequenceFlow("TaskA");
+ procBuilder.addTask("TaskA", TaskType.Receive).addSequenceFlow("End").addEndEvent("End");
+ try
+ {
+ procBuilder.getProcessDefinition();
+ fail("A Message for the MessageRef attribute MUST be entered");
+ }
+ catch (InvalidProcessException ex)
+ {
+ // expected
+ }
+ }
+
+ public void testUnregisteredProcess() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstance proc = procDef.newInstance();
+
+ MessageService msgService = MessageService.locateMessageService();
+ try
+ {
+ msgService.sendMessage(proc.getKey(), "TaskA", getMessage());
+ fail("Send to an unregistered process is expected to fail");
+ }
+ catch (RuntimeException ex)
+ {
+ // expected
+ }
+ }
+
+ public void testSuspendedMessage() throws Exception
+ {
+ ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
+ ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
+
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstance proc = procDef.newInstance();
+
+ ObjectName procID = procService.registerProcess(proc);
+ try
+ {
+ // Send the message before the process is started
+ MessageService msgService = MessageService.locateMessageService();
+ msgService.sendMessage(procID, "TaskA", getMessage());
+
+ proc.startProcess();
+ proc.waitForEnd(5000);
+ }
+ finally
+ {
+ procDefService.unregisterProcessDefinition(procDef.getKey());
+ }
+
+ Message endMsg = getMessages().get(0);
+ assertNotNull("End message expected", endMsg);
+ assertEquals("bar", endMsg.getProperty("foo").getValue());
+ }
+
+ public void testSuspendedToken() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ final ProcessInstance proc = procDef.newInstance();
+ SignalListener sigListener = new SignalListener()
+ {
+ private boolean sendMessage = true;
+
+ public boolean acceptSignal(Signal signal)
+ {
+ return signal.getSignalType() == SignalType.SYSTEM_TASK_EXIT;
+ }
+
+ public void catchSignal(Signal signal)
+ {
+ // Send the message after the process reached the receive task
+ if (sendMessage == true)
+ {
+ sendMessage = false;
+ MessageService msgService = MessageService.locateMessageService();
+ msgService.sendMessage(proc.getKey(), "TaskA", getMessage());
+ }
+ }
+ };
+ SignalService sigManager = SignalService.locateSignalService();
+ sigManager.addSignalListener(sigListener);
+
+ try
+ {
+ proc.startProcess();
+ proc.waitForEnd(5000);
+ }
+ finally
+ {
+ sigManager.removeSignalListener(sigListener);
+ }
+
+ Message endMsg = getMessages().get(0);
+ assertNotNull("End message expected", endMsg);
+ assertEquals("bar", endMsg.getProperty("foo").getValue());
+ }
+
+ private Message getMessage()
+ {
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
+ Message msg = msgBuilder.newMessage("ReceiveTaskMessage").addProperty("foo", "bar", true).getMessage();
+ return msg;
+ }
+
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ procBuilder.addProcess("ReceiveTaskTest");
+ procBuilder.addProcessMessage("ReceiveTaskMessage").addProperty("foo", null, true);
+ procBuilder.addProcessMessage("EndEventMessage").addToRef(getTestID()).addProperty("foo", null, true);
+ procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
+ procBuilder.addTask("TaskA", TaskType.Receive).addInMessageRef("ReceiveTaskMessage");
+ EventBuilder eventBuilder = procBuilder.addSequenceFlow("End").addEndEvent("End", EventDetailType.Message);
+ eventBuilder.addMessageRef("EndEventMessage");
+ return procBuilder.getProcessDefinition();
+ }
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/send/SendTaskTest.java (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/send/SendTaskTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/send/SendTaskTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,89 @@
+/*
+ * 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.test.cts.preview.task.send;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.List;
+
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.ProcessBuilderService;
+import org.jbpm.api.test.CTSTestCase;
+
+/**
+ * Test Send Task
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 03-Jul-2008
+ */
+public class SendTaskTest extends CTSTestCase
+{
+ public void testSendTask() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstance proc = procDef.newInstance();
+
+ BasicAttachments att = new BasicAttachments();
+ att.addAttachment("foo", "bar");
+ proc.startProcess(att);
+ proc.waitForEnd(5000);
+
+ List<Message> messages = getMessages();
+ assertEquals(1, messages.size());
+ assertEquals("bar", messages.get(0).getProperty("foo").getValue());
+ }
+
+ public void testSendTaskWithNoMessage() throws Exception
+ {
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ procBuilder.addProcess("SendTaskTest").addStartEvent("Start").addSequenceFlow("TaskA");
+ procBuilder.addTask("TaskA", TaskType.Send).addSequenceFlow("End").addEndEvent("End");
+ try
+ {
+ procBuilder.getProcessDefinition();
+ fail("A Message for the MessageRef attribute MUST be entered");
+ }
+ catch (InvalidProcessException ex)
+ {
+ // expected
+ }
+ }
+
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ MessageBuilder msgBuilder = procBuilder.addProcess("SendTaskTest").addProcessMessage("SendTaskMessage");
+ msgBuilder.addToRef(getTestID()).addProperty("foo", null, true);
+ procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
+ procBuilder.addTask("TaskA", TaskType.Send).addOutMessageRef("SendTaskMessage");
+ procBuilder.addSequenceFlow("End").addEndEvent("End");
+ return procBuilder.getProcessDefinition();
+ }
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskCallbackTest.java (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskCallbackTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskCallbackTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,91 @@
+/*
+ * 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.test.cts.preview.task.user;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.List;
+
+import org.jbpm.api.client.preview.UserTaskCallback;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.Event.EventDetailType;
+import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.UserTask;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.ProcessBuilderService;
+import org.jbpm.api.test.CTSTestCase;
+
+/**
+ * Test UserTask that uses the callback API
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2008
+ */
+public class UserTaskCallbackTest extends CTSTestCase
+{
+ public void testUserTask() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstance proc = procDef.newInstance();
+
+ // Attach the callback to the UserTask
+ UserTask userTask = proc.getNode(UserTask.class, "UserTask");
+ userTask.setUserTaskCallback(new UserTaskCallbackImpl());
+
+ BasicAttachments att = new BasicAttachments();
+ att.addAttachment("foo", "xxx");
+ proc.startProcess(att);
+ proc.waitForEnd(5000);
+
+ List<Message> messages = getMessages();
+ assertEquals(1, messages.size());
+ assertEquals("xxx", messages.get(0).getProperty("bar").getValue());
+ }
+
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ procBuilder.addProcess("UserTaskTest");
+ procBuilder.addProcessMessage("OutMessage").addProperty("foo", null, true);
+ procBuilder.addProcessMessage("InMessage").addProperty("bar", null, true);
+ procBuilder.addProcessMessage("EndMessage").addToRef(getTestID()).addProperty("bar", null, true);
+ procBuilder.addStartEvent("Start").addSequenceFlow("UserTask");
+ procBuilder.addTask("UserTask", TaskType.User).addOutMessageRef("OutMessage").addInMessageRef("InMessage");
+ procBuilder.addSequenceFlow("End").addEndEvent("End", EventDetailType.Message).addMessageRef("EndMessage");
+ return procBuilder.getProcessDefinition();
+ }
+
+ public static class UserTaskCallbackImpl extends UserTaskCallback
+ {
+ @Override
+ public void callback(Attachments att)
+ {
+ Object value = att.removeAttachment("foo");
+ att.addAttachment("bar", value);
+ }
+ }
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskTest.java (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/task/user/UserTaskTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1,128 @@
+/*
+ * 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.test.cts.preview.task.user;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.Constants;
+import org.jbpm.api.client.preview.MessageListener;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.model.Event.EventDetailType;
+import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.service.ProcessBuilderService;
+import org.jbpm.api.service.ProcessInstanceService;
+import org.jbpm.api.service.preview.MessageBuilderService;
+import org.jbpm.api.service.preview.MessageService;
+import org.jbpm.api.test.CTSTestCase;
+
+/**
+ * Test User Task
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 07-Oct-2008
+ */
+public class UserTaskTest extends CTSTestCase
+{
+ static final ObjectName MSG_LISTENER_ID = ObjectNameFactory.create(Constants.ID_DOMAIN, "msgListener", "UserTaskTest");
+
+ public void testUserTask() throws Exception
+ {
+ ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
+ ProcessInstance proc = procDef.newInstance();
+
+ // Register the process - this assigns the procID
+ ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
+ procService.registerProcess(proc);
+
+ // Add the user message listener
+ MessageService msgService = MessageService.locateMessageService();
+ msgService.addMessageListener(new UserMessageListener(proc.getKey()));
+
+ try
+ {
+ BasicAttachments att = new BasicAttachments();
+ att.addAttachment("foo", "xxx");
+ proc.startProcess(att);
+ proc.waitForEnd(5000);
+
+ List<Message> messages = getMessages();
+ assertEquals(1, messages.size());
+ assertEquals("xxx", messages.get(0).getProperty("bar").getValue());
+ }
+ finally
+ {
+ msgService.removeMessageListener(MSG_LISTENER_ID);
+ }
+ }
+
+ protected ProcessDefinition getProcessDefinition() throws IOException
+ {
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ procBuilder.addProcess("UserTaskTest");
+ procBuilder.addProcessMessage("OutMessage").addToRef(MSG_LISTENER_ID).addProperty("foo", null, true);
+ procBuilder.addProcessMessage("InMessage").addProperty("bar", null, true);
+ procBuilder.addProcessMessage("EndMessage").addToRef(getTestID()).addProperty("bar", null, true);
+ procBuilder.addStartEvent("Start").addSequenceFlow("UserTask");
+ procBuilder.addTask("UserTask", TaskType.User).addOutMessageRef("OutMessage").addInMessageRef("InMessage");
+ procBuilder.addSequenceFlow("End").addEndEvent("End", EventDetailType.Message).addMessageRef("EndMessage");
+ return procBuilder.getProcessDefinition();
+ }
+
+ public static class UserMessageListener implements MessageListener
+ {
+ ObjectName procID;
+
+ public UserMessageListener(ObjectName procID)
+ {
+ this.procID = procID;
+ }
+
+ @Override
+ public void catchMessage(Message message)
+ {
+ String propValue = message.getProperty("foo").getValue();
+ MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
+ Message resMessage = msgBuilder.newMessage("InMessage").addProperty("bar", propValue, true).getMessage();
+
+ MessageService msgService = MessageService.locateMessageService();
+ msgService.sendMessage(procID, "UserTask", resMessage);
+ }
+
+ @Override
+ public ObjectName getKey()
+ {
+ return MSG_LISTENER_ID;
+ }
+
+ }
+}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction (from rev 2888, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/transaction)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredMarshallerTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/transaction/TxRequiredMarshallerTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredMarshallerTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,7 +19,7 @@
* 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.test.cts.transaction;
+package org.jbpm.test.cts.preview.transaction;
// $Id$
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/transaction/TxRequiredTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/preview/transaction/TxRequiredTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -19,7 +19,7 @@
* 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.test.cts.transaction;
+package org.jbpm.test.cts.preview.transaction;
// $Id$
@@ -29,14 +29,14 @@
import org.hibernate.Transaction;
import org.jbpm.api.Constants;
import org.jbpm.api.Constants.TxType;
-import org.jbpm.api.model.Group;
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Group.GroupType;
import org.jbpm.api.model.Task.TaskType;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Group.GroupType;
import org.jbpm.api.runtime.BasicAttachments;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.Token;
@@ -66,7 +66,7 @@
assertSame("Group same", group, groupA);
assertSame("Group same", group, groupB);
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
proc.startProcess();
proc.waitForEnd();
@@ -78,7 +78,7 @@
public void testRollback() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment(Boolean.class, "rollback", Boolean.TRUE);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,8 +26,8 @@
import java.net.URL;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.config.MicrocontainerConfiguration;
-import org.jbpm.api.service.ProcessEngineRegistry;
+import org.jbpm.api.client.internal.MicrocontainerConfiguration;
+import org.jbpm.api.service.preview.ProcessEngineRegistry;
import org.jbpm.api.test.CTSTestCase;
/**
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessDefinitionServiceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -28,10 +28,10 @@
import javax.management.ObjectName;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.service.ProcessDefinitionService;
-import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.service.ProcessInstanceService;
import org.jbpm.api.test.CTSTestCase;
import org.jbpm.api.test.ProcessCatalog;
@@ -64,9 +64,9 @@
ProcessEngine engine = procDef.getProcessEngine();
ProcessDefinitionService procDefService = engine.getService(ProcessDefinitionService.class);
- ProcessService procService = engine.getService(ProcessService.class);
+ ProcessInstanceService procService = engine.getService(ProcessInstanceService.class);
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
assertNotNull("Process not null", proc);
assertNull("Process not automatically registered", procService.getProcess(proc.getKey()));
assertNull("ProcessDefinition not automatically registered", procDefService.getProcessDefinition(procDef.getKey()));
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/process/ProcessServiceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,16 +25,16 @@
import javax.management.ObjectName;
-import org.jbpm.api.client.SignalListener;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.client.preview.SignalListener;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.service.ProcessDefinitionService;
-import org.jbpm.api.service.ProcessService;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.service.ProcessInstanceService;
+import org.jbpm.api.service.preview.SignalService;
import org.jbpm.api.test.CTSTestCase;
/**
@@ -48,10 +48,10 @@
public void testRegisterProcess() throws Exception
{
ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
- ProcessService procService = ProcessService.locateProcessService();
+ ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
ProcessDefinition procDef = getProcessDefinition();
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
assertNull("ProcessDefinition not registered automatically", procDefService.getProcessDefinition(procDef.getKey()));
assertNull("Process not registered automatically", procService.getProcess(proc.getKey()));
@@ -74,10 +74,10 @@
public void testStartProcess() throws Exception
{
final ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
- final ProcessService procService = ProcessService.locateProcessService();
+ final ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
final ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- final Process proc = procDef.newInstance();
+ final ProcessInstance proc = procDef.newInstance();
assertNull("Process not registered automatically", procService.getProcess(proc.getKey()));
SignalListener sigListener = new SignalListener()
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -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.test.cts.task;
-
-// $Id$
-
-import java.io.IOException;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.SignalListener;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.Event.EventDetailType;
-import org.jbpm.api.model.Signal.SignalType;
-import org.jbpm.api.model.Task.TaskType;
-import org.jbpm.api.model.builder.EventBuilder;
-import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.service.MessageBuilderService;
-import org.jbpm.api.service.MessageService;
-import org.jbpm.api.service.ProcessBuilderService;
-import org.jbpm.api.service.ProcessDefinitionService;
-import org.jbpm.api.service.ProcessService;
-import org.jbpm.api.service.SignalService;
-import org.jbpm.api.test.CTSTestCase;
-
-/**
- * Test Receive Task
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class ReceiveTaskTest extends CTSTestCase
-{
- public void testReceiveTaskWithNoMessage() throws Exception
- {
- ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
- procBuilder.addProcess("ReceiveTaskTest").addStartEvent("Start").addSequenceFlow("TaskA");
- procBuilder.addTask("TaskA", TaskType.Receive).addSequenceFlow("End").addEndEvent("End");
- try
- {
- procBuilder.getProcessDefinition();
- fail("A Message for the MessageRef attribute MUST be entered");
- }
- catch (InvalidProcessException ex)
- {
- // expected
- }
- }
-
- public void testUnregisteredProcess() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
-
- MessageService msgService = MessageService.locateMessageService();
- try
- {
- msgService.sendMessage(proc.getKey(), "TaskA", getMessage());
- fail("Send to an unregistered process is expected to fail");
- }
- catch (RuntimeException ex)
- {
- // expected
- }
- }
-
- public void testSuspendedMessage() throws Exception
- {
- ProcessDefinitionService procDefService = ProcessDefinitionService.locateProcessDefinitionService();
- ProcessService procService = ProcessService.locateProcessService();
-
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
-
- ObjectName procID = procService.registerProcess(proc);
- try
- {
- // Send the message before the process is started
- MessageService msgService = MessageService.locateMessageService();
- msgService.sendMessage(procID, "TaskA", getMessage());
-
- proc.startProcess();
- proc.waitForEnd(5000);
- }
- finally
- {
- procDefService.unregisterProcessDefinition(procDef.getKey());
- }
-
- Message endMsg = getMessages().get(0);
- assertNotNull("End message expected", endMsg);
- assertEquals("bar", endMsg.getProperty("foo").getValue());
- }
-
- public void testSuspendedToken() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- final Process proc = procDef.newInstance();
- SignalListener sigListener = new SignalListener()
- {
- private boolean sendMessage = true;
-
- public boolean acceptSignal(Signal signal)
- {
- return signal.getSignalType() == SignalType.SYSTEM_TASK_EXIT;
- }
-
- public void catchSignal(Signal signal)
- {
- // Send the message after the process reached the receive task
- if (sendMessage == true)
- {
- sendMessage = false;
- MessageService msgService = MessageService.locateMessageService();
- msgService.sendMessage(proc.getKey(), "TaskA", getMessage());
- }
- }
- };
- SignalService sigManager = SignalService.locateSignalService();
- sigManager.addSignalListener(sigListener);
-
- try
- {
- proc.startProcess();
- proc.waitForEnd(5000);
- }
- finally
- {
- sigManager.removeSignalListener(sigListener);
- }
-
- Message endMsg = getMessages().get(0);
- assertNotNull("End message expected", endMsg);
- assertEquals("bar", endMsg.getProperty("foo").getValue());
- }
-
- private Message getMessage()
- {
- MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
- Message msg = msgBuilder.newMessage("ReceiveTaskMessage").addProperty("foo", "bar", true).getMessage();
- return msg;
- }
-
- protected ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
- procBuilder.addProcess("ReceiveTaskTest");
- procBuilder.addProcessMessage("ReceiveTaskMessage").addProperty("foo", null, true);
- procBuilder.addProcessMessage("EndEventMessage").addToRef(getTestID()).addProperty("foo", null, true);
- procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
- procBuilder.addTask("TaskA", TaskType.Receive).addInMessageRef("ReceiveTaskMessage");
- EventBuilder eventBuilder = procBuilder.addSequenceFlow("End").addEndEvent("End", EventDetailType.Message);
- eventBuilder.addMessageRef("EndEventMessage");
- return procBuilder.getProcessDefinition();
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,89 +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.test.cts.task;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.List;
-
-import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Task.TaskType;
-import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.runtime.BasicAttachments;
-import org.jbpm.api.service.ProcessBuilderService;
-import org.jbpm.api.test.CTSTestCase;
-
-/**
- * Test Send Task
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class SendTaskTest extends CTSTestCase
-{
- public void testSendTask() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
-
- BasicAttachments att = new BasicAttachments();
- att.addAttachment("foo", "bar");
- proc.startProcess(att);
- proc.waitForEnd(5000);
-
- List<Message> messages = getMessages();
- assertEquals(1, messages.size());
- assertEquals("bar", messages.get(0).getProperty("foo").getValue());
- }
-
- public void testSendTaskWithNoMessage() throws Exception
- {
- ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
- procBuilder.addProcess("SendTaskTest").addStartEvent("Start").addSequenceFlow("TaskA");
- procBuilder.addTask("TaskA", TaskType.Send).addSequenceFlow("End").addEndEvent("End");
- try
- {
- procBuilder.getProcessDefinition();
- fail("A Message for the MessageRef attribute MUST be entered");
- }
- catch (InvalidProcessException ex)
- {
- // expected
- }
- }
-
- protected ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
- MessageBuilder msgBuilder = procBuilder.addProcess("SendTaskTest").addProcessMessage("SendTaskMessage");
- msgBuilder.addToRef(getTestID()).addProperty("foo", null, true);
- procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
- procBuilder.addTask("TaskA", TaskType.Send).addOutMessageRef("SendTaskMessage");
- procBuilder.addSequenceFlow("End").addEndEvent("End");
- return procBuilder.getProcessDefinition();
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,101 +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.test.cts.task;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Assignment.AssignTime;
-import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.model.builder.TaskBuilder;
-import org.jbpm.api.runtime.BasicNodeHandler;
-import org.jbpm.api.runtime.ExecutionContext;
-import org.jbpm.api.runtime.ExecutionHandler;
-import org.jbpm.api.runtime.Token;
-import org.jbpm.api.service.ProcessBuilderService;
-import org.jbpm.api.test.CTSTestCase;
-
-/**
- * Test ExecutionHandler attached to Task
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class TaskExecutionHandlerTest extends CTSTestCase
-{
- public void testExecutionHandler() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
-
- proc.startProcess();
- proc.waitForEnd(5000);
-
- assertEquals("kermit", TaskExecutionHandler.procProp);
- assertEquals("piggy", TaskExecutionHandler.taskProp);
- assertEquals(Boolean.TRUE, TaskExecutionHandler.procAssign);
- assertEquals(Boolean.TRUE, TaskExecutionHandler.taskAssign);
- }
-
- protected ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
- procBuilder.addProcess("TaskExecutionHandlerTest").addProcessProperty("procProp", "kermit");
- procBuilder.addProcessAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "TaskExecutionHandlerTest_procProp == 'kermit'", "procAssign");
- procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
- TaskBuilder taskBuilder = procBuilder.addTask("TaskA");
- taskBuilder.addNodeProperty("taskProp", "piggy").addExecutionHandler(TaskExecutionHandler.class).addSequenceFlow("End");
- taskBuilder.addNodeAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "TaskExecutionHandlerTest_TaskA_taskProp == 'piggy'", "taskAssign");
- procBuilder.addEndEvent("End");
- return procBuilder.getProcessDefinition();
- }
-
- @SuppressWarnings("serial")
- public static class TaskExecutionHandler extends BasicNodeHandler implements ExecutionHandler
- {
- static String procProp;
- static String taskProp;
- static Object procAssign;
- static Object taskAssign;
-
- /**
- * This ExecutionHandler is supposed to see
- * - Process properties
- * - The result of start time process assignments
- * - Activity properties
- * - The result of start time activity assignments
- */
- @Override
- public void execute(Token token)
- {
- ExecutionContext exContext = token.getExecutionContext();
- procProp = (String)exContext.getAttachment("TaskExecutionHandlerTest.procProp");
- taskProp = (String)exContext.getAttachment("TaskExecutionHandlerTest.TaskA.taskProp");
- procAssign = exContext.getAttachment("procAssign");
- taskAssign = exContext.getAttachment("taskAssign");
- }
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskCallbackTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,91 +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.test.cts.task;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.List;
-
-import org.jbpm.api.client.UserTaskCallback;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.UserTask;
-import org.jbpm.api.model.Event.EventDetailType;
-import org.jbpm.api.model.Task.TaskType;
-import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.BasicAttachments;
-import org.jbpm.api.service.ProcessBuilderService;
-import org.jbpm.api.test.CTSTestCase;
-
-/**
- * Test UserTask that uses the callback API
- *
- * @author thomas.diesler(a)jboss.com
- * @since 07-Oct-2008
- */
-public class UserTaskCallbackTest extends CTSTestCase
-{
- public void testUserTask() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
-
- // Attach the callback to the UserTask
- UserTask userTask = proc.getNode(UserTask.class, "UserTask");
- userTask.setUserTaskCallback(new UserTaskCallbackImpl());
-
- BasicAttachments att = new BasicAttachments();
- att.addAttachment("foo", "xxx");
- proc.startProcess(att);
- proc.waitForEnd(5000);
-
- List<Message> messages = getMessages();
- assertEquals(1, messages.size());
- assertEquals("xxx", messages.get(0).getProperty("bar").getValue());
- }
-
- protected ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
- procBuilder.addProcess("UserTaskTest");
- procBuilder.addProcessMessage("OutMessage").addProperty("foo", null, true);
- procBuilder.addProcessMessage("InMessage").addProperty("bar", null, true);
- procBuilder.addProcessMessage("EndMessage").addToRef(getTestID()).addProperty("bar", null, true);
- procBuilder.addStartEvent("Start").addSequenceFlow("UserTask");
- procBuilder.addTask("UserTask", TaskType.User).addOutMessageRef("OutMessage").addInMessageRef("InMessage");
- procBuilder.addSequenceFlow("End").addEndEvent("End", EventDetailType.Message).addMessageRef("EndMessage");
- return procBuilder.getProcessDefinition();
- }
-
- public static class UserTaskCallbackImpl extends UserTaskCallback
- {
- @Override
- public void callback(Attachments att)
- {
- Object value = att.removeAttachment("foo");
- att.addAttachment("bar", value);
- }
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/UserTaskTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1,128 +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.test.cts.task;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.Constants;
-import org.jbpm.api.client.MessageListener;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Event.EventDetailType;
-import org.jbpm.api.model.Task.TaskType;
-import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.model.builder.ObjectNameFactory;
-import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.runtime.BasicAttachments;
-import org.jbpm.api.service.MessageBuilderService;
-import org.jbpm.api.service.MessageService;
-import org.jbpm.api.service.ProcessBuilderService;
-import org.jbpm.api.service.ProcessService;
-import org.jbpm.api.test.CTSTestCase;
-
-/**
- * Test User Task
- *
- * @author thomas.diesler(a)jboss.com
- * @since 07-Oct-2008
- */
-public class UserTaskTest extends CTSTestCase
-{
- static final ObjectName MSG_LISTENER_ID = ObjectNameFactory.create(Constants.ID_DOMAIN, "msgListener", "UserTaskTest");
-
- public void testUserTask() throws Exception
- {
- ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
-
- // Register the process - this assigns the procID
- ProcessService procService = ProcessService.locateProcessService();
- procService.registerProcess(proc);
-
- // Add the user message listener
- MessageService msgService = MessageService.locateMessageService();
- msgService.addMessageListener(new UserMessageListener(proc.getKey()));
-
- try
- {
- BasicAttachments att = new BasicAttachments();
- att.addAttachment("foo", "xxx");
- proc.startProcess(att);
- proc.waitForEnd(5000);
-
- List<Message> messages = getMessages();
- assertEquals(1, messages.size());
- assertEquals("xxx", messages.get(0).getProperty("bar").getValue());
- }
- finally
- {
- msgService.removeMessageListener(MSG_LISTENER_ID);
- }
- }
-
- protected ProcessDefinition getProcessDefinition() throws IOException
- {
- ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
- procBuilder.addProcess("UserTaskTest");
- procBuilder.addProcessMessage("OutMessage").addToRef(MSG_LISTENER_ID).addProperty("foo", null, true);
- procBuilder.addProcessMessage("InMessage").addProperty("bar", null, true);
- procBuilder.addProcessMessage("EndMessage").addToRef(getTestID()).addProperty("bar", null, true);
- procBuilder.addStartEvent("Start").addSequenceFlow("UserTask");
- procBuilder.addTask("UserTask", TaskType.User).addOutMessageRef("OutMessage").addInMessageRef("InMessage");
- procBuilder.addSequenceFlow("End").addEndEvent("End", EventDetailType.Message).addMessageRef("EndMessage");
- return procBuilder.getProcessDefinition();
- }
-
- public static class UserMessageListener implements MessageListener
- {
- ObjectName procID;
-
- public UserMessageListener(ObjectName procID)
- {
- this.procID = procID;
- }
-
- @Override
- public void catchMessage(Message message)
- {
- String propValue = message.getProperty("foo").getValue();
- MessageBuilder msgBuilder = MessageBuilderService.locateMessageBuilder();
- Message resMessage = msgBuilder.newMessage("InMessage").addProperty("bar", propValue, true).getMessage();
-
- MessageService msgService = MessageService.locateMessageService();
- msgService.sendMessage(procID, "UserTask", resMessage);
- }
-
- @Override
- public ObjectName getKey()
- {
- return MSG_LISTENER_ID;
- }
-
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -27,12 +27,12 @@
import java.util.List;
import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.model.builder.GatewayBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.GatewayBuilder;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.runtime.BasicAttachments;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -49,7 +49,7 @@
public void testGateA() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "5");
@@ -64,7 +64,7 @@
public void testGateB() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "15");
@@ -79,7 +79,7 @@
public void testInvalidGate() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "10");
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -27,12 +27,12 @@
import java.util.List;
import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.model.builder.GatewayBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.GatewayBuilder;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.runtime.BasicAttachments;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -49,7 +49,7 @@
public void testGateA() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "5");
@@ -63,7 +63,7 @@
public void testGateB() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
BasicAttachments att = new BasicAttachments();
att.addAttachment("foo", "15");
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -29,11 +29,11 @@
import javax.management.ObjectName;
import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -49,7 +49,7 @@
public void testParallelSplit() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
proc.startProcess();
proc.waitForEnd();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequencePersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequencePersistenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequencePersistenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -28,7 +28,7 @@
import javax.management.ObjectName;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.service.preview.PersistenceService;
/**
* Test the basic execution sequence
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,11 +26,11 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -46,7 +46,7 @@
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
// Start the Process
proc.startProcess();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,11 +26,11 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -46,7 +46,7 @@
public void testSimpleMerge() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
// Start the process
proc.startProcess();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,15 +25,15 @@
import java.io.IOException;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
-import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -50,7 +50,7 @@
public void testParallelMerge() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
// Start the process
proc.startProcess();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,14 +25,14 @@
import java.io.IOException;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -50,7 +50,7 @@
public void testCaseProperties() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
proc.startProcess();
proc.waitForEnd();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,15 +25,15 @@
import java.io.IOException;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
-import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
@@ -51,7 +51,7 @@
public void testTaskDataRead() throws Exception
{
ProcessDefinition procDef = unregisterOnTearDown(getProcessDefinition());
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
proc.startProcess();
proc.waitForEnd();
Modified: projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java
===================================================================
--- projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessMarshaller.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -31,31 +31,31 @@
import javax.xml.bind.Marshaller;
import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.model.Assignment;
-import org.jbpm.api.model.ComplexGateway;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Event;
import org.jbpm.api.model.ExclusiveGateway;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Gateway;
-import org.jbpm.api.model.Group;
-import org.jbpm.api.model.InclusiveGateway;
-import org.jbpm.api.model.InputSet;
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.OutputSet;
-import org.jbpm.api.model.ParallelGateway;
-import org.jbpm.api.model.Participant;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Property;
-import org.jbpm.api.model.ReceiveTask;
-import org.jbpm.api.model.SendTask;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.SequenceFlow.ConditionType;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.ComplexGateway;
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.InclusiveGateway;
+import org.jbpm.api.model.preview.InputSet;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.OutputSet;
+import org.jbpm.api.model.preview.ParallelGateway;
+import org.jbpm.api.model.preview.Participant;
+import org.jbpm.api.model.preview.Property;
+import org.jbpm.api.model.preview.ReceiveTask;
+import org.jbpm.api.model.preview.SendTask;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.SignalHandler;
Modified: projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java
===================================================================
--- projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/ProcessUnmarshaller.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -36,13 +36,13 @@
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.SequenceFlow.ConditionType;
import org.jbpm.api.model.Task.TaskType;
-import org.jbpm.api.model.builder.EventBuilder;
-import org.jbpm.api.model.builder.GatewayBuilder;
-import org.jbpm.api.model.builder.GroupBuilder;
-import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.model.builder.ObjectNameFactory;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.model.builder.preview.EventBuilder;
+import org.jbpm.api.model.builder.preview.GatewayBuilder;
+import org.jbpm.api.model.builder.preview.GroupBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.NodeHandler;
Modified: projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBAssignment.java
===================================================================
--- projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBAssignment.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBAssignment.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -27,8 +27,8 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-import org.jbpm.api.model.Assignment;
-import org.jbpm.api.model.Assignment.AssignTime;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
/**
* An Assignment, which is used in the definition of attributes for Process,
Modified: projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBGroup.java
===================================================================
--- projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBGroup.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBGroup.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -30,7 +30,7 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-import org.jbpm.api.model.Group.GroupType;
+import org.jbpm.api.model.preview.Group.GroupType;
/**
* An Assignment, which is used in the definition of attributes for Process,
Modified: projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBSignal.java
===================================================================
--- projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBSignal.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/dialects/api10/src/main/java/org/jbpm/dialect/api10/model/JAXBSignal.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -27,7 +27,7 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.preview.Signal.SignalType;
/**
* The base of all supported event details
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AbstractElementImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -32,7 +32,7 @@
import org.hibernate.Session;
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.internal.AbstractElement;
@@ -105,22 +105,22 @@
// nothing to do
}
- protected void create(Process proc)
+ protected void create(ProcessInstance proc)
{
// nothing to do
}
- protected void register(Process proc)
+ protected void register(ProcessInstance proc)
{
// nothing to do
}
- protected void unregister(Process proc)
+ protected void unregister(ProcessInstance proc)
{
// nothing to do
}
- protected void destroy(Process proc)
+ protected void destroy(ProcessInstance proc)
{
// nothing to do
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AssignmentImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AssignmentImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/AssignmentImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -31,9 +31,9 @@
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import org.jbpm.api.model.Assignment;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.Property;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Property;
/**
* An Assignment, which is used in the definition of attributes for Process, Activities, Events, Gateways, and Gates.
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ComplexGatewayImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,9 +26,9 @@
import javax.persistence.Entity;
import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.model.ComplexGateway;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.ComplexGateway;
/**
* A Complex Gateway handles situations that are not easily handled through the other types of Gateways. Complex
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -32,15 +32,15 @@
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.service.preview.SignalService;
import org.jbpm.ri.model.builder.SingleInFlowSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -34,17 +34,17 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Event;
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.service.preview.SignalService;
import org.jbpm.ri.runtime.MessageSender;
/**
@@ -214,7 +214,7 @@
}
@Override
- protected void create(Process proc)
+ protected void create(ProcessInstance proc)
{
super.create(proc);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GateImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GateImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GateImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -35,9 +35,9 @@
import javax.persistence.OneToOne;
import org.hibernate.annotations.IndexColumn;
-import org.jbpm.api.model.Assignment;
import org.jbpm.api.model.Gate;
import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.preview.Assignment;
/**
* There MAY be zero or more Gates (except where noted below). Zero Gates are allowed if the Gateway is last object in a
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GatewayImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -38,14 +38,14 @@
import org.jbpm.api.model.Gateway;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.SequenceFlow.ConditionType;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.service.preview.SignalService;
import org.jbpm.ri.model.builder.MultipleInFlowSupport;
import org.jbpm.ri.model.builder.MultipleOutFlowSupport;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GroupImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GroupImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/GroupImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -34,9 +34,9 @@
import javax.persistence.Id;
import javax.persistence.OneToOne;
-import org.jbpm.api.model.Group;
-import org.jbpm.api.model.Property;
import org.jbpm.api.model.internal.PropertySupport;
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.Property;
/**
* A Flow Object is one of the set of following graphical objects: Event, Activity, and
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InclusiveGatewayImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -31,12 +31,12 @@
import javax.persistence.Entity;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.InclusiveGateway;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.SequenceFlow.ConditionType;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.InclusiveGateway;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.Token;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InputSetImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InputSetImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/InputSetImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -32,9 +32,9 @@
import javax.persistence.Id;
import javax.persistence.OneToOne;
-import org.jbpm.api.model.InputSet;
-import org.jbpm.api.model.Property;
import org.jbpm.api.model.internal.PropertySupport;
+import org.jbpm.api.model.preview.InputSet;
+import org.jbpm.api.model.preview.Property;
/**
* An InputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MessageImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MessageImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/MessageImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -33,10 +33,10 @@
import javax.persistence.Id;
import javax.persistence.OneToOne;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Participant;
-import org.jbpm.api.model.Property;
import org.jbpm.api.model.internal.PropertySupport;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Participant;
+import org.jbpm.api.model.preview.Property;
/**
* A Message, which is used in the definition of attributes for a @{link StartEvent},
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -43,17 +43,17 @@
import org.hibernate.annotations.IndexColumn;
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NameNotUniqueException;
-import org.jbpm.api.model.Assignment;
import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.Group;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Property;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.model.internal.PropertySupport;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.Property;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.NodeHandler;
@@ -129,7 +129,7 @@
private ProcessDefinition procDef;
@ManyToOne(targetEntity = ProcessImpl.class)
- private Process proc;
+ private ProcessInstance proc;
@ManyToOne(targetEntity = GroupImpl.class)
private Group groupRef;
@@ -152,7 +152,7 @@
}
@Override
- public Process getProcess()
+ public ProcessInstance getProcess()
{
return proc;
}
@@ -396,7 +396,7 @@
}
@Override
- protected void create(Process proc)
+ protected void create(ProcessInstance proc)
{
super.create(proc);
this.proc = proc;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/OutputSetImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/OutputSetImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/OutputSetImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -32,9 +32,9 @@
import javax.persistence.Id;
import javax.persistence.OneToOne;
-import org.jbpm.api.model.OutputSet;
-import org.jbpm.api.model.Property;
import org.jbpm.api.model.internal.PropertySupport;
+import org.jbpm.api.model.preview.OutputSet;
+import org.jbpm.api.model.preview.Property;
/**
* An OutputSet, which is used in the definition of common attributes for Activities and for attributes of a Process
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParallelGatewayImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -32,9 +32,9 @@
import javax.persistence.Transient;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.ParallelGateway;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.ParallelGateway;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.Token;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParticipantImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParticipantImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ParticipantImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -29,8 +29,8 @@
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import org.jbpm.api.model.Participant;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
+import org.jbpm.api.model.preview.Participant;
/**
* A Participant, which is used in the definition of attributes for a @{link Pool}, @{link Message}, and @{link
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessDefinitionImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -42,15 +42,15 @@
import org.hibernate.Session;
import org.jbpm.api.Constants;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Assignment;
-import org.jbpm.api.model.Group;
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Property;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Property;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -87,7 +87,7 @@
}
@Override
- public Process newInstance()
+ public ProcessInstance newInstance()
{
// Create a copy of the process structure from raw data
ProcessStructureImpl procStructCopy;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -39,17 +39,17 @@
import org.hibernate.Session;
import org.jbpm.api.Constants;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Assignment;
-import org.jbpm.api.model.Group;
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Property;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Property;
import org.jbpm.api.runtime.Attachments;
import org.jbpm.api.service.ExecutionService;
-import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.service.ProcessInstanceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -60,7 +60,7 @@
* @since 08-Jul-2008
*/
@Entity(name = "BPMProcess")
-public class ProcessImpl extends AbstractElementImpl implements Process
+public class ProcessImpl extends AbstractElementImpl implements ProcessInstance
{
private static final long serialVersionUID = 1L;
@@ -247,7 +247,7 @@
catch (RuntimeException rte)
{
// A process that cannot be started id unregistered automatically
- ProcessService procService = getProcessEngine().getService(ProcessService.class);
+ ProcessInstanceService procService = getProcessEngine().getService(ProcessInstanceService.class);
procService.unregisterProcess(getKey());
throw rte;
}
@@ -284,28 +284,28 @@
}
@Override
- protected void create(Process proc)
+ protected void create(ProcessInstance proc)
{
super.create(proc);
procStruct.create(proc);
}
@Override
- public void register(Process proc)
+ public void register(ProcessInstance proc)
{
super.register(proc);
procStruct.register(proc);
}
@Override
- public void unregister(Process proc)
+ public void unregister(ProcessInstance proc)
{
super.unregister(proc);
procStruct.unregister(proc);
}
@Override
- protected void destroy(Process proc)
+ protected void destroy(ProcessInstance proc)
{
super.destroy(proc);
procStruct.destroy(proc);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ProcessStructureImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -42,18 +42,18 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Assignment;
import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.Group;
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Property;
import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.model.internal.ProcessStructure;
import org.jbpm.api.model.internal.PropertySupport;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Property;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -359,7 +359,7 @@
}
@Override
- protected void create(Process proc)
+ protected void create(ProcessInstance proc)
{
super.create(proc);
for (Node node : getNodes())
@@ -370,7 +370,7 @@
}
@Override
- protected void register(Process proc)
+ protected void register(ProcessInstance proc)
{
super.register(proc);
for (Node node : getNodes())
@@ -381,7 +381,7 @@
}
@Override
- protected void unregister(Process proc)
+ protected void unregister(ProcessInstance proc)
{
super.unregister(proc);
for (Node node : getNodes())
@@ -392,7 +392,7 @@
}
@Override
- protected void destroy(Process proc)
+ protected void destroy(ProcessInstance proc)
{
super.destroy(proc);
for (Node node : getNodes())
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertyImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertyImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertyImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -28,7 +28,7 @@
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import org.jbpm.api.model.Property;
+import org.jbpm.api.model.preview.Property;
/**
* A Property, which is used in the definition of attributes for a Process and common activity attributes
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertySupportImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertySupportImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/PropertySupportImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -37,8 +37,8 @@
import javax.persistence.MapKey;
import javax.persistence.OneToMany;
-import org.jbpm.api.model.Property;
import org.jbpm.api.model.internal.PropertySupport;
+import org.jbpm.api.model.preview.Property;
/**
* Basic property support
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/ReceiveTaskImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -31,12 +31,12 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NotImplementedException;
-import org.jbpm.api.client.MessageListener;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.client.preview.MessageListener;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.ReceiveTask;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.ReceiveTask;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
@@ -165,7 +165,7 @@
}
@Override
- protected void create(Process proc)
+ protected void create(ProcessInstance proc)
{
super.create(proc);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SendTaskImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -27,12 +27,12 @@
import javax.persistence.Transient;
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.SendTask;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.SendTask;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.Token;
import org.jbpm.ri.runtime.MessageSender;
@@ -119,7 +119,7 @@
}
@Override
- protected void create(Process proc)
+ protected void create(ProcessInstance proc)
{
super.create(proc);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SignalImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SignalImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/SignalImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -31,8 +31,8 @@
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
+import org.jbpm.api.model.preview.Signal;
/**
* A Signal thrown by the ProcessEngine
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -30,20 +30,20 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.client.preview.SignalListener;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.Signal.SignalType;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.service.ExecutionService;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.service.preview.SignalService;
import org.jbpm.ri.model.builder.SingleOutFlowSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -187,7 +187,7 @@
// There MAY be multiple Start Events for a given Process level. Each Start Event is an independent event.
// That is, a Process Instance SHALL be generated when the Start Event is triggered.
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
StartEvent startEvent = proc.getNode(StartEvent.class, startEventName);
ExecutionService execService = engine.getService(ExecutionService.class);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -41,20 +41,20 @@
import org.jbpm.api.NotImplementedException;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.InputSet;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.OutputSet;
-import org.jbpm.api.model.Property;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Task;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.InputSet;
+import org.jbpm.api.model.preview.OutputSet;
+import org.jbpm.api.model.preview.Property;
+import org.jbpm.api.model.preview.Signal;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.service.preview.SignalService;
import org.jbpm.ri.model.builder.SingleInFlowSupport;
import org.jbpm.ri.model.builder.SingleOutFlowSupport;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/UserTaskImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -33,13 +33,13 @@
import javax.persistence.Transient;
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.MessageListener;
-import org.jbpm.api.client.UserTaskCallback;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.client.preview.MessageListener;
+import org.jbpm.api.client.preview.UserTaskCallback;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.UserTask;
import org.jbpm.api.model.internal.ProcessStructure;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.UserTask;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
@@ -202,7 +202,7 @@
}
@Override
- protected void create(Process proc)
+ protected void create(ProcessInstance proc)
{
super.create(proc);
@@ -212,7 +212,7 @@
}
@Override
- protected void register(Process proc)
+ protected void register(ProcessInstance proc)
{
super.register(proc);
@@ -227,7 +227,7 @@
}
@Override
- protected void unregister(Process proc)
+ protected void unregister(ProcessInstance proc)
{
super.unregister(proc);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/EventBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/EventBuilderImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/EventBuilderImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -24,8 +24,8 @@
//$Id$
import org.jbpm.api.model.Event;
-import org.jbpm.api.model.Signal.SignalType;
-import org.jbpm.api.model.builder.EventBuilder;
+import org.jbpm.api.model.builder.preview.EventBuilder;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.ri.model.EventImpl;
import org.jbpm.ri.model.MessageImpl;
import org.jbpm.ri.model.SignalImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/GatewayBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/GatewayBuilderImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/GatewayBuilderImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,7 +26,7 @@
import org.jbpm.api.model.Gateway;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.SequenceFlow.ConditionType;
-import org.jbpm.api.model.builder.GatewayBuilder;
+import org.jbpm.api.model.builder.preview.GatewayBuilder;
import org.jbpm.ri.model.ExpressionImpl;
import org.jbpm.ri.model.GatewayImpl;
import org.jbpm.ri.model.SequenceFlowImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/GroupBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/GroupBuilderImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/GroupBuilderImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -23,9 +23,9 @@
//$Id$
-import org.jbpm.api.model.Group;
-import org.jbpm.api.model.Group.GroupType;
-import org.jbpm.api.model.builder.GroupBuilder;
+import org.jbpm.api.model.builder.preview.GroupBuilder;
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.Group.GroupType;
import org.jbpm.ri.model.GroupImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MessageBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MessageBuilderImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/MessageBuilderImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,9 +25,9 @@
import javax.management.ObjectName;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Property;
-import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Property;
import org.jbpm.ri.model.MessageImpl;
import org.jbpm.ri.model.ParticipantImpl;
import org.jbpm.ri.model.PropertyImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,20 +25,20 @@
import org.jbpm.api.NotImplementedException;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Event.EventDetailType;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
-import org.jbpm.api.model.Group.GroupType;
import org.jbpm.api.model.Task.TaskType;
-import org.jbpm.api.model.builder.EventBuilder;
-import org.jbpm.api.model.builder.GatewayBuilder;
-import org.jbpm.api.model.builder.GroupBuilder;
-import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.model.builder.preview.EventBuilder;
+import org.jbpm.api.model.builder.preview.GatewayBuilder;
+import org.jbpm.api.model.builder.preview.GroupBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
+import org.jbpm.api.model.preview.Group.GroupType;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.SignalHandler;
@@ -63,7 +63,7 @@
import org.jbpm.ri.model.UserTaskImpl;
/**
- * The ProcessBuilder can be used to dynamically build a {@link Process}.
+ * The ProcessBuilder can be used to dynamically build a {@link ProcessInstance}.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SignalBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SignalBuilderImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/SignalBuilderImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,9 +25,9 @@
import javax.management.ObjectName;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.Signal.SignalType;
-import org.jbpm.api.model.builder.SignalBuilder;
+import org.jbpm.api.model.builder.preview.SignalBuilder;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.ri.model.SignalImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -23,10 +23,10 @@
//$Id$
-import org.jbpm.api.model.Property;
import org.jbpm.api.model.Task;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.model.preview.Property;
import org.jbpm.ri.model.ExpressionImpl;
import org.jbpm.ri.model.InputSetImpl;
import org.jbpm.ri.model.MessageImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/AssignmentInterceptor.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -23,10 +23,10 @@
//$Id$
-import org.jbpm.api.model.Assignment;
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Assignment.AssignTime;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.Token;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -29,13 +29,13 @@
import java.util.Map;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Property;
+import org.jbpm.api.model.preview.Property;
import org.jbpm.api.runtime.ExecutionContext;
/**
- * An ExecutionContext that delegates to the current {@link Node} or {@link Process} for property rerieval.
+ * An ExecutionContext that delegates to the current {@link Node} or {@link ProcessInstance} for property rerieval.
*
* @author Thomas.Diesler(a)jboss.com
* @since 15-Aug-2008
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,7 +25,7 @@
import org.hibernate.Session;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.Token;
@@ -82,7 +82,7 @@
}
@Override
- public Process getProcess()
+ public ProcessInstance getProcess()
{
return delegateToken.getProcess();
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/MessageSender.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,14 +26,14 @@
import javax.management.ObjectName;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Message;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Participant;
-import org.jbpm.api.model.Property;
-import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Participant;
+import org.jbpm.api.model.preview.Property;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.Token;
-import org.jbpm.api.service.MessageService;
+import org.jbpm.api.service.preview.MessageService;
import org.jbpm.ri.model.MessageImpl;
import org.jbpm.ri.model.ParticipantImpl;
import org.jbpm.ri.model.builder.MessageBuilderImpl;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/PersistenceSessionInterceptor.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -27,7 +27,7 @@
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
import org.jbpm.api.runtime.Token.TokenStatus;
-import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.service.preview.PersistenceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RunnableToken.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -22,13 +22,13 @@
package org.jbpm.ri.runtime;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
import org.jbpm.api.runtime.Token.TokenStatus;
-import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.service.ProcessInstanceService;
import org.jbpm.ri.model.ProcessImpl;
import org.jbpm.ri.service.ProcessServiceImpl;
import org.slf4j.Logger;
@@ -69,7 +69,7 @@
public void run()
{
- Process proc = rtProc.getProcess();
+ ProcessInstance proc = rtProc.getProcess();
try
{
SequenceFlow flow = token.getSequenceFlow();
@@ -90,7 +90,7 @@
RuntimeContext rtContext = new RuntimeContext(tokenExecutor, tokCopy);
// Add the interceptors that are defined on the ProcessService
- ProcessServiceImpl procService = (ProcessServiceImpl)node.getProcessEngine().getService(ProcessService.class);
+ ProcessServiceImpl procService = (ProcessServiceImpl)node.getProcessEngine().getService(ProcessInstanceService.class);
for (NodeInterceptor itor : procService.getNodeInterceptors())
rtContext.addInterceptor(itor);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -23,12 +23,12 @@
//$Id$
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.runtime.TokenExecutor;
/**
- * A RuntimeProcess add runtime behaviour to the {@link Process} <p/> To protect the engine from maligious user code it
- * does not extend {@link Process} directly.
+ * A RuntimeProcess add runtime behaviour to the {@link ProcessInstance} <p/> To protect the engine from maligious user code it
+ * does not extend {@link ProcessInstance} directly.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
@@ -36,12 +36,12 @@
public interface RuntimeProcess
{
/**
- * Get the associated {@link Process}
+ * Get the associated {@link ProcessInstance}
*/
- Process getProcess();
+ ProcessInstance getProcess();
/**
- * Get the {@link TokenExecutor} for this {@link Process}
+ * Get the {@link TokenExecutor} for this {@link ProcessInstance}
*/
TokenExecutor getTokenExecutor();
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -23,27 +23,27 @@
//$Id$
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.runtime.TokenExecutor;
/**
- * A RuntimeProcess add runtime behaviour to the {@link Process}
+ * A RuntimeProcess add runtime behaviour to the {@link ProcessInstance}
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
public class RuntimeProcessImpl implements RuntimeProcess
{
- private Process proc;
+ private ProcessInstance proc;
private TokenExecutor tokenExecutor;
- public RuntimeProcessImpl(Process proc)
+ public RuntimeProcessImpl(ProcessInstance proc)
{
this.proc = proc;
this.tokenExecutor = new TokenExecutorImpl(this);
}
- public Process getProcess()
+ public ProcessInstance getProcess()
{
return proc;
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -32,7 +32,7 @@
import java.util.concurrent.Executors;
import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TokenImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,7 +25,7 @@
import org.hibernate.Session;
import org.jboss.util.id.UID;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.runtime.Attachments;
import org.jbpm.api.runtime.BasicExecutionContext;
@@ -51,13 +51,13 @@
private SequenceFlow flow;
private ExecutionContext context;
private TokenStatus status;
- private Process process;
+ private ProcessInstance process;
private Session session;
/**
* Construct a Token with given {@link Attachments}
*/
- public TokenImpl(Process process, Attachments att)
+ public TokenImpl(ProcessInstance process, Attachments att)
{
this.context = new BasicExecutionContext(att);
this.id = new UID().toString();
@@ -84,7 +84,7 @@
}
@Override
- public Process getProcess()
+ public ProcessInstance getProcess()
{
return process;
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/runtime/TransactionInterceptor.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -29,12 +29,12 @@
import org.jbpm.api.NotImplementedException;
import org.jbpm.api.Constants.TxType;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Group;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Property;
-import org.jbpm.api.model.Group.GroupType;
+import org.jbpm.api.model.preview.Group;
+import org.jbpm.api.model.preview.Property;
+import org.jbpm.api.model.preview.Group.GroupType;
import org.jbpm.api.runtime.Token;
-import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.service.preview.PersistenceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -33,21 +33,21 @@
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.ProcessTimeoutException;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Assignment;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Event.EventDetailType;
-import org.jbpm.api.model.Process.ProcessStatus;
-import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.api.runtime.Attachments;
import org.jbpm.api.runtime.ExecutionContext;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
import org.jbpm.api.service.ExecutionService;
-import org.jbpm.api.service.ProcessService;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.service.ProcessInstanceService;
+import org.jbpm.api.service.preview.SignalService;
import org.jbpm.ri.model.ProcessImpl;
import org.jbpm.ri.model.SequenceFlowImpl;
import org.jbpm.ri.model.SignalImpl;
@@ -81,7 +81,7 @@
}
@Override
- public void startProcess(Process proc, Attachments att)
+ public void startProcess(ProcessInstance proc, Attachments att)
{
// Get the None Start Event if there is one and start the initial flow
StartEvent start = getNoneStartEvent(proc);
@@ -98,12 +98,12 @@
}
@Override
- public void startProcess(Process proc, StartEvent start, Attachments att)
+ public void startProcess(ProcessInstance proc, StartEvent start, Attachments att)
{
startProcessInternal(proc, start, att);
}
- private synchronized void startProcessInternal(Process proc, StartEvent start, Attachments att)
+ private synchronized void startProcessInternal(ProcessInstance proc, StartEvent start, Attachments att)
{
// Prepare the process to start
startProcessPrepare(proc);
@@ -158,7 +158,7 @@
tokenExecutor.start(initialToken);
}
- private void startProcessPrepare(Process proc)
+ private void startProcessPrepare(ProcessInstance proc)
{
// Veriy the process state
ProcessStatus procStatus = proc.getProcessStatus();
@@ -167,13 +167,13 @@
// Register the process if needed
ProcessEngine engine = getProcessEngine();
- ProcessService procService = engine.getService(ProcessService.class);
+ ProcessInstanceService procService = engine.getService(ProcessInstanceService.class);
if (procService.getProcess(proc.getKey()) == null)
procService.registerProcess(proc);
}
// Evaluate the Start time assignments
- private void startTimeAssignments(Process proc, Token token)
+ private void startTimeAssignments(ProcessInstance proc, Token token)
{
DelegatingToken delegatingToken = new DelegatingToken((MutableToken)token);
ExecutionContext exContext = token.getExecutionContext();
@@ -190,12 +190,12 @@
}
}
- public ProcessStatus waitForEnd(Process proc)
+ public ProcessStatus waitForEnd(ProcessInstance proc)
{
return waitForEndInternal(proc, 0);
}
- public ProcessStatus waitForEnd(Process proc, long timeout)
+ public ProcessStatus waitForEnd(ProcessInstance proc, long timeout)
{
return waitForEndInternal(proc, timeout);
}
@@ -205,7 +205,7 @@
* arrive at an End Event. The Process will be in a running state until all Tokens are consumed. If the process was
* aborted this method throws the causing RuntimeException if avaialable.
*/
- private ProcessStatus waitForEndInternal(Process proc, long timeout)
+ private ProcessStatus waitForEndInternal(ProcessInstance proc, long timeout)
{
ProcessImpl procImpl = (ProcessImpl)proc;
@@ -261,7 +261,7 @@
// this could happen when the Process never received a start signal
// and then we get here because of a ProcessTimeoutException
ProcessEngine engine = getProcessEngine();
- ProcessService procService = engine.getService(ProcessService.class);
+ ProcessInstanceService procService = engine.getService(ProcessInstanceService.class);
if (procService.getProcess(proc.getKey()) != null)
procService.unregisterProcess(proc.getKey());
}
@@ -270,13 +270,13 @@
return status;
}
- private boolean isProcessTerminated(Process proc)
+ private boolean isProcessTerminated(ProcessInstance proc)
{
ProcessStatus status = proc.getProcessStatus();
return status == ProcessStatus.Cancelled || status == ProcessStatus.Completed || status == ProcessStatus.Aborted;
}
- private StartEvent getNoneStartEvent(Process proc)
+ private StartEvent getNoneStartEvent(ProcessInstance proc)
{
StartEvent start = null;
for (StartEvent aux : proc.getNodes(StartEvent.class))
@@ -291,7 +291,7 @@
return start;
}
- private RuntimeProcess getRuntimeProcess(Process proc, boolean createNew)
+ private RuntimeProcess getRuntimeProcess(ProcessInstance proc, boolean createNew)
{
RuntimeProcess rtProcess;
synchronized (runtimeProcesses)
@@ -322,7 +322,7 @@
{
TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
ProcessImpl procImpl = (ProcessImpl)rtProc.getProcess();
- Process proc = rtProc.getProcess();
+ ProcessInstance proc = rtProc.getProcess();
ProcessEngine engine = getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
@@ -367,7 +367,7 @@
synchronized (proc)
{
- ProcessService procService = engine.getService(ProcessService.class);
+ ProcessInstanceService procService = engine.getService(ProcessInstanceService.class);
procService.unregisterProcess(procID);
runtimeProcesses.remove(procID);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/HibernatePersistenceServiceImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -38,10 +38,10 @@
import org.jbpm.api.ProcessNotFoundException;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.service.PersistenceService;
import org.jbpm.api.service.Service;
+import org.jbpm.api.service.preview.PersistenceService;
import org.jbpm.ri.model.AbstractElementImpl;
import org.jbpm.ri.model.ProcessDefinitionImpl;
import org.jbpm.ri.model.ProcessImpl;
@@ -151,7 +151,7 @@
}
@Override
- public ObjectName saveProcess(Process proc)
+ public ObjectName saveProcess(ProcessInstance proc)
{
log.debug("START saveProcess: " + proc.getKey());
Session session = getSessionFactory().openSession();
@@ -170,15 +170,15 @@
}
@Override
- public Process loadProcess(ObjectName procID)
+ public ProcessInstance loadProcess(ObjectName procID)
{
log.debug("START loadProcess: " + procID);
- Process proc = null;
+ ProcessInstance proc = null;
Session session = getSessionFactory().openSession();
try
{
Integer id = Integer.valueOf(procID.getKeyProperty("id"));
- proc = (Process)session.load(ProcessImpl.class, id);
+ proc = (ProcessInstance)session.load(ProcessImpl.class, id);
AbstractElementImpl elImpl = (AbstractElementImpl)proc;
elImpl.initialize(session);
}
@@ -195,7 +195,7 @@
}
@Override
- public void deleteProcess(Process proc)
+ public void deleteProcess(ProcessInstance proc)
{
log.debug("START deleteProcess: " + proc);
Session session = getSessionFactory().openSession();
@@ -204,7 +204,7 @@
{
ObjectName procID = proc.getKey();
Integer id = Integer.valueOf(procID.getKeyProperty("id"));
- proc = (Process)session.load(ProcessImpl.class, id);
+ proc = (ProcessInstance)session.load(ProcessImpl.class, id);
session.delete(proc);
tx.commit();
}
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/InMemoryPersistenceServiceImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -32,9 +32,9 @@
import org.jbpm.api.ProcessNotFoundException;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.service.preview.PersistenceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -50,7 +50,7 @@
final Logger log = LoggerFactory.getLogger(InMemoryPersistenceServiceImpl.class);
private Map<ObjectName, ProcessDefinition> procDefs = new HashMap<ObjectName, ProcessDefinition>();
- private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
+ private Map<ObjectName, ProcessInstance> procs = new HashMap<ObjectName, ProcessInstance>();
private Map<ObjectName, Node> nodes = new HashMap<ObjectName, Node>();
@Override
@@ -89,7 +89,7 @@
}
@Override
- public ObjectName saveProcess(Process proc)
+ public ObjectName saveProcess(ProcessInstance proc)
{
procs.put(proc.getKey(), proc);
@@ -100,9 +100,9 @@
}
@Override
- public Process loadProcess(ObjectName procID)
+ public ProcessInstance loadProcess(ObjectName procID)
{
- Process proc = procs.get(procID);
+ ProcessInstance proc = procs.get(procID);
if (proc == null)
throw new ProcessNotFoundException("Cannot find process: " + procID);
@@ -110,7 +110,7 @@
}
@Override
- public void deleteProcess(Process proc)
+ public void deleteProcess(ProcessInstance proc)
{
procs.remove(proc.getKey());
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/MessageBuilderServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/MessageBuilderServiceImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/MessageBuilderServiceImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -24,9 +24,9 @@
// $Id$
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.service.MessageBuilderService;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.service.preview.MessageBuilderService;
import org.jbpm.ri.model.builder.MessageBuilderImpl;
/**
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -27,10 +27,10 @@
import javax.transaction.Synchronization;
import org.hibernate.Transaction;
-import org.jbpm.api.client.MessageListener;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.service.MessageService;
+import org.jbpm.api.client.preview.MessageListener;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.service.preview.MessageService;
import org.jbpm.ri.runtime.TransactionAssociation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -24,13 +24,13 @@
// $Id$
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.service.ProcessBuilderService;
import org.jbpm.ri.model.builder.ProcessBuilderImpl;
/**
- * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ * The ProcessBuilder can be used to build a {@link ProcessInstance} dynamically.
*
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -30,10 +30,10 @@
import javax.management.ObjectName;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.Process.ProcessStatus;
-import org.jbpm.api.service.PersistenceService;
-import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.model.ProcessInstance;
+import org.jbpm.api.model.ProcessInstance.ProcessStatus;
+import org.jbpm.api.service.ProcessInstanceService;
+import org.jbpm.api.service.preview.PersistenceService;
import org.jbpm.ri.model.ProcessImpl;
import org.jbpm.ri.runtime.NodeInterceptor;
import org.slf4j.Logger;
@@ -45,7 +45,7 @@
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
*/
-public class ProcessServiceImpl extends ProcessService implements MutableService
+public class ProcessServiceImpl extends ProcessInstanceService implements MutableService
{
// Provide logging
final static Logger log = LoggerFactory.getLogger(ProcessServiceImpl.class);
@@ -73,7 +73,7 @@
}
@Override
- public ObjectName registerProcess(Process proc)
+ public ObjectName registerProcess(ProcessInstance proc)
{
ObjectName procID = super.registerProcess(proc);
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/SignalBuilderServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/SignalBuilderServiceImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/SignalBuilderServiceImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -24,9 +24,9 @@
// $Id$
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.builder.SignalBuilder;
-import org.jbpm.api.service.SignalBuilderService;
+import org.jbpm.api.model.builder.preview.SignalBuilder;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.service.preview.SignalBuilderService;
import org.jbpm.ri.model.builder.SignalBuilderImpl;
/**
Modified: projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/SignalServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/SignalServiceImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/java/org/jbpm/ri/service/SignalServiceImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -24,7 +24,7 @@
// $Id$
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.service.preview.SignalService;
/**
* An implementation of the SignalService
Copied: projects/spec/trunk/modules/ri/src/main/resources/org.jbpm.api.client.Configuration (from rev 2888, projects/spec/trunk/modules/ri/src/main/resources/org.jbpm.api.config.Configuration)
===================================================================
--- projects/spec/trunk/modules/ri/src/main/resources/org.jbpm.api.client.Configuration (rev 0)
+++ projects/spec/trunk/modules/ri/src/main/resources/org.jbpm.api.client.Configuration 2008-11-12 10:08:22 UTC (rev 2889)
@@ -0,0 +1 @@
+org.jbpm.api.client.internal.MicrocontainerConfiguration
\ No newline at end of file
Deleted: projects/spec/trunk/modules/ri/src/main/resources/org.jbpm.api.config.Configuration
===================================================================
--- projects/spec/trunk/modules/ri/src/main/resources/org.jbpm.api.config.Configuration 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/main/resources/org.jbpm.api.config.Configuration 2008-11-12 10:08:22 UTC (rev 2889)
@@ -1 +0,0 @@
-org.jbpm.api.config.MicrocontainerConfiguration
\ No newline at end of file
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ComplexGatewayPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ComplexGatewayPersistenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ComplexGatewayPersistenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,8 +25,8 @@
import javax.management.ObjectName;
-import org.jbpm.api.model.ComplexGateway;
import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.preview.ComplexGateway;
import org.jbpm.ri.model.ComplexGatewayImpl;
/**
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/EndEventPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/EndEventPersistenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/EndEventPersistenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -26,10 +26,10 @@
import javax.management.ObjectName;
import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Event.EventDetailType;
-import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.ri.model.EndEventImpl;
import org.jbpm.ri.model.MessageImpl;
import org.jbpm.ri.model.SignalImpl;
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/InclusiveGatewayPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/InclusiveGatewayPersistenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/InclusiveGatewayPersistenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,8 +25,8 @@
import javax.management.ObjectName;
-import org.jbpm.api.model.InclusiveGateway;
import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.preview.InclusiveGateway;
import org.jbpm.ri.model.InclusiveGatewayImpl;
/**
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/NodePersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/NodePersistenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/NodePersistenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -27,7 +27,7 @@
import org.hibernate.Session;
import org.jbpm.api.model.Node;
-import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.service.preview.PersistenceService;
import org.jbpm.api.test.CTSTestCase;
import org.jbpm.ri.service.HibernatePersistenceServiceImpl;
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ParallelGatewayPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ParallelGatewayPersistenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ParallelGatewayPersistenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,8 +25,8 @@
import javax.management.ObjectName;
-import org.jbpm.api.model.ParallelGateway;
import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.preview.ParallelGateway;
import org.jbpm.ri.model.ParallelGatewayImpl;
/**
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessDefinitionPersistenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -31,7 +31,7 @@
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
-import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.service.preview.PersistenceService;
import org.jbpm.api.test.CTSTestCase;
import org.jbpm.api.test.ProcessCatalog;
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/ProcessPersistenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -28,12 +28,12 @@
import org.jbpm.api.ProcessNotFoundException;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
-import org.jbpm.api.service.PersistenceService;
import org.jbpm.api.service.ProcessDefinitionService;
+import org.jbpm.api.service.preview.PersistenceService;
import org.jbpm.api.test.CTSTestCase;
import org.jbpm.api.test.ProcessCatalog;
@@ -59,12 +59,12 @@
procDefService.registerProcessDefinition(procDef);
// Create and save the Process
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
service.saveProcess(proc);
// Load the process
ObjectName procID = proc.getKey();
- Process loadProc = service.loadProcess(procID);
+ ProcessInstance loadProc = service.loadProcess(procID);
ProcessCatalog.validateDefaultProcess(loadProc.getProcessDefinition());
StartEvent start = loadProc.getNode(StartEvent.class, "Start");
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/StartEventPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/StartEventPersistenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/StartEventPersistenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,11 +25,11 @@
import javax.management.ObjectName;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Signal;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Event.EventDetailType;
-import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.model.preview.Signal.SignalType;
import org.jbpm.ri.model.MessageImpl;
import org.jbpm.ri.model.SignalImpl;
import org.jbpm.ri.model.StartEventImpl;
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/TaskPersistenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -28,16 +28,16 @@
import javax.management.ObjectName;
-import org.jbpm.api.model.Assignment;
import org.jbpm.api.model.Expression;
-import org.jbpm.api.model.InputSet;
import org.jbpm.api.model.Node;
-import org.jbpm.api.model.OutputSet;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.Task;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.SequenceFlow.ConditionType;
import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.preview.Assignment;
+import org.jbpm.api.model.preview.InputSet;
+import org.jbpm.api.model.preview.OutputSet;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.runtime.ExecutionHandler;
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.SignalHandler;
Modified: projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/UserTaskPersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/UserTaskPersistenceTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/ri/src/test/java/org/jbpm/test/ri/service/persistence/UserTaskPersistenceTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,9 +25,9 @@
import javax.management.ObjectName;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.UserTask;
import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.UserTask;
import org.jbpm.ri.model.MessageImpl;
import org.jbpm.ri.model.UserTaskImpl;
Modified: projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/AirticketProcessBuilder.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -27,13 +27,13 @@
import org.jbpm.api.model.Expression;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Assignment.AssignTime;
import org.jbpm.api.model.Expression.ExpressionLanguage;
import org.jbpm.api.model.Gateway.GatewayType;
import org.jbpm.api.model.Task.TaskType;
-import org.jbpm.api.model.builder.GatewayBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.model.builder.preview.GatewayBuilder;
+import org.jbpm.api.model.preview.Assignment.AssignTime;
import org.jbpm.api.service.ProcessBuilderService;
/**
Modified: projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/samples/airticket/server/src/main/java/org/jboss/bpm/samples/airticket/server/AirticketServiceImpl.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -15,18 +15,18 @@
import org.jboss.bpm.samples.airticket.client.OfferMessage;
import org.jboss.bpm.samples.airticket.client.OrderMessage;
import org.jboss.bpm.samples.airticket.client.RequestMessage;
-import org.jbpm.api.client.MessageListener;
-import org.jbpm.api.client.SignalListener;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.client.preview.MessageListener;
+import org.jbpm.api.client.preview.SignalListener;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.model.builder.ObjectNameFactory;
-import org.jbpm.api.service.MessageBuilderService;
-import org.jbpm.api.service.MessageService;
-import org.jbpm.api.service.ProcessService;
-import org.jbpm.api.service.SignalService;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.Signal;
+import org.jbpm.api.service.ProcessInstanceService;
+import org.jbpm.api.service.preview.MessageBuilderService;
+import org.jbpm.api.service.preview.MessageService;
+import org.jbpm.api.service.preview.SignalService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
@@ -37,7 +37,7 @@
public void sendMessage(GwtMessage gwtMsg)
{
- ProcessService procService = ProcessService.locateProcessService();
+ ProcessInstanceService procService = ProcessInstanceService.locateProcessService();
MessageService mm = MessageService.locateMessageService();
SignalService sm = SignalService.locateSignalService();
@@ -65,7 +65,7 @@
System.out.println("Create new Process");
AirticketProcessBuilder procBuilder = new AirticketProcessBuilder(sampleID);
ProcessDefinition procDef = procBuilder.buildProcessDefinition();
- Process proc = procDef.newInstance();
+ ProcessInstance proc = procDef.newInstance();
procService.registerProcess(proc);
procID = proc.startProcess();
httpSession.setAttribute("procID", procID);
Modified: projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
===================================================================
--- projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-11-12 07:11:59 UTC (rev 2888)
+++ projects/spec/trunk/modules/samples/airticket/server/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-11-12 10:08:22 UTC (rev 2889)
@@ -25,17 +25,17 @@
import javax.management.ObjectName;
-import org.jbpm.api.client.MessageListener;
-import org.jbpm.api.client.UserTaskCallback;
-import org.jbpm.api.model.Message;
-import org.jbpm.api.model.Process;
+import org.jbpm.api.client.preview.MessageListener;
+import org.jbpm.api.client.preview.UserTaskCallback;
+import org.jbpm.api.model.ProcessInstance;
import org.jbpm.api.model.ProcessDefinition;
-import org.jbpm.api.model.UserTask;
-import org.jbpm.api.model.builder.MessageBuilder;
-import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.model.builder.preview.MessageBuilder;
+import org.jbpm.api.model.builder.preview.ObjectNameFactory;
+import org.jbpm.api.model.preview.Message;
+import org.jbpm.api.model.preview.UserTask;
import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.service.MessageBuilderService;
-import org.jbpm.api.service.MessageService;
+import org.jbpm.api.service.preview.MessageBuilderService;
+import org.jbpm.api.service.preview.MessageService;
import org.jbpm.api.test.CTSTestCase;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -53,7 +53,7 @@
private MessageService messageManager = MessageService.locateMessageService();
private AirticketMessageListener msgListener;
- private Process proc;
+ private ProcessInstance proc;
public void testValidData() throws Exception
{
17 years, 5 months
JBoss JBPM SVN: r2888 - jbpm3/branches.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-12 02:11:59 -0500 (Wed, 12 Nov 2008)
New Revision: 2888
Added:
jbpm3/branches/jpdl-3.2.2-SOA-4.2/
Removed:
jbpm3/branches/jpdl-3.2.2-SOA-4.2-old/
Log:
Restore Ant based jpdl-3.2.2-SOA-4.2
Copied: jbpm3/branches/jpdl-3.2.2-SOA-4.2 (from rev 2887, jbpm3/branches/jpdl-3.2.2-SOA-4.2-old)
17 years, 5 months
JBoss JBPM SVN: r2887 - jbpm3/branches.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-12 02:11:44 -0500 (Wed, 12 Nov 2008)
New Revision: 2887
Removed:
jbpm3/branches/jpdl-3.2.2-SOA-4.2/
Log:
Restore Ant based jpdl-3.2.2-SOA-4.2
17 years, 5 months
JBoss JBPM SVN: r2886 - jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-11-11 16:09:48 -0500 (Tue, 11 Nov 2008)
New Revision: 2886
Modified:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java
Log:
Prevent intermittent NPE on MailServer.sop()
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java 2008-11-11 15:50:40 UTC (rev 2885)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/mail/TaskMailTest.java 2008-11-11 21:09:48 UTC (rev 2886)
@@ -4,6 +4,8 @@
import java.util.Iterator;
import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jbpm.AbstractJbpmTestCase;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
@@ -24,7 +26,9 @@
import com.dumbster.smtp.SimpleSmtpServer;
import com.dumbster.smtp.SmtpMessage;
-public class TaskMailTest extends AbstractJbpmTestCase {
+public class TaskMailTest extends AbstractJbpmTestCase
+{
+ private static Log log = LogFactory.getLog(TaskMailTest.class);
static JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
"<jbpm-configuration>" +
@@ -51,7 +55,15 @@
protected void tearDown() throws Exception
{
jbpmContext.close();
- server.stop();
+ try
+ {
+ server.stop();
+ }
+ catch (RuntimeException rte)
+ {
+ // This is an intermittent issue that we can safely ignore
+ log.error("Cannot stop server: " + rte);
+ }
super.tearDown();
}
17 years, 5 months
JBoss JBPM SVN: r2885 - in jbpm3: tags and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-11-11 10:50:40 -0500 (Tue, 11 Nov 2008)
New Revision: 2885
Added:
jbpm3/branches/jpdl-3.2.3.GA_JBPM-1704/
Removed:
jbpm3/tags/jpdl-3.2.3.GA_JBPM-1704/
Log:
patch not yet complete, see Jiri's comment in Jira
Copied: jbpm3/branches/jpdl-3.2.3.GA_JBPM-1704 (from rev 2884, jbpm3/tags/jpdl-3.2.3.GA_JBPM-1704)
17 years, 5 months