Author: thomas.diesler(a)jboss.com
Date: 2008-07-24 15:56:44 -0400 (Thu, 24 Jul 2008)
New Revision: 1718
Added:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/NoneTaskImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ReceiveTaskImpl.java
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Assignment.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Condition.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Entity.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Expression.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gate.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/InputSet.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Message.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/OutputSet.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Participant.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ReceiveTask.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Role.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java
jbossbpm/spec/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessUnmarshaller.java
jbossbpm/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jboss/bpm/dialect/jpdl32/ProcessDefinitionAdapter.java
jbossbpm/spec/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/ProcessUnmarshaller.java
jbossbpm/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jboss/bpm/dialect/xpdl21/WorkflowProcessAdapter.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderFactoryImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessIntegrityTest.java
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/parallelsplit/ParallelSplitTest.java
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
Log:
Add ReceiveTask
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Assignment.java
===================================================================
---
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Assignment.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Assignment.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -30,7 +30,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Assignment extends BPMNElement
+public interface Assignment extends SupportingElement
{
enum AssignTime
{
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Condition.java
===================================================================
---
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Condition.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Condition.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -30,7 +30,7 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2008
*/
-public interface Condition
+public interface Condition extends SupportingElement
{
/**
* Name is an optional attribute that is text description of the Condition. If a Name
is
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Entity.java
===================================================================
---
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Entity.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Entity.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -29,7 +29,7 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2008
*/
-public interface Entity
+public interface Entity extends SupportingElement
{
/**
* Name is an attribute that is text description of the Entity.
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Expression.java
===================================================================
---
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Expression.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Expression.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -30,7 +30,7 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2008
*/
-public interface Expression
+public interface Expression extends SupportingElement
{
/**
* An ExpressionBody MUST be entered to provide the text of the expression, which
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gate.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gate.java 2008-07-24
17:18:10 UTC (rev 1717)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gate.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -46,7 +46,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Gate extends BPMNElement
+public interface Gate extends SupportingElement
{
/**
* Each Gate MUST have an associated (outgoing) Sequence Flow.
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/InputSet.java
===================================================================
---
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/InputSet.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/InputSet.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -31,7 +31,7 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2008
*/
-public interface InputSet
+public interface InputSet extends SupportingElement
{
/**
* Zero or more ArtifactInputs MAY be defined for each InputSet. For the
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Message.java
===================================================================
---
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Message.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Message.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -32,7 +32,7 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2008
*/
-public interface Message
+public interface Message extends SupportingElement
{
/**
* Name is an attribute that is text description of the Message.
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/OutputSet.java
===================================================================
---
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/OutputSet.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/OutputSet.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -31,7 +31,7 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2008
*/
-public interface OutputSet
+public interface OutputSet extends SupportingElement
{
/**
* Zero or more ArtifactOutputs MAY be defined for each OutputSet. For the
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Participant.java
===================================================================
---
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Participant.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Participant.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -31,9 +31,9 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2008
*/
-public interface Participant
+public interface Participant extends SupportingElement
{
- enum ParticipantType
+ public enum ParticipantType
{
Role, Entity
}
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java
===================================================================
---
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -21,6 +21,7 @@
*/
package org.jboss.bpm.model;
+import org.jboss.bpm.model.Task.TaskType;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.SignalHandler;
@@ -36,6 +37,11 @@
public interface ProcessBuilder
{
/**
+ * Add a {@link Process} with a given name
+ */
+ ProcessBuilder addProcess(String name);
+
+ /**
* Get the {@link Process}.
* <p/>
* This is the final call to the ProcessBuilder after all elements have been added.
@@ -73,9 +79,10 @@
ProcessBuilder addEndEvent(String name);
/**
- * Add a {@link Task} with a given name
+ * Add a None {@link Task} with a given name
+ * @param type TODO
*/
- ProcessBuilder addTask(String name);
+ ProcessBuilder addTask(String name, TaskType type);
/**
* Add an {@link ExclusiveGateway} with a given name
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java
===================================================================
---
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -54,7 +54,7 @@
}
/**
- * Get a {@link ProcessBuilder} for a given process name.
+ * Get a {@link ProcessBuilder}.
*/
- public abstract ProcessBuilder newProcessBuilder(String procName);
+ public abstract ProcessBuilder newProcessBuilder();
}
\ No newline at end of file
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ReceiveTask.java
===================================================================
---
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ReceiveTask.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ReceiveTask.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -24,7 +24,8 @@
//$Id$
/**
- * A Receive Task.
+ * 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
@@ -32,28 +33,24 @@
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.
+ * 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.
+ * 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.
+ * This attribute specifies the technology that will be used to send or receive the
message. A Web service is the
+ * default technology.
*/
- Implementation getImplementation();
+ Implementation getImplementation();
}
\ No newline at end of file
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Role.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Role.java 2008-07-24
17:18:10 UTC (rev 1717)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Role.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -29,7 +29,7 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2008
*/
-public interface Role
+public interface Role extends SupportingElement
{
/**
* Name is an attribute that is text description of the Role.
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-24
17:18:10 UTC (rev 1717)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -40,7 +40,7 @@
* Specifies the technology that will be used to send or receive the
* message.
*/
- enum Implementation
+ public enum Implementation
{
WebService, Other, Unspecified
}
@@ -48,7 +48,7 @@
/**
* The TaskType
*/
- enum TaskType
+ public enum TaskType
{
Service, Receive, Send, User, Script, Manual, Reference, None
}
Modified:
jbossbpm/spec/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessUnmarshaller.java
===================================================================
---
jbossbpm/spec/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessUnmarshaller.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/dialects/api10/src/main/java/org/jboss/bpm/dialect/api10/ProcessUnmarshaller.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -48,6 +48,7 @@
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.ProcessBuilder;
import org.jboss.bpm.model.ProcessBuilderFactory;
+import org.jboss.bpm.model.Task.TaskType;
/**
@@ -70,7 +71,9 @@
private Process adaptProcess(JAXBProcess jaxbProc)
{
- ProcessBuilder builder =
ProcessBuilderFactory.newInstance().newProcessBuilder(jaxbProc.getName());
+ ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ builder.addProcess(jaxbProc.getName());
+
for (JAXBFlowObject jaxbFlowObject : jaxbProc.getFlowObjects())
{
if (jaxbFlowObject instanceof JAXBStartEvent)
@@ -150,7 +153,7 @@
private void adaptTask(ProcessBuilder builder, JAXBTask jaxb)
{
String targetName = jaxb.getOutFlow().getTargetName();
- builder.addTask(jaxb.getName()).addSequenceFlow(targetName);
+ builder.addTask(jaxb.getName(), TaskType.None).addSequenceFlow(targetName);
JAXBHandler jaxbHandler = jaxb.getExecutionHandler();
if (jaxbHandler != null)
Modified:
jbossbpm/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jboss/bpm/dialect/jpdl32/ProcessDefinitionAdapter.java
===================================================================
---
jbossbpm/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jboss/bpm/dialect/jpdl32/ProcessDefinitionAdapter.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/dialects/jpdl32/src/main/java/org/jboss/bpm/dialect/jpdl32/ProcessDefinitionAdapter.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -37,6 +37,7 @@
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.ProcessBuilder;
import org.jboss.bpm.model.ProcessBuilderFactory;
+import org.jboss.bpm.model.Task.TaskType;
import org.jboss.bpm.runtime.ExecutionHandler;
/**
@@ -49,7 +50,9 @@
{
public Process adaptProcessDefinition(JPDL32ProcessDefinition jpdlProcDef)
{
- ProcessBuilder builder =
ProcessBuilderFactory.newInstance().newProcessBuilder(jpdlProcDef.getName());
+ ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ builder.addProcess(jpdlProcDef.getName());
+
for (Object jpdlObj : jpdlProcDef.getDescriptionOrSwimlaneOrStartState())
{
if (jpdlObj instanceof JPDL32StartState)
@@ -91,7 +94,7 @@
private void adaptState(ProcessBuilder builder, JPDL32State jpdlState)
{
- builder.addTask(jpdlState.getName());
+ builder.addTask(jpdlState.getName(), TaskType.None);
adaptTransitions(builder, jpdlState.getDescriptionOrEventOrExceptionHandler());
for (Object jpdlObj : jpdlState.getDescriptionOrEventOrExceptionHandler())
Modified:
jbossbpm/spec/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/ProcessUnmarshaller.java
===================================================================
---
jbossbpm/spec/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/ProcessUnmarshaller.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/dialects/stp/src/main/java/org/jboss/bpm/dialect/stp/ProcessUnmarshaller.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -45,6 +45,7 @@
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.ProcessBuilder;
import org.jboss.bpm.model.ProcessBuilderFactory;
+import org.jboss.bpm.model.Task.TaskType;
import org.jboss.util.xml.DOMUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -143,7 +144,8 @@
throw new IllegalStateException("Multiple Pools not supported");
Pool stpPool = stpPools.get(0);
- ProcessBuilder builder =
ProcessBuilderFactory.newInstance().newProcessBuilder(stpPool.getId());
+ ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ builder.addProcess(stpPool.getId());
return builder;
}
@@ -164,7 +166,7 @@
else if (activityType == ActivityType.TASK)
{
String name = stpActivity.getLabel();
- builder.addTask(name);
+ builder.addTask(name, TaskType.None);
adaptOutgoingEdges(builder, stpActivity);
}
else if (activityType == ActivityType.GATEWAY_DATA_BASED_EXCLUSIVE)
Modified:
jbossbpm/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jboss/bpm/dialect/xpdl21/WorkflowProcessAdapter.java
===================================================================
---
jbossbpm/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jboss/bpm/dialect/xpdl21/WorkflowProcessAdapter.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/dialects/xpdl21/src/main/java/org/jboss/bpm/dialect/xpdl21/WorkflowProcessAdapter.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -42,7 +42,9 @@
{
public Process adaptWorkflowProcess(XPDLWorkflowProcess xpdlProc)
{
- ProcessBuilder builder =
ProcessBuilderFactory.newInstance().newProcessBuilder(xpdlProc.getName());
+ ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ builder.addProcess(xpdlProc.getName());
+
XPDLActivities xpdlActivities = xpdlProc.getActivities();
for (XPDLActivity xpdlActivity : xpdlActivities.getActivity())
{
Modified:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java
===================================================================
---
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -103,9 +103,9 @@
exm.startProcess(new RuntimeProcessImpl(proc), att);
proc.setStatus(Status.Completed);
}
- catch (RuntimeException ex)
+ catch (RuntimeException rte)
{
- log.error("Process aborted: " + proc, ex);
+ log.error("Process aborted: " + proc, rte);
proc.setStatus(Status.Aborted);
}
}
Modified:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java
===================================================================
---
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/FlowObjectImpl.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -42,10 +42,8 @@
*/
public abstract class FlowObjectImpl extends GraphicalElementImpl implements FlowObject
{
- /**
- * Initialize the flow object
- */
- protected void initialize(ProcessImpl proc)
+ @Override
+ protected void initialize(Process proc)
{
super.initialize(proc);
Added:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageImpl.java
===================================================================
---
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageImpl.java
(rev 0)
+++
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageImpl.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -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.jboss.bpm.model.internal;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.model.Message;
+import org.jboss.bpm.model.Participant;
+import org.jboss.bpm.model.Property;
+
+//$Id$
+
+/**
+ * A Message, which is used in the definition of attributes for a @{link StartEvent},
+ *
+ * @{EndEvent , @{IntermediateEvent}, @{Task}, and @{MessageFlow}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public class MessageImpl extends SupportingElementImpl implements Message
+{
+ private String name;
+ private List<Property> props;
+
+ /**
+ * Name is an attribute that is text description of the Message.
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Multiple Properties MAY entered for the Message.
+ */
+ public List<Property> getProperties()
+ {
+ return Collections.unmodifiableList(props);
+ }
+
+ /**
+ * This defines the source of the Message.
+ */
+ public Participant getFromRef()
+ {
+ throw new NotImplementedException();
+ }
+
+ /**
+ * This defines the target of the Message.
+ */
+ public Participant getToRef()
+ {
+ throw new NotImplementedException();
+ }
+}
Property changes on:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/NoneTaskImpl.java
===================================================================
---
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/NoneTaskImpl.java
(rev 0)
+++
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/NoneTaskImpl.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -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.jboss.bpm.model.internal;
+
+
+//$Id$
+
+/**
+ * Task that corresponds to the TaskType.None
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class NoneTaskImpl extends TaskImpl
+{
+ public NoneTaskImpl(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ public TaskType getTaskType()
+ {
+ return TaskType.None;
+ }
+}
\ No newline at end of file
Property changes on:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/NoneTaskImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderFactoryImpl.java
===================================================================
---
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderFactoryImpl.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderFactoryImpl.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -23,22 +23,9 @@
//$Id$
-import org.jboss.bpm.model.ComplexGateway;
-import org.jboss.bpm.model.EndEvent;
-import org.jboss.bpm.model.ExclusiveGateway;
-import org.jboss.bpm.model.FlowObject;
-import org.jboss.bpm.model.InclusiveGateway;
-import org.jboss.bpm.model.IntermediateEvent;
-import org.jboss.bpm.model.ParallelGateway;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.ProcessBuilder;
import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.StartEvent;
-import org.jboss.bpm.model.SubProcess;
-import org.jboss.bpm.model.Task;
-import org.jboss.bpm.runtime.ExecutionHandler;
-import org.jboss.bpm.runtime.FlowHandler;
-import org.jboss.bpm.runtime.SignalHandler;
/**
* The ProcessBuilder can be used to dynamically build {@link Process}es.
@@ -49,8 +36,8 @@
public class ProcessBuilderFactoryImpl extends ProcessBuilderFactory
{
@Override
- public ProcessBuilder newProcessBuilder(String procName)
+ public ProcessBuilder newProcessBuilder()
{
- return new ProcessBuilderImpl(procName);
+ return new ProcessBuilderImpl();
}
}
\ No newline at end of file
Modified:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java
===================================================================
---
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -23,8 +23,10 @@
//$Id$
+import org.jboss.bpm.NotImplementedException;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.Task.TaskType;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.SignalHandler;
@@ -40,13 +42,17 @@
private ProcessImpl proc;
private FlowObjectImpl flowObject;
- public ProcessBuilderImpl(String procName)
+ public ProcessBuilder addProcess(String procName)
{
proc = new ProcessImpl(procName);
+ return this;
}
public Process getProcess()
{
+ if (proc == null)
+ throw new IllegalStateException("No process has been added");
+
proc.initialize();
return proc;
}
@@ -54,7 +60,7 @@
public ProcessBuilder addSubProcess(String name)
{
flowObject = new SubProcessImpl(name);
- proc.addFlowObject(flowObject);
+ addFlowObject();
return this;
}
@@ -99,56 +105,67 @@
public ProcessBuilder addStartEvent()
{
flowObject = new StartEventImpl();
- proc.addFlowObject(flowObject);
+ addFlowObject();
return this;
}
public ProcessBuilder addItermediateEvent(String name)
{
flowObject = new IntermediateEventImpl(name);
- proc.addFlowObject(flowObject);
+ addFlowObject();
return this;
}
public ProcessBuilder addEndEvent(String name)
{
flowObject = new EndEventImpl(name);
- proc.addFlowObject(flowObject);
+ addFlowObject();
return this;
}
- public ProcessBuilder addTask(String name)
+ public ProcessBuilder addTask(String name, TaskType type)
{
- flowObject = new TaskImpl(name);
- proc.addFlowObject(flowObject);
+ if (type == TaskType.None)
+ {
+ flowObject = new NoneTaskImpl(name);
+ }
+ else if (type == TaskType.Receive)
+ {
+ flowObject = new ReceiveTaskImpl(name);
+ }
+ else
+ {
+ throw new NotImplementedException("Task type: " + type);
+ }
+ addFlowObject();
return this;
}
public ProcessBuilder addExclusiveDataBasedGateway(String name)
{
flowObject = new ExclusiveGatewayDataBasedImpl(name);
- proc.addFlowObject(flowObject);
+ addFlowObject();
return this;
}
public ProcessBuilder addInclusiveGateway(String name)
{
flowObject = new InclusiveGatewayImpl(name);
- proc.addFlowObject(flowObject);
+ addFlowObject();
return this;
}
public ProcessBuilder addComplexGateway(String name)
{
flowObject = new ComplexGatewayImpl(name);
- proc.addFlowObject(flowObject);
+ addFlowObject();
return this;
}
public ProcessBuilder addParallelGateway(String name)
{
flowObject = new ParallelGatewayImpl(name);
- proc.addFlowObject(flowObject);
+ addFlowObject();
return this;
}
@@ -191,4 +208,12 @@
}
return this;
}
+
+ private void addFlowObject()
+ {
+ if (proc == null)
+ throw new IllegalStateException("No process has been added");
+
+ proc.addFlowObject(flowObject);
+ }
}
\ No newline at end of file
Added:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ReceiveTaskImpl.java
===================================================================
---
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ReceiveTaskImpl.java
(rev 0)
+++
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ReceiveTaskImpl.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -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.jboss.bpm.model.internal;
+
+import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.model.Message;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ReceiveTask;
+
+
+//$Id$
+
+/**
+ * Task that corresponds to the TaskType.None
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class ReceiveTaskImpl extends TaskImpl implements ReceiveTask
+{
+ // A Web service is the default technology
+ private Implementation implementation = Implementation.WebService;
+ private Message messageRef;
+
+ public ReceiveTaskImpl(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ public TaskType getTaskType()
+ {
+ return TaskType.Receive;
+ }
+
+ public Implementation getImplementation()
+ {
+ return implementation;
+ }
+
+ public Message getMessageRef()
+ {
+ return messageRef;
+ }
+
+ public void setMessageRef(Message message)
+ {
+ this.messageRef = message;
+ }
+
+ public boolean isInstantiate()
+ {
+ throw new NotImplementedException();
+ }
+
+ @Override
+ protected void initialize(Process proc)
+ {
+ super.initialize(proc);
+
+ if (messageRef == null)
+ throw new InvalidProcessException("A Message for the MessageRef attribute MUST
be entered");
+ }
+}
\ No newline at end of file
Property changes on:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ReceiveTaskImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java
===================================================================
---
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -51,7 +51,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class TaskImpl extends ActivityImpl implements Task, HandlerSetterSupport,
SingleInFlowSetterSupport, SingleOutFlowSetterSupport
+public abstract class TaskImpl extends ActivityImpl implements Task,
HandlerSetterSupport, SingleInFlowSetterSupport, SingleOutFlowSetterSupport
{
// provide logging
private static final Log log = LogFactory.getLog(TaskImpl.class);
@@ -72,6 +72,8 @@
return ActivityType.Task;
}
+ public abstract TaskType getTaskType();
+
public int getCompletionQuantity()
{
throw new NotImplementedException();
@@ -112,11 +114,6 @@
throw new NotImplementedException();
}
- public TaskType getTaskType()
- {
- throw new NotImplementedException();
- }
-
/**
* Get the out flow
*/
Modified:
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessIntegrityTest.java
===================================================================
---
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessIntegrityTest.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessIntegrityTest.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -26,6 +26,7 @@
import java.util.List;
import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.model.Task.TaskType;
import org.jboss.bpm.test.DefaultEngineTestCase;
/**
@@ -39,28 +40,29 @@
public void testAnonymousProcess() throws Exception
{
// Create a Process through the ProcessBuilder
- ProcessBuilder builder =
ProcessBuilderFactory.newInstance().newProcessBuilder(null);
- Process proc =
builder.addStartEvent().addSequenceFlow("taskA").addTask("taskA").addSequenceFlow("end").addEndEvent("end").getProcess();
+ ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ Process proc =
builder.addProcess(null).addStartEvent().addSequenceFlow("taskA").addTask("taskA",
TaskType.None).
+ addSequenceFlow("end").addEndEvent("end").getProcess();
assertEquals("AnonymousProcess#0", proc.getName());
-
+
StartEvent start = proc.getStartEvent();
assertNotNull("Start expected", start);
FlowObject nfo = proc.findFlowObject("taskA");
assertNotNull("FlowObject expected", nfo);
assertTrue("Task expected", nfo instanceof Task);
-
+
List<EndEvent> ends = proc.getEndEvents();
assertEquals(1, ends.size());
}
-
+
public void testNoStartState() throws Exception
{
try
{
// Create a Process through the ProcessBuilder
- ProcessBuilder builder =
ProcessBuilderFactory.newInstance().newProcessBuilder(null);
-
builder.addTask("taskA").addSequenceFlow("end").addEndEvent("end").getProcess();
+ ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ builder.addProcess(null).addTask("taskA",
TaskType.None).addSequenceFlow("end").addEndEvent("end").getProcess();
fail("InvalidProcessException expected");
}
catch (InvalidProcessException ex)
@@ -68,14 +70,15 @@
assertTrue("Unexpected message: " + ex.getMessage(),
ex.getMessage().indexOf("start event") > 0);
}
}
-
+
public void testNoEndState() throws Exception
{
try
{
// Create a Process through the ProcessBuilder
- ProcessBuilder builder =
ProcessBuilderFactory.newInstance().newProcessBuilder(null);
-
builder.addStartEvent().addSequenceFlow("taskA").addTask("taskA").addSequenceFlow("end").addTask("end").getProcess();
+ ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+
builder.addProcess(null).addStartEvent().addSequenceFlow("taskA").addTask("taskA",
TaskType.None).addSequenceFlow("end").addTask(
+ "end", TaskType.None).getProcess();
fail("InvalidProcessException expected");
}
catch (InvalidProcessException ex)
@@ -83,14 +86,15 @@
assertTrue("Unexpected message: " + ex.getMessage(),
ex.getMessage().indexOf("end event") > 0);
}
}
-
+
public void testNodeNameUniqueness() throws Exception
{
try
{
// Create a Process through the ProcessBuilder
- ProcessBuilder builder =
ProcessBuilderFactory.newInstance().newProcessBuilder(null);
-
builder.addStartEvent().addSequenceFlow("taskA").addTask("taskA").addSequenceFlow("end").addTask("taskA").addSequenceFlow("end").addEndEvent("end").getProcess();
+ ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+
builder.addProcess(null).addStartEvent().addSequenceFlow("taskA").addTask("taskA",
TaskType.None).addSequenceFlow("end").addTask(
+ "taskA",
TaskType.None).addSequenceFlow("end").addEndEvent("end").getProcess();
fail("InvalidProcessException expected");
}
catch (InvalidProcessException ex)
Modified:
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
===================================================================
---
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -27,6 +27,10 @@
import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.ProcessBuilderFactory;
+import org.jboss.bpm.model.Task;
+import org.jboss.bpm.model.Task.TaskType;
import org.jboss.bpm.test.DefaultEngineTestCase;
/**
@@ -37,7 +41,7 @@
*/
public class AirticketTest extends DefaultEngineTestCase
{
- public void testProcessStart() throws Exception
+ public void _testProcessStart() throws Exception
{
URL jpdlURL = getResourceURL("samples/airticket/airticket.bpmn");
@@ -49,4 +53,20 @@
proc.startProcess();
proc.waitForEnd();
}
+
+ public void testDynamicProcess() throws Exception
+ {
+ // Create a Process through the ProcessBuilder
+ ProcessBuilderFactory factory = ProcessBuilderFactory.newInstance();
+ ProcessBuilder procBuilder = factory.newProcessBuilder();
+ Process proc =
procBuilder.addProcess(getName()).addStartEvent().addSequenceFlow("ReceiveReq").addTask("ReceiveReq",
TaskType.Receive).
+ addSequenceFlow("End").addEndEvent("End").getProcess();
+
+ // Register the Process with the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ pm.registerProcess(proc);
+
+ proc.startProcess();
+ proc.waitForEnd();
+ }
}
Modified:
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/parallelsplit/ParallelSplitTest.java
===================================================================
---
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/parallelsplit/ParallelSplitTest.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/parallelsplit/ParallelSplitTest.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -70,8 +70,8 @@
public void testParallelSplitDynamic() throws Exception
{
// Create a Process through the ProcessBuilder
- ProcessBuilder procBuilder =
ProcessBuilderFactory.newInstance().newProcessBuilder(getName());
- Process proc =
procBuilder.addStartEvent().addSequenceFlow("gateway").addParallelGateway("gateway").
+ ProcessBuilder procBuilder =
ProcessBuilderFactory.newInstance().newProcessBuilder();
+ Process proc =
procBuilder.addProcess(getName()).addStartEvent().addSequenceFlow("gateway").addParallelGateway("gateway").
addSequenceFlow("endA").addSequenceFlow("endB").addEndEvent("endA").addEndEvent("endB").getProcess();
// Register the Process with the ProcessManager
Modified:
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java
===================================================================
---
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -33,6 +33,8 @@
import org.jboss.bpm.model.ProcessBuilder;
import org.jboss.bpm.model.ProcessBuilderFactory;
import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.model.Task;
+import org.jboss.bpm.model.Task.TaskType;
import org.jboss.bpm.test.DefaultEngineTestCase;
/**
@@ -71,8 +73,8 @@
public void testBasicSequenceDynamic() throws Exception
{
// Create a Process through the ProcessBuilder
- ProcessBuilder procBuilder =
ProcessBuilderFactory.newInstance().newProcessBuilder(getName());
- Process proc =
procBuilder.addStartEvent().addSequenceFlow("stateA").addTask("stateA").
+ ProcessBuilder procBuilder =
ProcessBuilderFactory.newInstance().newProcessBuilder();
+ Process proc =
procBuilder.addProcess(getName()).addStartEvent().addSequenceFlow("stateA").addTask("stateA",
TaskType.None).
addSequenceFlow("end").addEndEvent("end").getProcess();
// Register the Process with the ProcessManager
Modified:
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
===================================================================
---
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-24
17:18:10 UTC (rev 1717)
+++
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-24
19:56:44 UTC (rev 1718)
@@ -33,6 +33,8 @@
import org.jboss.bpm.model.ProcessBuilder;
import org.jboss.bpm.model.ProcessBuilderFactory;
import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.model.Task;
+import org.jboss.bpm.model.Task.TaskType;
import org.jboss.bpm.test.DefaultEngineTestCase;
/**
@@ -71,8 +73,8 @@
public void testBasicTaskDynamic() throws Exception
{
// Create a Process through the ProcessBuilder
- ProcessBuilder procBuilder =
ProcessBuilderFactory.newInstance().newProcessBuilder(getName());
- Process proc =
procBuilder.addStartEvent().addSequenceFlow("stateA").addTask("stateA").
+ ProcessBuilder procBuilder =
ProcessBuilderFactory.newInstance().newProcessBuilder();
+ Process proc =
procBuilder.addProcess(getName()).addStartEvent().addSequenceFlow("stateA").addTask("stateA",
TaskType.None).
addExecutionHandler(TaskA.class).addSequenceFlow("end").addEndEvent("end").getProcess();
// Register the Process with the ProcessManager