JBoss JBPM SVN: r1725 - in jbossbpm/spec/trunk/modules: api/src/main/java/org/jboss/bpm/model and 5 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-25 08:09:19 -0400 (Fri, 25 Jul 2008)
New Revision: 1725
Added:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageBuilder.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageBuilderFactory.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/TaskBuilder.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/MessageReceiver.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ExpressionImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageBuilderFactoryImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageBuilderImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/PropertyImpl.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/TaskBuilderImpl.java
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.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/Process.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/Property.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java
jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.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/MessageImpl.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/ProcessImpl.java
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/TaskImpl.java
jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java
jbossbpm/spec/trunk/modules/testsuite/src/test/resources/jbpm-beans.xml
Log:
Add MessageReceiver
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -24,12 +24,12 @@
// $Id$
import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Signal;
import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
import org.jboss.bpm.runtime.HandlerSupport;
-import org.jboss.bpm.runtime.RuntimeProcess;
import org.jboss.bpm.runtime.SignalHandler;
/**
@@ -54,7 +54,7 @@
* @param att The Attachments in the ExecutionContext
* @return The Future from which to obtain the process result
*/
- public abstract void startProcess(RuntimeProcess proc, Attachments att);
+ public abstract void startProcess(Process proc, Attachments att);
/**
* Locate the signal manager
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -41,9 +41,12 @@
import org.jboss.bpm.BPMException;
import org.jboss.bpm.EngineShutdownException;
import org.jboss.bpm.ProcessTimeoutException;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Message;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Process.Status;
import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.MessageReceiver;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -188,13 +191,28 @@
public abstract void startProcess(String name, Attachments att);
/**
+ * Send a message to a given {@link MessageReceiver}
+ */
+ public void sendMessage(ObjectName procID, String toName, Message msg)
+ {
+ Process proc = getProcessByID(procID);
+ FlowObject target = proc.findFlowObject(toName);
+ if (target == null)
+ throw new IllegalArgumentException("Cannot find message target: " + toName);
+ if (target instanceof MessageReceiver == false)
+ throw new IllegalArgumentException("Message target is not a valid message receiver: " + toName);
+
+ ((MessageReceiver)target).receiveMessage(msg);
+ }
+
+ /**
* Wait for the Process to end. 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.
+ * arrive at an End Event. The Process will be in a running state until all Tokens are consumed.
+ * <p/>
+ * If the process was aborted this method throws the causing RuntimeException if avaialable.
*
- * @param id
- * @param timeout
*/
- public void waitForEnd(ObjectName id, long timeout)
+ public Status waitForEnd(ObjectName id, long timeout)
{
Process proc = getProcessByID(id);
Status status = proc.getStatus();
@@ -211,10 +229,18 @@
while (forever || now < until)
{
status = proc.getStatus();
- if (status == Status.Cancelled || status == Status.Aborted || status == Status.Completed)
+ if (status == Status.Cancelled || status == Status.Completed)
{
- return;
+ return status;
}
+ else if (status == Status.Aborted)
+ {
+ RuntimeException rte = proc.getRuntimeException();
+ if (rte == null)
+ return status;
+ else
+ throw rte;
+ }
Thread.currentThread().sleep(100);
now = System.currentTimeMillis();
}
@@ -223,8 +249,8 @@
{
log.warn(ex);
}
-
- // Throw timeout exception if it took too long
+
+ // Throw timeout exception if it took too long
throw new ProcessTimeoutException("Process timeout for: " + id);
}
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-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Message.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -45,6 +45,11 @@
List<Property> getProperties();
/**
+ * Get a Property with a given name.
+ */
+ Property getProperty(String name);
+
+ /**
* This defines the source of the Message.
*/
Participant getFromRef();
Added: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageBuilder.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageBuilder.java (rev 0)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageBuilder.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -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.jboss.bpm.model;
+
+//$Id$
+
+/**
+ * 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 name);
+
+ /**
+ * Add a message property
+ */
+ MessageBuilder addMessageProperty(String name, String value);
+
+ /**
+ * Add a message property
+ */
+ MessageBuilder addMessageProperty(String name, String value, boolean isCorrelation);
+
+ /**
+ * Get the Message
+ */
+ Message getMessage();
+}
\ No newline at end of file
Property changes on: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageBuilderFactory.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageBuilderFactory.java (rev 0)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageBuilderFactory.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -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.jboss.bpm.model;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.util.KernelLocator;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+
+//$Id$
+
+/**
+ * A Factory for the {@link MessageBuilder}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class MessageBuilderFactory
+{
+ /** The bean name - jBPMMessageBuilderFactory */
+ public static final String BEAN_NAME = "jBPMMessageBuilderFactory";
+
+ // Hide the constructor
+ protected MessageBuilderFactory()
+ {
+ }
+
+ /**
+ * Get a MessageBuilderFactory instance.
+ */
+ public static MessageBuilderFactory newInstance()
+ {
+ Kernel kernel = KernelLocator.getKernel();
+ KernelRegistryEntry entry = kernel.getRegistry().getEntry(BEAN_NAME);
+ return (MessageBuilderFactory)entry.getTarget();
+ }
+
+ /**
+ * Get a {@link MessageBuilder}.
+ */
+ public abstract MessageBuilder newMessageBuilder();
+}
\ No newline at end of file
Property changes on: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/MessageBuilderFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -112,6 +112,11 @@
Process copyProcess();
/**
+ * Get the possible runtime exception when the process was aborted.
+ */
+ RuntimeException getRuntimeException();
+
+ /**
* Get the start event
*/
StartEvent getStartEvent();
@@ -153,4 +158,9 @@
* This method until the process ends with a given timeout.
*/
void waitForEnd(long timeout);
+
+ /**
+ * Send a message to a given @{link Task} or @{link Event}
+ */
+ void sendMessage(String toName, Message msg);
}
\ No newline at end of file
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-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilder.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -42,12 +42,10 @@
ProcessBuilder addProcess(String name);
/**
- * Get the {@link Process}.
- * <p/>
- * This is the final call to the ProcessBuilder after all elements have been added.
+ * Get the {@link Process}. <p/> This is the final call to the ProcessBuilder after all elements have been added.
*/
Process getProcess();
-
+
/**
* Add a {@link SubProcess} with a given name
*/
@@ -79,10 +77,11 @@
ProcessBuilder addEndEvent(String name);
/**
- * Add a None {@link Task} with a given name
+ * Add a {@link Task} with a given name
+ *
* @param type TODO
*/
- ProcessBuilder addTask(String name, TaskType type);
+ TaskBuilder 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-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/ProcessBuilderFactory.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -35,7 +35,7 @@
*/
public abstract class ProcessBuilderFactory
{
- /** The process engine bean name - jBPMEngine */
+ /** The bean name - jBPMProcessBuilderFactory */
public static final String BEAN_NAME = "jBPMProcessBuilderFactory";
// Hide the constructor
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Property.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Property.java 2008-07-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Property.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -32,6 +32,14 @@
public interface Property extends SupportingElement
{
/**
+ * Supported property types
+ */
+ public enum PropertyType
+ {
+ String
+ }
+
+ /**
* Each Property has a Name (e.g., name=”Customer Name”).
*/
String getName();
@@ -40,7 +48,7 @@
* Each Property has a Type (e.g., type=”String”). Properties may be defined
* hierarchically.
*/
- String getType();
+ PropertyType getType();
/**
* Each Property MAY have a Value specified.
Added: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/TaskBuilder.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/TaskBuilder.java (rev 0)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/TaskBuilder.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model;
+
+
+//$Id$
+
+/**
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface TaskBuilder extends ProcessBuilder
+{
+ TaskBuilder addMessageRef(String name);
+
+ TaskBuilder addMessageProperty(String name, String value, boolean isCorrelation);
+}
\ No newline at end of file
Property changes on: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/TaskBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/MessageReceiver.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/MessageReceiver.java (rev 0)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/MessageReceiver.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -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.jboss.bpm.runtime;
+
+import org.jboss.bpm.model.Message;
+
+//$Id$
+
+/**
+ * The {@link FlowScheduler} that can be manipulated.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MessageReceiver
+{
+ void receiveMessage(Message message);
+}
\ No newline at end of file
Property changes on: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/MessageReceiver.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java 2008-07-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeProcess.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -26,10 +26,8 @@
import org.jboss.bpm.model.Process;
/**
- * 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
@@ -37,12 +35,12 @@
public interface RuntimeProcess
{
/**
- * Get the associated {@link Process}
+ * Get the associated {@link Process}
*/
Process getProcess();
-
- /**
- * Get the {@link FlowScheduler} for this {@link Process}
+
+ /**
+ * Get the {@link FlowScheduler} for this {@link Process}
*/
MutableFlowScheduler getFlowScheduler();
}
\ No newline at end of file
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java 2008-07-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -32,6 +32,9 @@
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Signal;
import org.jboss.bpm.model.StartEvent;
+import org.jboss.bpm.model.Process.Status;
+import org.jboss.bpm.model.internal.ProcessImpl;
+import org.jboss.bpm.model.internal.RuntimeProcessImpl;
import org.jboss.bpm.model.internal.SequenceFlowImpl;
import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.ExecutionHandler;
@@ -59,10 +62,25 @@
}
@Override
- public void startProcess(RuntimeProcess rtProc, Attachments att)
+ public void startProcess(Process proc, Attachments att)
{
- Process proc = rtProc.getProcess();
-
+ ProcessImpl procImpl = (ProcessImpl)proc;
+ procImpl.setStatus(Status.Active);
+
+ // Run the process in a thread
+ // TODO: one thread per process is not scalable
+ ProcessRunner runner = new ProcessRunner(procImpl, att);
+ new Thread(runner).start();
+
+ // Throw possible exception from the runner
+ // if (runner.getException() != null)
+ // throw runner.getException();
+ }
+
+ private void startProcessInternal(ProcessImpl proc, Attachments att)
+ {
+ RuntimeProcess rtProc = new RuntimeProcessImpl(proc);
+
throwSignal(new Signal(proc, Signal.Type.ENTER_PROCESS));
MutableFlowScheduler flowScheduler = rtProc.getFlowScheduler();
try
@@ -98,18 +116,25 @@
// Remove the head tuple
flowScheduler.removeHeadTuple();
-
+
// Transfer the token to the FlowHandler
flowHandler.execute(flowScheduler, token);
}
+ proc.setStatus(Status.Completed);
}
+ catch (RuntimeException rte)
+ {
+ log.error("Process aborted: " + proc, rte);
+ proc.setStatus(Status.Aborted);
+ proc.setRuntimeException(rte);
+ }
finally
{
throwSignal(new Signal(proc, Signal.Type.EXIT_PROCESS));
}
}
- /**
+ /**
* The initial flow 'to' the StartEvent
*/
class InitialFlow extends SequenceFlowImpl
@@ -120,4 +145,21 @@
setTargetRef(start);
}
}
+
+ class ProcessRunner implements Runnable
+ {
+ ProcessImpl proc;
+ Attachments att;
+
+ public ProcessRunner(ProcessImpl proc, Attachments att)
+ {
+ this.proc = proc;
+ this.att = att;
+ }
+
+ public void run()
+ {
+ startProcessInternal(proc, att);
+ }
+ }
}
\ No newline at end of file
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-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -36,7 +36,6 @@
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Process.Status;
import org.jboss.bpm.model.internal.ProcessImpl;
-import org.jboss.bpm.model.internal.RuntimeProcessImpl;
import org.jboss.bpm.runtime.Attachments;
/**
@@ -49,7 +48,7 @@
{
// provide logging
private static final Log log = LogFactory.getLog(ProcessManagerImpl.class);
-
+
public void setProcessEngine(ProcessEngine engine)
{
this.engine = engine;
@@ -72,42 +71,15 @@
throw new IllegalStateException("Cannot obtain process with name: " + name);
if (procSet.size() > 1)
throw new IllegalStateException("Multiple processes with name: " + name);
-
+
ProcessImpl proc = (ProcessImpl)procSet.iterator().next();
-
+
// Copy and register a copy of the process instance
Process procCopy = (ProcessImpl)proc.copyProcess();
registerProcess(procCopy);
-
+
// Start the process in a thread
- proc.setStatus(Status.Active);
- new Thread(new ProcessRunner(proc, att)).start();
+ ExecutionManager exm = ExecutionManager.locateExecutionManager();
+ exm.startProcess(proc, att);
}
-
- class ProcessRunner implements Runnable
- {
- ProcessImpl proc;
- Attachments att;
-
- public ProcessRunner(ProcessImpl proc, Attachments att)
- {
- this.proc = proc;
- this.att = att;
- }
-
- public void run()
- {
- try
- {
- ExecutionManager exm = ExecutionManager.locateExecutionManager();
- exm.startProcess(new RuntimeProcessImpl(proc), att);
- proc.setStatus(Status.Completed);
- }
- catch (RuntimeException rte)
- {
- log.error("Process aborted: " + proc, rte);
- proc.setStatus(Status.Aborted);
- }
- }
- }
}
Added: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ExpressionImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ExpressionImpl.java (rev 0)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ExpressionImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -0,0 +1,54 @@
+/*
+ * 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$
+
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.model.Expression;
+
+/**
+ * An Expression, which is used in the definition of attributes for @{link StartEvent},
+ * @{link IntermediateEvent}, @{link Activity}, @{link ComplexGateway}, and @{link SequenceFlow}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class ExpressionImpl extends SupportingElementImpl implements Expression
+{
+ private String body;
+
+ public ExpressionImpl(String body)
+ {
+ this.body = body;
+ }
+
+ public String getExpressionBody()
+ {
+ return body;
+ }
+
+ public String getExpressionLanguage()
+ {
+ throw new NotImplementedException();
+ }
+}
Property changes on: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ExpressionImpl.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/MessageBuilderFactoryImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageBuilderFactoryImpl.java (rev 0)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageBuilderFactoryImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -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.jboss.bpm.model.internal;
+
+//$Id$
+
+import org.jboss.bpm.model.Message;
+import org.jboss.bpm.model.MessageBuilder;
+import org.jboss.bpm.model.MessageBuilderFactory;
+
+/**
+ * A MessageBuilder can be used to build a {@link Message} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class MessageBuilderFactoryImpl extends MessageBuilderFactory
+{
+ @Override
+ public MessageBuilder newMessageBuilder()
+ {
+ return new MessageBuilderImpl();
+ }
+}
\ No newline at end of file
Property changes on: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageBuilderFactoryImpl.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/MessageBuilderImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageBuilderImpl.java (rev 0)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageBuilderImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -0,0 +1,65 @@
+/*
+ * 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$
+
+import org.jboss.bpm.model.Message;
+import org.jboss.bpm.model.MessageBuilder;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Property;
+
+/**
+ * The ProcessBuilder can be used to dynamically build a {@link Process}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class MessageBuilderImpl implements MessageBuilder
+{
+ private MessageImpl message;
+
+ public MessageBuilder newMessage(String name)
+ {
+ message = new MessageImpl(name);
+ return this;
+ }
+
+ public MessageBuilder addMessageProperty(String name, String value)
+ {
+ Property prop = new PropertyImpl(name, new ExpressionImpl(value));
+ message.addProperty(prop);
+ return this;
+ }
+
+ public MessageBuilder addMessageProperty(String name, String value, boolean isCorrelation)
+ {
+ Property prop = new PropertyImpl(name, new ExpressionImpl(value), isCorrelation);
+ message.addProperty(prop);
+ return this;
+ }
+
+ public Message getMessage()
+ {
+ return message;
+ }
+}
\ No newline at end of file
Property changes on: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageBuilderImpl.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/MessageImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageImpl.java 2008-07-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/MessageImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -21,6 +21,7 @@
*/
package org.jboss.bpm.model.internal;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -42,8 +43,13 @@
public class MessageImpl extends SupportingElementImpl implements Message
{
private String name;
- private List<Property> props;
+ private List<Property> props = new ArrayList<Property>();
+ public MessageImpl(String name)
+ {
+ this.name = name;
+ }
+
/**
* Name is an attribute that is text description of the Message.
*/
@@ -53,6 +59,19 @@
}
/**
+ * Get a Property with a given name.
+ */
+ public Property getProperty(String name)
+ {
+ for (Property prop : props)
+ {
+ if (prop.getName().equals(name))
+ return prop;
+ }
+ return null;
+ }
+
+ /**
* Multiple Properties MAY entered for the Message.
*/
public List<Property> getProperties()
@@ -61,6 +80,14 @@
}
/**
+ * Add a property
+ */
+ public void addProperty(Property prop)
+ {
+ props.add(prop);
+ }
+
+ /**
* This defines the source of the Message.
*/
public Participant getFromRef()
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-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessBuilderImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -26,6 +26,7 @@
import org.jboss.bpm.NotImplementedException;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.TaskBuilder;
import org.jboss.bpm.model.Task.TaskType;
import org.jboss.bpm.runtime.ExecutionHandler;
import org.jboss.bpm.runtime.FlowHandler;
@@ -39,9 +40,19 @@
*/
public class ProcessBuilderImpl implements ProcessBuilder
{
- private ProcessImpl proc;
- private FlowObjectImpl flowObject;
+ protected ProcessImpl proc;
+ protected FlowObjectImpl flowObject;
+ public ProcessBuilderImpl()
+ {
+ }
+
+ protected ProcessBuilderImpl(ProcessImpl proc, FlowObjectImpl flowObject)
+ {
+ this.proc = proc;
+ this.flowObject = flowObject;
+ }
+
public ProcessBuilder addProcess(String procName)
{
proc = new ProcessImpl(procName);
@@ -123,7 +134,7 @@
return this;
}
- public ProcessBuilder addTask(String name, TaskType type)
+ public TaskBuilder addTask(String name, TaskType type)
{
if (type == TaskType.None)
{
@@ -138,7 +149,7 @@
throw new NotImplementedException("Task type: " + type);
}
addFlowObject();
- return this;
+ return new TaskBuilderImpl(proc, flowObject);
}
public ProcessBuilder addExclusiveDataBasedGateway(String name)
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java 2008-07-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -37,6 +37,7 @@
import org.jboss.bpm.model.EndEvent;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.InputSet;
+import org.jboss.bpm.model.Message;
import org.jboss.bpm.model.NameSupport;
import org.jboss.bpm.model.OutputSet;
import org.jboss.bpm.model.Process;
@@ -52,9 +53,14 @@
*/
public class ProcessImpl extends SupportingElementImpl implements Process
{
+ // The required process name
private String name;
+ // The list of associated flow objects
private List<FlowObject> flowObjects = new ArrayList<FlowObject>();
+ // the status of the process
private Status status = Status.None;
+ // The possible exception that caused the process to abort
+ private RuntimeException runtimeException;
public ProcessImpl(String name)
{
@@ -102,6 +108,16 @@
flowObjects.add(flowObject);
}
+ public RuntimeException getRuntimeException()
+ {
+ return runtimeException;
+ }
+
+ public void setRuntimeException(RuntimeException rte)
+ {
+ this.runtimeException = rte;
+ }
+
public StartEventImpl getStartEvent()
{
StartEventImpl start = null;
@@ -214,6 +230,12 @@
this.status = status;
}
+ public void sendMessage(String toName, Message msg)
+ {
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ pm.sendMessage(getID(), toName, msg);
+ }
+
/**
* Set the process state
*/
Added: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/PropertyImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/PropertyImpl.java (rev 0)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/PropertyImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -0,0 +1,88 @@
+/*
+ * 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$
+
+import org.jboss.bpm.model.Expression;
+import org.jboss.bpm.model.Property;
+
+/**
+ * A Property, which is used in the definition of attributes for a Process and common activity attributes
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class PropertyImpl extends SupportingElementImpl implements Property
+{
+ private String name;
+ private Expression expression;
+ private boolean isCorrelation;
+
+ public PropertyImpl(String name, Expression expression)
+ {
+ this.expression = expression;
+ this.name = name;
+ }
+
+ public PropertyImpl(String name, Expression expression, boolean isCorrelation)
+ {
+ this.name = name;
+ this.expression = expression;
+ this.isCorrelation = isCorrelation;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public PropertyType getType()
+ {
+ return PropertyType.String;
+ }
+
+ public Expression getValue()
+ {
+ return expression;
+ }
+
+ public void setExpression(Expression expression)
+ {
+ this.expression = expression;
+ }
+
+ public boolean isCorrelation()
+ {
+ return isCorrelation;
+ }
+
+ public void setCorrelation(boolean isCorrelation)
+ {
+ this.isCorrelation = isCorrelation;
+ }
+}
Property changes on: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/PropertyImpl.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/ReceiveTaskImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ReceiveTaskImpl.java 2008-07-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ReceiveTaskImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -21,13 +21,21 @@
*/
package org.jboss.bpm.model.internal;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.InvalidProcessException;
import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.ProcessTimeoutException;
+import org.jboss.bpm.model.Expression;
import org.jboss.bpm.model.Message;
import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Property;
import org.jboss.bpm.model.ReceiveTask;
+import org.jboss.bpm.runtime.ExecutionContext;
+import org.jboss.bpm.runtime.ExecutionHandler;
+import org.jboss.bpm.runtime.MessageReceiver;
+import org.jboss.bpm.runtime.Token;
-
//$Id$
/**
@@ -36,17 +44,23 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class ReceiveTaskImpl extends TaskImpl implements ReceiveTask
+public class ReceiveTaskImpl extends TaskImpl implements ReceiveTask, MessageReceiver
{
+ private static final int RECEIVE_TIMEOUT = 5000;
+
+ // provide logging
+ private static final Log log = LogFactory.getLog(ReceiveTaskImpl.class);
+
// A Web service is the default technology
private Implementation implementation = Implementation.WebService;
private Message messageRef;
-
+ private Message receivedMessage;
+
public ReceiveTaskImpl(String name)
{
super(name);
}
-
+
@Override
public TaskType getTaskType()
{
@@ -73,11 +87,76 @@
throw new NotImplementedException();
}
+ public void receiveMessage(Message message)
+ {
+ String msgName = message.getName();
+ if (messageRef.getName().equals(msgName))
+ {
+ for (Property prop : messageRef.getProperties())
+ {
+ String name = prop.getName();
+ if (message.getProperty(name) == null)
+ throw new IllegalArgumentException("Received message does not contain expected property: " + name);
+ }
+ this.receivedMessage = message;
+ }
+ else
+ {
+ log.debug("Ignore unexpected message: " + message);
+ }
+ }
+
@Override
+ public ExecutionHandler getExecutionHandler()
+ {
+ final ReceiveTask task = this;
+ ExecutionHandler handler = executionHandler;
+ if (handler == null)
+ {
+ handler = new ExecutionHandler()
+ {
+ public void execute(Token token)
+ {
+ // Wait for the message to arrive
+ long now = System.currentTimeMillis();
+ long until = now + RECEIVE_TIMEOUT;
+ while (receivedMessage == null && now < until)
+ {
+ try
+ {
+ Thread.currentThread().sleep(500);
+ now = System.currentTimeMillis();
+ }
+ catch (InterruptedException ex)
+ {
+ log.error("ReceiveTask interrupted" + ex.toString());
+ }
+ }
+
+ // Timeout if the message did not arrive
+ if (receivedMessage == null)
+ throw new ProcessTimeoutException("Message receive timeout in: " + task);
+
+ // Copy the expected properties from the
+ // received message to the execution context
+ ExecutionContext exContext = token.getExecutionContext();
+ for (Property prop : messageRef.getProperties())
+ {
+ String key = prop.getName();
+ Expression value = receivedMessage.getProperty(key).getValue();
+ exContext.addAttachment(key, value);
+ }
+ }
+ };
+ }
+ return handler;
+ }
+
+ @Override
protected void initialize(Process proc)
{
super.initialize(proc);
-
+
if (messageRef == null)
throw new InvalidProcessException("A Message for the MessageRef attribute MUST be entered");
}
Added: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/TaskBuilderImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/TaskBuilderImpl.java (rev 0)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/TaskBuilderImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -0,0 +1,72 @@
+/*
+ * 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$
+
+import org.jboss.bpm.model.Property;
+import org.jboss.bpm.model.Task;
+import org.jboss.bpm.model.TaskBuilder;
+
+/**
+ * The TaskBuilder can be used to dynamically build {@link Task}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class TaskBuilderImpl extends ProcessBuilderImpl implements TaskBuilder
+{
+ private MessageImpl message;
+
+ public TaskBuilderImpl(ProcessImpl proc, FlowObjectImpl flowObject)
+ {
+ super(proc, flowObject);
+ }
+
+ public TaskBuilder addMessageRef(String name)
+ {
+ message = new MessageImpl(name);
+ if (flowObject instanceof ReceiveTaskImpl)
+ {
+ ((ReceiveTaskImpl)flowObject).setMessageRef(message);
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot add message to: " + flowObject);
+ }
+ return this;
+ }
+
+ public TaskBuilder addMessageProperty(String name, String value, boolean isCorrelation)
+ {
+ Property prop = new PropertyImpl(name, new ExpressionImpl(value), isCorrelation);
+ message.addProperty(prop);
+ return this;
+ }
+
+ private Task getTask()
+ {
+ if (flowObject instanceof Task == false)
+ throw new IllegalStateException("Last added flow object is not a Task");
+ return (Task)flowObject;
+ }
+}
\ No newline at end of file
Property changes on: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/TaskBuilderImpl.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-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/TaskImpl.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -56,9 +56,10 @@
// provide logging
private static final Log log = LogFactory.getLog(TaskImpl.class);
+ protected ExecutionHandler executionHandler;
+
private Flow inFlow;
private Flow outFlow;
- private ExecutionHandler executionHandler;
private FlowHandler flowHandler;
private SignalHandler signalHandler;
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-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-07-25 12:09:19 UTC (rev 1725)
@@ -26,10 +26,16 @@
import java.net.URL;
import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.client.SignalListener;
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.Message;
+import org.jboss.bpm.model.MessageBuilder;
+import org.jboss.bpm.model.MessageBuilderFactory;
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.Signal;
+import org.jboss.bpm.model.TaskBuilder;
import org.jboss.bpm.model.Task.TaskType;
import org.jboss.bpm.test.DefaultEngineTestCase;
@@ -41,6 +47,23 @@
*/
public class AirticketTest extends DefaultEngineTestCase
{
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ // Add a signal listener
+ SignalManager sm = SignalManager.locateSignalManager();
+ SignalListener sl = new SignalListener()
+ {
+ public void catchSignal(Signal signal)
+ {
+ System.out.println(signal);
+ }
+ };
+ sm.addListener("Airticket", sl);
+ }
+
public void _testProcessStart() throws Exception
{
URL jpdlURL = getResourceURL("samples/airticket/airticket.bpmn");
@@ -56,17 +79,41 @@
public void testDynamicProcess() throws Exception
{
+ ProcessBuilderFactory procFactory = ProcessBuilderFactory.newInstance();
+ MessageBuilderFactory msgFactory = MessageBuilderFactory.newInstance();
+
// 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();
+ ProcessBuilder procBuilder = procFactory.newProcessBuilder();
+ procBuilder.addProcess("Airticket").addStartEvent().addSequenceFlow("ReceiveReq");
+
+ TaskBuilder taskBuilder = procBuilder.addTask("ReceiveReq", TaskType.Receive);
+ taskBuilder.addMessageRef("ReqDataMsg").
+ addMessageProperty("Name", null, true).
+ addMessageProperty("From", null, true).
+ addMessageProperty("To", null, true).
+ addMessageProperty("Date", null, true).
+ addMessageProperty("Seats", null, true).
+ addSequenceFlow("End");
+
+ Process proc = procBuilder.addEndEvent("End").getProcess();
// Register the Process with the ProcessManager
ProcessManager pm = ProcessManager.locateProcessManager();
pm.registerProcess(proc);
proc.startProcess();
+
+ MessageBuilder msgBuilder = msgFactory.newMessageBuilder();
+ Message msg = msgBuilder.newMessage("ReqDataMsg").
+ addMessageProperty("Name", "Kermit").
+ addMessageProperty("From", "MUC").
+ addMessageProperty("To", "NYC").
+ addMessageProperty("Date", "25-Jul-2008").
+ addMessageProperty("Seats", "1").
+ getMessage();
+
+ proc.sendMessage("ReceiveReq", msg);
+
proc.waitForEnd();
}
}
Modified: jbossbpm/spec/trunk/modules/testsuite/src/test/resources/jbpm-beans.xml
===================================================================
--- jbossbpm/spec/trunk/modules/testsuite/src/test/resources/jbpm-beans.xml 2008-07-25 11:20:30 UTC (rev 1724)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/resources/jbpm-beans.xml 2008-07-25 12:09:19 UTC (rev 1725)
@@ -10,8 +10,9 @@
<property name="signalManager"><inject bean="jBPMSignalManager"/></property>
</bean>
- <!-- The ProcessBuilderFactory -->
+ <!-- The Builder Factories -->
<bean name="jBPMProcessBuilderFactory" class="org.jboss.bpm.model.internal.ProcessBuilderFactoryImpl"/>
+ <bean name="jBPMMessageBuilderFactory" class="org.jboss.bpm.model.internal.MessageBuilderFactoryImpl"/>
<!-- The ProcessManager -->
<bean name="jBPMProcessManager" class="org.jboss.bpm.client.internal.ProcessManagerImpl">
17 years, 9 months
JBoss JBPM SVN: r1724 - in jbossbpm/impl/jbpm3/trunk/modules: jpdl/core/src/main/resources and 1 other directory.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-07-25 07:20:30 -0400 (Fri, 25 Jul 2008)
New Revision: 1724
Modified:
jbossbpm/impl/jbpm3/trunk/modules/console/src/main/resources/hibernate.cfg.xml
jbossbpm/impl/jbpm3/trunk/modules/jpdl/core/src/main/resources/hibernate.cfg.xml
Log:
Set hibernate.ddl.auto=create to force schema generation
Modified: jbossbpm/impl/jbpm3/trunk/modules/console/src/main/resources/hibernate.cfg.xml
===================================================================
--- jbossbpm/impl/jbpm3/trunk/modules/console/src/main/resources/hibernate.cfg.xml 2008-07-25 11:19:46 UTC (rev 1723)
+++ jbossbpm/impl/jbpm3/trunk/modules/console/src/main/resources/hibernate.cfg.xml 2008-07-25 11:20:30 UTC (rev 1724)
@@ -21,6 +21,9 @@
<!-- DataSource properties (begin) -->
<property name="hibernate.connection.datasource">java:comp/env/jdbc/JbpmDataSource</property>
+
+ <property name="hibernate.hbm2ddl.auto">create</property>
+
<!-- DataSource properties (end) -->
<!-- JTA transaction properties (begin) ===
Modified: jbossbpm/impl/jbpm3/trunk/modules/jpdl/core/src/main/resources/hibernate.cfg.xml
===================================================================
--- jbossbpm/impl/jbpm3/trunk/modules/jpdl/core/src/main/resources/hibernate.cfg.xml 2008-07-25 11:19:46 UTC (rev 1723)
+++ jbossbpm/impl/jbpm3/trunk/modules/jpdl/core/src/main/resources/hibernate.cfg.xml 2008-07-25 11:20:30 UTC (rev 1724)
@@ -18,11 +18,13 @@
<!-- JDBC connection properties (end) -->
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
+
+ <property name="hibernate.hbm2ddl.auto">create</property>
+
+ <!-- DataSource properties (begin) ===
+ <property name="hibernate.connection.datasource">java:comp/env/jdbc/JbpmDataSource</property>
+ ==== DataSource properties (end) -->
- <!-- DataSource properties (begin) ===
- <property name="hibernate.connection.datasource">java:comp/env/jdbc/JbpmDataSource</property>
- ==== DataSource properties (end) -->
-
<!-- JTA transaction properties (begin) ===
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
17 years, 9 months
JBoss JBPM SVN: r1723 - jbossbpm/impl/jbpm3/trunk/modules/jpdl/core.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-07-25 07:19:46 -0400 (Fri, 25 Jul 2008)
New Revision: 1723
Modified:
jbossbpm/impl/jbpm3/trunk/modules/jpdl/core/pom.xml
Log:
Include hibernate config in jpdl-core.jar
Modified: jbossbpm/impl/jbpm3/trunk/modules/jpdl/core/pom.xml
===================================================================
--- jbossbpm/impl/jbpm3/trunk/modules/jpdl/core/pom.xml 2008-07-25 11:18:39 UTC (rev 1722)
+++ jbossbpm/impl/jbpm3/trunk/modules/jpdl/core/pom.xml 2008-07-25 11:19:46 UTC (rev 1723)
@@ -141,11 +141,11 @@
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
- <excludes>
+ <!--excludes>
<exclude>hibernate.cfg.xml</exclude>
<exclude>jbpm.cfg.xml</exclude>
<exclude>jbpm.mail.templates.xml</exclude>
- </excludes>
+ </excludes-->
</configuration>
</plugin>
<plugin>
17 years, 9 months
JBoss JBPM SVN: r1722 - jbossbpm/impl/jbpm3/trunk/modules/distribution.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2008-07-25 07:18:39 -0400 (Fri, 25 Jul 2008)
New Revision: 1722
Modified:
jbossbpm/impl/jbpm3/trunk/modules/distribution/pom.xml
Log:
Remove legacy dependency on org.jboss.jbpm:jbpm-jpdl.integration
Modified: jbossbpm/impl/jbpm3/trunk/modules/distribution/pom.xml
===================================================================
--- jbossbpm/impl/jbpm3/trunk/modules/distribution/pom.xml 2008-07-25 10:51:28 UTC (rev 1721)
+++ jbossbpm/impl/jbpm3/trunk/modules/distribution/pom.xml 2008-07-25 11:18:39 UTC (rev 1722)
@@ -50,11 +50,6 @@
<artifactId>jbpm-jpdl-identity</artifactId>
<version>${version}</version>
</dependency>
- <!--dependency>
- <groupId>org.jboss.jbpm</groupId>
- <artifactId>jbpm-jpdl-integration</artifactId>
- <version>${version}</version>
- </dependency-->
<dependency>
<groupId>izpack</groupId>
<artifactId>standalone-compiler</artifactId>
@@ -112,4 +107,4 @@
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
17 years, 9 months
JBoss JBPM SVN: r1721 - in jbpm4/pvm/trunk: modules/core and 21 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-07-25 06:51:28 -0400 (Fri, 25 Jul 2008)
New Revision: 1721
Added:
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetMessagesCmd.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetTimersCmd.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandManagementService.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/binding/ExecutionServiceBinding.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/binding/ManagementServiceBinding.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/DbLangExtTests.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/DbModelTests.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/DbSvcTests.java
jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/
jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/model/
jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/svc/
Removed:
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetJobsCmd.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/langext/
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/pvm/
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/svc/
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring/spring.beans.xml
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/
jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/client/
jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/db/
jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/pvm/
jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/spring2/
Modified:
jbpm4/pvm/trunk/
jbpm4/pvm/trunk/modules/core/pom.xml
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java
jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/session/PvmDbSession.java
jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/hibernate.job.hbm.xml
jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/pvm.wire.bindings.xml
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/jobexecutor/JobExecutorTimerSessionTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/DbTests.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/AddressActivity.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/AddressSession.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/LanguageExtensionsDbTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/language.extensions.hbm.xml
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/CommentDbTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/HibernateJobDbSessionTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/ProcessCacheDbTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/ProcessDefinitionDbTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/ProcessExecutionDbTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/SessionFactoryDbTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/WireDbTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/WireTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/ExecutionServiceTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/ManagementServiceTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/ProcessServiceTest.java
jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/timer/TimerIntegrationTest.java
jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/langext/environment.cfg.xml
jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/langext/language.extensions.hbm.xml
jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/svc/environment.cfg.xml
Log:
completed services split and updated some db tests
Property changes on: jbpm4/pvm/trunk
___________________________________________________________________
Name: svn:ignore
- target
+ target
.settings
Modified: jbpm4/pvm/trunk/modules/core/pom.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/pom.xml 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/pom.xml 2008-07-25 10:51:28 UTC (rev 1721)
@@ -148,9 +148,6 @@
<configuration>
<argLine>${surefire.jvm.args}</argLine>
<excludes>
- <exclude>org/jbpm/db/svc/ManagementServiceTest.java</exclude>
- <exclude>org/jbpm/db/svc/ProcessServiceTest.java</exclude>
- <exclude>org/jbpm/db/svc/ExecutionServiceTest.java</exclude>
<exclude>org/jbpm/enterprise/CommandExecutorTest.java</exclude>
<exclude>org/jbpm/enterprise/TimerTest.java</exclude>
<exclude>org/jbpm/enterprise/EnterpriseTimerSessionTest.java</exclude>
@@ -161,7 +158,7 @@
<exclude>org/jbpm/pvm/samples/ex12/TimerTest.java</exclude>
<exclude>org/jbpm/pvm/samples/ex02/BasicProcessPersistenceTest.java</exclude>
<exclude>org/jbpm/pvm/samples/ex11/AsynchronousContinuationsTest.java</exclude>
- <exclude>org/jbpm/pvm/svc/hibernate/ExecutionTypeTest.java</exclude>
+ <exclude>org/jbpm/svc/hibernate/ExecutionTypeTest.java</exclude>
</excludes>
</configuration>
</plugin>
Deleted: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetJobsCmd.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetJobsCmd.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetJobsCmd.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.pvm.internal.cmd;
-
-import java.util.List;
-
-import org.jbpm.pvm.env.Environment;
-import org.jbpm.pvm.job.Job;
-import org.jbpm.pvm.session.PvmDbSession;
-
-/**
- * @author Tom Baeyens
- */
-public class GetJobsCmd implements Command<List<Job>> {
-
- private static final long serialVersionUID = 1L;
-
- public List<Job> execute(Environment environment) throws Exception {
- return environment.get(PvmDbSession.class).findAllJobs();
- }
-
-}
Added: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetMessagesCmd.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetMessagesCmd.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetMessagesCmd.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.cmd;
+
+import java.util.List;
+
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.job.Message;
+import org.jbpm.pvm.session.PvmDbSession;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetMessagesCmd implements Command<List<Message>> {
+
+ private static final long serialVersionUID = 1L;
+
+ public List<Message> execute(Environment environment) throws Exception {
+ return environment.get(PvmDbSession.class).findMessages();
+ }
+
+}
Copied: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetTimersCmd.java (from rev 1720, jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetJobsCmd.java)
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetTimersCmd.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetTimersCmd.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.pvm.internal.cmd;
+
+import java.util.List;
+
+import org.jbpm.pvm.env.Environment;
+import org.jbpm.pvm.job.Timer;
+import org.jbpm.pvm.session.PvmDbSession;
+
+/**
+ * @author Tom Baeyens
+ */
+public class GetTimersCmd implements Command<List<Timer>> {
+
+ private static final long serialVersionUID = 1L;
+
+ public List<Timer> execute(Environment environment) throws Exception {
+ return environment.get(PvmDbSession.class).findTimers();
+ }
+
+}
Property changes on: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/cmd/GetTimersCmd.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -27,6 +27,8 @@
import org.jbpm.pvm.client.ClientExecution;
import org.jbpm.pvm.client.ClientProcessDefinition;
import org.jbpm.pvm.job.Job;
+import org.jbpm.pvm.job.Message;
+import org.jbpm.pvm.job.Timer;
import org.jbpm.pvm.session.PvmDbSession;
/**
@@ -76,11 +78,16 @@
return (ClientExecution) query.uniqueResult();
}
- public List<Job> findAllJobs() {
+ public List<Timer> findTimers() {
// query definition can be found at the bottom of resource org/jbpm/pvm/hibernate.job.hbm.xml
- return session.getNamedQuery("findAllJobs").list();
+ return session.getNamedQuery("findTimers").list();
}
+ public List<Message> findMessages() {
+ // query definition can be found at the bottom of resource org/jbpm/pvm/hibernate.job.hbm.xml
+ return session.getNamedQuery("findMessages").list();
+ }
+
public List<Job> findDeadJobs() {
// query definition can be found at the bottom of resource org/jbpm/pvm/hibernate.job.hbm.xml
return session.getNamedQuery("findDeadJobs").list();
Added: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandExecutionService.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -0,0 +1,152 @@
+/*
+ * 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.pvm.internal.svc;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jbpm.pvm.Execution;
+import org.jbpm.pvm.ExecutionService;
+import org.jbpm.pvm.internal.cmd.ActivityInstanceCmd;
+import org.jbpm.pvm.internal.cmd.CommandService;
+import org.jbpm.pvm.internal.cmd.FindExecutionCmd;
+import org.jbpm.pvm.internal.cmd.GetVariableCmd;
+import org.jbpm.pvm.internal.cmd.GetVariablesCmd;
+import org.jbpm.pvm.internal.cmd.SetVariablesCmd;
+import org.jbpm.pvm.internal.cmd.SignalCmd;
+import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CommandExecutionService implements ExecutionService {
+
+ protected CommandService commandService;
+
+ public Execution startExecution(long processDefinitionDbid){
+ return commandService.execute(new StartExecutionCmd(processDefinitionDbid, null, null));
+ }
+
+ public Execution startExecution(long processDefinitionDbid, String executionKey) {
+ return commandService.execute(new StartExecutionCmd(processDefinitionDbid, null, executionKey));
+ }
+
+ public Execution startExecution(long processDefinitionDbid, Map<String, Object> variables){
+ return commandService.execute(new StartExecutionCmd(processDefinitionDbid, variables, null));
+ }
+
+ public Execution startExecution(long processDefinitionDbid, Map<String, Object> variables, String executionKey){
+ return commandService.execute(new StartExecutionCmd(processDefinitionDbid, variables, executionKey));
+ }
+
+ public Execution startExecution(String processDefinitionName) {
+ return commandService.execute(new StartExecutionCmd(processDefinitionName, null, null));
+ }
+
+ public Execution startExecution(String processDefinitionName, Map<String, Object> variables){
+ return commandService.execute(new StartExecutionCmd(processDefinitionName, variables, null));
+ }
+
+ public Execution startExecution(String processDefinitionName, String executionKey) {
+ return commandService.execute(new StartExecutionCmd(processDefinitionName, null, executionKey));
+ }
+
+ public Execution startExecution(String processDefinitionName, Map<String, Object> variables, String executionKey){
+ return commandService.execute(new StartExecutionCmd(processDefinitionName, variables, executionKey));
+ }
+
+ public Execution signalExecution(long executionDbid) {
+ return commandService.execute(new SignalCmd(executionDbid, null, null));
+ }
+
+ public Execution signalExecution(long executionDbid, String signalName) {
+ return commandService.execute(new SignalCmd(executionDbid, signalName, null));
+ }
+
+ public Execution signalExecution(long executionDbid, String signalName, Map<String, Object> parameters) {
+ return commandService.execute(new SignalCmd(executionDbid, signalName, parameters));
+ }
+
+ public Execution signalExecution(long executionDbid, Map<String, Object> parameters) {
+ return commandService.execute(new SignalCmd(executionDbid, null, parameters));
+ }
+
+ public Execution signalExecution(String processDefinitionName, String executionKey) {
+ return commandService.execute(new SignalCmd(processDefinitionName, executionKey, null, null));
+ }
+
+ public Execution signalExecution(String processDefinitionName, String executionKey, String signalName) {
+ return commandService.execute(new SignalCmd(processDefinitionName, executionKey, signalName, null));
+ }
+
+ public Execution signalExecution(String processDefinitionName, String executionKey, String signalName, Map<String, Object> parameters) {
+ return commandService.execute(new SignalCmd(processDefinitionName, executionKey, signalName, parameters));
+ }
+
+ public Execution signalExecution(String processDefinitionName, String executionKey, Map<String, Object> parameters) {
+ return commandService.execute(new SignalCmd(processDefinitionName, executionKey, null, parameters));
+ }
+
+ public Execution signalActivityInstance(long activityInstanceDbid) {
+ return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, null, null));
+ }
+
+ public Execution signalActivityInstance(long activityInstanceDbid, String signalName) {
+ return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, signalName, null));
+ }
+
+ public Execution signalActivityInstance(long activityInstanceDbid, String signalName, Map<String, Object> parameters) {
+ return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, signalName, parameters));
+ }
+
+ public Execution signalActivityInstance(long activityInstanceDbid, Map<String, Object> parameters) {
+ return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, null, parameters));
+ }
+
+ public Execution findExecution(long executionDbid) {
+ return commandService.execute(new FindExecutionCmd(executionDbid));
+ }
+
+ public Execution findExecution(String processDefinitionName, String key) {
+ return commandService.execute(new FindExecutionCmd(processDefinitionName, key));
+ }
+
+ public Object getVariable(long executionDbid, String variableName) {
+ return commandService.execute(new GetVariableCmd(executionDbid, variableName));
+ }
+
+ public Map<String, Object> getVariables(long executionDbid, List<String> variableNames) {
+ return commandService.execute(new GetVariablesCmd(executionDbid, variableNames));
+ }
+
+ public Execution setVariable(long executionDbid, String name, Object value) {
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put(name, value);
+ return setVariables(executionDbid, variables);
+ }
+
+ public Execution setVariables(long executionDbid, Map<String, Object> variables) {
+ return commandService.execute(new SetVariablesCmd(executionDbid, variables));
+ }
+}
Added: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandManagementService.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandManagementService.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandManagementService.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.pvm.internal.svc;
+
+import java.util.List;
+
+import org.jbpm.pvm.ManagementService;
+import org.jbpm.pvm.internal.cmd.CommandService;
+import org.jbpm.pvm.internal.cmd.GetMessagesCmd;
+import org.jbpm.pvm.internal.cmd.GetTimersCmd;
+import org.jbpm.pvm.job.Message;
+import org.jbpm.pvm.job.Timer;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class CommandManagementService implements ManagementService {
+
+ protected CommandService commandService;
+
+ public List<Message> getMessages() {
+ return commandService.execute(new GetMessagesCmd());
+ }
+
+ public List<Timer> getTimers() {
+ return commandService.execute(new GetTimersCmd());
+ }
+
+}
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/svc/CommandProcessService.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -21,28 +21,16 @@
*/
package org.jbpm.pvm.internal.svc;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import org.jbpm.pvm.Deployment;
-import org.jbpm.pvm.Execution;
import org.jbpm.pvm.ProcessService;
-import org.jbpm.pvm.internal.cmd.ActivityInstanceCmd;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.cmd.DeployCmd;
-import org.jbpm.pvm.internal.cmd.FindExecutionCmd;
import org.jbpm.pvm.internal.cmd.FindLatestProcessDefinitionCmd;
import org.jbpm.pvm.internal.cmd.FindProcessDefinitionCmd;
import org.jbpm.pvm.internal.cmd.FindProcessDefinitionNamesCmd;
import org.jbpm.pvm.internal.cmd.FindProcessDefinitionsCmd;
-import org.jbpm.pvm.internal.cmd.GetJobsCmd;
-import org.jbpm.pvm.internal.cmd.GetVariableCmd;
-import org.jbpm.pvm.internal.cmd.GetVariablesCmd;
-import org.jbpm.pvm.internal.cmd.SetVariablesCmd;
-import org.jbpm.pvm.internal.cmd.SignalCmd;
-import org.jbpm.pvm.internal.cmd.StartExecutionCmd;
-import org.jbpm.pvm.job.Job;
import org.jbpm.pvm.model.ProcessDefinition;
/** {@link ProcessService} implementation that delegates execution of the
@@ -83,116 +71,6 @@
return commandService.execute(new FindProcessDefinitionCmd(processDefinitionDbid));
}
- public Execution startExecution(long processDefinitionDbid){
- return commandService.execute(new StartExecutionCmd(processDefinitionDbid, null, null));
- }
-
- public Execution startExecution(long processDefinitionDbid, String executionKey) {
- return commandService.execute(new StartExecutionCmd(processDefinitionDbid, null, executionKey));
- }
-
- public Execution startExecution(long processDefinitionDbid, Map<String, Object> variables){
- return commandService.execute(new StartExecutionCmd(processDefinitionDbid, variables, null));
- }
-
- public Execution startExecution(long processDefinitionDbid, Map<String, Object> variables, String executionKey){
- return commandService.execute(new StartExecutionCmd(processDefinitionDbid, variables, executionKey));
- }
-
- public Execution startExecution(String processDefinitionName) {
- return commandService.execute(new StartExecutionCmd(processDefinitionName, null, null));
- }
-
- public Execution startExecution(String processDefinitionName, Map<String, Object> variables){
- return commandService.execute(new StartExecutionCmd(processDefinitionName, variables, null));
- }
-
- public Execution startExecution(String processDefinitionName, String executionKey) {
- return commandService.execute(new StartExecutionCmd(processDefinitionName, null, executionKey));
- }
-
- public Execution startExecution(String processDefinitionName, Map<String, Object> variables, String executionKey){
- return commandService.execute(new StartExecutionCmd(processDefinitionName, variables, executionKey));
- }
-
- public Execution signalExecution(long executionDbid) {
- return commandService.execute(new SignalCmd(executionDbid, null, null));
- }
-
- public Execution signalExecution(long executionDbid, String signalName) {
- return commandService.execute(new SignalCmd(executionDbid, signalName, null));
- }
-
- public Execution signalExecution(long executionDbid, String signalName, Map<String, Object> parameters) {
- return commandService.execute(new SignalCmd(executionDbid, signalName, parameters));
- }
-
- public Execution signalExecution(long executionDbid, Map<String, Object> parameters) {
- return commandService.execute(new SignalCmd(executionDbid, null, parameters));
- }
-
- public Execution signalExecution(String processDefinitionName, String executionKey) {
- return commandService.execute(new SignalCmd(processDefinitionName, executionKey, null, null));
- }
-
- public Execution signalExecution(String processDefinitionName, String executionKey, String signalName) {
- return commandService.execute(new SignalCmd(processDefinitionName, executionKey, signalName, null));
- }
-
- public Execution signalExecution(String processDefinitionName, String executionKey, String signalName, Map<String, Object> parameters) {
- return commandService.execute(new SignalCmd(processDefinitionName, executionKey, signalName, parameters));
- }
-
- public Execution signalExecution(String processDefinitionName, String executionKey, Map<String, Object> parameters) {
- return commandService.execute(new SignalCmd(processDefinitionName, executionKey, null, parameters));
- }
-
- public Execution signalActivityInstance(long activityInstanceDbid) {
- return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, null, null));
- }
-
- public Execution signalActivityInstance(long activityInstanceDbid, String signalName) {
- return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, signalName, null));
- }
-
- public Execution signalActivityInstance(long activityInstanceDbid, String signalName, Map<String, Object> parameters) {
- return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, signalName, parameters));
- }
-
- public Execution signalActivityInstance(long activityInstanceDbid, Map<String, Object> parameters) {
- return commandService.execute(new ActivityInstanceCmd(activityInstanceDbid, null, parameters));
- }
-
- public Execution findExecution(long executionDbid) {
- return commandService.execute(new FindExecutionCmd(executionDbid));
- }
-
- public Execution findExecution(String processDefinitionName, String key) {
- return commandService.execute(new FindExecutionCmd(processDefinitionName, key));
- }
-
- public Object getVariable(long executionDbid, String variableName) {
- return commandService.execute(new GetVariableCmd(executionDbid, variableName));
- }
-
- public Map<String, Object> getVariables(long executionDbid, List<String> variableNames) {
- return commandService.execute(new GetVariablesCmd(executionDbid, variableNames));
- }
-
- public Execution setVariable(long executionDbid, String name, Object value) {
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put(name, value);
- return setVariables(executionDbid, variables);
- }
-
- public Execution setVariables(long executionDbid, Map<String, Object> variables) {
- return commandService.execute(new SetVariablesCmd(executionDbid, variables));
- }
-
- public List<Job> getJobs() {
- return commandService.execute(new GetJobsCmd());
- }
-
public CommandService getCommandService() {
return commandService;
}
Added: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/binding/ExecutionServiceBinding.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/binding/ExecutionServiceBinding.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/binding/ExecutionServiceBinding.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.pvm.internal.wire.binding;
+
+import org.jbpm.pvm.internal.cmd.CommandService;
+import org.jbpm.pvm.internal.svc.CommandExecutionService;
+import org.jbpm.pvm.internal.wire.descriptor.ContextTypeRefDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExecutionServiceBinding extends WireDescriptorBinding {
+
+ public ExecutionServiceBinding() {
+ super("execution-service");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ ObjectDescriptor descriptor = new ObjectDescriptor(CommandExecutionService.class);
+ descriptor.addInjection("commandService", new ContextTypeRefDescriptor(CommandService.class));
+ return descriptor;
+ }
+}
Added: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/binding/ManagementServiceBinding.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/binding/ManagementServiceBinding.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/binding/ManagementServiceBinding.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.pvm.internal.wire.binding;
+
+import org.jbpm.pvm.internal.cmd.CommandService;
+import org.jbpm.pvm.internal.svc.CommandManagementService;
+import org.jbpm.pvm.internal.wire.descriptor.ContextTypeRefDescriptor;
+import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
+import org.jbpm.pvm.internal.xml.Parse;
+import org.jbpm.pvm.internal.xml.Parser;
+import org.w3c.dom.Element;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ManagementServiceBinding extends WireDescriptorBinding {
+
+ public ManagementServiceBinding() {
+ super("management-service");
+ }
+
+ public Object parse(Element element, Parse parse, Parser parser) {
+ ObjectDescriptor descriptor = new ObjectDescriptor(CommandManagementService.class);
+ descriptor.addInjection("commandService", new ContextTypeRefDescriptor(CommandService.class));
+ return descriptor;
+ }
+}
Modified: jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/session/PvmDbSession.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/session/PvmDbSession.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/session/PvmDbSession.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -23,12 +23,11 @@
import java.util.List;
-import org.jbpm.pvm.Execution;
import org.jbpm.pvm.client.ClientExecution;
import org.jbpm.pvm.client.ClientProcessDefinition;
-import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.job.Job;
-import org.jbpm.pvm.model.ProcessDefinition;
+import org.jbpm.pvm.job.Message;
+import org.jbpm.pvm.job.Timer;
/**
* @author Tom Baeyens, Pascal Verdage
@@ -50,11 +49,13 @@
/** an execution identified by process definition and business key */
ClientExecution findExecution(String processDefinitionName, String key);
- /** all jobs */
- List<Job> findAllJobs();
+ /** timers */
+ List<Timer> findTimers();
+ /** timers */
+ List<Message> findMessages();
+
/** the jobs for which all the retries have failed and which will not be picked up
* any more by the jobImpl executor */
public List<Job> findDeadJobs();
-
}
Modified: jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/hibernate.job.hbm.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/hibernate.job.hbm.xml 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/hibernate.job.hbm.xml 2008-07-25 10:51:28 UTC (rev 1721)
@@ -55,14 +55,21 @@
<!-- ### HibernatePvmDbSession QUERIES ################################## -->
- <query name="findAllJobs">
+ <query name="findTimers">
<![CDATA[
- select job
- from org.jbpm.pvm.internal.job.JobImpl as job
+ select t
+ from org.jbpm.pvm.internal.job.TimerImpl as t
order by dueDate asc
]]>
</query>
+ <query name="findMessages">
+ <![CDATA[
+ select m
+ from org.jbpm.pvm.internal.job.MessageImpl as m
+ ]]>
+ </query>
+
<query name="findDeadJobs">
<![CDATA[
select job
Modified: jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/pvm.wire.bindings.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/pvm.wire.bindings.xml 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/main/resources/org/jbpm/pvm/pvm.wire.bindings.xml 2008-07-25 10:51:28 UTC (rev 1721)
@@ -53,6 +53,8 @@
<binding class="org.jbpm.pvm.internal.wire.binding.StandardCommandServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.AsyncCommandServiceBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.ProcessServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.ExecutionServiceBinding" />
+ <binding class="org.jbpm.pvm.internal.wire.binding.ManagementServiceBinding" />
<!-- deployers -->
<binding class="org.jbpm.pvm.internal.wire.binding.DeployerManagerBinding" />
<binding class="org.jbpm.pvm.internal.wire.binding.CreateProcessBinding" />
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/jobexecutor/JobExecutorTimerSessionTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/jobexecutor/JobExecutorTimerSessionTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/jobexecutor/JobExecutorTimerSessionTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -27,6 +27,7 @@
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.job.Job;
+import org.jbpm.pvm.job.Timer;
import org.jbpm.pvm.session.PvmDbSession;
import org.jbpm.pvm.session.TimerSession;
@@ -78,9 +79,9 @@
/** return the number of timers among active jobs */
private static int getNbTimer() {
int result = 0;
- List<Job> activeJobs = getPvmDbSession().findAllJobs();
- if (activeJobs != null) {
- for (Job job : activeJobs) {
+ List<Timer> timers = getPvmDbSession().findTimers();
+ if (timers != null) {
+ for (Job job : timers) {
if (job instanceof TimerImpl) {
result++;
}
@@ -134,13 +135,13 @@
if (firstJob instanceof TimerImpl) {
result = (TimerImpl) firstJob;
} else {
- List<Job> jobs = getPvmDbSession().findAllJobs();
- if (jobs != null) {
+ List<Timer> timers = getPvmDbSession().findTimers();
+ if (timers != null) {
Date dueDate = new Date(Long.MAX_VALUE);
- for (Job job : jobs) {
- if (job instanceof TimerImpl && job.getDueDate().before(dueDate)) {
- dueDate = job.getDueDate();
- result = (TimerImpl) job;
+ for (Timer timer : timers) {
+ if (timer instanceof TimerImpl && timer.getDueDate().before(dueDate)) {
+ dueDate = timer.getDueDate();
+ result = (TimerImpl) timer;
}
}
}
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/DbTests.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/DbTests.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/DbTests.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -24,7 +24,11 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jbpm.pvm.db.langext.DbLangExtTests;
+import org.jbpm.pvm.db.model.DbModelTests;
+import org.jbpm.pvm.db.svc.DbSvcTests;
+
/**
* @author Tom Baeyens
*/
@@ -34,7 +38,9 @@
TestSuite suite = new TestSuite("Test for org.jbpm.pvm");
//$JUnit-BEGIN$
- // TODO
+ suite.addTest(DbLangExtTests.suite());
+ suite.addTest(DbModelTests.suite());
+ suite.addTest(DbSvcTests.suite());
//$JUnit-END$
return suite;
Copied: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext (from rev 1715, jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/langext)
Property changes on: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/AddressActivity.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/langext/AddressActivity.java 2008-07-24 14:46:43 UTC (rev 1715)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/AddressActivity.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.db.langext;
+package org.jbpm.pvm.db.langext;
import org.jbpm.pvm.activity.Activity;
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/AddressSession.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/langext/AddressSession.java 2008-07-24 14:46:43 UTC (rev 1715)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/AddressSession.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.db.langext;
+package org.jbpm.pvm.db.langext;
import java.util.ArrayList;
import java.util.List;
Added: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/DbLangExtTests.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/DbLangExtTests.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/DbLangExtTests.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.pvm.db.langext;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DbLangExtTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.jbpm.pvm.db.langext");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(LanguageExtensionsDbTest.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/LanguageExtensionsDbTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/langext/LanguageExtensionsDbTest.java 2008-07-24 14:46:43 UTC (rev 1715)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/LanguageExtensionsDbTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.db.langext;
+package org.jbpm.pvm.db.langext;
import java.util.ArrayList;
import java.util.List;
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/language.extensions.hbm.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/langext/language.extensions.hbm.xml 2008-07-24 14:46:43 UTC (rev 1715)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/langext/language.extensions.hbm.xml 2008-07-25 10:51:28 UTC (rev 1721)
@@ -3,7 +3,7 @@
<hibernate-mapping package="org.jbpm.pvm" default-access="field">
- <class name="org.jbpm.db.langext.AddressActivity">
+ <class name="org.jbpm.pvm.db.langext.AddressActivity">
<id name="id" column="DBID_" type="long">
<generator class="native" />
</id>
Copied: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model (from rev 1720, jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/pvm)
Property changes on: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/CommentDbTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/pvm/CommentDbTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/CommentDbTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.db.pvm;
+package org.jbpm.pvm.db.model;
import java.util.Date;
import java.util.List;
Added: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/DbModelTests.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/DbModelTests.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/DbModelTests.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.pvm.db.model;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DbModelTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.jbpm.pvm.db.model");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(SessionFactoryDbTest.class);
+ suite.addTestSuite(ProcessCacheDbTest.class);
+ suite.addTestSuite(WireDbTest.class);
+ suite.addTestSuite(ProcessExecutionDbTest.class);
+ suite.addTestSuite(CommentDbTest.class);
+ suite.addTestSuite(WireTest.class);
+ suite.addTestSuite(ProcessDefinitionDbTest.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/HibernateJobDbSessionTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/pvm/HibernateJobDbSessionTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/HibernateJobDbSessionTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -1,4 +1,4 @@
-package org.jbpm.db.pvm;
+package org.jbpm.pvm.db.model;
import org.jbpm.pvm.test.base.JbpmTestCase;
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/ProcessCacheDbTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/pvm/ProcessCacheDbTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/ProcessCacheDbTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -11,7 +11,7 @@
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
-package org.jbpm.db.pvm;
+package org.jbpm.pvm.db.model;
import java.util.List;
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/ProcessDefinitionDbTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/pvm/ProcessDefinitionDbTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/ProcessDefinitionDbTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -11,7 +11,7 @@
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
-package org.jbpm.db.pvm;
+package org.jbpm.pvm.db.model;
import java.util.Date;
import java.util.List;
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/ProcessExecutionDbTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/pvm/ProcessExecutionDbTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/ProcessExecutionDbTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -11,7 +11,7 @@
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
-package org.jbpm.db.pvm;
+package org.jbpm.pvm.db.model;
import org.jbpm.pvm.test.base.DbTestCase;
import org.jbpm.pvm.internal.model.ExecutionImpl;
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/SessionFactoryDbTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/pvm/SessionFactoryDbTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/SessionFactoryDbTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.db.pvm;
+package org.jbpm.pvm.db.model;
import org.hibernate.SessionFactory;
import org.jbpm.pvm.test.base.DbTestCase;
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/WireDbTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/pvm/WireDbTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/WireDbTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -11,7 +11,7 @@
* program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301, USA.
**/
-package org.jbpm.db.pvm;
+package org.jbpm.pvm.db.model;
import java.util.ArrayList;
import java.util.LinkedList;
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/WireTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/pvm/WireTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/model/WireTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.db.pvm;
+package org.jbpm.pvm.db.model;
import org.hibernate.Session;
import org.jbpm.pvm.test.base.DbTestCase;
Copied: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc (from rev 1720, jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/svc)
Added: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/DbSvcTests.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/DbSvcTests.java (rev 0)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/DbSvcTests.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.pvm.db.svc;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class DbSvcTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.jbpm.pvm.db.svc");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(ExecutionServiceTest.class);
+ suite.addTestSuite(ProcessServiceTest.class);
+ suite.addTestSuite(ManagementServiceTest.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/ExecutionServiceTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/svc/ExecutionServiceTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/ExecutionServiceTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.db.svc;
+package org.jbpm.pvm.db.svc;
import java.util.ArrayList;
import java.util.HashMap;
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/ManagementServiceTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/svc/ManagementServiceTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/ManagementServiceTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.db.svc;
+package org.jbpm.pvm.db.svc;
import org.jbpm.pvm.test.base.ServiceTestCase;
import org.jbpm.pvm.ManagementService;
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/ProcessServiceTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/db/svc/ProcessServiceTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/db/svc/ProcessServiceTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -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.db.svc;
+package org.jbpm.pvm.db.svc;
import java.util.ArrayList;
import java.util.List;
Deleted: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring/spring.beans.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring/spring.beans.xml 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring/spring.beans.xml 2008-07-25 10:51:28 UTC (rev 1721)
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
- <!-- SINGLETONS
- SpringEnvironmentFactory will only see the singleton beans.
- -->
-
- <bean id="processService"
- class="org.jbpm.pvm.internal.svc.CommandProcessService"
- scope="singleton">
- <property name="commandService" ref="commandService" />
- </bean>
-
- <bean id="commandService"
- class="org.jbpm.pvm.internal.spring.SpringCommandService"
- scope="singleton">
- <property name="transactionManager" ref="transactionManager" />
- <property name="environmentFactory" ref="environmentFactory"/>
- </bean>
-
- <bean id="transactionManager"
- class="org.springframework.orm.hibernate3.HibernateTransactionManager"
- scope="singleton">
- <property name="sessionFactory" ref="sessionFactory"/>
- </bean>
-
- <bean id="environmentFactory"
- class="org.jbpm.pvm.internal.spring.SpringEnvironmentFactory"
- scope="singleton" />
-
- <bean id="sessionFactory"
- class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
- scope="singleton">
- <property name="mappingResources">
- <list>
- <value>org/jbpm/pvm/hibernate.typedefs.hbm.xml</value>
- <value>org/jbpm/pvm/hibernate.wire.hbm.xml</value>
- <value>org/jbpm/pvm/hibernate.definition.hbm.xml</value>
- <value>org/jbpm/pvm/hibernate.execution.hbm.xml</value>
- <value>org/jbpm/pvm/hibernate.variable.hbm.xml</value>
- <value>org/jbpm/pvm/hibernate.job.hbm.xml</value>
- </list>
- </property>
- <property name="hibernateProperties"><value>
- hibernate.dialect = org.hibernate.dialect.HSQLDialect
- hibernate.connection.driver_class = org.hsqldb.jdbcDriver
- hibernate.connection.url = jdbc:hsqldb:mem:.
- hibernate.connection.username = sa
- hibernate.connection.password =
- hibernate.hbm2ddl.auto = create-drop
- hibernate.cache.use_second_level_cache = true
- hibernate.cache.provider_class = org.hibernate.cache.HashtableCacheProvider
- </value></property>
- </bean>
-
- <bean id="hibernateSessionManager"
- class="org.jbpm.pvm.internal.spring.HibernateSessionManager"
- scope="singleton">
- <property name="sessionFactory" ref="sessionFactory" />
- </bean>
-
- <!-- PROTOTYPES
- The PVM environment scope will only see prototype beans.
- Each environment will cache the prototype beans that are fetched
- through it.
- -->
-
- <bean id="session"
- factory-bean="hibernateSessionManager"
- factory-method="getSession"
- scope="prototype" />
-
-</beans>
\ No newline at end of file
Modified: jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/timer/TimerIntegrationTest.java
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/timer/TimerIntegrationTest.java 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/timer/TimerIntegrationTest.java 2008-07-25 10:51:28 UTC (rev 1721)
@@ -27,7 +27,6 @@
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.NodeImpl;
import org.jbpm.pvm.internal.util.Clock;
-import org.jbpm.pvm.job.Job;
import org.jbpm.pvm.job.JobTestHelper;
import org.jbpm.pvm.job.Timer;
import org.jbpm.pvm.model.OpenExecution;
@@ -150,9 +149,9 @@
assertNull(child);
// check that timers have been deleted
- List<Job> jobs = Environment.getCurrent().get(PvmDbSession.class).findAllJobs();
- assertNotNull(jobs);
- assertTrue(jobs.isEmpty());
+ List<Timer> timers = Environment.getCurrent().get(PvmDbSession.class).findTimers();
+ assertNotNull(timers);
+ assertTrue(timers.isEmpty());
// check that process is in the right state
execution = loadExecutionFromDb(processInstance.getDbid());
@@ -184,9 +183,9 @@
assertNull(child);
// check that timers have been deleted
- List<Job> jobs = Environment.getCurrent().get(PvmDbSession.class).findAllJobs();
- assertNotNull(jobs);
- assertTrue(jobs.isEmpty());
+ List<Timer> timers = Environment.getCurrent().get(PvmDbSession.class).findTimers();
+ assertNotNull(timers);
+ assertTrue(timers.isEmpty());
// check that process is in the right state
execution = loadExecutionFromDb(processInstance.getDbid());
@@ -293,9 +292,9 @@
assertNull(child);
// check that timers have been deleted
- List<Job> jobs = Environment.getCurrent().get(PvmDbSession.class).findAllJobs();
- assertNotNull(jobs);
- assertTrue(jobs.isEmpty());
+ List<Timer> timers = Environment.getCurrent().get(PvmDbSession.class).findTimers();
+ assertNotNull(timers);
+ assertTrue(timers.isEmpty());
// check that process is in the right state
execution = loadExecutionFromDb(processInstance.getDbid());
@@ -330,9 +329,9 @@
assertNull(child);
// check that timers have been deleted
- List<Job> jobs = Environment.getCurrent().get(PvmDbSession.class).findAllJobs();
- assertNotNull(jobs);
- assertTrue(jobs.isEmpty());
+ List<Timer> timers = Environment.getCurrent().get(PvmDbSession.class).findTimers();
+ assertNotNull(timers);
+ assertTrue(timers.isEmpty());
// check that process is in the right state
execution = loadExecutionFromDb(processInstance.getDbid());
Copied: jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db (from rev 1714, jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/db)
Property changes on: jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/langext/environment.cfg.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/db/langext/environment.cfg.xml 2008-07-24 14:29:59 UTC (rev 1714)
+++ jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/langext/environment.cfg.xml 2008-07-25 10:51:28 UTC (rev 1721)
@@ -6,7 +6,7 @@
<properties resource="hibernate.properties" />
<mappings resource="org/jbpm/pvm/pvm.hibernate.mappings.xml" />
<cache-configuration resource="org/jbpm/pvm/pvm.cache.xml" usage="nonstrict-read-write" />
- <mapping resource="org/jbpm/db/langext/language.extensions.hbm.xml" />
+ <mapping resource="org/jbpm/pvm/db/langext/language.extensions.hbm.xml" />
</hibernate-configuration>
<hibernate-session-factory />
@@ -19,7 +19,7 @@
<transaction />
<hibernate-session />
<pvm-db-session />
- <object class="org.jbpm.db.langext.AddressSession" />
+ <object class="org.jbpm.pvm.db.langext.AddressSession" />
</environment>
Modified: jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/langext/language.extensions.hbm.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/db/langext/language.extensions.hbm.xml 2008-07-24 14:29:59 UTC (rev 1714)
+++ jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/langext/language.extensions.hbm.xml 2008-07-25 10:51:28 UTC (rev 1721)
@@ -3,7 +3,7 @@
<hibernate-mapping package="org.jbpm.pvm" default-access="field">
- <class name="org.jbpm.db.langext.AddressActivity">
+ <class name="org.jbpm.pvm.db.langext.AddressActivity">
<id name="id" column="DBID_" type="long">
<generator class="native" />
</id>
Copied: jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/model (from rev 1714, jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/db/pvm)
Property changes on: jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/model
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/svc (from rev 1720, jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/client)
Property changes on: jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/svc
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/svc/environment.cfg.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/client/environment.cfg.xml 2008-07-25 09:50:20 UTC (rev 1720)
+++ jbpm4/pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/db/svc/environment.cfg.xml 2008-07-25 10:51:28 UTC (rev 1721)
@@ -12,6 +12,8 @@
</deployer-manager>
<process-service />
+ <execution-service />
+ <management-service />
<command-service>
<retry-interceptor />
17 years, 9 months
JBoss JBPM SVN: r1720 - in jbpm4/pvm/trunk: modules/core and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-07-25 05:50:20 -0400 (Fri, 25 Jul 2008)
New Revision: 1720
Modified:
jbpm4/pvm/trunk/modules/core/pom.xml
jbpm4/pvm/trunk/pom.xml
Log:
juel dependency fixes
Modified: jbpm4/pvm/trunk/modules/core/pom.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/pom.xml 2008-07-25 09:31:03 UTC (rev 1719)
+++ jbpm4/pvm/trunk/modules/core/pom.xml 2008-07-25 09:50:20 UTC (rev 1720)
@@ -42,6 +42,21 @@
<!-- Compile Dependencies -->
<dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel-engine</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel-impl</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
</dependency>
@@ -96,26 +111,6 @@
<artifactId>cactus</artifactId>
</dependency>
- <dependency>
- <groupId>juel</groupId>
- <artifactId>juel</artifactId>
- </dependency>
-
- <dependency>
- <groupId>juel</groupId>
- <artifactId>juel-engine</artifactId>
- </dependency>
-
- <dependency>
- <groupId>juel</groupId>
- <artifactId>juel-impl</artifactId>
- </dependency>
-
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- </dependency>
-
</dependencies>
<!-- Plugins -->
@@ -153,29 +148,20 @@
<configuration>
<argLine>${surefire.jvm.args}</argLine>
<excludes>
- <exclude>org/jbpm/client/ExecutionServiceTest.java</exclude>
- <exclude>org/jbpm/client/ManagementServiceTest.java</exclude>
+ <exclude>org/jbpm/db/svc/ManagementServiceTest.java</exclude>
+ <exclude>org/jbpm/db/svc/ProcessServiceTest.java</exclude>
+ <exclude>org/jbpm/db/svc/ExecutionServiceTest.java</exclude>
<exclude>org/jbpm/enterprise/CommandExecutorTest.java</exclude>
<exclude>org/jbpm/enterprise/TimerTest.java</exclude>
<exclude>org/jbpm/enterprise/EnterpriseTimerSessionTest.java</exclude>
<exclude>org/jbpm/enterprise/CommandReceiverTest.java</exclude>
<exclude>org/jbpm/jobexecutor/JobExecutorTimerSessionTest.java</exclude>
-<!-- <exclude>org/jbpm/msg/MemMessageServiceTest.java</exclude>-->
-<!-- <exclude>org/jbpm/pvm/ConcurrentIncomingTransitionsTest.java</exclude>-->
<exclude>org/jbpm/pvm/timer/TimerIntegrationTest.java</exclude>
-<!-- <exclude>org/jbpm/pvm/spring2/SpringPojoEnvironmentFactoryTest.java</exclude>-->
- <exclude>org/jbpm/pvm/expr/ExpressionTest.java</exclude>
-<!-- <exclude>org/jbpm/pvm/VariableExecutionTest.java</exclude>-->
-<!-- <exclude>org/jbpm/pvm/ForLoopBasedOnTransitionTest.java</exclude>-->
-<!-- <exclude>org/jbpm/pvm/VariableActivityInstanceTest.java</exclude>-->
-<!-- <exclude>org/jbpm/pvm/VariableScopeProgrammaticTest.java</exclude>-->
<exclude>org/jbpm/svc/jobexecutor/ContinuationTest.java</exclude>
-<!-- <exclude>org/jbpm/svc/hibernate/ExecutionTypeTest.java</exclude>-->
-<!-- <exclude>org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java</exclude>-->
<exclude>org/jbpm/pvm/samples/ex12/TimerTest.java</exclude>
<exclude>org/jbpm/pvm/samples/ex02/BasicProcessPersistenceTest.java</exclude>
<exclude>org/jbpm/pvm/samples/ex11/AsynchronousContinuationsTest.java</exclude>
-<!-- <exclude>org/jbpm/pvm/samples/ex07/EventListenerTest.java</exclude>-->
+ <exclude>org/jbpm/pvm/svc/hibernate/ExecutionTypeTest.java</exclude>
</excludes>
</configuration>
</plugin>
Modified: jbpm4/pvm/trunk/pom.xml
===================================================================
--- jbpm4/pvm/trunk/pom.xml 2008-07-25 09:31:03 UTC (rev 1719)
+++ jbpm4/pvm/trunk/pom.xml 2008-07-25 09:50:20 UTC (rev 1720)
@@ -49,7 +49,6 @@
<jboss.seam.version>2.0.1.GA</jboss.seam.version>
<cactus.version>13-1.7.1</cactus.version>
<juel.version>2.1.0</juel.version>
- <javax.el.api.version>1.0</javax.el.api.version>
</properties>
<!-- DependencyManagement -->
@@ -64,6 +63,24 @@
<!-- Thirdparty Dependencies -->
<dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel</artifactId>
+ <version>${juel.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel-engine</artifactId>
+ <version>${juel.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>juel</groupId>
+ <artifactId>juel-impl</artifactId>
+ <version>${juel.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>
@@ -129,30 +146,6 @@
<version>${cactus.version}</version>
</dependency>
- <dependency>
- <groupId>juel</groupId>
- <artifactId>juel</artifactId>
- <version>${juel.version}</version>
- </dependency>
-
- <dependency>
- <groupId>juel</groupId>
- <artifactId>juel-engine</artifactId>
- <version>${juel.version}</version>
- </dependency>
-
- <dependency>
- <groupId>juel</groupId>
- <artifactId>juel-impl</artifactId>
- <version>${juel.version}</version>
- </dependency>
-
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>${javax.el.api.version}</version>
- </dependency>
-
</dependencies>
</dependencyManagement>
17 years, 9 months
JBoss JBPM SVN: r1719 - jbpm4/pvm/trunk/modules/core.
by do-not-reply@jboss.org
Author: porcherg
Date: 2008-07-25 05:31:03 -0400 (Fri, 25 Jul 2008)
New Revision: 1719
Modified:
jbpm4/pvm/trunk/modules/core/pom.xml
Log:
rename db tables during compilation
Modified: jbpm4/pvm/trunk/modules/core/pom.xml
===================================================================
--- jbpm4/pvm/trunk/modules/core/pom.xml 2008-07-24 19:56:44 UTC (rev 1718)
+++ jbpm4/pvm/trunk/modules/core/pom.xml 2008-07-25 09:31:03 UTC (rev 1719)
@@ -29,6 +29,7 @@
<!-- Properties -->
<properties>
+ <table.prefix>JBPM_</table.prefix>
<surefire.gc.args>-XX:MaxPermSize=128m</surefire.gc.args>
<surefire.jdwp.args>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005</surefire.jdwp.args>
<test.resources.directory>${project.build.directory}/test-resources</test.resources.directory>
@@ -196,6 +197,18 @@
</tasks>
</configuration>
</execution>
+ <execution>
+ <id>rename-tables</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <replace dir="target/classes" includes="**/hibernate.*.hbm.xml" token="table="JBPM_" value="table="${table.prefix}" />
+ </tasks>
+ </configuration>
+ </execution>
</executions>
</plugin>
</plugins>
17 years, 9 months
JBoss JBPM SVN: r1718 - in jbossbpm/spec/trunk/modules: dialects/api10/src/main/java/org/jboss/bpm/dialect/api10 and 10 other directories.
by do-not-reply@jboss.org
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
17 years, 9 months
JBoss JBPM SVN: r1717 - in jbossbpm/spec/trunk/modules: api/src/main/java/org/jboss/bpm/model and 7 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-24 13:18:10 -0400 (Thu, 24 Jul 2008)
New Revision: 1717
Modified:
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Handler.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/ProcessImpl.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:
startProcess() registers copy. All good.
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-24 15:06:58 UTC (rev 1716)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-24 17:18:10 UTC (rev 1717)
@@ -129,22 +129,24 @@
}
/**
- * Find a Process for a given name
+ * Find the set of Processes for a given name
*
- * @return null if the process definition is not defined
+ * @param name The process name
+ * @param status The optional process status
+ * @return An empty set if the process cannot be found
*/
- public Process findProcess(String name)
+ public Set<Process> findProcessByName(String name, Process.Status status)
{
- Process proc = null;
+ Set<Process> procSet = new HashSet<Process>();
for (Process aux : procs)
{
if (aux.getName().equals(name))
{
- proc = aux;
- break;
+ if (status == null || aux.getStatus() == status)
+ procSet.add(aux);
}
}
- return proc;
+ return procSet;
}
/**
@@ -181,10 +183,10 @@
}
/**
- * Start a Process with a given process ID
+ * Start a Process with a given name
*/
- public abstract ObjectName startProcess(ObjectName id, Attachments att);
-
+ public abstract void startProcess(String name, Attachments att);
+
/**
* Wait for the Process to end. 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.
@@ -196,10 +198,11 @@
{
Process proc = getProcessByID(id);
Status status = proc.getStatus();
-
- if (status != Status.Active)
+
+ if (status == Status.None || status == Status.Ready)
throw new IllegalStateException("Cannot wait for process in state: " + status);
+ // Wait a little for the process to end
boolean forever = (timeout < 1);
long now = System.currentTimeMillis();
long until = now + timeout;
@@ -221,6 +224,7 @@
log.warn(ex);
}
+ // Throw timeout exception if it took too long
throw new ProcessTimeoutException("Process timeout for: " + id);
}
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-24 15:06:58 UTC (rev 1716)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-24 17:18:10 UTC (rev 1717)
@@ -25,7 +25,6 @@
import java.util.List;
-import javax.management.ObjectName;
import org.jboss.bpm.runtime.Attachments;
@@ -124,15 +123,13 @@
/**
* Start the process
- * @return the process instance identifier
*/
- ObjectName startProcess();
+ void startProcess();
/**
* Start the process, with a given execution context
- * @return the process instance identifier
*/
- ObjectName startProcess(Attachments att);
+ void startProcess(Attachments att);
/**
* Find a flow object by name
Modified: jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Handler.java
===================================================================
--- jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Handler.java 2008-07-24 15:06:58 UTC (rev 1716)
+++ jbossbpm/spec/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Handler.java 2008-07-24 17:18:10 UTC (rev 1717)
@@ -21,6 +21,8 @@
*/
package org.jboss.bpm.runtime;
+import java.io.Serializable;
+
import org.jboss.bpm.model.FlowObject;
//$Id$
@@ -31,7 +33,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Handler
+public interface Handler extends Serializable
{
}
\ No newline at end of file
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 15:06:58 UTC (rev 1716)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java 2008-07-24 17:18:10 UTC (rev 1717)
@@ -24,9 +24,8 @@
// $Id$
import java.util.Map;
+import java.util.Set;
-import javax.management.ObjectName;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.client.DialectHandler;
@@ -34,6 +33,7 @@
import org.jboss.bpm.client.ExecutionManager;
import org.jboss.bpm.client.ProcessEngine;
import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Process.Status;
import org.jboss.bpm.model.internal.ProcessImpl;
import org.jboss.bpm.model.internal.RuntimeProcessImpl;
@@ -65,20 +65,23 @@
this.dialectRegistry = dialectRegistry;
}
- public ObjectName startProcess(ObjectName id, Attachments att)
+ public void startProcess(String name, Attachments att)
{
- ProcessImpl proc = (ProcessImpl)getProcessByID(id);
- if (proc.getStatus() != Status.Ready)
- throw new IllegalStateException("Cannot start process in state: " + proc.getStatus());
-
- // Copy and register the process instance
- proc = (ProcessImpl)proc.copyProcess();
- registerProcess(proc);
+ Set<Process> procSet = findProcessByName(name, Status.Ready);
+ if (procSet.size() == 0)
+ throw new IllegalStateException("Cannot obtain process with name: " + name);
+ if (procSet.size() > 1)
+ throw new IllegalStateException("Multiple processes with name: " + name);
+ ProcessImpl proc = (ProcessImpl)procSet.iterator().next();
+
+ // Copy and register a copy of the process instance
+ Process procCopy = (ProcessImpl)proc.copyProcess();
+ registerProcess(procCopy);
+
// Start the process in a thread
+ proc.setStatus(Status.Active);
new Thread(new ProcessRunner(proc, att)).start();
-
- return proc.getID();
}
class ProcessRunner implements Runnable
@@ -94,7 +97,6 @@
public void run()
{
- proc.setStatus(Status.Active);
try
{
ExecutionManager exm = ExecutionManager.locateExecutionManager();
Modified: jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java
===================================================================
--- jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java 2008-07-24 15:06:58 UTC (rev 1716)
+++ jbossbpm/spec/trunk/modules/ri/src/main/java/org/jboss/bpm/model/internal/ProcessImpl.java 2008-07-24 17:18:10 UTC (rev 1717)
@@ -31,8 +31,6 @@
import java.util.Collections;
import java.util.List;
-import javax.management.ObjectName;
-
import org.jboss.bpm.InvalidProcessException;
import org.jboss.bpm.NotImplementedException;
import org.jboss.bpm.client.ProcessManager;
@@ -158,19 +156,19 @@
}
catch (Exception ex)
{
- throw new InvalidProcessException("Cannot create a copy of: " + this);
+ throw new InvalidProcessException("Cannot create a copy of: " + this, ex);
}
}
- public ObjectName startProcess()
+ public void startProcess()
{
- return startProcess(null);
+ startProcess(null);
}
- public ObjectName startProcess(Attachments att)
+ public void startProcess(Attachments att)
{
ProcessManager pm = ProcessManager.locateProcessManager();
- return pm.startProcess(getID(), att);
+ pm.startProcess(getName(), att);
}
public void waitForEnd()
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 15:06:58 UTC (rev 1716)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/airticket/AirticketTest.java 2008-07-24 17:18:10 UTC (rev 1717)
@@ -47,6 +47,6 @@
assertNotNull(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 15:06:58 UTC (rev 1716)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/parallelsplit/ParallelSplitTest.java 2008-07-24 17:18:10 UTC (rev 1717)
@@ -26,14 +26,12 @@
import java.net.URL;
import java.util.List;
import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.client.SignalManager;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.ProcessBuilder;
import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.Signal;
import org.jboss.bpm.test.DefaultEngineTestCase;
@@ -76,6 +74,10 @@
Process proc = procBuilder.addStartEvent().addSequenceFlow("gateway").addParallelGateway("gateway").
addSequenceFlow("endA").addSequenceFlow("endB").addEndEvent("endA").addEndEvent("endB").getProcess();
+ // Register the Process with the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ pm.registerProcess(proc);
+
runProcess(proc);
}
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 15:06:58 UTC (rev 1716)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-24 17:18:10 UTC (rev 1717)
@@ -75,6 +75,10 @@
Process proc = procBuilder.addStartEvent().addSequenceFlow("stateA").addTask("stateA").
addSequenceFlow("end").addEndEvent("end").getProcess();
+ // Register the Process with the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ pm.registerProcess(proc);
+
runProcess(proc);
}
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 15:06:58 UTC (rev 1716)
+++ jbossbpm/spec/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-24 17:18:10 UTC (rev 1717)
@@ -72,9 +72,13 @@
{
// Create a Process through the ProcessBuilder
ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder(getName());
- Process proc = procBuilder.addStartEvent().addSequenceFlow("stateA").addTask("stateA").addExecutionHandler(
- TaskA.class).addSequenceFlow("end").addEndEvent("end").getProcess();
+ Process proc = procBuilder.addStartEvent().addSequenceFlow("stateA").addTask("stateA").
+ addExecutionHandler(TaskA.class).addSequenceFlow("end").addEndEvent("end").getProcess();
+ // Register the Process with the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ pm.registerProcess(proc);
+
runProcess(proc);
}
17 years, 9 months