JBoss JBPM SVN: r2445 - in projects/spec/trunk/modules/cts: src/test/java/org and 23 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-30 04:24:31 -0400 (Tue, 30 Sep 2008)
New Revision: 2445
Added:
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/activity/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processmanager/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/signalmanager/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/
Removed:
projects/spec/trunk/modules/cts/src/test/java/org/jboss/
Modified:
projects/spec/trunk/modules/cts/pom.xml
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/activity/ActivityInputSetTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/activity/ActivityOutputSetTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/activity/ActivityPropertyTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext/ExecutionContextTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processmanager/ProcessManagerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/signalmanager/SignalManagerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java
Log:
Use package jbpm/test
Modified: projects/spec/trunk/modules/cts/pom.xml
===================================================================
--- projects/spec/trunk/modules/cts/pom.xml 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/pom.xml 2008-09-30 08:24:31 UTC (rev 2445)
@@ -70,31 +70,31 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
- <exclude>org/jboss/bpm/cts/activity/ActivityInputSetTest.java</exclude>
- <exclude>org/jboss/bpm/cts/activity/ActivityOutputSetTest.java</exclude>
- <exclude>org/jboss/bpm/cts/activity/ActivityPropertyTest.java</exclude>
- <exclude>org/jboss/bpm/cts/endevent/EndEventMessageTest.java</exclude>
- <exclude>org/jboss/bpm/cts/executioncontext/ExecutionContextTest.java</exclude>
- <exclude>org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java</exclude>
- <exclude>org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java</exclude>
- <exclude>org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeTest.java</exclude>
- <exclude>org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitTest.java</exclude>
- <exclude>org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeTest.java</exclude>
- <exclude>org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitTest.java</exclude>
- <exclude>org/jboss/bpm/cts/processmanager/ProcessManagerTest.java</exclude>
- <exclude>org/jboss/bpm/cts/process/ProcessPropertyTest.java</exclude>
- <exclude>org/jboss/bpm/cts/signalmanager/SignalManagerTest.java</exclude>
- <exclude>org/jboss/bpm/cts/startevent/StartEventSignalTest.java</exclude>
- <exclude>org/jboss/bpm/cts/task/ReceiveTaskTest.java</exclude>
- <exclude>org/jboss/bpm/cts/task/SendTaskTest.java</exclude>
- <exclude>org/jboss/bpm/cts/task/TaskExecutionHandlerTest.java</exclude>
- <exclude>org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceTest.java</exclude>
- <exclude>org/jboss/bpm/pattern/control/multichoice/MultiChoiceTest.java</exclude>
- <exclude>org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitTest.java</exclude>
- <exclude>org/jboss/bpm/pattern/control/simplemerge/SimpleMergeTest.java</exclude>
- <exclude>org/jboss/bpm/pattern/control/synchronization/SynchronizationTest.java</exclude>
- <exclude>org/jboss/bpm/pattern/data/casedata/CaseDataTest.java</exclude>
- <exclude>org/jboss/bpm/pattern/data/taskdata/TaskDataTest.java</exclude>
+ <exclude>org/jbpm/test/cts/activity/ActivityInputSetTest.java</exclude>
+ <exclude>org/jbpm/test/cts/activity/ActivityOutputSetTest.java</exclude>
+ <exclude>org/jbpm/test/cts/activity/ActivityPropertyTest.java</exclude>
+ <exclude>org/jbpm/test/cts/endevent/EndEventMessageTest.java</exclude>
+ <exclude>org/jbpm/test/cts/executioncontext/ExecutionContextTest.java</exclude>
+ <exclude>org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java</exclude>
+ <exclude>org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java</exclude>
+ <exclude>org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java</exclude>
+ <exclude>org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java</exclude>
+ <exclude>org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java</exclude>
+ <exclude>org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java</exclude>
+ <exclude>org/jbpm/test/cts/processmanager/ProcessManagerTest.java</exclude>
+ <exclude>org/jbpm/test/cts/process/ProcessPropertyTest.java</exclude>
+ <exclude>org/jbpm/test/cts/signalmanager/SignalManagerTest.java</exclude>
+ <exclude>org/jbpm/test/cts/startevent/StartEventSignalTest.java</exclude>
+ <exclude>org/jbpm/test/cts/task/ReceiveTaskTest.java</exclude>
+ <exclude>org/jbpm/test/cts/task/SendTaskTest.java</exclude>
+ <exclude>org/jbpm/test/cts/task/TaskExecutionHandlerTest.java</exclude>
+ <exclude>org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java</exclude>
+ <exclude>org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java</exclude>
+ <exclude>org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java</exclude>
+ <exclude>org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java</exclude>
+ <exclude>org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java</exclude>
+ <exclude>org/jbpm/test/pattern/data/casedata/CaseDataTest.java</exclude>
+ <exclude>org/jbpm/test/pattern/data/taskdata/TaskDataTest.java</exclude>
</excludes>
</configuration>
</plugin>
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/activity (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/activity/ActivityInputSetTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/activity/ActivityInputSetTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.activity;
+package org.jbpm.test.cts.activity;
// $Id$
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/activity/ActivityOutputSetTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityOutputSetTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/activity/ActivityOutputSetTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.activity;
+package org.jbpm.test.cts.activity;
// $Id$
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/activity/ActivityPropertyTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/activity/ActivityPropertyTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.activity;
+package org.jbpm.test.cts.activity;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/endevent)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/endevent/EndEventMessageTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.endevent;
+package org.jbpm.test.cts.endevent;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/executioncontext)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext/ExecutionContextTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/executioncontext/ExecutionContextTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/executioncontext/ExecutionContextTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.executioncontext;
+package org.jbpm.test.cts.executioncontext;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.gateway.exclusive;
+package org.jbpm.test.cts.gateway.exclusive;
// $Id$
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.gateway.exclusive;
+package org.jbpm.test.cts.gateway.exclusive;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewayMergeTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.gateway.inclusive;
+package org.jbpm.test.cts.gateway.inclusive;
// $Id$
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/inclusive/InclusiveGatewaySplitTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.gateway.inclusive;
+package org.jbpm.test.cts.gateway.inclusive;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewayMergeTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.gateway.parallel;
+package org.jbpm.test.cts.gateway.parallel;
// $Id$
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/gateway/parallel/ParallelGatewaySplitTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.gateway.parallel;
+package org.jbpm.test.cts.gateway.parallel;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/process/ProcessPropertyTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.process;
+package org.jbpm.test.cts.process;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processmanager (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/processmanager)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processmanager/ProcessManagerTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/processmanager/ProcessManagerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processmanager/ProcessManagerTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.processmanager;
+package org.jbpm.test.cts.processmanager;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/signalmanager (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/signalmanager)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/signalmanager/SignalManagerTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/signalmanager/SignalManagerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/signalmanager/SignalManagerTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.signalmanager;
+package org.jbpm.test.cts.signalmanager;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/startevent)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/startevent/StartEventSignalTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.startevent;
+package org.jbpm.test.cts.startevent;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/ReceiveTaskTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.task;
+package org.jbpm.test.cts.task;
// $Id$
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/SendTaskTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/SendTaskTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.task;
+package org.jbpm.test.cts.task;
// $Id$
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/task/TaskExecutionHandlerTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.cts.task;
+package org.jbpm.test.cts.task;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.pattern.control.exclusivechoice;
+package org.jbpm.test.pattern.control.exclusivechoice;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/multichoice)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/multichoice/MultiChoiceTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.pattern.control.multichoice;
+package org.jbpm.test.pattern.control.multichoice;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/parallelsplit/ParallelSplitTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.pattern.control.parallelsplit;
+package org.jbpm.test.pattern.control.parallelsplit;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/simplemerge)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/simplemerge/SimpleMergeTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.pattern.control.simplemerge;
+package org.jbpm.test.pattern.control.simplemerge;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/synchronization)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/synchronization/SynchronizationTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.pattern.control.synchronization;
+package org.jbpm.test.pattern.control.synchronization;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/casedata)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/casedata/CaseDataTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.pattern.data.casedata;
+package org.jbpm.test.pattern.data.casedata;
// $Id$
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata (from rev 2444, projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/taskdata)
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataTest.java 2008-09-30 08:08:49 UTC (rev 2444)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/data/taskdata/TaskDataTest.java 2008-09-30 08:24:31 UTC (rev 2445)
@@ -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.jboss.bpm.pattern.data.taskdata;
+package org.jbpm.test.pattern.data.taskdata;
// $Id$
15 years, 8 months
JBoss JBPM SVN: r2444 - in projects/spec/trunk/modules: api/src/main/java/org/jbpm/api/model/builder and 34 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-30 04:08:49 -0400 (Tue, 30 Sep 2008)
New Revision: 2444
Added:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/EventBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilderService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/EventBuilderImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/GatewayBuilderImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java
Removed:
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityOutputSetMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/engine/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessIntegrityTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/SendTaskDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/SendTaskMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitSTPTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/sequence/
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataMarshallerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataDescriptorTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataMarshallerTest.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
projects/spec/trunk/modules/cts/pom.xml
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityOutputSetTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/executioncontext/ExecutionContextTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/processmanager/ProcessManagerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/signalmanager/SignalManagerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/SendTaskTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/ProcessBuilderTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/TestProcessBuilder.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java
projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
Log:
Restore CTS test cases from Alpha1
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.model.Message;
+
+//$Id$
+
+/**
+ * A MessageListener that can be registered with the ProcessEngine
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MessageListener
+{
+ /**
+ * Get the id for this listener
+ */
+ ObjectName getID();
+
+ /**
+ * Catch a message from the process that this listener is registered with
+ */
+ void catchMessage(Message message);
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/MessageListener.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/EventBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/EventBuilder.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/EventBuilder.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.builder;
+
+//$Id$
+
+import org.jbpm.api.model.Signal.SignalType;
+
+/**
+ * The EventBuilder can be used to build an Event dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface EventBuilder extends ProcessBuilder
+{
+ /**
+ * Add a signal ref to the last added EventDetail
+ */
+ EventBuilder addSignalRef(SignalType signalType, String signalMessage);
+
+ /**
+ * Add a message ref to the last added EventDetail
+ */
+ EventBuilder addMessageRef(String msgName);
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/EventBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.builder;
+
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+
+
+//$Id$
+
+/**
+ * The GatewayBuilder can be used to build a Gateway dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface GatewayBuilder extends ProcessBuilder
+{
+ /**
+ * Add the default {@link Gate}
+ */
+ GatewayBuilder addDefaultGate(String targetName);
+
+ /**
+ * Add a conditional {@link Gate}
+ */
+ GatewayBuilder addConditionalGate(String targetName, ExpressionLanguage exprLang, String exprBody);
+
+ /**
+ * Add an unconditional {@link Gate}
+ */
+ GatewayBuilder addGate(String targetName);
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/GatewayBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilderService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilderService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilderService.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.builder;
+
+//$Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.service.Service;
+
+/**
+ * The MessageBuilder can be used to build a {@link Message} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class MessageBuilderService implements Service
+{
+ /**
+ * Locate the default MessageBuilder
+ */
+ public static MessageBuilder locateMessageBuilder()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ MessageBuilderService builderService = engine.getService(MessageBuilderService.class);
+ return builderService.getMessageBuilder();
+ }
+
+ /**
+ * Get the MessageBuilder
+ */
+ public abstract MessageBuilder getMessageBuilder();
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/MessageBuilderService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -23,9 +23,15 @@
//$Id$
+import org.jbpm.api.model.Message;
import org.jbpm.api.model.Process;
+import org.jbpm.api.model.EndEvent.ResultType;
import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.StartEvent.TriggerType;
import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.runtime.ExecutionHandler;
+import org.jbpm.api.runtime.FlowHandler;
+import org.jbpm.api.runtime.SignalHandler;
/**
* The ProcessBuilder can be used to build a {@link Process} dynamically.
@@ -56,9 +62,14 @@
/**
* Add a SartEvent with a given name
*/
- ProcessBuilder addStartEvent(String name);
+ EventBuilder addStartEvent(String name);
/**
+ * Add a SartEvent with a given name and TriggerType
+ */
+ EventBuilder addStartEvent(String name, TriggerType triggerType);
+
+ /**
* Add an IntermediateEvent with a given name
*/
ProcessBuilder addEvent(String name);
@@ -66,20 +77,51 @@
/**
* Add an EndEvent with a given name
*/
- ProcessBuilder addEndEvent(String name);
+ EventBuilder addEndEvent(String name);
/**
+ * Add an EndEvent with a given name and ResultType
+ */
+ EventBuilder addEndEvent(String name, ResultType resultType);
+
+ /**
* Add a Task of {@link TaskType} NONE with a given name
*/
- ProcessBuilder addTask(String name);
+ TaskBuilder addTask(String name);
/**
* Add a Task of {@link TaskType} with a given name
*/
- ProcessBuilder addTask(String name, TaskType type);
+ TaskBuilder addTask(String name, TaskType type);
/**
* Add a Gateway with a given name
*/
- ProcessBuilder addGateway(String name, GatewayType type);
+ GatewayBuilder addGateway(String name, GatewayType type);
+
+ /**
+ * Add a {@link Message} with a given name.
+ */
+ MessageBuilder addMessage(String name);
+
+ /**
+ * Add a process property
+ */
+ ProcessBuilder addProperty(String name, String value);
+
+
+ /**
+ * Add an {@link ExecutionHandler} with a given Class
+ */
+ <T extends ExecutionHandler> ProcessBuilder addExecutionHandler(Class<T> clazz);
+
+ /**
+ * Add an {@link FlowHandler} with a given Class
+ */
+ <T extends FlowHandler> ProcessBuilder addFlowHandler(Class<T> clazz);
+
+ /**
+ * Add an {@link SignalHandler} with a given Class
+ */
+ <T extends SignalHandler> ProcessBuilder addSignalHandler(Class<T> clazz);
}
\ No newline at end of file
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilderService.java (from rev 2438, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilder.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilderService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/ProcessBuilderService.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.builder;
+
+//$Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.service.Service;
+
+/**
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class ProcessBuilderService implements Service
+{
+ /**
+ * Locate the default ProcessBuilder
+ */
+ public static ProcessBuilder locateProcessBuilder()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilderService builderService = engine.getService(ProcessBuilderService.class);
+ return builderService.getProcessBuilder();
+ }
+
+ /**
+ * Get the ProcessBuilder
+ */
+ public abstract ProcessBuilder getProcessBuilder();
+}
\ No newline at end of file
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model.builder;
+
+
+//$Id$
+
+/**
+ * The TaskBuilder can be used to build a Task dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface TaskBuilder extends ProcessBuilder
+{
+ /**
+ * Add a {@link Message} reference.
+ * <p/>
+ * The {@link Message} must be defined at {@link Process} level
+ */
+ TaskBuilder addMessageRef(String msgName);
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/builder/TaskBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -21,6 +21,8 @@
*/
package org.jbpm.api.runtime;
+import java.io.Serializable;
+
//$Id$
@@ -31,7 +33,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface ExecutionHandler
+public interface ExecutionHandler extends Serializable
{
/**
* Execute the associated business logic.
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -23,6 +23,8 @@
// $Id$
+import java.io.Serializable;
+
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
@@ -33,7 +35,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface FlowHandler
+public interface FlowHandler extends Serializable
{
/**
* Execute the FlowHandler.
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -23,6 +23,8 @@
// $Id$
+import java.io.Serializable;
+
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.Signal;
@@ -34,7 +36,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface SignalHandler
+public interface SignalHandler extends Serializable
{
/**
* Get signal for enter
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -0,0 +1,168 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software{} you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation{} either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY{} without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software{} if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.client.MessageListener;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Event;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Participant;
+import org.jbpm.api.model.Task;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The ProcessEngine sends messages through the MessageService.
+ * <p/>
+ * A {@link Message} has an ID and is targeted to a
+ * specific Participant. A component can register a {@link MessageListener} with the MessageService.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public abstract class MessageService implements Service
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(MessageService.class);
+
+ // The set of registered message listeners
+ private Map<ObjectName, MessageListener> listeners = new HashMap<ObjectName, MessageListener>();
+
+ /**
+ * Locate the default MessageService
+ */
+ public static MessageService locateMessageService()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ return engine.getService(MessageService.class);
+ }
+
+ /**
+ * Add a MessageListener
+ */
+ public void addMessageListener(MessageListener listener)
+ {
+ synchronized (listeners)
+ {
+ if (hasMessageListener(listener.getID()))
+ throw new IllegalStateException("Listener already registered: " + listener.getID());
+
+ log.debug("addMessageListener: " + listener.getID());
+ listeners.put(listener.getID(), listener);
+ }
+ }
+
+ /**
+ * Get the set of registered MessageListeners
+ */
+ public Set<MessageListener> getMessageListeners()
+ {
+ synchronized (listeners)
+ {
+ HashSet<MessageListener> set = new HashSet<MessageListener>(listeners.values());
+ return Collections.unmodifiableSet(set);
+ }
+ }
+
+ /**
+ * Get a MessageListener for a given ID
+ *
+ * @return null if there is none
+ */
+ public MessageListener getMessageListener(ObjectName listenerID)
+ {
+ synchronized (listeners)
+ {
+ return listeners.get(listenerID);
+ }
+ }
+
+ /**
+ * True if there is a MessageListener for a given ID
+ */
+ public boolean hasMessageListener(ObjectName listenerID)
+ {
+ return getMessageListener(listenerID) != null;
+ }
+
+ /**
+ * Remove an MessageListener
+ */
+ public void removeMessageListener(ObjectName listenerID)
+ {
+ synchronized (listeners)
+ {
+ log.debug("removeMessageListener: " + listenerID);
+ listeners.remove(listenerID);
+ }
+ }
+
+ /**
+ * Send a message to a given {@link Task} or {@link Event}
+ */
+ public void sendMessage(ObjectName procID, String targetName, Message msg)
+ {
+ ProcessService procService = ProcessService.locateProcessService();
+ Process proc = procService.getProcessByKey(procID);
+ if (proc == null)
+ throw new IllegalStateException("Cannot obtain registered process: " + procID);
+
+ Node targetNode = proc.getNode(targetName);
+ if (targetNode == null)
+ throw new IllegalArgumentException("Cannot find message target: " + targetName);
+ if (targetNode instanceof MessageListener == false)
+ throw new IllegalArgumentException("Message target is not a valid message receiver: " + targetName);
+
+ log.debug("sendMessage to " + targetNode + " => " + msg);
+ MessageListener msgListener = (MessageListener)targetNode;
+ msgListener.catchMessage(msg);
+ }
+
+ /**
+ * Send a message to a given {@link MessageListener}
+ */
+ public void sendMessage(Message msg)
+ {
+ Participant toRef = msg.getToRef();
+ if (toRef == null)
+ throw new IllegalArgumentException("Target entity cannot be null");
+
+ MessageListener msgListener = getMessageListener(toRef.getName());
+ if (msgListener == null)
+ throw new IllegalStateException("No message listener registered for: " + toRef);
+
+ log.debug("sendMessage to '" + toRef + "' => " + msg);
+ msgListener.catchMessage(msg);
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/MessageService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/PersistenceService.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,6 +25,7 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Process;
/**
@@ -33,12 +34,30 @@
* @author thomas.diesler(a)jboss.com
* @since 17-Sep-2008
*/
-public interface PersistenceService extends Service
+public abstract class PersistenceService implements Service
{
- ObjectName saveProcess(Process proc);
+ /**
+ * Locate the default PersistenceService
+ */
+ public static PersistenceService locatePersistenceService()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ return engine.getService(PersistenceService.class);
+ }
+
+ /**
+ * Save the Process to persistent storage
+ */
+ public abstract ObjectName saveProcess(Process proc);
- Process loadProcess(ObjectName key);
+ /**
+ * Load the Process from persistent storage
+ */
+ public abstract Process loadProcess(ObjectName key);
- void deleteProcess(Process proc);
-
+ /**
+ * Delete the Process from persistent storage
+ */
+ public abstract void deleteProcess(Process proc);
+
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -57,6 +57,15 @@
{
}
+ /**
+ * Locate the default ProcessService
+ */
+ public static ProcessService locateProcessService()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ return engine.getService(ProcessService.class);
+ }
+
/**
* Deploy a new process to the process service.
*/
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -27,6 +27,7 @@
import java.util.HashSet;
import java.util.Set;
+import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.client.SignalListener;
import org.jbpm.api.model.Signal;
import org.slf4j.Logger;
@@ -48,6 +49,15 @@
private Set<SignalListener> listeners = new HashSet<SignalListener>();
/**
+ * Locate the default SignalService
+ */
+ public static SignalService locateSignalService()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ return engine.getService(SignalService.class);
+ }
+
+ /**
* Add a SignalListener for a given source
*/
public void addSignalListener(SignalListener listener)
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -34,10 +34,15 @@
import junit.framework.TestCase;
import org.jbpm.api.Constants;
+import org.jbpm.api.client.MessageListener;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.service.MessageService;
+import org.jbpm.api.service.ProcessService;
import org.jbpm.api.service.SignalService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -58,6 +63,10 @@
private SignalListener signalListener;
// The signals caught by this test case
private List<Signal> signals = new ArrayList<Signal>();
+ // The embedded MessageListener
+ private MessageListener messageListener;
+ // The messages caught by this test case
+ private List<Message> messages = new ArrayList<Message>();
@Override
protected void setUp() throws Exception
@@ -74,18 +83,35 @@
{
signals.clear();
}
+
+ // Setup the MessageListener
+ clearAllMessageListeners();
+ MessageService msgService = MessageService.locateMessageService();
+ msgService.addMessageListener(getMessageListener());
}
@Override
protected void tearDown() throws Exception
{
- super.tearDown();
-
// Tear down the SignalListener
ProcessEngine engine = ProcessEngine.getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
sigService.removeSignalListener(getSignalListener());
+ // Tear down the MessageListener
+ MessageService msgService = MessageService.locateMessageService();
+ msgService.removeMessageListener(getTestID());
+
+ // Check that there are no registered processes left
+ ProcessService procManager = ProcessService.locateProcessService();
+ Set<Process> procs = procManager.getProcesses();
+ if (procs.size() > 0)
+ {
+ String logMsg = "Registered processes on tear down of " + getName() + ": " + procs;
+ System.out.println(logMsg);
+ log.warn(logMsg);
+ }
+
// Check that there are no registered signal listeners left
Set<SignalListener> sigListeners = sigService.getSignalListeners();
if (sigListeners.size() > 0)
@@ -95,6 +121,16 @@
log.warn(logMsg);
}
+ // Check that there are no registered message listeners left
+ Set<MessageListener> msgListeners = msgService.getMessageListeners();
+ if (msgListeners.size() > 0)
+ {
+ String logMsg = "Registered message listeners on tear down of " + getName() + ": " + msgListeners;
+ System.out.println(logMsg);
+ log.warn(logMsg);
+ }
+
+ super.tearDown();
log.debug("### END " + getLongName());
}
@@ -136,6 +172,14 @@
}
}
+ public List<Message> getMessages()
+ {
+ synchronized (messages)
+ {
+ return Collections.unmodifiableList(messages);
+ }
+ }
+
public List<Signal> getSignals(Signal.SignalType type)
{
synchronized (signals)
@@ -161,6 +205,16 @@
}
}
+ private void clearAllMessageListeners()
+ {
+ MessageService msgService = MessageService.locateMessageService();
+ Set<MessageListener> msgListeners = msgService.getMessageListeners();
+ for (MessageListener msgListener : msgListeners)
+ {
+ msgService.removeMessageListener(msgListener.getID());
+ }
+ }
+
public SignalListener getSignalListener()
{
if (signalListener == null)
@@ -188,4 +242,28 @@
}
return signalListener;
}
+
+ public MessageListener getMessageListener()
+ {
+ if (messageListener == null)
+ {
+ messageListener = new MessageListener()
+ {
+ public ObjectName getID()
+ {
+ return getTestID();
+ }
+
+ public void catchMessage(Message message)
+ {
+ synchronized (messages)
+ {
+ log.debug("catchMessage: " + message);
+ messages.add(message);
+ }
+ }
+ };
+ }
+ return messageListener;
+ }
}
Modified: projects/spec/trunk/modules/cts/pom.xml
===================================================================
--- projects/spec/trunk/modules/cts/pom.xml 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/pom.xml 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- ====================================================================== -->
-<!-- -->
-<!-- JBoss, the OpenSource J2EE webOS -->
-<!-- -->
-<!-- Distributable under LGPL license. -->
-<!-- See terms of license at http://www.gnu.org. -->
-<!-- -->
-<!-- ====================================================================== -->
+ <!-- ====================================================================== -->
+ <!-- -->
+ <!-- JBoss, the OpenSource J2EE webOS -->
+ <!-- -->
+ <!-- Distributable under LGPL license. -->
+ <!-- See terms of license at http://www.gnu.org. -->
+ <!-- -->
+ <!-- ====================================================================== -->
-<!-- $Id$ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <!-- $Id$ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>JBoss jBPM4 - CTS</name>
<groupId>org.jbpm.jbpm4</groupId>
@@ -29,7 +30,7 @@
<properties>
<mysql.connector.version>5.1.6</mysql.connector.version>
</properties>
-
+
<!-- Dependencies -->
<dependencies>
<dependency>
@@ -50,7 +51,7 @@
<artifactId>slf4j-log4j12</artifactId>
</dependency>
</dependencies>
-
+
<!-- DependencyManagement -->
<dependencyManagement>
<dependencies>
@@ -61,16 +62,48 @@
</dependency>
</dependencies>
</dependencyManagement>
-
+
<!-- Plugins -->
<build>
<plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/jboss/bpm/cts/activity/ActivityInputSetTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/activity/ActivityOutputSetTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/activity/ActivityPropertyTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/endevent/EndEventMessageTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/executioncontext/ExecutionContextTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/processmanager/ProcessManagerTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/process/ProcessPropertyTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/signalmanager/SignalManagerTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/startevent/StartEventSignalTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/task/ReceiveTaskTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/task/SendTaskTest.java</exclude>
+ <exclude>org/jboss/bpm/cts/task/TaskExecutionHandlerTest.java</exclude>
+ <exclude>org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceTest.java</exclude>
+ <exclude>org/jboss/bpm/pattern/control/multichoice/MultiChoiceTest.java</exclude>
+ <exclude>org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitTest.java</exclude>
+ <exclude>org/jboss/bpm/pattern/control/simplemerge/SimpleMergeTest.java</exclude>
+ <exclude>org/jboss/bpm/pattern/control/synchronization/SynchronizationTest.java</exclude>
+ <exclude>org/jboss/bpm/pattern/data/casedata/CaseDataTest.java</exclude>
+ <exclude>org/jboss/bpm/pattern/data/taskdata/TaskDataTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
</plugins>
</build>
-
+
<!-- Profiles -->
<profiles>
-
+
<!--
Name: no-impl
Descr: The default implementation profile
@@ -90,7 +123,7 @@
</dependency>
</dependencies>
</profile>
-
+
<!--
Name: no-database
Descr: Setup the default database
@@ -113,7 +146,7 @@
</dependency>
</dependencies>
</profile>
-
+
</profiles>
-
+
</project>
\ No newline at end of file
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss (from rev 2416, projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss)
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm (from rev 2443, projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm)
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.activity;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test Activity InputSet
- *
- * @author thomas.diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class ActivityInputSetDescriptorTest extends ActivityInputSetTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/activity/activity-inputset-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.activity;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test Activity InputSet
- *
- * @author thomas.diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class ActivityInputSetMarshallerTest extends ActivityInputSetTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityInputSetTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,15 +25,14 @@
import java.io.IOException;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.TaskBuilder;
-import org.jboss.bpm.model.EventDetail.EventDetailType;
-import org.jboss.bpm.runtime.BasicAttachments;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.test.CTSTestCase;
/**
* InputSets define the data requirements for input to the activity. Zero or more InputSets MAY be defined. Each
@@ -45,7 +44,7 @@
* @author thomas.diesler(a)jboss.com
* @since 15-Aug-2008
*/
-public class ActivityInputSetTest extends DefaultEngineTestCase
+public class ActivityInputSetTest extends CTSTestCase
{
public void testValidProps() throws Exception
{
@@ -58,7 +57,7 @@
Message endMessage = getMessages().get(0);
assertNotNull("EndMessage expected", endMessage);
- assertEquals("kermit", endMessage.getPropertyValue("frog"));
+ assertEquals("kermit", endMessage.getProperty("frog").getValue());
}
public void testInvalidProps() throws Exception
@@ -81,11 +80,11 @@
protected Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("ActivityInputSet").addStartEvent("Start").addSequenceFlow("TaskA");
- TaskBuilder taskBuilder = procBuilder.addTask("TaskA");
- taskBuilder.addInputSet().addPropertyInput("frog").addSequenceFlow("End");
- procBuilder.addEndEvent("End").addEventDetail(EventDetailType.Message).addMessageRef("EndMessage");
+ //TaskBuilder taskBuilder = procBuilder.addTask("TaskA");
+ //taskBuilder.addInputSet().addPropertyInput("frog").addSequenceFlow("End");
+ procBuilder.addEndEvent("End", ResultType.Message).addMessageRef("EndMessage");
MessageBuilder msgBuilder = procBuilder.addMessage("EndMessage");
msgBuilder.addToRef(getTestID()).addProperty("frog", null, true);
Process proc = procBuilder.getProcess();
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityOutputSetMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/activity/ActivityOutputSetMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityOutputSetMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.activity;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test Activity OutputSet
- *
- * https://jira.jboss.org/jira/browse/JBPM-1703
- *
- * @author thomas.diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class ActivityOutputSetMarshallerTest extends ActivityOutputSetTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- // System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityOutputSetTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/activity/ActivityOutputSetTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityOutputSetTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,14 +25,13 @@
import java.io.IOException;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.TaskBuilder;
-import org.jboss.bpm.model.EventDetail.EventDetailType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.test.CTSTestCase;
/**
* OutputSets define the data requirements for output from the activity. Zero or more OutputSets MAY be defined. At the
@@ -45,7 +44,7 @@
* @author thomas.diesler(a)jboss.com
* @since 15-Aug-2008
*/
-public class ActivityOutputSetTest extends DefaultEngineTestCase
+public class ActivityOutputSetTest extends CTSTestCase
{
public void testValidProps() throws Exception
{
@@ -56,16 +55,16 @@
Message endMessage = getMessages().get(0);
assertNotNull("EndMessage expected", endMessage);
- assertEquals("kermit", endMessage.getPropertyValue("frog"));
+ assertEquals("kermit", endMessage.getProperty("frog").getValue());
}
protected Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("ActivityInputSet").addStartEvent("Start").addSequenceFlow("TaskA");
- TaskBuilder taskBuilder = procBuilder.addTask("TaskA");
- taskBuilder.addOutputSet().addPropertyOutput("frog", "kermit").addSequenceFlow("End");
- procBuilder.addEndEvent("End").addEventDetail(EventDetailType.Message).addMessageRef("EndMessage");
+ //TaskBuilder taskBuilder = procBuilder.addTask("TaskA");
+ //taskBuilder.addOutputSet().addPropertyOutput("frog", "kermit").addSequenceFlow("End");
+ procBuilder.addEndEvent("End", ResultType.Message).addMessageRef("EndMessage");
MessageBuilder msgBuilder = procBuilder.addMessage("EndMessage");
msgBuilder.addToRef(getTestID()).addProperty("frog", null, true);
Process proc = procBuilder.getProcess();
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.activity;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- *
- * An ActivityPropertyTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class ActivityPropertyDescriptorTest extends ActivityPropertyTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/activity/activity-property-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.activity;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- *
- * An ActivityPropertyTest using the ProcessMarshaller
- *
- * @author thomas.diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class ActivityPropertyMarshallerTest extends ActivityPropertyTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- // System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/activity/ActivityPropertyTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,16 +25,14 @@
import java.io.IOException;
-import org.jboss.bpm.model.EventDetail;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.TaskBuilder;
-import org.jboss.bpm.model.Assignment.AssignTime;
-import org.jboss.bpm.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.test.CTSTestCase;
/**
* Modeler-defined Properties MAY be added to an activity. These Properties are "local" to the activity. These
@@ -46,7 +44,7 @@
* @author thomas.diesler(a)jboss.com
* @since 15-Aug-2008
*/
-public class ActivityPropertyTest extends DefaultEngineTestCase
+public class ActivityPropertyTest extends CTSTestCase
{
public void testActivityPropertyRead() throws Exception
{
@@ -56,17 +54,17 @@
Message endMessage = getMessages().get(0);
assertNotNull("EndMessage expected", endMessage);
- assertEquals("bar", endMessage.getPropertyValue("propValue"));
+ assertEquals("bar", endMessage.getProperty("propValue").getValue());
}
protected Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("ActivityProperties").addStartEvent("Start").addSequenceFlow("TaskA");
TaskBuilder taskBuilder = procBuilder.addTask("TaskA");
taskBuilder.addProperty("foo", "bar").addSequenceFlow("End");
- taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "ActivityProperties_TaskA_foo", "propValue");
- procBuilder.addEndEvent("End").addEventDetail(EventDetail.EventDetailType.Message).addMessageRef("EndMessage");
+ //taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "ActivityProperties_TaskA_foo", "propValue");
+ procBuilder.addEndEvent("End", ResultType.Message).addMessageRef("EndMessage");
MessageBuilder msgBuilder = procBuilder.addMessage("EndMessage");
msgBuilder.addToRef(getTestID()).addProperty("propValue", null, true);
Process proc = procBuilder.getProcess();
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.endevent;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test end event with message result
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class EndEventMessageDescriptorTest extends EndEventMessageTest
-{
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/endevent/endevent-message-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.endevent;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test end event with message result
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class EndEventMessageMarshallerTest extends EndEventMessageTest
-{
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/endevent/EndEventMessageTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,14 +25,14 @@
import java.io.IOException;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.EventDetail.EventDetailType;
-import org.jboss.bpm.runtime.BasicAttachments;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.test.CTSTestCase;
/**
* Test end event with message result
@@ -40,7 +40,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class EndEventMessageTest extends DefaultEngineTestCase
+public class EndEventMessageTest extends CTSTestCase
{
public void testStart() throws Exception
{
@@ -56,15 +56,15 @@
// Verify the result
Message endMessage = getMessages().get(0);
- assertEquals("the frog", endMessage.getPropertyValue("kermit"));
+ assertEquals("the frog", endMessage.getProperty("kermit").getValue());
}
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("EndEventMessage").addStartEvent("Start");
procBuilder.addSequenceFlow("TaskA").addTask("TaskA").addSequenceFlow("End");
- procBuilder.addEndEvent("End").addEventDetail(EventDetailType.Message).addMessageRef("EndMessage");
+ procBuilder.addEndEvent("End", ResultType.Message).addMessageRef("EndMessage");
MessageBuilder msgBuilder = procBuilder.addMessage("EndMessage");
msgBuilder.addToRef(getTestID()).addProperty("kermit", null, true);
Process proc = procBuilder.getProcess();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/executioncontext/ExecutionContextTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/executioncontext/ExecutionContextTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/executioncontext/ExecutionContextTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -23,9 +23,9 @@
// $Id$
-import org.jboss.bpm.runtime.BasicExecutionContext;
-import org.jboss.bpm.runtime.ExecutionContext;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.runtime.BasicExecutionContext;
+import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.test.CTSTestCase;
/**
* Test the execution context
@@ -33,7 +33,7 @@
* @author thomas.diesler(a)jboss.com
* @since 03-Jul-2008
*/
-public class ExecutionContextTest extends DefaultEngineTestCase
+public class ExecutionContextTest extends CTSTestCase
{
public void testStringKey() throws Exception
{
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.exclusive;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ExclusiveMergeTest using the Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ExclusiveGatewayMergeDescriptorTest extends ExclusiveGatewayMergeTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/gateway/exclusive/exclusive-merge-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.exclusive;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ExclusiveMergeTest using the process Marshaller
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ExclusiveGatewayMergeMarshallerTest extends ExclusiveGatewayMergeTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewayMergeTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,22 +25,21 @@
import java.io.IOException;
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.EventBuilder;
-import org.jboss.bpm.model.EventDetail;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.TaskBuilder;
-import org.jboss.bpm.model.Assignment.AssignTime;
-import org.jboss.bpm.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.model.Gateway.GatewayType;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.StartEvent.TriggerType;
+import org.jbpm.api.model.builder.EventBuilder;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Exclusive data-based gateway that has multiple incoming sequence flows. The first token arriving from one of the
@@ -50,14 +49,14 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class ExclusiveGatewayMergeTest extends DefaultEngineTestCase
+public class ExclusiveGatewayMergeTest extends CTSTestCase
{
public void testGateA() throws Exception
{
Process proc = getProcess();
// Add a signal listener that sends the other start trigger signal
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigManager = SignalService.locateSignalService();
MergeListener sigListener = new MergeListener(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "B"));
sigManager.addSignalListener(sigListener);
@@ -78,7 +77,7 @@
// Verify the result
Message endMessage = getMessages().get(0);
assertNotNull("EndMessage expected", endMessage);
- assertEquals("TaskA", endMessage.getPropertyValue("taskValue"));
+ assertEquals("TaskA", endMessage.getProperty("taskValue").getValue());
}
public void testGateB() throws Exception
@@ -86,7 +85,7 @@
Process proc = getProcess();
// Add a signal listener that sends the other start trigger signal
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigManager = SignalService.locateSignalService();
MergeListener sigListener = new MergeListener(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
sigManager.addSignalListener(sigListener);
@@ -107,7 +106,7 @@
// Verify the result
Message endMessage = getMessages().get(0);
assertNotNull("EndMessage expected", endMessage);
- assertEquals("TaskB", endMessage.getPropertyValue("taskValue"));
+ assertEquals("TaskB", endMessage.getProperty("taskValue").getValue());
}
public void testInvalidToken() throws Exception
@@ -115,7 +114,7 @@
Process proc = getProcess();
// Add a signal listener that sends the other start trigger signal
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigManager = SignalService.locateSignalService();
MergeListener sigListener = new MergeListener(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
sigManager.addSignalListener(sigListener);
@@ -161,24 +160,24 @@
// Verify the result
Message endMessage = getMessages().get(0);
assertNotNull("EndMessage expected", endMessage);
- assertEquals("TaskA", endMessage.getPropertyValue("taskValue"));
+ assertEquals("TaskA", endMessage.getProperty("taskValue").getValue());
}
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
- EventBuilder eventBuilder = procBuilder.addProcess(getName()).addStartEvent("StartA");
- eventBuilder.addEventDetail(EventDetail.EventDetailType.Signal).addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ EventBuilder eventBuilder = procBuilder.addProcess(getName()).addStartEvent("StartA", TriggerType.Signal);
+ eventBuilder.addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
TaskBuilder taskBuilder = procBuilder.addSequenceFlow("TaskA").addTask("TaskA");
- taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskA'", "taskValue");
+ //taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskA'", "taskValue");
taskBuilder.addSequenceFlow("Merge");
- eventBuilder = procBuilder.addStartEvent("StartB");
- eventBuilder.addEventDetail(EventDetail.EventDetailType.Signal).addSignalRef(SignalType.SYSTEM_START_TRIGGER, "B");
+ eventBuilder = procBuilder.addStartEvent("StartB", TriggerType.Signal);
+ eventBuilder.addSignalRef(SignalType.SYSTEM_START_TRIGGER, "B");
taskBuilder = procBuilder.addSequenceFlow("TaskB").addTask("TaskB");
- taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskB'", "taskValue");
+ //taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskB'", "taskValue");
taskBuilder.addSequenceFlow("Merge");
procBuilder.addGateway("Merge", GatewayType.Exclusive).addSequenceFlow("End");
- procBuilder.addEndEvent("End").addEventDetail(EventDetail.EventDetailType.Message).addMessageRef("EndMessage");
+ procBuilder.addEndEvent("End", ResultType.Message).addMessageRef("EndMessage");
MessageBuilder msgBuilder = procBuilder.addMessage("EndMessage");
msgBuilder.addToRef(getTestID()).addProperty("taskValue", null, true);
Process proc = procBuilder.getProcess();
@@ -203,8 +202,8 @@
{
if (nextSignal != null)
{
- SignalManager signalManager = SignalManager.locateSignalManager();
- signalManager.throwSignal(nextSignal);
+ SignalService sigService = SignalService.locateSignalService();
+ sigService.throwSignal(nextSignal);
nextSignal = null;
}
}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.exclusive;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ExclusiveSplitTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ExclusiveGatewaySplitDescriptorTest extends ExclusiveGatewaySplitTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/gateway/exclusive/exclusive-split-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.exclusive;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ExclusiveSplitTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ExclusiveGatewaySplitMarshallerTest extends ExclusiveGatewaySplitTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/exclusive/ExclusiveGatewaySplitTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -26,15 +26,15 @@
import java.io.IOException;
import java.util.List;
-import org.jboss.bpm.model.GatewayBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.model.Gateway.GatewayType;
-import org.jboss.bpm.runtime.BasicAttachments;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.builder.GatewayBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.test.CTSTestCase;
/**
* Exclusive data-based gateway that has conditional outgoing sequence flows.
@@ -43,7 +43,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class ExclusiveGatewaySplitTest extends DefaultEngineTestCase
+public class ExclusiveGatewaySplitTest extends CTSTestCase
{
public void testGateA() throws Exception
{
@@ -93,7 +93,7 @@
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Split");
GatewayBuilder gatewayBuilder = procBuilder.addGateway("Split", GatewayType.Exclusive);
gatewayBuilder.addConditionalGate("EndA", ExpressionLanguage.MVEL, "foo < 10");
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.inclusive;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * InclusiveMergeTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class InclusiveGatewayMergeDescriptorTest extends InclusiveGatewayMergeTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/gateway/inclusive/inclusive-merge-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.inclusive;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * InclusiveMergeTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class InclusiveGatewayMergeMarshallerTest extends InclusiveGatewayMergeTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewayMergeTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -26,17 +26,17 @@
import java.io.IOException;
import java.util.List;
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.EventBuilder;
-import org.jboss.bpm.model.EventDetail;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.Gateway.GatewayType;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.StartEvent.TriggerType;
+import org.jbpm.api.model.builder.EventBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Inclusive gateway that has multiple incoming sequence flows. All tokens arriving from incoming sequence flows
@@ -45,29 +45,29 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class InclusiveGatewayMergeTest extends DefaultEngineTestCase
+public class InclusiveGatewayMergeTest extends CTSTestCase
{
public void testGateA() throws Exception
{
Process proc = getProcess();
// Add a signal listener that sends the other start trigger signal
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigService = SignalService.locateSignalService();
MergeListener sigListener = new MergeListener(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "B"));
- sigManager.addSignalListener(sigListener);
+ sigService.addSignalListener(sigListener);
try
{
// Send start trigger signals
proc.startProcess();
- sigManager.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
+ sigService.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
// Wait for the process to end
proc.waitForEnd();
}
finally
{
- sigManager.removeSignalListener(sigListener);
+ sigService.removeSignalListener(sigListener);
}
List<Signal> endSignals = getSignals(Signal.SignalType.SYSTEM_END_EVENT_EXIT);
@@ -76,11 +76,11 @@
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
- EventBuilder eventBuilder = procBuilder.addProcess(getName()).addStartEvent("StartA");
- eventBuilder.addEventDetail(EventDetail.EventDetailType.Signal).addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
- eventBuilder = procBuilder.addSequenceFlow("Merge").addStartEvent("StartB");
- eventBuilder.addEventDetail(EventDetail.EventDetailType.Signal).addSignalRef(SignalType.SYSTEM_START_TRIGGER, "B");
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ EventBuilder eventBuilder = procBuilder.addProcess(getName()).addStartEvent("StartA", TriggerType.Signal);
+ eventBuilder.addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
+ eventBuilder = procBuilder.addSequenceFlow("Merge").addStartEvent("StartB", TriggerType.Signal);
+ eventBuilder.addSignalRef(SignalType.SYSTEM_START_TRIGGER, "B");
procBuilder.addSequenceFlow("Merge").addGateway("Merge", GatewayType.Inclusive).addSequenceFlow("End");
procBuilder.addEndEvent("End");
Process proc = procBuilder.getProcess();
@@ -105,8 +105,8 @@
{
if (nextSignal != null)
{
- SignalManager signalManager = SignalManager.locateSignalManager();
- signalManager.throwSignal(nextSignal);
+ SignalService sigService = SignalService.locateSignalService();
+ sigService.throwSignal(nextSignal);
nextSignal = null;
}
}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.inclusive;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * InclusiveSplitTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class InclusiveGatewaySplitDescriptorTest extends InclusiveGatewaySplitTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/gateway/inclusive/inclusive-split-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.inclusive;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * InclusiveSplitTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class InclusiveGatewaySplitMarshallerTest extends InclusiveGatewaySplitTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/inclusive/InclusiveGatewaySplitTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -26,15 +26,15 @@
import java.io.IOException;
import java.util.List;
-import org.jboss.bpm.model.GatewayBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.model.Gateway.GatewayType;
-import org.jboss.bpm.runtime.BasicAttachments;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.builder.GatewayBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.test.CTSTestCase;
/**
* Inclusive gateway that has conditional outgoing sequence flows.
@@ -43,7 +43,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class InclusiveGatewaySplitTest extends DefaultEngineTestCase
+public class InclusiveGatewaySplitTest extends CTSTestCase
{
public void testGateA() throws Exception
{
@@ -74,7 +74,7 @@
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("InclusiveGatewaySplitTest").addStartEvent("Start").addSequenceFlow("Split");
GatewayBuilder gatewayBuilder = procBuilder.addGateway("Split", GatewayType.Inclusive);
gatewayBuilder.addConditionalGate("EndA", ExpressionLanguage.MVEL, "foo < 10");
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.parallel;
-
-//$Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-
-/**
- * ParallelMergeTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ParallelGatewayMergeDescriptorTest extends ParallelGatewayMergeTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/gateway/parallel/parallel-merge-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.parallel;
-
-//$Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-
-/**
- * ParallelMergeTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ParallelGatewayMergeMarshallerTest extends ParallelGatewayMergeTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewayMergeTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,22 +25,21 @@
import java.io.IOException;
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.EventBuilder;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.TaskBuilder;
-import org.jboss.bpm.model.Assignment.AssignTime;
-import org.jboss.bpm.model.EventDetail.EventDetailType;
-import org.jboss.bpm.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.model.Gateway.GatewayType;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.StartEvent.TriggerType;
+import org.jbpm.api.model.builder.EventBuilder;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Parallel gateway that that has multiple incoming sequence flows. Each token arriving from an incoming sequence flow
@@ -50,14 +49,14 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class ParallelGatewayMergeTest extends DefaultEngineTestCase
+public class ParallelGatewayMergeTest extends CTSTestCase
{
public void testParallelMerge() throws Exception
{
Process proc = getProcess();
// Add a signal listener that sends the other start trigger signal
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigManager = SignalService.locateSignalService();
MergeListener sigListener = new MergeListener(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "B"));
sigManager.addSignalListener(sigListener);
@@ -77,8 +76,8 @@
// Verify the result
Message endMessage = getMessages().get(0);
- assertEquals("TaskA", endMessage.getPropertyValue("taskValueA"));
- assertEquals("TaskB", endMessage.getPropertyValue("taskValueB"));
+ assertEquals("TaskA", endMessage.getProperty("taskValueA").getValue());
+ assertEquals("TaskB", endMessage.getProperty("taskValueB").getValue());
}
public void testMergeTimeout() throws Exception
@@ -87,8 +86,8 @@
// Start the process and send start trigger signal
proc.startProcess();
- SignalManager signalManager = SignalManager.locateSignalManager();
- signalManager.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
+ SignalService sigService = SignalService.locateSignalService();
+ sigService.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
// Wait for the process to end
try
@@ -107,7 +106,7 @@
Process proc = getProcess();
// Add a signal listener that sends the other start trigger signal
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigManager = SignalService.locateSignalService();
MergeListener sigListener = new MergeListener(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
sigManager.addSignalListener(sigListener);
@@ -152,25 +151,25 @@
// Verify the result
Message endMessage = getMessages().get(0);
- assertEquals("TaskA", endMessage.getPropertyValue("taskValueA"));
- assertEquals("TaskB", endMessage.getPropertyValue("taskValueB"));
+ assertEquals("TaskA", endMessage.getProperty("taskValueA").getValue());
+ assertEquals("TaskB", endMessage.getProperty("taskValueB").getValue());
}
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
- EventBuilder eventBuilder = procBuilder.addProcess(getName()).addStartEvent("StartA");
- eventBuilder.addEventDetail(EventDetailType.Signal).addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ EventBuilder eventBuilder = procBuilder.addProcess(getName()).addStartEvent("StartA", TriggerType.Signal);
+ eventBuilder.addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
TaskBuilder taskBuilder = procBuilder.addSequenceFlow("TaskA").addTask("TaskA");
- taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskA'", "taskValueA");
+ //taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskA'", "taskValueA");
taskBuilder.addSequenceFlow("Merge");
- eventBuilder = procBuilder.addStartEvent("StartB");
- eventBuilder.addEventDetail(EventDetailType.Signal).addSignalRef(SignalType.SYSTEM_START_TRIGGER, "B");
+ eventBuilder = procBuilder.addStartEvent("StartB", TriggerType.Signal);
+ eventBuilder.addSignalRef(SignalType.SYSTEM_START_TRIGGER, "B");
taskBuilder = procBuilder.addSequenceFlow("TaskB").addTask("TaskB");
- taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskB'", "taskValueB");
+ //taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskB'", "taskValueB");
taskBuilder.addSequenceFlow("Merge");
procBuilder.addGateway("Merge", GatewayType.Parallel).addSequenceFlow("End");
- procBuilder.addEndEvent("End").addEventDetail(EventDetailType.Message).addMessageRef("EndMessage");
+ procBuilder.addEndEvent("End", ResultType.Message).addMessageRef("EndMessage");
MessageBuilder msgBuilder = procBuilder.addMessage("EndMessage");
msgBuilder.addToRef(getTestID()).addProperty("taskValueA", null, true).addProperty("taskValueB", null, true);
Process proc = procBuilder.getProcess();
@@ -195,8 +194,8 @@
{
if (nextSignal != null)
{
- SignalManager signalManager = SignalManager.locateSignalManager();
- signalManager.throwSignal(nextSignal);
+ SignalService sigService = SignalService.locateSignalService();
+ sigService.throwSignal(nextSignal);
nextSignal = null;
}
}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.parallel;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ParallelSplitTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ParallelGatewaySplitDescriptorTest extends ParallelGatewaySplitTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/gateway/parallel/parallel-split-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.gateway.parallel;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ParallelSplitTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ParallelGatewaySplitMarshallerTest extends ParallelGatewaySplitTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/gateway/parallel/ParallelGatewaySplitTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -28,13 +28,13 @@
import javax.management.ObjectName;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.Gateway.GatewayType;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Parallel gateway that has uncontrolled outgoing sequence flows. All of them are taken, which leads to parallel paths
@@ -43,7 +43,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class ParallelGatewaySplitTest extends DefaultEngineTestCase
+public class ParallelGatewaySplitTest extends CTSTestCase
{
public void testParallelSplit() throws Exception
{
@@ -63,7 +63,7 @@
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("ParallelGatewaySplit").addStartEvent("Start").addSequenceFlow("Split");
procBuilder.addGateway("Split", GatewayType.Parallel).addSequenceFlow("EndA").addSequenceFlow("EndB");
Process proc = procBuilder.addEndEvent("EndA").addEndEvent("EndB").getProcess();
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessIntegrityTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/process/ProcessIntegrityTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessIntegrityTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.process;
-
-// $Id$
-
-import org.jboss.bpm.InvalidProcessException;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.test.DefaultEngineTestCase;
-
-/**
- * Test the intergety of various process definitions
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public class ProcessIntegrityTest extends DefaultEngineTestCase
-{
- public void testNoStartState() throws Exception
- {
- try
- {
- // Create a Process through the ProcessBuilder
- ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder();
- builder.addProcess("NoStartState").addTask("taskA").addSequenceFlow("end").addEndEvent("end").getProcess();
- fail("InvalidProcessException expected");
- }
- catch (InvalidProcessException ex)
- {
- 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();
- builder.addProcess("NoEndState").addStartEvent("Start").addSequenceFlow("taskA").addTask("taskA").addSequenceFlow("end").
- addTask("end").getProcess();
- fail("InvalidProcessException expected");
- }
- catch (InvalidProcessException ex)
- {
- assertTrue("Unexpected message: " + ex.getMessage(), ex.getMessage().indexOf("end event") > 0);
- }
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.process;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- *
- * An ProcessPropertyTest using the Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class ProcessPropertyDescriptorTest extends ProcessPropertyTest
-{
- protected Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/process/process-property-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.process;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- *
- * An ProcessPropertyTest using the ProcessMarshaller
- *
- * @author thomas.diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class ProcessPropertyMarshallerTest extends ProcessPropertyTest
-{
- protected Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/process/ProcessPropertyTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,15 +25,13 @@
import java.io.IOException;
-import org.jboss.bpm.model.EventDetail;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Assignment.AssignTime;
-import org.jboss.bpm.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Modeler-defined Properties MAY be added to a Process. These Properties are "local" to the Process. All Tasks,
@@ -47,7 +45,7 @@
* @author thomas.diesler(a)jboss.com
* @since 15-Aug-2008
*/
-public class ProcessPropertyTest extends DefaultEngineTestCase
+public class ProcessPropertyTest extends CTSTestCase
{
/**
* Test the the process properties can be used by Assignments
@@ -61,16 +59,16 @@
Message endMessage = getMessages().get(0);
assertNotNull("EndMessage expected", endMessage);
- assertEquals("bar", endMessage.getPropertyValue("propValue"));
+ assertEquals("bar", endMessage.getProperty("propValue").getValue());
}
protected Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("ProcessProperties").addStartEvent("Start").addSequenceFlow("TaskA");
- procBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "ProcessProperties_foo", "propValue");
+ //procBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "ProcessProperties_foo", "propValue");
procBuilder.addProperty("foo", "bar").addTask("TaskA").addSequenceFlow("End");
- procBuilder.addEndEvent("End").addEventDetail(EventDetail.EventDetailType.Message).addMessageRef("EndMessage");
+ procBuilder.addEndEvent("End", ResultType.Message).addMessageRef("EndMessage");
MessageBuilder msgBuilder = procBuilder.addMessage("EndMessage");
msgBuilder.addToRef(getTestID()).addProperty("propValue", null, true);
Process proc = procBuilder.getProcess();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/processmanager/ProcessManagerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/processmanager/ProcessManagerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/processmanager/ProcessManagerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,31 +25,31 @@
import javax.management.ObjectName;
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.client.SignalListener;
-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.Signal;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.api.test.CTSTestCase;
/**
- * Test the ProcessManager
+ * Test the ProcessService
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class ProcessManagerTest extends DefaultEngineTestCase
+public class ProcessManagerTest extends CTSTestCase
{
public void testStartProcess() throws Exception
{
final Process proc = getProcess();
- final ObjectName procID = proc.getID();
+ final ObjectName procID = proc.getKey();
- final ProcessManager pm = ProcessManager.locateProcessManager();
- assertNull("A process created through the builder is not registered automatically", pm.getProcessByID(procID));
+ final ProcessService procService = ProcessService.locateProcessService();
+ assertNull("A process created through the builder is not registered automatically", procService.getProcessByKey(procID));
SignalListener sigListener = new SignalListener()
{
@@ -60,10 +60,10 @@
public void catchSignal(Signal signal)
{
- assertNotNull(pm.getProcessByID(procID));
+ assertNotNull(procService.getProcessByKey(procID));
}
};
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigManager = SignalService.locateSignalService();
sigManager.addSignalListener(sigListener);
try
@@ -77,12 +77,12 @@
sigManager.removeSignalListener(sigListener);
}
- assertNull("A terminated process is removed from the registry", pm.getProcessByID(procID));
+ assertNull("A terminated process is removed from the registry", procService.getProcessByKey(procID));
}
private Process getProcess()
{
- ProcessBuilder builder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
builder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("taskA");
Process proc = builder.addTask("taskA").addSequenceFlow("end").addEndEvent("end").getProcess();
return proc;
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/signalmanager/SignalManagerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/signalmanager/SignalManagerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/signalmanager/SignalManagerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -23,11 +23,11 @@
// $Id$
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Test the ProcessManager
@@ -35,9 +35,9 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class SignalManagerTest extends DefaultEngineTestCase
+public class SignalManagerTest extends CTSTestCase
{
- final SignalManager sigManager = SignalManager.locateSignalManager();
+ final SignalService sigManager = SignalService.locateSignalService();
final Signal sigA = new Signal(getTestID(), SignalType.USER_SIGNAL, "A");
final Signal sigB = new Signal(getTestID(), SignalType.USER_SIGNAL, "B");
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.startevent;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test start event with signal trigger
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class StartEventSignalDescriptorTest extends StartEventSignalTest
-{
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/startevent/startevent-signal-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.startevent;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test start event with signal trigger
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class StartEventSignalMarshallerTest extends StartEventSignalTest
-{
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/startevent/StartEventSignalTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -26,21 +26,20 @@
import java.io.IOException;
import java.util.List;
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.EventBuilder;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.TaskBuilder;
-import org.jboss.bpm.model.Assignment.AssignTime;
-import org.jboss.bpm.model.EventDetail.EventDetailType;
-import org.jboss.bpm.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.StartEvent.TriggerType;
+import org.jbpm.api.model.builder.EventBuilder;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Test start event with signal trigger
@@ -48,7 +47,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class StartEventSignalTest extends DefaultEngineTestCase
+public class StartEventSignalTest extends CTSTestCase
{
public void testStart() throws Exception
{
@@ -56,15 +55,15 @@
// Start the process and send start trigger signal
proc.startProcess();
- SignalManager signalManager = SignalManager.locateSignalManager();
- signalManager.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
+ SignalService sigService = SignalService.locateSignalService();
+ sigService.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
// Wait for the process to end
proc.waitForEnd();
// Verify the result
Message endMessage = getMessages().get(0);
- assertEquals("TaskA", endMessage.getPropertyValue("taskValue"));
+ assertEquals("TaskA", endMessage.getProperty("taskValue").getValue());
}
public void testRestart() throws Exception
@@ -73,15 +72,15 @@
// Start the process and send start trigger signal
proc.startProcess();
- SignalManager signalManager = SignalManager.locateSignalManager();
- signalManager.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
+ SignalService sigService = SignalService.locateSignalService();
+ sigService.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
// Wait for the process to end
proc.waitForEnd();
// Start the process and send start trigger signal
proc.startProcess();
- signalManager.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
+ sigService.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
// Wait for the process to end
proc.waitForEnd();
@@ -89,8 +88,8 @@
// Verify the result
List<Message> messages = getMessages();
assertEquals(2, messages.size());
- assertEquals("TaskA", messages.get(0).getPropertyValue("taskValue"));
- assertEquals("TaskA", messages.get(1).getPropertyValue("taskValue"));
+ assertEquals("TaskA", messages.get(0).getProperty("taskValue").getValue());
+ assertEquals("TaskA", messages.get(1).getProperty("taskValue").getValue());
}
public void testRestartBeforeEnd() throws Exception
@@ -99,7 +98,7 @@
// Add a signal listener that sends the other start trigger signal
TaskListener sigListener = new TaskListener(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigManager = SignalService.locateSignalService();
sigManager.addSignalListener(sigListener);
try
@@ -119,19 +118,19 @@
// Verify the result
List<Message> messages = getMessages();
assertEquals(2, messages.size());
- assertEquals("TaskA", messages.get(0).getPropertyValue("taskValue"));
- assertEquals("TaskA", messages.get(1).getPropertyValue("taskValue"));
+ assertEquals("TaskA", messages.get(0).getProperty("taskValue").getValue());
+ assertEquals("TaskA", messages.get(1).getProperty("taskValue").getValue());
}
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
- EventBuilder eventBuilder = procBuilder.addProcess("StartEventSignal").addStartEvent("StartA");
- eventBuilder.addEventDetail(EventDetailType.Signal).addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ EventBuilder eventBuilder = procBuilder.addProcess("StartEventSignal").addStartEvent("StartA", TriggerType.Signal);
+ eventBuilder.addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
TaskBuilder taskBuilder = procBuilder.addSequenceFlow("TaskA").addTask("TaskA");
- taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskA'", "taskValue");
+ //taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskA'", "taskValue");
taskBuilder.addSequenceFlow("End");
- procBuilder.addEndEvent("End").addEventDetail(EventDetailType.Message).addMessageRef("EndMessage");
+ procBuilder.addEndEvent("End", ResultType.Message).addMessageRef("EndMessage");
MessageBuilder msgBuilder = procBuilder.addMessage("EndMessage");
msgBuilder.addToRef(getTestID()).addProperty("taskValue", null, true);
Process proc = procBuilder.getProcess();
@@ -156,8 +155,8 @@
{
if (nextSignal != null)
{
- SignalManager signalManager = SignalManager.locateSignalManager();
- signalManager.throwSignal(nextSignal);
+ SignalService sigService = SignalService.locateSignalService();
+ sigService.throwSignal(nextSignal);
nextSignal = null;
}
}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.task;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test Receive Task
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class ReceiveTaskDescriptorTest extends ReceiveTaskTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/task/task-receive-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.task;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test Receive Task
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class ReceiveTaskMarshallerTest extends ReceiveTaskTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/ReceiveTaskTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,23 +25,23 @@
import java.io.IOException;
-import org.jboss.bpm.InvalidProcessException;
-import org.jboss.bpm.client.MessageManager;
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.EventBuilder;
-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.Signal;
-import org.jboss.bpm.model.EventDetail.EventDetailType;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.model.Task.TaskType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.builder.EventBuilder;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.MessageBuilderService;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.MessageService;
+import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Test Receive Task
@@ -49,11 +49,11 @@
* @author thomas.diesler(a)jboss.com
* @since 03-Jul-2008
*/
-public class ReceiveTaskTest extends DefaultEngineTestCase
+public class ReceiveTaskTest extends CTSTestCase
{
public void testReceiveTaskWithNoMessage() throws Exception
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("ReceiveTaskTest").addStartEvent("Start").addSequenceFlow("TaskA");
procBuilder.addTask("TaskA", TaskType.Receive).addSequenceFlow("End").addEndEvent("End");
try
@@ -71,10 +71,10 @@
{
Process proc = getProcess();
- MessageManager msgManager = MessageManager.locateMessageManager();
+ MessageService msgManager = MessageService.locateMessageService();
try
{
- msgManager.sendMessage(proc.getID(), "TaskA", getMessage());
+ msgManager.sendMessage(proc.getKey(), "TaskA", getMessage());
fail("Send to an unregistered process is expected to fail");
}
catch (RuntimeException ex)
@@ -86,19 +86,19 @@
public void testSuspendedMessage() throws Exception
{
Process proc = getProcess();
- ProcessManager procManager = ProcessManager.locateProcessManager();
- procManager.registerProcess(proc);
+ ProcessService procService = ProcessService.locateProcessService();
+ procService.registerProcess(proc);
// Send the message before the process is started
- MessageManager msgManager = MessageManager.locateMessageManager();
- msgManager.sendMessage(proc.getID(), "TaskA", getMessage());
+ MessageService msgManager = MessageService.locateMessageService();
+ msgManager.sendMessage(proc.getKey(), "TaskA", getMessage());
proc.startProcess();
proc.waitForEnd();
Message endMsg = getMessages().get(0);
assertNotNull("End message expected", endMsg);
- assertEquals("bar", endMsg.getPropertyValue("foo"));
+ assertEquals("bar", endMsg.getProperty("foo").getValue());
}
public void testSuspendedToken() throws Exception
@@ -119,12 +119,12 @@
if (sendMessage == true)
{
sendMessage = false;
- MessageManager msgManager = MessageManager.locateMessageManager();
- msgManager.sendMessage(proc.getID(), "TaskA", getMessage());
+ MessageService msgManager = MessageService.locateMessageService();
+ msgManager.sendMessage(proc.getKey(), "TaskA", getMessage());
}
}
};
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigManager = SignalService.locateSignalService();
sigManager.addSignalListener(sigListener);
try
@@ -139,27 +139,27 @@
Message endMsg = getMessages().get(0);
assertNotNull("End message expected", endMsg);
- assertEquals("bar", endMsg.getPropertyValue("foo"));
+ assertEquals("bar", endMsg.getProperty("foo").getValue());
}
private Message getMessage()
{
- MessageBuilder procBuilder = MessageBuilderFactory.newInstance().newMessageBuilder();
+ MessageBuilder procBuilder = MessageBuilderService.locateMessageBuilder();
Message msg = procBuilder.newMessage("ReceiveTaskMessage").addProperty("foo", "bar", true).getMessage();
return msg;
}
protected Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
MessageBuilder msgBuilder = procBuilder.addProcess("ReceiveTaskTest").addMessage("ReceiveTaskMessage");
msgBuilder.addProperty("foo", null, true);
msgBuilder = procBuilder.addMessage("EndEventMessage");
msgBuilder.addToRef(getTestID()).addProperty("foo", null, true);
procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
procBuilder.addTask("TaskA", TaskType.Receive).addMessageRef("ReceiveTaskMessage");
- EventBuilder eventBuilder = procBuilder.addSequenceFlow("End").addEndEvent("End");
- eventBuilder.addEventDetail(EventDetailType.Message).addMessageRef("EndEventMessage");
+ EventBuilder eventBuilder = procBuilder.addSequenceFlow("End").addEndEvent("End", ResultType.Message);
+ eventBuilder.addMessageRef("EndEventMessage");
return procBuilder.getProcess();
}
}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/SendTaskDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/task/SendTaskDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/SendTaskDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.task;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test Send Task
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class SendTaskDescriptorTest extends SendTaskTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/task/task-send-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/SendTaskMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/task/SendTaskMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/SendTaskMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.task;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test Send Task
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class SendTaskMarshallerTest extends SendTaskTest
-{
- @Override
- protected Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/SendTaskTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/task/SendTaskTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/SendTaskTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -26,15 +26,15 @@
import java.io.IOException;
import java.util.List;
-import org.jboss.bpm.InvalidProcessException;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-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.BasicAttachments;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.test.CTSTestCase;
/**
* Test Send Task
@@ -42,7 +42,7 @@
* @author thomas.diesler(a)jboss.com
* @since 03-Jul-2008
*/
-public class SendTaskTest extends DefaultEngineTestCase
+public class SendTaskTest extends CTSTestCase
{
public void testSendTask() throws Exception
{
@@ -55,12 +55,12 @@
List<Message> messages = getMessages();
assertEquals(1, messages.size());
- assertEquals("bar", messages.get(0).getPropertyValue("foo"));
+ assertEquals("bar", messages.get(0).getProperty("foo").getValue());
}
public void testSendTaskWithNoMessage() throws Exception
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("SendTaskTest").addStartEvent("Start").addSequenceFlow("TaskA");
procBuilder.addTask("TaskA", TaskType.Send).addSequenceFlow("End").addEndEvent("End");
try
@@ -76,7 +76,7 @@
protected Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
MessageBuilder msgBuilder = procBuilder.addProcess("SendTaskTest").addMessage("SendTaskMessage");
msgBuilder.addToRef(getTestID()).addProperty("foo", null, true);
procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.task;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test ExecutionHandler attached to Task
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class TaskExecutionHandlerDescriptorTest extends TaskExecutionHandlerTest
-{
- protected Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("cts/task/task-executionhandler-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.cts.task;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Test ExecutionHandler attached to Task
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class TaskExecutionHandlerMarshallerTest extends TaskExecutionHandlerTest
-{
- protected Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/cts/task/TaskExecutionHandlerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,16 +25,14 @@
import java.io.IOException;
-import org.jboss.bpm.model.Assignment;
-import org.jboss.bpm.model.Expression;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.TaskBuilder;
-import org.jboss.bpm.runtime.ExecutionContext;
-import org.jboss.bpm.runtime.ExecutionHandler;
-import org.jboss.bpm.runtime.Token;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.runtime.ExecutionHandler;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.test.CTSTestCase;
/**
* Test ExecutionHandler attached to Task
@@ -42,7 +40,7 @@
* @author thomas.diesler(a)jboss.com
* @since 03-Jul-2008
*/
-public class TaskExecutionHandlerTest extends DefaultEngineTestCase
+public class TaskExecutionHandlerTest extends CTSTestCase
{
public void testExecutionHandler() throws Exception
{
@@ -58,13 +56,13 @@
protected Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("TaskExecutionHandlerTest").addProperty("procProp", "kermit");
- procBuilder.addAssignment(Assignment.AssignTime.Start, Expression.ExpressionLanguage.MVEL, "TaskExecutionHandlerTest_procProp == 'kermit'", "procAssign");
+ //procBuilder.addAssignment(Assignment.AssignTime.Start, Expression.ExpressionLanguage.MVEL, "TaskExecutionHandlerTest_procProp == 'kermit'", "procAssign");
procBuilder.addStartEvent("Start").addSequenceFlow("TaskA");
TaskBuilder taskBuilder = procBuilder.addTask("TaskA");
taskBuilder.addProperty("taskProp", "piggy").addExecutionHandler(TaskExecutionHandler.class).addSequenceFlow("End");
- taskBuilder.addAssignment(Assignment.AssignTime.Start, Expression.ExpressionLanguage.MVEL, "TaskExecutionHandlerTest_TaskA_taskProp == 'piggy'", "taskAssign");
+ //taskBuilder.addAssignment(Assignment.AssignTime.Start, Expression.ExpressionLanguage.MVEL, "TaskExecutionHandlerTest_TaskA_taskProp == 'piggy'", "taskAssign");
procBuilder.addEndEvent("End");
return procBuilder.getProcess();
}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.control.exclusivechoice;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ExclusiveChoiceTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ExclusiveChoiceDescriptorTest extends ExclusiveChoiceTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("pattern/control/exclusivechoice/pattern-control-exclusive-choice-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.control.exclusivechoice;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ExclusiveChoiceTest using the ProcessMarshaller
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ExclusiveChoiceMarshallerTest extends ExclusiveChoiceTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/exclusivechoice/ExclusiveChoiceTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -26,15 +26,15 @@
import java.io.IOException;
import java.util.List;
-import org.jboss.bpm.model.Expression;
-import org.jboss.bpm.model.Gateway;
-import org.jboss.bpm.model.GatewayBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.runtime.BasicAttachments;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Gateway;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.builder.GatewayBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.test.CTSTestCase;
/**
* Exclusive data-based gateway that has conditional outgoing sequence flows.
@@ -43,7 +43,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class ExclusiveChoiceTest extends DefaultEngineTestCase
+public class ExclusiveChoiceTest extends CTSTestCase
{
public void testGateA() throws Exception
{
@@ -93,11 +93,11 @@
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Split");
GatewayBuilder gatewayBuilder = procBuilder.addGateway("Split", Gateway.GatewayType.Exclusive);
- gatewayBuilder.addConditionalGate("EndA", Expression.ExpressionLanguage.MVEL, "foo < 10");
- gatewayBuilder.addConditionalGate("EndB", Expression.ExpressionLanguage.MVEL, "foo > 10");
+ gatewayBuilder.addConditionalGate("EndA", ExpressionLanguage.MVEL, "foo < 10");
+ gatewayBuilder.addConditionalGate("EndB", ExpressionLanguage.MVEL, "foo > 10");
procBuilder.addEndEvent("EndA").addEndEvent("EndB");
Process proc = procBuilder.getProcess();
return proc;
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.control.multichoice;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * MultiChoiceTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class MultiChoiceDescriptorTest extends MultiChoiceTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("pattern/control/multichoice/pattern-control-multi-choice-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.control.multichoice;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * MultiChoiceTest using the ProcessMarshaller
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class MultiChoiceMarshallerTest extends MultiChoiceTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/multichoice/MultiChoiceTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -26,15 +26,15 @@
import java.io.IOException;
import java.util.List;
-import org.jboss.bpm.model.Expression;
-import org.jboss.bpm.model.Gateway;
-import org.jboss.bpm.model.GatewayBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.runtime.BasicAttachments;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Gateway;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.builder.GatewayBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.runtime.BasicAttachments;
+import org.jbpm.api.test.CTSTestCase;
/**
* Inclusive gateway that has conditional outgoing sequence flows.
@@ -43,7 +43,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class MultiChoiceTest extends DefaultEngineTestCase
+public class MultiChoiceTest extends CTSTestCase
{
public void testGateA() throws Exception
{
@@ -74,11 +74,11 @@
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("MultiChoiceTest").addStartEvent("Start").addSequenceFlow("Split");
GatewayBuilder gatewayBuilder = procBuilder.addGateway("Split", Gateway.GatewayType.Inclusive);
- gatewayBuilder.addConditionalGate("EndA", Expression.ExpressionLanguage.MVEL, "foo < 10");
- gatewayBuilder.addConditionalGate("EndB", Expression.ExpressionLanguage.MVEL, "foo < 20");
+ gatewayBuilder.addConditionalGate("EndA", ExpressionLanguage.MVEL, "foo < 10");
+ gatewayBuilder.addConditionalGate("EndB", ExpressionLanguage.MVEL, "foo < 20");
procBuilder.addEndEvent("EndA").addEndEvent("EndB");
Process proc = procBuilder.getProcess();
return proc;
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.control.parallelsplit;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ParallelSplitTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ParallelSplitDescriptorTest extends ParallelSplitTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("pattern/control/parallelsplit/pattern-control-parallel-split-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.control.parallelsplit;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ParallelSplitTest using the ProcessMarshaller
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ParallelSplitMarshallerTest extends ParallelSplitTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitSTPTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitSTPTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitSTPTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.control.parallelsplit;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * ParallelSplitTest using the STP Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class ParallelSplitSTPTest extends ParallelSplitTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("pattern/control/parallelsplit/pattern-control-parallel-split.bpmn");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/parallelsplit/ParallelSplitTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -28,13 +28,13 @@
import javax.management.ObjectName;
-import org.jboss.bpm.model.Gateway;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Gateway;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Parallel gateway that has uncontrolled outgoing sequence flows.
@@ -43,7 +43,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class ParallelSplitTest extends DefaultEngineTestCase
+public class ParallelSplitTest extends CTSTestCase
{
public void testParallelSplit() throws Exception
{
@@ -63,7 +63,7 @@
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
Process proc = procBuilder.addProcess(getName()).addStartEvent("Start").addSequenceFlow("Split").addGateway("Split", Gateway.GatewayType.Parallel).
addSequenceFlow("EndA").addSequenceFlow("EndB").addEndEvent("EndA").addEndEvent("EndB").getProcess();
return proc;
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.control.simplemerge;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * InclusiveMergeTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class SimpleMergeDescriptorTest extends SimpleMergeTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("pattern/control/simplemerge/pattern-control-simple-merge-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.control.simplemerge;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * InclusiveMergeTest using the ProcessMarshaller
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class SimpleMergeMarshallerTest extends SimpleMergeTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/simplemerge/SimpleMergeTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -26,17 +26,17 @@
import java.io.IOException;
import java.util.List;
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.EventBuilder;
-import org.jboss.bpm.model.EventDetail;
-import org.jboss.bpm.model.Gateway;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Gateway;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.StartEvent.TriggerType;
+import org.jbpm.api.model.builder.EventBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Inclusive gateway that has multiple incoming sequence flows. All tokens arriving from incoming sequence flows
@@ -45,7 +45,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class SimpleMergeTest extends DefaultEngineTestCase
+public class SimpleMergeTest extends CTSTestCase
{
public void testSimpleMerge() throws Exception
{
@@ -53,7 +53,7 @@
// Add a signal listener that sends the other start trigger signal
MergeListener sigListener = new MergeListener(proc.getName(), new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "B"));
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigManager = SignalService.locateSignalService();
sigManager.addSignalListener(sigListener);
try
@@ -76,11 +76,11 @@
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
- EventBuilder eventBuilder = procBuilder.addProcess(getName()).addStartEvent("StartA");
- eventBuilder.addEventDetail(EventDetail.EventDetailType.Signal).addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
- eventBuilder = procBuilder.addSequenceFlow("Merge").addStartEvent("StartB");
- eventBuilder.addEventDetail(EventDetail.EventDetailType.Signal).addSignalRef(SignalType.SYSTEM_START_TRIGGER, "B");
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ EventBuilder eventBuilder = procBuilder.addProcess(getName()).addStartEvent("StartA", TriggerType.Signal);
+ eventBuilder.addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
+ eventBuilder = procBuilder.addSequenceFlow("Merge").addStartEvent("StartB", TriggerType.Signal);
+ eventBuilder.addSignalRef(SignalType.SYSTEM_START_TRIGGER, "B");
procBuilder.addSequenceFlow("Merge").addGateway("Merge", Gateway.GatewayType.Inclusive).addSequenceFlow("End");
procBuilder.addEndEvent("End");
Process proc = procBuilder.getProcess();
@@ -105,8 +105,8 @@
{
if (nextSignal != null)
{
- SignalManager signalManager = SignalManager.locateSignalManager();
- signalManager.throwSignal(nextSignal);
+ SignalService sigService = SignalService.locateSignalService();
+ sigService.throwSignal(nextSignal);
nextSignal = null;
}
}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.control.synchronization;
-
-//$Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-
-/**
- * ParallelMergeTest using the API Descriptor
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class SynchronizationDescriptorTest extends SynchronizationTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("pattern/control/synchronization/pattern-control-synchronization-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.control.synchronization;
-
-//$Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-
-/**
- * ParallelMergeTest using the ProcessMarshaller
- *
- * @author thomas.diesler(a)jboss.com
- * @since 06-Aug-2008
- */
-public class SynchronizationMarshallerTest extends SynchronizationTest
-{
- @Override
- public Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/control/synchronization/SynchronizationTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,22 +25,21 @@
import java.io.IOException;
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.EventBuilder;
-import org.jboss.bpm.model.EventDetail;
-import org.jboss.bpm.model.Gateway;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.model.TaskBuilder;
-import org.jboss.bpm.model.Assignment.AssignTime;
-import org.jboss.bpm.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.model.Signal.SignalType;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Gateway;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.StartEvent.TriggerType;
+import org.jbpm.api.model.builder.EventBuilder;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Parallel gateway that that has multiple incoming sequence flows. Each token arriving from an incoming sequence flow
@@ -50,7 +49,7 @@
* @author thomas.diesler(a)jboss.com
* @since 06-Aug-2008
*/
-public class SynchronizationTest extends DefaultEngineTestCase
+public class SynchronizationTest extends CTSTestCase
{
public void testParallelMerge() throws Exception
{
@@ -58,7 +57,7 @@
// Add a signal listener that sends the other start trigger signal
MergeListener sigListener = new MergeListener(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "B"));
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigManager = SignalService.locateSignalService();
sigManager.addSignalListener(sigListener);
try
@@ -77,8 +76,8 @@
// Verify the result
Message endMessage = getMessages().get(0);
- assertEquals("TaskA", endMessage.getPropertyValue("taskValueA"));
- assertEquals("TaskB", endMessage.getPropertyValue("taskValueB"));
+ assertEquals("TaskA", endMessage.getProperty("taskValueA").getValue());
+ assertEquals("TaskB", endMessage.getProperty("taskValueB").getValue());
}
public void testMergeTimeout() throws Exception
@@ -87,8 +86,8 @@
// Start the process and send start trigger signal
proc.startProcess();
- SignalManager signalManager = SignalManager.locateSignalManager();
- signalManager.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
+ SignalService sigService = SignalService.locateSignalService();
+ sigService.throwSignal(new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A"));
// Wait for the process to end
try
@@ -109,7 +108,7 @@
// Add a signal listener that sends the other start trigger signal
Signal startTrigger = new Signal(getTestID(), SignalType.SYSTEM_START_TRIGGER, "A");
MergeListener sigListener = new MergeListener(startTrigger);
- SignalManager sigManager = SignalManager.locateSignalManager();
+ SignalService sigManager = SignalService.locateSignalService();
sigManager.addSignalListener(sigListener);
try
@@ -154,25 +153,25 @@
// Verify the result
Message endMessage = getMessages().get(0);
- assertEquals("TaskA", endMessage.getPropertyValue("taskValueA"));
- assertEquals("TaskB", endMessage.getPropertyValue("taskValueB"));
+ assertEquals("TaskA", endMessage.getProperty("taskValueA").getValue());
+ assertEquals("TaskB", endMessage.getProperty("taskValueB").getValue());
}
public Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
- EventBuilder eventBuilder = procBuilder.addProcess("Synchronization").addStartEvent("StartA");
- eventBuilder.addEventDetail(EventDetail.EventDetailType.Signal).addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
+ EventBuilder eventBuilder = procBuilder.addProcess("Synchronization").addStartEvent("StartA", TriggerType.Signal);
+ eventBuilder.addSignalRef(SignalType.SYSTEM_START_TRIGGER, "A");
TaskBuilder taskBuilder = procBuilder.addSequenceFlow("TaskA").addTask("TaskA");
- taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskA'", "taskValueA");
+ //taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskA'", "taskValueA");
taskBuilder.addSequenceFlow("Merge");
- eventBuilder = procBuilder.addStartEvent("StartB");
- eventBuilder.addEventDetail(EventDetail.EventDetailType.Signal).addSignalRef(SignalType.SYSTEM_START_TRIGGER, "B");
+ eventBuilder = procBuilder.addStartEvent("StartB", TriggerType.Signal);
+ eventBuilder.addSignalRef(SignalType.SYSTEM_START_TRIGGER, "B");
taskBuilder = procBuilder.addSequenceFlow("TaskB").addTask("TaskB");
- taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskB'", "taskValueB");
+ //taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "'TaskB'", "taskValueB");
taskBuilder.addSequenceFlow("Merge");
procBuilder.addGateway("Merge", Gateway.GatewayType.Parallel).addSequenceFlow("End");
- procBuilder.addEndEvent("End").addEventDetail(EventDetail.EventDetailType.Message).addMessageRef("EndMessage");
+ procBuilder.addEndEvent("End", ResultType.Message).addMessageRef("EndMessage");
MessageBuilder msgBuilder = procBuilder.addMessage("EndMessage");
msgBuilder.addToRef(getTestID()).addProperty("taskValueA", null, true).addProperty("taskValueB", null, true);
Process proc = procBuilder.getProcess();
@@ -197,8 +196,8 @@
{
if (nextSignal != null)
{
- SignalManager signalManager = SignalManager.locateSignalManager();
- signalManager.throwSignal(nextSignal);
+ SignalService sigService = SignalService.locateSignalService();
+ sigService.throwSignal(nextSignal);
nextSignal = null;
}
}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.data.casedata;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Data elements are supported which are specific to a process instance or case. They can be accessed by all components
- * of the process during the execution of the case.
- *
- * https://jira.jboss.org/jira/browse/JBPM-1519
- *
- * @author thomas.diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class CaseDataDescriptorTest extends CaseDataTest
-{
- protected Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("pattern/data/casedata/pattern-data-casedata-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.data.casedata;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Data elements are supported which are specific to a process instance or case. They can be accessed by all components
- * of the process during the execution of the case.
- *
- * https://jira.jboss.org/jira/browse/JBPM-1519
- *
- * @author thomas.diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class CaseDataMarshallerTest extends CaseDataTest
-{
- protected Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- //System.out.println(procXML);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/casedata/CaseDataTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,15 +25,13 @@
import java.io.IOException;
-import org.jboss.bpm.model.EventDetail;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.Assignment.AssignTime;
-import org.jboss.bpm.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.test.CTSTestCase;
/**
* Data elements are supported which are specific to a process instance or case. They can be accessed by all components
@@ -44,7 +42,7 @@
* @author thomas.diesler(a)jboss.com
* @since 15-Aug-2008
*/
-public class CaseDataTest extends DefaultEngineTestCase
+public class CaseDataTest extends CTSTestCase
{
public void testCaseProperties() throws Exception
{
@@ -54,17 +52,17 @@
Message endMessage = getMessages().get(0);
assertNotNull("EndMessage expected", endMessage);
- assertEquals("bar", endMessage.getPropertyValue("propValue"));
+ assertEquals("bar", endMessage.getProperty("propValue").getValue());
}
protected Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("CaseData");
- procBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "CaseData_foo", "propValue");
+ //procBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "CaseData_foo", "propValue");
procBuilder.addProperty("foo", "bar").addStartEvent("Start").addSequenceFlow("TaskA");
procBuilder.addTask("TaskA").addSequenceFlow("End");
- procBuilder.addEndEvent("End").addEventDetail(EventDetail.EventDetailType.Message).addMessageRef("EndMessage");
+ procBuilder.addEndEvent("End", ResultType.Message).addMessageRef("EndMessage");
MessageBuilder msgBuilder = procBuilder.addMessage("EndMessage");
msgBuilder.addToRef(getTestID()).addProperty("propValue", null, true);
Process proc = procBuilder.getProcess();
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataDescriptorTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataDescriptorTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataDescriptorTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.data.taskdata;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Data elements can be defined by tasks which are accessible only within the context of individual execution instances
- * of that task.
- *
- * https://jira.jboss.org/jira/browse/JBPM-1515
- *
- * @author thomas.diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class TaskDataDescriptorTest extends TaskDataTest
-{
- protected Process getProcess() throws IOException
- {
- URL procURL = getResourceURL("pattern/data/taskdata/pattern-data-taskdata-" + getDialect() + ".xml");
- ProcessManager pm = ProcessManager.locateProcessManager();
- Process proc = pm.createProcess(procURL);
- return proc;
- }
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataMarshallerTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataMarshallerTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataMarshallerTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.pattern.data.taskdata;
-
-// $Id$
-
-import java.io.IOException;
-
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.model.Process;
-
-/**
- * Data elements can be defined by tasks which are accessible only within the context of individual execution instances
- * of that task.
- *
- * https://jira.jboss.org/jira/browse/JBPM-1515
- *
- * @author thomas.diesler(a)jboss.com
- * @since 15-Aug-2008
- */
-public class TaskDataMarshallerTest extends TaskDataTest
-{
- protected Process getProcess() throws IOException
- {
- // Marshall the process to a string
- Process proc = super.getProcess();
- String procXML = marshallProcess(proc);
-
- // Recreate the process from the marshalled process
- ProcessManager procManager = ProcessManager.locateProcessManager();
- return procManager.createProcess(procXML);
- }
-}
\ No newline at end of file
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataTest.java
===================================================================
--- projects/spec/tags/jbpm-spec-1.0.0-Alpha1/modules/testsuite/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jboss/bpm/pattern/data/taskdata/TaskDataTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,16 +25,14 @@
import java.io.IOException;
-import org.jboss.bpm.model.EventDetail;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.MessageBuilder;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.ProcessBuilderFactory;
-import org.jboss.bpm.model.TaskBuilder;
-import org.jboss.bpm.model.Assignment.AssignTime;
-import org.jboss.bpm.model.Expression.ExpressionLanguage;
-import org.jboss.bpm.test.DefaultEngineTestCase;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.EndEvent.ResultType;
+import org.jbpm.api.model.builder.MessageBuilder;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.test.CTSTestCase;
/**
* Data elements can be defined by tasks which are accessible only within the context of individual execution instances
@@ -45,7 +43,7 @@
* @author thomas.diesler(a)jboss.com
* @since 15-Aug-2008
*/
-public class TaskDataTest extends DefaultEngineTestCase
+public class TaskDataTest extends CTSTestCase
{
public void testTaskDataRead() throws Exception
{
@@ -55,17 +53,17 @@
Message endMessage = getMessages().get(0);
assertNotNull("EndMessage expected", endMessage);
- assertEquals("bar", endMessage.getPropertyValue("foo"));
+ assertEquals("bar", endMessage.getProperty("foo").getValue());
}
protected Process getProcess() throws IOException
{
- ProcessBuilder procBuilder = ProcessBuilderFactory.newInstance().newProcessBuilder();
+ ProcessBuilder procBuilder = ProcessBuilderService.locateProcessBuilder();
procBuilder.addProcess("TaskData").addStartEvent("Start").addSequenceFlow("TaskA");
TaskBuilder taskBuilder = procBuilder.addTask("TaskA");
taskBuilder.addProperty("foo", "bar").addSequenceFlow("End");
- taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "TaskData_TaskA_foo", "foo");
- procBuilder.addEndEvent("End").addEventDetail(EventDetail.EventDetailType.Message).addMessageRef("EndMessage");
+ //taskBuilder.addAssignment(AssignTime.Start, ExpressionLanguage.MVEL, "TaskData_TaskA_foo", "foo");
+ procBuilder.addEndEvent("End", ResultType.Message).addMessageRef("EndMessage");
MessageBuilder msgBuilder = procBuilder.addMessage("EndMessage");
msgBuilder.addToRef(getTestID()).addProperty("foo", null, true);
Process proc = procBuilder.getProcess();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -26,7 +26,6 @@
import javax.management.ObjectName;
import org.jbpm.api.ProcessNotFoundException;
-import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Process;
import org.jbpm.api.service.PersistenceService;
import org.jbpm.api.test.CTSTestCase;
@@ -45,8 +44,7 @@
*/
public void testSaveLoadDelete() throws Exception
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- PersistenceService service = engine.getService(PersistenceService.class);
+ PersistenceService service = PersistenceService.locatePersistenceService();
// Save the process
Process proc = TestProcessBuilder.getTrivalProcess();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/ProcessBuilderTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/ProcessBuilderTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/ProcessBuilderTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -24,9 +24,9 @@
// $Id$
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.test.CTSTestCase;
/**
@@ -45,8 +45,7 @@
public void testNoProcessName() throws Exception
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
builder.addProcess(null).addStartEvent("Start").addSequenceFlow("Task");
builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
try
@@ -62,8 +61,7 @@
public void testNoStartName() throws Exception
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
builder.addProcess("Proc").addStartEvent(null).addSequenceFlow("Task");
builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
try
@@ -79,8 +77,7 @@
public void testNoTaskName() throws Exception
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
builder.addTask(null).addSequenceFlow("End").addEndEvent("End");
try
@@ -96,8 +93,7 @@
public void testNoEndName() throws Exception
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
builder.addTask("Task").addSequenceFlow("End").addEndEvent(null);
try
@@ -113,8 +109,7 @@
public void testNoStartEvent() throws Exception
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
builder.addProcess("Proc").addTask("Task").addSequenceFlow("End").addEndEvent("End");
try
{
@@ -129,8 +124,7 @@
public void testNoEndEvent() throws Exception
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
builder.addTask("Task");
try
@@ -146,8 +140,7 @@
public void testUnreachableNode() throws Exception
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task1");
builder.addTask("Task1").addSequenceFlow("End").addTask("Task2").addSequenceFlow("End").addEndEvent("End");
try
@@ -163,8 +156,7 @@
public void testDeadEndNode() throws Exception
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
builder.addTask("Task").addEndEvent("End");
try
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/TestProcessBuilder.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/TestProcessBuilder.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/TestProcessBuilder.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,13 +25,13 @@
import junit.framework.TestCase;
-import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.Task;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
/**
* A catalog of CTS test processes
@@ -43,8 +43,7 @@
{
public static Process getTrivalProcess()
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
Process proc = builder.getProcess();
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,7 +25,6 @@
import java.util.List;
-import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.service.SignalService;
@@ -44,9 +43,7 @@
*/
public void testSignalListener() throws Exception
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- SignalService sigService = engine.getService(SignalService.class);
-
+ SignalService sigService = SignalService.locateSignalService();
Signal signal = new Signal(getTestID(), SignalType.USER_SIGNAL, "HelloWorld");
sigService.throwSignal(signal);
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -26,11 +26,11 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Signal.SignalType;
import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
import org.jbpm.api.service.ProcessService;
import org.jbpm.api.test.CTSTestCase;
@@ -48,8 +48,7 @@
// Start the Process
Process proc = getProcess();
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessService procService = engine.getService(ProcessService.class);
+ ProcessService procService = ProcessService.locateProcessService();
procService.registerProcess(proc);
proc.startProcess();
@@ -69,8 +68,7 @@
public Process getProcess() throws IOException
{
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ ProcessBuilder builder = ProcessBuilderService.locateProcessBuilder();
builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
Process proc = builder.getProcess();
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -83,6 +83,11 @@
return resultType;
}
+ public void setResultType(ResultType resultType)
+ {
+ this.resultType = resultType;
+ }
+
@Override
@Transient
public ObjectName getKey()
@@ -112,6 +117,8 @@
{
return new SignalHandler()
{
+ private static final long serialVersionUID = 1L;
+
ProcessEngine engine = ProcessEngine.getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
public void throwEnterSignal(Token token)
@@ -138,6 +145,8 @@
{
return new FlowHandler()
{
+ private static final long serialVersionUID = 1L;
+
public void execute(TokenExecutor tokenExecutor, Token token)
{
log.debug("End reached in: " + getName());
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -83,6 +83,8 @@
{
return new SignalHandler()
{
+ private static final long serialVersionUID = 1L;
+
ProcessEngine engine = ProcessEngine.getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
public void throwEnterSignal(Token token)
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -161,6 +161,11 @@
return Collections.unmodifiableSet(properties);
}
+ public void addProperty(Property prop)
+ {
+ properties.add(prop);
+ }
+
public List<SequenceFlow> getInFlows()
{
return inFlows;
@@ -171,6 +176,21 @@
return outFlows;
}
+ public <T extends ExecutionHandler> void setExecutionHandler(Class<T> clazz)
+ {
+ this.execHandler = clazz.getName();
+ }
+
+ public <T extends FlowHandler> void setFlowHandler(Class<T> clazz)
+ {
+ this.flowHandler = clazz.getName();
+ }
+
+ public <T extends SignalHandler> void setSignalHandler(Class<T> clazz)
+ {
+ this.sigHandler = clazz.getName();
+ }
+
public ExecutionHandler getExecutionHandler(boolean defaultHandler)
{
if (customExecHandler == null && execHandler != null)
@@ -186,6 +206,8 @@
{
return new ExecutionHandler()
{
+ private static final long serialVersionUID = 1L;
+
public void execute(Token token)
{
// nothing to do
@@ -222,6 +244,8 @@
final Node thisNode = this;
return new FlowHandler()
{
+ private static final long serialVersionUID = 1L;
+
public void execute(TokenExecutor tokenExecutor, Token token)
{
if (getOutFlows().size() == 1)
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -139,6 +139,11 @@
return Collections.unmodifiableSet(properties);
}
+ public void addProperty(Property prop)
+ {
+ properties.add(prop);
+ }
+
public void addNode(NodeImpl nodeImpl)
{
if (nodeImpl == null)
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -78,6 +78,11 @@
return triggerType;
}
+ public void setTriggerType(TriggerType triggerType)
+ {
+ this.triggerType = triggerType;
+ }
+
@Override
public ObjectName getKey()
{
@@ -106,6 +111,8 @@
{
return new SignalHandler()
{
+ private static final long serialVersionUID = 1L;
+
ProcessEngine engine = ProcessEngine.getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
public void throwEnterSignal(Token token)
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -118,6 +118,8 @@
{
return new SignalHandler()
{
+ private static final long serialVersionUID = 1L;
+
ProcessEngine engine = ProcessEngine.getProcessEngine();
SignalService sigService = engine.getService(SignalService.class);
public void throwEnterSignal(Token token)
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/EventBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/EventBuilderImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/EventBuilderImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.model.builder;
+
+//$Id$
+
+import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.model.Event;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.builder.EventBuilder;
+import org.jbpm.ri.model.NodeImpl;
+import org.jbpm.ri.model.ProcessImpl;
+
+/**
+ * The EventBuilder can be used to build an {@link Event} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class EventBuilderImpl extends ProcessBuilderImpl implements EventBuilder
+{
+ public EventBuilderImpl(ProcessImpl proc, NodeImpl node)
+ {
+ super(proc, node);
+ }
+
+ public EventBuilder addMessageRef(String msgName)
+ {
+ throw new NotImplementedException();
+ }
+
+ public EventBuilder addSignalRef(SignalType signalType, String signalMessage)
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/EventBuilderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/GatewayBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/GatewayBuilderImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/GatewayBuilderImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.model.builder;
+
+//$Id$
+
+import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.model.Expression.ExpressionLanguage;
+import org.jbpm.api.model.builder.GatewayBuilder;
+import org.jbpm.ri.model.NodeImpl;
+import org.jbpm.ri.model.ProcessImpl;
+
+/**
+ * The GatewayBuilder can be used to build a {@link Gateway} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class GatewayBuilderImpl extends ProcessBuilderImpl implements GatewayBuilder
+{
+ public GatewayBuilderImpl(ProcessImpl proc, NodeImpl node)
+ {
+ super(proc, node);
+ }
+
+ public GatewayBuilder addConditionalGate(String targetName, ExpressionLanguage exprLang, String exprBody)
+ {
+ throw new NotImplementedException();
+ }
+
+ public GatewayBuilder addDefaultGate(String targetName)
+ {
+ throw new NotImplementedException();
+ }
+
+ public GatewayBuilder addGate(String targetName)
+ {
+ throw new NotImplementedException();
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/GatewayBuilderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/ProcessBuilderImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -25,14 +25,23 @@
import org.jbpm.api.NotImplementedException;
import org.jbpm.api.model.Process;
+import org.jbpm.api.model.EndEvent.ResultType;
import org.jbpm.api.model.Gateway.GatewayType;
+import org.jbpm.api.model.StartEvent.TriggerType;
import org.jbpm.api.model.Task.TaskType;
+import org.jbpm.api.model.builder.EventBuilder;
+import org.jbpm.api.model.builder.GatewayBuilder;
+import org.jbpm.api.model.builder.MessageBuilder;
import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.service.Service;
+import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.api.runtime.ExecutionHandler;
+import org.jbpm.api.runtime.FlowHandler;
+import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.ri.model.EndEventImpl;
import org.jbpm.ri.model.EventImpl;
import org.jbpm.ri.model.NodeImpl;
import org.jbpm.ri.model.ProcessImpl;
+import org.jbpm.ri.model.PropertyImpl;
import org.jbpm.ri.model.SequenceFlowImpl;
import org.jbpm.ri.model.StartEventImpl;
import org.jbpm.ri.model.TaskImpl;
@@ -43,7 +52,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public class ProcessBuilderImpl implements ProcessBuilder, Service
+public class ProcessBuilderImpl implements ProcessBuilder
{
protected ProcessImpl proc;
protected NodeImpl node;
@@ -52,6 +61,12 @@
{
}
+ protected ProcessBuilderImpl(ProcessImpl proc, NodeImpl node)
+ {
+ this.proc = proc;
+ this.node = node;
+ }
+
public ProcessBuilder addProcess(String procName)
{
proc = new ProcessImpl(procName);
@@ -84,31 +99,48 @@
return this;
}
- public ProcessBuilder addStartEvent(String name)
+ public EventBuilder addStartEvent(String name)
{
- node = new StartEventImpl(name);
- return addNode(node);
+ addNode(node = new StartEventImpl(name));
+ return new EventBuilderImpl(proc, node);
}
- public ProcessBuilder addEvent(String name)
+ public EventBuilder addStartEvent(String name, TriggerType triggerType)
{
- node = new EventImpl(name);
- return addNode(node);
+ StartEventImpl startImpl = new StartEventImpl(name);
+ startImpl.setTriggerType(triggerType);
+ addNode(node = startImpl);
+ return new EventBuilderImpl(proc, node);
}
+
+ public EventBuilder addEvent(String name)
+ {
+ addNode(node = new EventImpl(name));
+ return new EventBuilderImpl(proc, node);
+ }
- public ProcessBuilder addEndEvent(String name)
+ public EventBuilder addEndEvent(String name)
{
- node = new EndEventImpl(name);
- return addNode(node);
+ addNode(node = new EndEventImpl(name));
+ return new EventBuilderImpl(proc, node);
}
- public ProcessBuilder addTask(String name)
+ public EventBuilder addEndEvent(String name, ResultType resultType)
{
- return addTask(name, TaskType.None);
+ EndEventImpl endImpl = new EndEventImpl(name);
+ endImpl.setResultType(resultType);
+ addNode(node = endImpl);
+ return new EventBuilderImpl(proc, node);
}
- public ProcessBuilder addTask(String name, TaskType type)
+ public TaskBuilder addTask(String name)
{
+ addTask(name, TaskType.None);
+ return new TaskBuilderImpl(proc, node);
+ }
+
+ public TaskBuilder addTask(String name, TaskType type)
+ {
if (type == TaskType.None || type == null)
{
node = new TaskImpl(name);
@@ -145,35 +177,69 @@
{
throw new IllegalStateException("Task type: " + type);
}
- return addNode(node);
+ addNode(node);
+ return new TaskBuilderImpl(proc, node);
}
- public ProcessBuilder addGateway(String name, GatewayType type)
+ public GatewayBuilder addGateway(String name, GatewayType type)
{
- node = (NodeImpl)getProcessInternal().getNode(name);
- if (node == null)
+ if (GatewayType.Exclusive == type)
{
- if (GatewayType.Exclusive == type)
- {
- throw new NotImplementedException();
- }
- else if (GatewayType.Inclusive == type)
- {
- throw new NotImplementedException();
- }
- else if (GatewayType.Parallel == type)
- {
- throw new NotImplementedException();
- }
- else if (GatewayType.Complex == type)
- {
- throw new NotImplementedException();
- }
- addNode(node);
+ throw new NotImplementedException();
}
+ else if (GatewayType.Inclusive == type)
+ {
+ throw new NotImplementedException();
+ }
+ else if (GatewayType.Parallel == type)
+ {
+ throw new NotImplementedException();
+ }
+ else if (GatewayType.Complex == type)
+ {
+ throw new NotImplementedException();
+ }
+ addNode(node);
+ return new GatewayBuilderImpl(proc, node);
+ }
+
+ public <T extends ExecutionHandler> ProcessBuilder addExecutionHandler(Class<T> clazz)
+ {
+ node.setExecutionHandler(clazz);
return this;
}
+ public <T extends FlowHandler> ProcessBuilder addFlowHandler(Class<T> clazz)
+ {
+ node.setFlowHandler(clazz);
+ return this;
+ }
+
+ public <T extends SignalHandler> ProcessBuilder addSignalHandler(Class<T> clazz)
+ {
+ node.setSignalHandler(clazz);
+ return this;
+ }
+
+ public MessageBuilder addMessage(String name)
+ {
+ throw new NotImplementedException();
+ }
+
+ public ProcessBuilder addProperty(String name, String value)
+ {
+ PropertyImpl prop = new PropertyImpl(name, value);
+ if (node != null)
+ {
+ node.addProperty(prop);
+ }
+ else
+ {
+ proc.addProperty(prop);
+ }
+ return this;
+ }
+
private ProcessBuilder addNode(NodeImpl nodeImpl)
{
getProcessInternal().addNode(nodeImpl);
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -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.ri.model.builder;
+
+//$Id$
+
+import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.model.builder.TaskBuilder;
+import org.jbpm.ri.model.NodeImpl;
+import org.jbpm.ri.model.ProcessImpl;
+
+/**
+ * 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
+{
+ public TaskBuilderImpl(ProcessImpl proc, NodeImpl node)
+ {
+ super(proc, node);
+ }
+
+ public TaskBuilder addMessageRef(String msgName)
+ {
+ throw new NotImplementedException();
+ }
+
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/builder/TaskBuilderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -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.ri.service;
+
+// $Id$
+
+import org.jbpm.api.client.MessageListener;
+import org.jbpm.api.model.Message;
+import org.jbpm.api.service.MessageService;
+
+/**
+ * The ProcessEngine sends messages through the MessageService.
+ * <p/>
+ * A {@link Message} has an ID and is targeted to a
+ * specific Participant. A component can register a {@link MessageListener} with the MessageService.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Sep-2008
+ */
+public class MessageServiceImpl extends MessageService
+{
+}
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/MessageServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -49,7 +49,7 @@
* @author thomas.diesler(a)jboss.com
* @since 17-Sep-2008
*/
-public class PersistenceServiceImpl implements PersistenceService
+public class PersistenceServiceImpl extends PersistenceService
{
// Provide logging
final Logger log = LoggerFactory.getLogger(PersistenceServiceImpl.class);
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java 2008-09-30 08:08:49 UTC (rev 2444)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.service;
+
+// $Id$
+
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.model.builder.ProcessBuilderService;
+import org.jbpm.ri.model.builder.ProcessBuilderImpl;
+
+/**
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessBuilderServiceImpl extends ProcessBuilderService
+{
+ @Override
+ public ProcessBuilder getProcessBuilder()
+ {
+ return new ProcessBuilderImpl();
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessBuilderServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-09-30 00:03:33 UTC (rev 2443)
+++ projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-09-30 08:08:49 UTC (rev 2444)
@@ -9,6 +9,7 @@
<property name="services">
<set elementClass="org.jbpm.api.service.Service">
<inject bean="jBPMExecutionService" />
+ <inject bean="jBPMMessageService" />
<inject bean="jBPMPersistenceService" />
<inject bean="jBPMProcessBuilderService" />
<inject bean="jBPMProcessService" />
@@ -35,7 +36,8 @@
<!-- Other Services -->
<bean name="jBPMExecutionService" class="org.jbpm.ri.service.ExecutionServiceImpl" />
- <bean name="jBPMProcessBuilderService" class="org.jbpm.ri.model.builder.ProcessBuilderImpl" />
+ <bean name="jBPMMessageService" class="org.jbpm.ri.service.MessageServiceImpl" />
+ <bean name="jBPMProcessBuilderService" class="org.jbpm.ri.service.ProcessBuilderServiceImpl" />
<bean name="jBPMProcessService" class="org.jbpm.ri.service.ProcessServiceImpl" />
<bean name="jBPMSignalService" class="org.jbpm.ri.service.SignalServiceImpl" />
15 years, 8 months
JBoss JBPM SVN: r2443 - jbpm3/trunk/modules/integration.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-09-29 20:03:33 -0400 (Mon, 29 Sep 2008)
New Revision: 2443
Modified:
jbpm3/trunk/modules/integration/.classpath
Log:
[JBPM-1764] excluding JobExecutorDbTest from Sybase test suite
Modified: jbpm3/trunk/modules/integration/.classpath
===================================================================
--- jbpm3/trunk/modules/integration/.classpath 2008-09-29 23:18:59 UTC (rev 2442)
+++ jbpm3/trunk/modules/integration/.classpath 2008-09-30 00:03:33 UTC (rev 2443)
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
15 years, 8 months
JBoss JBPM SVN: r2442 - jbpm3/trunk/modules/core.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-09-29 19:18:59 -0400 (Mon, 29 Sep 2008)
New Revision: 2442
Modified:
jbpm3/trunk/modules/core/pom.xml
Log:
[JBPM-1764] excluding JobExecutorDbTest from Sybase test suite
Modified: jbpm3/trunk/modules/core/pom.xml
===================================================================
--- jbpm3/trunk/modules/core/pom.xml 2008-09-29 19:56:05 UTC (rev 2441)
+++ jbpm3/trunk/modules/core/pom.xml 2008-09-29 23:18:59 UTC (rev 2442)
@@ -369,6 +369,8 @@
<exclude>org/jbpm/perf/StateUpdateTest.java</exclude>
<!-- https://jira.jboss.org/jira/browse/JBPM-1724 -->
<exclude>org/jbpm/seam/SeamPageFlowTest.java</exclude>
+ <!-- https://jira.jboss.org/jira/browse/JBPM-1764 -->
+ <exclude>org/jbpm/job/executor/JobExecutorDbTest</exclude>
</excludes>
</configuration>
</plugin>
15 years, 8 months
JBoss JBPM SVN: r2441 - in projects/spec/trunk/modules: api/src/main/java/org/jbpm/api/service and 6 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-29 15:56:05 -0400 (Mon, 29 Sep 2008)
New Revision: 2441
Added:
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
Removed:
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionManagerImpl.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/PropertyImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java
projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
Log:
Pattern controll sequence - pass
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -42,11 +42,11 @@
String getName();
/** Get the associated ExecutionHandler */
- ExecutionHandler getExecutionHandler();
+ ExecutionHandler getExecutionHandler(boolean defaultHandler);
/** Get the associated SignalHandler */
- SignalHandler getSignalHandler();
+ SignalHandler getSignalHandler(boolean defaultHandler);
/** Get the associated FlowHandler */
- FlowHandler getFlowHandler();
+ FlowHandler getFlowHandler(boolean defaultHandler);
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -41,5 +41,5 @@
/**
* Get the list of property names
*/
- Set<String> getPropertyNames();
+ Set<Property> getProperties();
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -39,7 +39,7 @@
import org.slf4j.LoggerFactory;
/**
- * The marker interface for all Services
+ * The ProcessService is the entry point to create, find and otherwise manage processes.
*
* @author thomas.diesler(a)jboss.com
* @since 25-Sep-2008
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -56,7 +56,7 @@
assertEquals("HelloWorld", signals.get(0).getMessage());
// test the the signal can be retrieved by type
- assertEquals("No signal", 0, getSignals(SignalType.SYSTEM_PROCESS_ENTER));
- assertEquals("One signal", 1, getSignals(SignalType.USER_SIGNAL));
+ assertEquals("No signal", 0, getSignals(SignalType.SYSTEM_PROCESS_ENTER).size());
+ assertEquals("One signal", 1, getSignals(SignalType.USER_SIGNAL).size());
}
}
Modified: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -26,7 +26,6 @@
import java.io.IOException;
import java.util.List;
-import org.jbpm.api.client.Deployment;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Process;
import org.jbpm.api.model.Signal;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EndEventImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -31,9 +31,17 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.Signal;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.runtime.FlowHandler;
+import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.service.SignalService;
import org.jbpm.ri.model.builder.SingleInFlowSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -99,6 +107,63 @@
inFlows.add(inFlow);
}
+ @Override
+ protected SignalHandler getDefaultSignalHandler()
+ {
+ return new SignalHandler()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ SignalService sigService = engine.getService(SignalService.class);
+ public void throwEnterSignal(Token token)
+ {
+ Signal signal = new Signal(getKey(), Signal.SignalType.SYSTEM_END_EVENT_ENTER);
+ sigService.throwSignal(signal);
+ }
+
+ public void throwExitSignal(Token token)
+ {
+ Signal signal = new Signal(getKey(), Signal.SignalType.SYSTEM_END_EVENT_EXIT);
+ sigService.throwSignal(signal);
+
+ // Destroy the token
+ ExecutionContext exContext = token.getExecutionContext();
+ EndSignalCallback callback = exContext.removeAttachment(EndSignalCallback.class);
+ callback.destroyToken(token);
+ }
+ };
+ }
+
+ @Override
+ protected FlowHandler getDefaultFlowHandler()
+ {
+ return new FlowHandler()
+ {
+ public void execute(TokenExecutor tokenExecutor, Token token)
+ {
+ log.debug("End reached in: " + getName());
+ ExecutionContext exContext = token.getExecutionContext();
+ exContext.addAttachment(EndSignalCallback.class, new EndSignalCallback(tokenExecutor));
+ }
+ };
+ }
+
+ /**
+ * The callback that destroys the token AFTER the SYSTEM_END_EVENT_EXIT signal
+ */
+ static class EndSignalCallback
+ {
+ TokenExecutor tokenExecutor;
+ public EndSignalCallback(TokenExecutor tokenExecutor)
+ {
+ this.tokenExecutor = tokenExecutor;
+ }
+
+ void destroyToken(Token token)
+ {
+ tokenExecutor.destroy(token);
+ }
+ }
+
public String toString()
{
return "EndEvent[" + getName() + "]";
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/EventImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -29,8 +29,13 @@
import javax.persistence.MappedSuperclass;
import org.jbpm.api.Constants;
+import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.Event;
+import org.jbpm.api.model.Signal;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.service.SignalService;
/**
* An Event is something that “happens” during the course of a business process. <p/> These Events affect the flow of
@@ -72,4 +77,25 @@
{
return eventType;
}
+
+ @Override
+ protected SignalHandler getDefaultSignalHandler()
+ {
+ return new SignalHandler()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ SignalService sigService = engine.getService(SignalService.class);
+ public void throwEnterSignal(Token token)
+ {
+ Signal signal = new Signal(getKey(), Signal.SignalType.SYSTEM_EVENT_ENTER);
+ sigService.throwSignal(signal);
+ }
+
+ public void throwExitSignal(Token token)
+ {
+ Signal signal = new Signal(getKey(), Signal.SignalType.SYSTEM_EVENT_EXIT);
+ sigService.throwSignal(signal);
+ }
+ };
+ }
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -52,10 +52,13 @@
import org.jbpm.api.runtime.FlowHandler;
import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.TokenExecutor;
import org.jbpm.ri.model.builder.MultipleInFlowSupport;
import org.jbpm.ri.model.builder.MultipleOutFlowSupport;
import org.jbpm.ri.model.builder.SingleInFlowSupport;
import org.jbpm.ri.model.builder.SingleOutFlowSupport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* A Flow Object is one of the set of following graphical objects: Event, Activity, and
@@ -67,9 +70,11 @@
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class NodeImpl extends AbstractElementImpl implements Node
{
- // provide serial version UID
private static final long serialVersionUID = 1L;
+ // provide logging
+ final static Logger log = LoggerFactory.getLogger(NodeImpl.class);
+
@Basic
private String name;
@@ -92,12 +97,20 @@
private Set<Property> properties = new HashSet<Property>();
@Basic
- private String executionHandler;
+ private String execHandler;
+ private transient ExecutionHandler customExecHandler;
+ private transient ExecutionHandler defaultExecHandler;
+
@Basic
- private String signalHandler;
+ private String sigHandler;
+ private transient SignalHandler customSignalHandler;
+ private transient SignalHandler defaultSignalHandler;
+
@Basic
private String flowHandler;
-
+ private transient FlowHandler customFlowHandler;
+ private transient FlowHandler defaultFlowHandler;
+
public NodeImpl(String name)
{
this.name = name;
@@ -118,12 +131,11 @@
return nodeIndex;
}
- // Persistence method
public void setNodeIndex(int nodeIndex)
{
this.nodeIndex = nodeIndex;
}
-
+
public String getName()
{
return name;
@@ -133,7 +145,7 @@
{
this.name = name;
}
-
+
public Property getProperty(String name)
{
for (Property prop : properties)
@@ -144,14 +156,9 @@
return null;
}
- public Set<String> getPropertyNames()
+ public Set<Property> getProperties()
{
- Set<String> propNames = new HashSet<String>();
- for (Property prop : properties)
- {
- propNames.add(prop.getName());
- }
- return Collections.unmodifiableSet(propNames);
+ return Collections.unmodifiableSet(properties);
}
public List<SequenceFlow> getInFlows()
@@ -164,8 +171,19 @@
return outFlows;
}
- public ExecutionHandler getExecutionHandler()
+ public ExecutionHandler getExecutionHandler(boolean defaultHandler)
{
+ if (customExecHandler == null && execHandler != null)
+ customExecHandler = loadHandlerInstance(ExecutionHandler.class, execHandler);
+
+ if (defaultExecHandler == null)
+ defaultExecHandler = getDefaultExecutionHandler();
+
+ return defaultHandler ? defaultExecHandler : customExecHandler;
+ }
+
+ protected ExecutionHandler getDefaultExecutionHandler()
+ {
return new ExecutionHandler()
{
public void execute(Token token)
@@ -175,10 +193,69 @@
};
}
- public abstract FlowHandler getFlowHandler();
+ public SignalHandler getSignalHandler(boolean defaultHandler)
+ {
+ if (customSignalHandler == null && sigHandler != null)
+ customSignalHandler = loadHandlerInstance(SignalHandler.class, sigHandler);
+
+ if (defaultSignalHandler == null)
+ defaultSignalHandler = getDefaultSignalHandler();
+
+ return defaultHandler ? defaultSignalHandler : customSignalHandler;
+ }
+
+ protected abstract SignalHandler getDefaultSignalHandler();
- public abstract SignalHandler getSignalHandler();
+ public FlowHandler getFlowHandler(boolean defaultHandler)
+ {
+ if (customFlowHandler == null && flowHandler != null)
+ customFlowHandler = loadHandlerInstance(FlowHandler.class, flowHandler);
+
+ if (defaultFlowHandler == null)
+ defaultFlowHandler = getDefaultFlowHandler();
+
+ return defaultHandler ? defaultFlowHandler : customFlowHandler;
+ }
+ protected FlowHandler getDefaultFlowHandler()
+ {
+ final Node thisNode = this;
+ return new FlowHandler()
+ {
+ public void execute(TokenExecutor tokenExecutor, Token token)
+ {
+ if (getOutFlows().size() == 1)
+ {
+ SequenceFlow outFlow = getOutFlows().get(0);
+ tokenExecutor.move(token, outFlow);
+ }
+ else
+ {
+ throw new IllegalStateException("Cannot use default flow handler on " + thisNode + " with: " + getOutFlows());
+ }
+ }
+ };
+ }
+
+ @SuppressWarnings("unchecked")
+ private <T> T loadHandlerInstance(Class<T> clazz, String className)
+ {
+ T handler = null;
+ if (className != null)
+ {
+ try
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ handler = (T)ctxLoader.loadClass(className).newInstance();
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot load handler instance: " + className, ex);
+ }
+ }
+ return handler;
+ }
+
@Override
protected void initialize(Process proc)
{
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -42,7 +42,6 @@
import org.hibernate.annotations.IndexColumn;
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.NotImplementedException;
import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Node;
@@ -66,7 +65,7 @@
{
private static final long serialVersionUID = 1L;
- // Provide logging
+ // provide logging
final static Logger log = LoggerFactory.getLogger(ProcessImpl.class);
@Basic
@@ -135,14 +134,9 @@
return null;
}
- public Set<String> getPropertyNames()
+ public Set<Property> getProperties()
{
- Set<String> propNames = new HashSet<String>();
- for (Property prop : properties)
- {
- propNames.add(prop.getName());
- }
- return Collections.unmodifiableSet(propNames);
+ return Collections.unmodifiableSet(properties);
}
public void addNode(NodeImpl nodeImpl)
@@ -291,7 +285,9 @@
*/
private ProcessStatus waitForEndInternal(long timeout)
{
- throw new NotImplementedException();
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ExecutionService exService = engine.getService(ExecutionService.class);
+ return exService.waitForEnd(this, timeout);
}
public String toString()
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/PropertyImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/PropertyImpl.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/PropertyImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -25,6 +25,8 @@
import javax.persistence.Basic;
import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
import org.jbpm.api.model.Property;
@@ -39,6 +41,10 @@
{
private static final long serialVersionUID = 1L;
+ @Id @GeneratedValue
+ @SuppressWarnings("unused")
+ private Integer id;
+
@Basic
private String name;
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/StartEventImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -31,9 +31,14 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.Signal;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.service.SignalService;
import org.jbpm.ri.model.builder.SingleOutFlowSupport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -96,6 +101,27 @@
outFlows.add(outFlow);
}
+ @Override
+ protected SignalHandler getDefaultSignalHandler()
+ {
+ return new SignalHandler()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ SignalService sigService = engine.getService(SignalService.class);
+ public void throwEnterSignal(Token token)
+ {
+ Signal signal = new Signal(getKey(), Signal.SignalType.SYSTEM_START_EVENT_ENTER);
+ sigService.throwSignal(signal);
+ }
+
+ public void throwExitSignal(Token token)
+ {
+ Signal signal = new Signal(getKey(), Signal.SignalType.SYSTEM_START_EVENT_EXIT);
+ sigService.throwSignal(signal);
+ }
+ };
+ }
+
public String toString()
{
return "StartEvent[" + getName() + "]";
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/TaskImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -31,9 +31,14 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.Signal;
import org.jbpm.api.model.Task;
import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.service.SignalService;
import org.jbpm.ri.model.builder.SingleInFlowSupport;
import org.jbpm.ri.model.builder.SingleOutFlowSupport;
@@ -108,6 +113,27 @@
outFlows.add(outFlow);
}
+ @Override
+ protected SignalHandler getDefaultSignalHandler()
+ {
+ return new SignalHandler()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ SignalService sigService = engine.getService(SignalService.class);
+ public void throwEnterSignal(Token token)
+ {
+ Signal signal = new Signal(getKey(), Signal.SignalType.SYSTEM_TASK_ENTER);
+ sigService.throwSignal(signal);
+ }
+
+ public void throwExitSignal(Token token)
+ {
+ Signal signal = new Signal(getKey(), Signal.SignalType.SYSTEM_TASK_EXIT);
+ sigService.throwSignal(signal);
+ }
+ };
+ }
+
public String toString()
{
return "Task[" + getTaskType() + "," + getName() + "]";
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -28,29 +28,28 @@
import java.util.HashMap;
import java.util.Map;
-import org.jboss.bpm.model.Activity;
-import org.jboss.bpm.model.FlowObject;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.Property;
-import org.jboss.bpm.runtime.ExecutionContext;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Property;
+import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.model.Process;
/**
- * An ExecutionContext that delegates to the current {@link Activity} or {@link Process} for property rerieval.
+ * An ExecutionContext that delegates to the current {@link Node} or {@link Process} for property rerieval.
*
* @author Thomas.Diesler(a)jboss.com
* @since 15-Aug-2008
*/
public class DelegatingExecutionContext implements ExecutionContext
{
- private FlowObject flowObject;
+ private Node node;
private ExecutionContext delegate;
private String activityPrefix;
private String procPrefix;
private Process proc;
- DelegatingExecutionContext(FlowObject flowObject, ExecutionContext delegate)
+ DelegatingExecutionContext(Node flowObject, ExecutionContext delegate)
{
- this.flowObject = flowObject;
+ this.node = flowObject;
this.delegate = delegate;
proc = flowObject.getProcess();
@@ -63,11 +62,10 @@
Object value = null;
// Get activity property
- if (flowObject instanceof Activity && name.startsWith(activityPrefix))
+ if (name.startsWith(activityPrefix))
{
- Activity activity = (Activity)flowObject;
String key = name.substring(activityPrefix.length());
- Property prop = activity.getProperty(key);
+ Property prop = node.getProperty(key);
if (prop != null)
{
value = prop.getValue();
@@ -99,14 +97,10 @@
Collection<Key> keys = new ArrayList<Key>(delegate.getAttachmentKeys());
// Add activity property keys
- if (flowObject instanceof Activity)
+ for (Property prop : node.getProperties())
{
- Activity activity = (Activity)flowObject;
- for (Property prop : activity.getProperties())
- {
- Key key = new Key(null, activityPrefix + prop.getName());
- keys.add(key);
- }
+ Key key = new Key(null, activityPrefix + prop.getName());
+ keys.add(key);
}
// Add process property keys
@@ -171,7 +165,7 @@
public String toString()
{
- Map<Key,Object> combined = new HashMap<Key,Object>();
+ Map<Key, Object> combined = new HashMap<Key, Object>();
for (Key key : getAttachmentKeys())
{
if (key.getClassPart() != null)
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -34,14 +34,16 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.runtime.ExecutionHandler;
+import org.jbpm.api.runtime.FlowHandler;
+import org.jbpm.api.runtime.SignalHandler;
import org.jbpm.api.runtime.Token;
import org.jbpm.api.runtime.TokenExecutor;
import org.jbpm.api.runtime.Token.TokenStatus;
-import org.jbpm.ri.model.NodeImpl;
import org.jbpm.ri.model.ProcessImpl;
-import org.jbpm.api.model.Process;
/**
* The {@link FlowHandler} invokes the TokenExecutor to schedule {@link ConnectingObject} objects together with their
@@ -221,12 +223,13 @@
while (procStatus == ProcessStatus.Active && tokStatus == TokenStatus.Started)
{
// Get the target and its handlers
- Node flowObject = token.getFlow().getTargetRef();
- NodeImpl flowObjectImpl = (NodeImpl)flowObject;
- SignalHandler sigHandler = getSignalHandler(flowObject);
+ Node node = token.getFlow().getTargetRef();
+ SignalHandler sigHandler = getSignalHandler(node);
+ ExecutionHandler execHandler = getExecutionHandler(node);
+ FlowHandler flowHandler = getFlowHandler(node);
// Synchronize execution on the target FlowObject
- synchronized (flowObject)
+ synchronized (node)
{
// Create a Token that includes properties from the current Activity
DelegatingToken tokCopy = new DelegatingToken(token);
@@ -235,10 +238,10 @@
sigHandler.throwEnterSignal(tokCopy);
// Execute the target FlowObject
- flowObjectImpl.execute(tokCopy);
+ execHandler.execute(tokCopy);
// Transfer the token to the FlowHandler
- flowObjectImpl.executeFlowHandler(tokenExecutor, tokCopy);
+ flowHandler.execute(tokenExecutor, tokCopy);
// Throw the Exit Signal
sigHandler.throwExitSignal(tokCopy);
@@ -290,19 +293,20 @@
private SignalHandler getSignalHandler(Node target)
{
- HandlerSupport handlerSupport = getHandlerSupport(target);
- SignalHandler handler = handlerSupport.getSignalHandler();
- if (handler == null)
- throw new IllegalStateException("Cannot obtain signal handler from: " + target);
+ SignalHandler customHandler = target.getSignalHandler(false);
+ return customHandler != null ? customHandler : target.getSignalHandler(true);
+ }
- return handler;
+ private ExecutionHandler getExecutionHandler(Node target)
+ {
+ ExecutionHandler customHandler = target.getExecutionHandler(false);
+ return customHandler != null ? customHandler : target.getExecutionHandler(true);
}
- private HandlerSupport getHandlerSupport(FlowObject fo)
+ private FlowHandler getFlowHandler(Node target)
{
- if (fo instanceof HandlerSupport == false)
- throw new IllegalStateException("Flow object does not implement handler support: " + fo);
- return (HandlerSupport)fo;
+ FlowHandler customHandler = target.getFlowHandler(false);
+ return customHandler != null ? customHandler : target.getFlowHandler(true);
}
@Override
Deleted: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionManagerImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionManagerImpl.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionManagerImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -1,354 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.ri.service;
-
-// $Id$
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.management.ObjectName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jbpm.api.BPMException;
-import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.ProcessTimeoutException;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.Signal;
-import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.Process.ProcessStatus;
-import org.jbpm.api.model.Signal.SignalType;
-import org.jbpm.api.model.StartEvent.TriggerType;
-import org.jbpm.api.runtime.Attachments;
-import org.jbpm.api.runtime.TokenExecutor;
-import org.jbpm.api.service.ExecutionService;
-import org.jbpm.api.service.ProcessService;
-import org.jbpm.api.service.SignalService;
-import org.jbpm.ri.model.ProcessImpl;
-import org.jbpm.ri.model.SequenceFlowImpl;
-import org.jbpm.ri.runtime.RuntimeProcess;
-import org.jbpm.ri.runtime.RuntimeProcessImpl;
-import org.jbpm.ri.runtime.TokenImpl;
-
-/**
- * The process manager is the entry point to create, find and otherwise manage processes.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class ExecutionManagerImpl extends ExecutionService
-{
- // provide logging
- private static final Log log = LogFactory.getLog(ExecutionManagerImpl.class);
-
- // The map of active runtime processes
- private Map<ObjectName, RuntimeProcess> runtimeProcesses = new HashMap<ObjectName, RuntimeProcess>();
-
- @Override
- public void startProcess(Process proc, Attachments att)
- {
- // Prepare the process for start
- startProcessPrepare(proc);
-
- // Get the None Start Event if there is one and start the initial flow
- StartEvent start = getNoneStartEvent(proc);
- if (start != null)
- {
- if (proc.getProcessStatus() == ProcessStatus.Active)
- throw new IllegalStateException("Cannot start an already active process");
-
- startProcessInternal(start, att);
- }
- }
-
- @Override
- public void startProcess(StartEvent start, Attachments att)
- {
- // Prepare the process for start
- startProcessPrepare(start.getProcess());
-
- startProcessInternal(start, att);
- }
-
- private synchronized void startProcessInternal(StartEvent start, Attachments att)
- {
- @SuppressWarnings("serial")
- class InitialFlow extends SequenceFlowImpl
- {
- InitialFlow(StartEvent start)
- {
- super(start.getName());
- setTargetRef(start);
- }
- }
-
- Process proc = start.getProcess();
- RuntimeProcess rtProc = getRuntimeProcess(proc, false);
- boolean startProcessThread = (rtProc == null);
-
- // Create initial Token
- TokenImpl initialToken = new TokenImpl(att);
- InitialFlow initialFlow = new InitialFlow(start);
- initialToken.setFlow(initialFlow);
-
- // Register the initial Token
- rtProc = getRuntimeProcess(proc, true);
- TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
- tokenExecutor.create(initialToken, initialFlow);
-
- // Start a new process thread
- if (startProcessThread)
- {
- RunnableProcess runnable = new RunnableProcess(rtProc);
- getProcessExecutor().execute(runnable);
- synchronized (proc)
- {
- while (proc.getProcessStatus() != ProcessStatus.Active)
- {
- try
- {
- proc.wait();
- }
- catch (InterruptedException ex)
- {
- log.error(ex);
- }
- }
- }
- }
-
- // Do the start time assignments
- // startTimeAssignments(proc, initialToken);
-
- // Start the initial token
- tokenExecutor.start(initialToken);
- }
-
- private void startProcessPrepare(Process proc)
- {
- // Reset the process if already terminated
- ProcessImpl procImpl = (ProcessImpl)proc;
- if (isProcessTerminated(proc))
- procImpl.resetProcess();
-
- ProcessStatus procStatus = proc.getProcessStatus();
- if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
- throw new IllegalStateException("Cannot start process in state: " + procStatus);
-
- // Register the process if needed
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessService procService = engine.getService(ProcessService.class);
- if (procService.getProcessByKey(proc.getKey()) == null)
- procService.registerProcess(proc);
- }
-
- public ProcessStatus waitForEnd(Process proc)
- {
- return waitForEndInternal(proc, 0);
- }
-
- public ProcessStatus waitForEnd(Process proc, long timeout)
- {
- return waitForEndInternal(proc, timeout);
- }
-
- /**
- * 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. If the process was
- * aborted this method throws the causing RuntimeException if avaialable.
- */
- private ProcessStatus waitForEndInternal(Process proc, long timeout)
- {
- ProcessImpl procImpl = (ProcessImpl)proc;
-
- ProcessStatus status = proc.getProcessStatus();
- if (status == ProcessStatus.None)
- 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;
- try
- {
- while (forever || now < until)
- {
- synchronized (proc)
- {
- if (isProcessTerminated(proc))
- {
- if (procImpl.getRuntimeException() != null)
- {
- throw new BPMException("Process aborted", procImpl.getRuntimeException());
- }
- else
- {
- break;
- }
- }
-
- // Start waiting to get notified
- long waitTimeout = forever ? 0 : until - now;
- proc.wait(waitTimeout);
- }
- now = System.currentTimeMillis();
- }
-
- // Throw timeout exception if it took too long
- if (isProcessTerminated(proc) == false)
- {
- RuntimeException rte = new ProcessTimeoutException("Process timeout after " + timeout + "ms for: " + proc.getKey());
- procImpl.setRuntimeException(rte);
- log.error(rte);
- throw rte;
- }
- }
- catch (InterruptedException ex)
- {
- log.warn(ex);
- }
- finally
- {
- // Unregister the process if not done already
- // this could happen when the Process never received a start signal
- // and then we get here because of a ProcessTimeoutException
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessService procService = engine.getService(ProcessService.class);
- if (procService.getProcessByKey(proc.getKey()) != null)
- procService.unregisterProcess(proc);
- }
-
-
- status = proc.getProcessStatus();
- return status;
- }
-
- private boolean isProcessTerminated(Process proc)
- {
- ProcessStatus status = proc.getProcessStatus();
- return status == ProcessStatus.Cancelled || status == ProcessStatus.Completed || status == ProcessStatus.Aborted;
- }
-
- private StartEvent getNoneStartEvent(Process proc)
- {
- StartEvent start = null;
- for (StartEvent aux : proc.getNodes(StartEvent.class))
- {
- if (aux.getTriggerType() == TriggerType.None)
- {
- if (start != null)
- throw new InvalidProcessException("Process cannot have multiple start events with no trigger");
- start = aux;
- }
- }
- return start;
- }
-
- private RuntimeProcess getRuntimeProcess(Process proc, boolean createNew)
- {
- RuntimeProcess rtProcess;
- synchronized (runtimeProcesses)
- {
- rtProcess = runtimeProcesses.get(proc.getKey());
- if (rtProcess == null && createNew)
- {
- rtProcess = new RuntimeProcessImpl(proc);
- runtimeProcesses.put(proc.getKey(), rtProcess);
- }
- }
- return rtProcess;
- }
-
- /***************************************************************
- * The runnable Process
- */
- class RunnableProcess implements Runnable
- {
- private RuntimeProcess rtProc;
-
- public RunnableProcess(RuntimeProcess rtProc)
- {
- this.rtProc = rtProc;
- }
-
- public void run()
- {
- TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
- ProcessImpl procImpl = (ProcessImpl)rtProc.getProcess();
- Process proc = rtProc.getProcess();
-
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- SignalService sigService = engine.getService(SignalService.class);
-
- ObjectName procID = proc.getKey();
- String procName = proc.getName();
- try
- {
- synchronized (proc)
- {
- procImpl.setProcessStatus(ProcessStatus.Active);
- sigService.throwSignal(new Signal(procID, SignalType.SYSTEM_PROCESS_ENTER));
-
- // Notify that the process is now Active
- proc.notifyAll();
- }
-
- synchronized (rtProc)
- {
- // Wait until there are no more runnable tokens
- while (tokenExecutor.hasRunnableTokens())
- {
- try
- {
- rtProc.wait();
- }
- catch (InterruptedException ex)
- {
- log.error(ex);
- }
- }
-
- log.debug("End execution thread [proc=" + procName + ",status=" + proc.getProcessStatus() + "]");
-
- if (proc.getProcessStatus() == ProcessStatus.Active)
- procImpl.setProcessStatus(ProcessStatus.Completed);
- }
- }
- finally
- {
- sigService.throwSignal(new Signal(procID, Signal.SignalType.SYSTEM_PROCESS_EXIT));
-
- synchronized (proc)
- {
- ProcessService procService = engine.getService(ProcessService.class);
- procService.unregisterProcess(proc);
- runtimeProcesses.remove(procID);
-
- // Notify that the process has now ended
- proc.notifyAll();
- }
- }
- }
- }
-}
\ No newline at end of file
Copied: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java (from rev 2439, projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionManagerImpl.java)
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionServiceImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -0,0 +1,354 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.service;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.ObjectName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jbpm.api.BPMException;
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.ProcessTimeoutException;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.StartEvent;
+import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.StartEvent.TriggerType;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.service.ExecutionService;
+import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.ri.model.ProcessImpl;
+import org.jbpm.ri.model.SequenceFlowImpl;
+import org.jbpm.ri.runtime.RuntimeProcess;
+import org.jbpm.ri.runtime.RuntimeProcessImpl;
+import org.jbpm.ri.runtime.TokenImpl;
+
+/**
+ * The process manager is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ExecutionServiceImpl extends ExecutionService
+{
+ // provide logging
+ private static final Log log = LogFactory.getLog(ExecutionServiceImpl.class);
+
+ // The map of active runtime processes
+ private Map<ObjectName, RuntimeProcess> runtimeProcesses = new HashMap<ObjectName, RuntimeProcess>();
+
+ @Override
+ public void startProcess(Process proc, Attachments att)
+ {
+ // Prepare the process for start
+ startProcessPrepare(proc);
+
+ // Get the None Start Event if there is one and start the initial flow
+ StartEvent start = getNoneStartEvent(proc);
+ if (start != null)
+ {
+ if (proc.getProcessStatus() == ProcessStatus.Active)
+ throw new IllegalStateException("Cannot start an already active process");
+
+ startProcessInternal(start, att);
+ }
+ }
+
+ @Override
+ public void startProcess(StartEvent start, Attachments att)
+ {
+ // Prepare the process for start
+ startProcessPrepare(start.getProcess());
+
+ startProcessInternal(start, att);
+ }
+
+ private synchronized void startProcessInternal(StartEvent start, Attachments att)
+ {
+ @SuppressWarnings("serial")
+ class InitialFlow extends SequenceFlowImpl
+ {
+ InitialFlow(StartEvent start)
+ {
+ super(start.getName());
+ setTargetRef(start);
+ }
+ }
+
+ Process proc = start.getProcess();
+ RuntimeProcess rtProc = getRuntimeProcess(proc, false);
+ boolean startProcessThread = (rtProc == null);
+
+ // Create initial Token
+ TokenImpl initialToken = new TokenImpl(att);
+ InitialFlow initialFlow = new InitialFlow(start);
+ initialToken.setFlow(initialFlow);
+
+ // Register the initial Token
+ rtProc = getRuntimeProcess(proc, true);
+ TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
+ tokenExecutor.create(initialToken, initialFlow);
+
+ // Start a new process thread
+ if (startProcessThread)
+ {
+ RunnableProcess runnable = new RunnableProcess(rtProc);
+ getProcessExecutor().execute(runnable);
+ synchronized (proc)
+ {
+ while (proc.getProcessStatus() != ProcessStatus.Active)
+ {
+ try
+ {
+ proc.wait();
+ }
+ catch (InterruptedException ex)
+ {
+ log.error(ex);
+ }
+ }
+ }
+ }
+
+ // Do the start time assignments
+ // startTimeAssignments(proc, initialToken);
+
+ // Start the initial token
+ tokenExecutor.start(initialToken);
+ }
+
+ private void startProcessPrepare(Process proc)
+ {
+ // Reset the process if already terminated
+ ProcessImpl procImpl = (ProcessImpl)proc;
+ if (isProcessTerminated(proc))
+ procImpl.resetProcess();
+
+ ProcessStatus procStatus = proc.getProcessStatus();
+ if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
+ throw new IllegalStateException("Cannot start process in state: " + procStatus);
+
+ // Register the process if needed
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessService procService = engine.getService(ProcessService.class);
+ if (procService.getProcessByKey(proc.getKey()) == null)
+ procService.registerProcess(proc);
+ }
+
+ public ProcessStatus waitForEnd(Process proc)
+ {
+ return waitForEndInternal(proc, 0);
+ }
+
+ public ProcessStatus waitForEnd(Process proc, long timeout)
+ {
+ return waitForEndInternal(proc, timeout);
+ }
+
+ /**
+ * 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. If the process was
+ * aborted this method throws the causing RuntimeException if avaialable.
+ */
+ private ProcessStatus waitForEndInternal(Process proc, long timeout)
+ {
+ ProcessImpl procImpl = (ProcessImpl)proc;
+
+ ProcessStatus status = proc.getProcessStatus();
+ if (status == ProcessStatus.None)
+ 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;
+ try
+ {
+ while (forever || now < until)
+ {
+ synchronized (proc)
+ {
+ if (isProcessTerminated(proc))
+ {
+ if (procImpl.getRuntimeException() != null)
+ {
+ throw new BPMException("Process aborted", procImpl.getRuntimeException());
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ // Start waiting to get notified
+ long waitTimeout = forever ? 0 : until - now;
+ proc.wait(waitTimeout);
+ }
+ now = System.currentTimeMillis();
+ }
+
+ // Throw timeout exception if it took too long
+ if (isProcessTerminated(proc) == false)
+ {
+ RuntimeException rte = new ProcessTimeoutException("Process timeout after " + timeout + "ms for: " + proc.getKey());
+ procImpl.setRuntimeException(rte);
+ log.error(rte);
+ throw rte;
+ }
+ }
+ catch (InterruptedException ex)
+ {
+ log.warn(ex);
+ }
+ finally
+ {
+ // Unregister the process if not done already
+ // this could happen when the Process never received a start signal
+ // and then we get here because of a ProcessTimeoutException
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessService procService = engine.getService(ProcessService.class);
+ if (procService.getProcessByKey(proc.getKey()) != null)
+ procService.unregisterProcess(proc);
+ }
+
+
+ status = proc.getProcessStatus();
+ return status;
+ }
+
+ private boolean isProcessTerminated(Process proc)
+ {
+ ProcessStatus status = proc.getProcessStatus();
+ return status == ProcessStatus.Cancelled || status == ProcessStatus.Completed || status == ProcessStatus.Aborted;
+ }
+
+ private StartEvent getNoneStartEvent(Process proc)
+ {
+ StartEvent start = null;
+ for (StartEvent aux : proc.getNodes(StartEvent.class))
+ {
+ if (aux.getTriggerType() == TriggerType.None)
+ {
+ if (start != null)
+ throw new InvalidProcessException("Process cannot have multiple start events with no trigger");
+ start = aux;
+ }
+ }
+ return start;
+ }
+
+ private RuntimeProcess getRuntimeProcess(Process proc, boolean createNew)
+ {
+ RuntimeProcess rtProcess;
+ synchronized (runtimeProcesses)
+ {
+ rtProcess = runtimeProcesses.get(proc.getKey());
+ if (rtProcess == null && createNew)
+ {
+ rtProcess = new RuntimeProcessImpl(proc);
+ runtimeProcesses.put(proc.getKey(), rtProcess);
+ }
+ }
+ return rtProcess;
+ }
+
+ /***************************************************************
+ * The runnable Process
+ */
+ class RunnableProcess implements Runnable
+ {
+ private RuntimeProcess rtProc;
+
+ public RunnableProcess(RuntimeProcess rtProc)
+ {
+ this.rtProc = rtProc;
+ }
+
+ public void run()
+ {
+ TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
+ ProcessImpl procImpl = (ProcessImpl)rtProc.getProcess();
+ Process proc = rtProc.getProcess();
+
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ SignalService sigService = engine.getService(SignalService.class);
+
+ ObjectName procID = proc.getKey();
+ String procName = proc.getName();
+ try
+ {
+ synchronized (proc)
+ {
+ procImpl.setProcessStatus(ProcessStatus.Active);
+ sigService.throwSignal(new Signal(procID, SignalType.SYSTEM_PROCESS_ENTER));
+
+ // Notify that the process is now Active
+ proc.notifyAll();
+ }
+
+ synchronized (rtProc)
+ {
+ // Wait until there are no more runnable tokens
+ while (tokenExecutor.hasRunnableTokens())
+ {
+ try
+ {
+ rtProc.wait();
+ }
+ catch (InterruptedException ex)
+ {
+ log.error(ex);
+ }
+ }
+
+ log.debug("End execution thread [proc=" + procName + ",status=" + proc.getProcessStatus() + "]");
+
+ if (proc.getProcessStatus() == ProcessStatus.Active)
+ procImpl.setProcessStatus(ProcessStatus.Completed);
+ }
+ }
+ finally
+ {
+ sigService.throwSignal(new Signal(procID, Signal.SignalType.SYSTEM_PROCESS_EXIT));
+
+ synchronized (proc)
+ {
+ ProcessService procService = engine.getService(ProcessService.class);
+ procService.unregisterProcess(proc);
+ runtimeProcesses.remove(procID);
+
+ // Notify that the process has now ended
+ proc.notifyAll();
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -23,6 +23,10 @@
// $Id$
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
import javax.management.ObjectName;
import org.hibernate.Hibernate;
@@ -34,13 +38,8 @@
import org.jbpm.api.ProcessNotFoundException;
import org.jbpm.api.model.Process;
import org.jbpm.api.service.PersistenceService;
-import org.jbpm.ri.model.AbstractElementImpl;
-import org.jbpm.ri.model.EndEventImpl;
-import org.jbpm.ri.model.NodeImpl;
+import org.jbpm.api.service.Service;
import org.jbpm.ri.model.ProcessImpl;
-import org.jbpm.ri.model.SequenceFlowImpl;
-import org.jbpm.ri.model.StartEventImpl;
-import org.jbpm.ri.model.TaskImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -54,15 +53,21 @@
{
// Provide logging
final Logger log = LoggerFactory.getLogger(PersistenceServiceImpl.class);
-
+
private String hibernateConfig;
private SessionFactory sessionFactory;
+ private Set<String> annotatedClasses = new HashSet<String>();
public void setHibernateConfig(String hibernateConfig)
{
this.hibernateConfig = hibernateConfig;
}
+ public void setAnnotatedClasses(Set<String> annotatedClasses)
+ {
+ this.annotatedClasses = annotatedClasses;
+ }
+
public ObjectName saveProcess(Process proc)
{
log.debug("START saveProcess: " + proc.getKey());
@@ -121,10 +126,11 @@
log.debug("END deleteProcess: " + proc.getKey());
}
+ @SuppressWarnings("unchecked")
private SessionFactory getSessionFactory()
{
// If this property is not explicitly set in the beans config
- // fall back to the -Ddatabase property that also activates
+ // fall back to the -Ddatabase property that also activates
// the corresponding mvn profiles
if (hibernateConfig == null)
{
@@ -135,13 +141,24 @@
if (sessionFactory == null)
{
AnnotationConfiguration anConfig = new AnnotationConfiguration();
- anConfig.addAnnotatedClass(AbstractElementImpl.class);
- anConfig.addAnnotatedClass(EndEventImpl.class);
- anConfig.addAnnotatedClass(NodeImpl.class);
- anConfig.addAnnotatedClass(ProcessImpl.class);
- anConfig.addAnnotatedClass(SequenceFlowImpl.class);
- anConfig.addAnnotatedClass(StartEventImpl.class);
- anConfig.addAnnotatedClass(TaskImpl.class);
+
+ String serviceName = null;
+ try
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ Iterator<String> itAnn = annotatedClasses.iterator();
+ while (itAnn.hasNext())
+ {
+ serviceName = itAnn.next();
+ Class<Service> serviceClass = (Class<Service>)ctxLoader.loadClass(serviceName);
+ anConfig.addAnnotatedClass(serviceClass);
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot load service: " + serviceName, ex);
+ }
+
sessionFactory = anConfig.configure(hibernateConfig).buildSessionFactory();
}
return sessionFactory;
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java 2008-09-29 19:56:05 UTC (rev 2441)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.service;
+
+// $Id$
+
+import org.jbpm.api.service.ProcessService;
+
+/**
+ * The ProcessService is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessServiceImpl extends ProcessService
+{
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ProcessServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-09-29 17:44:30 UTC (rev 2440)
+++ projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-09-29 19:56:05 UTC (rev 2441)
@@ -8,16 +8,35 @@
<bean name="jBPMProcessEngine" class="org.jbpm.ri.client.ProcessEngineImpl">
<property name="services">
<set elementClass="org.jbpm.api.service.Service">
- <inject bean="jBPMProcessBuilder" />
+ <inject bean="jBPMExecutionService" />
<inject bean="jBPMPersistenceService" />
+ <inject bean="jBPMProcessBuilderService" />
+ <inject bean="jBPMProcessService" />
<inject bean="jBPMSignalService" />
</set>
</property>
</bean>
- <!-- The Services -->
- <bean name="jBPMProcessBuilder" class="org.jbpm.ri.model.builder.ProcessBuilderImpl" />
- <bean name="jBPMPersistenceService" class="org.jbpm.ri.service.PersistenceServiceImpl" />
+ <!-- The PersistenceService -->
+ <bean name="jBPMPersistenceService" class="org.jbpm.ri.service.PersistenceServiceImpl">
+ <property name="annotatedClasses">
+ <set elementClass="java.lang.String">
+ <value>org.jbpm.ri.model.AbstractElementImpl</value>
+ <value>org.jbpm.ri.model.EndEventImpl</value>
+ <value>org.jbpm.ri.model.NodeImpl</value>
+ <value>org.jbpm.ri.model.ProcessImpl</value>
+ <value>org.jbpm.ri.model.PropertyImpl</value>
+ <value>org.jbpm.ri.model.SequenceFlowImpl</value>
+ <value>org.jbpm.ri.model.StartEventImpl</value>
+ <value>org.jbpm.ri.model.TaskImpl</value>
+ </set>
+ </property>
+ </bean>
+
+ <!-- Other Services -->
+ <bean name="jBPMExecutionService" class="org.jbpm.ri.service.ExecutionServiceImpl" />
+ <bean name="jBPMProcessBuilderService" class="org.jbpm.ri.model.builder.ProcessBuilderImpl" />
+ <bean name="jBPMProcessService" class="org.jbpm.ri.service.ProcessServiceImpl" />
<bean name="jBPMSignalService" class="org.jbpm.ri.service.SignalServiceImpl" />
-
+
</deployment>
15 years, 8 months
JBoss JBPM SVN: r2440 - in jbpm3/trunk: modules/core and 23 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-09-29 13:44:30 -0400 (Mon, 29 Sep 2008)
New Revision: 2440
Removed:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/command/
jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/package.html
Modified:
jbpm3/trunk/modules/core/pom.xml
jbpm3/trunk/modules/core/src/main/java/org/jbpm/bytes/ByteArray.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ArrayUtil.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ByteUtil.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/EqualsUtil.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/JndiUtil.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/StaticUtil.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/StringUtil.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java
jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.mysql.xml
jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.postgresql.xml
jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.sybase.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/JcrNodeInstance.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/action/Script.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/ExceptionHandler.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/Node.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/ProcessDefinition.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/Transition.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/exe/Comment.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/instantiation/Delegation.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/job/Job.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/logging/log/MessageLog.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/module/def/ModuleDefinition.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/taskmgmt/def/Task.hbm.xml
jbpm3/trunk/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml
jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/bytes/ByteArrayDbTest.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/bytes/ByteArrayTest.java
jbpm3/trunk/modules/enterprise/jar/pom.xml
jbpm3/trunk/modules/simulation/src/tutorial/org/jbpm/sim/tutorial/jbpm.mysql.cfg.xml
jbpm3/trunk/pom.xml
Log:
merge -r2320:2439 https://svn.jboss.org/repos/jbpm/jbpm3/branches/aguizar
Modified: jbpm3/trunk/modules/core/pom.xml
===================================================================
--- jbpm3/trunk/modules/core/pom.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/pom.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -161,6 +161,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${surefire.jvm.args}</argLine>
+ <systemProperties>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${basedir}/target</value>
+ </property>
+ </systemProperties>
</configuration>
</plugin>
</plugins>
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/bytes/ByteArray.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/bytes/ByteArray.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/bytes/ByteArray.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -48,7 +48,7 @@
protected String name = null;
protected List byteBlocks = null;
- private static Log log = LogFactory.getLog(ByteArray.class);
+ private static final Log log = LogFactory.getLog(ByteArray.class);
public ByteArray() {
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -22,55 +22,93 @@
package org.jbpm.bytes;
import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.jbpm.JbpmConfiguration;
/**
* is used by {@link org.jbpm.bytes.ByteArray} to chop a
* byte arrays into a list of chunks and glue them back together.
*/
-public abstract class ByteBlockChopper {
+public class ByteBlockChopper {
+ private static final Log log = LogFactory.getLog(ByteBlockChopper.class);
+
+ private ByteBlockChopper() {
+ // hide default constructor to prevent instantiation
+ }
+
public static List chopItUp(byte[] byteArray) {
- int blockSize = JbpmConfiguration.Configs.getInt("jbpm.byte.block.size");
List bytes = null;
- if ( (byteArray!=null)
- && (byteArray.length>0) ){
- bytes = new ArrayList();
- int index = 0;
- while ( (byteArray.length-index) > blockSize ) {
- byte[] byteBlock = new byte[blockSize];
- System.arraycopy(byteArray, index, byteBlock, 0, blockSize);
- bytes.add(byteBlock);
- index+=blockSize;
+ if (byteArray != null) {
+ int blockSize = JbpmConfiguration.Configs.getInt("jbpm.byte.block.size");
+ int byteCount = byteArray.length;
+ if (byteCount > blockSize) {
+ log.debug("chopping " + byteCount + " bytes");
+ bytes = new ArrayList();
+ int offset;
+ for (offset = 0; byteCount - offset > blockSize; offset += blockSize) {
+ bytes.add(subArray(byteArray, offset, blockSize));
+ }
+ bytes.add(subArray(byteArray, offset, byteCount - offset));
}
- byte[] byteBlock = new byte[byteArray.length-index];
- System.arraycopy(byteArray, index, byteBlock, 0, byteArray.length-index);
- bytes.add(byteBlock);
+ else if (byteCount > 0) {
+ log.debug("no need to chop " + byteCount + " bytes");
+ bytes = Collections.singletonList(byteArray);
+ }
}
return bytes;
}
- public static byte[] glueChopsBackTogether(List bytes) {
- byte[] value = null;
+ private static byte[] subArray(byte[] array, int offset, int length) {
+ byte[] subArray = new byte[length];
+ System.arraycopy(array, offset, subArray, 0, length);
+ log.debug("chopped " + length + " bytes beggining at " + offset);
+ return subArray;
+ }
+
+ public static byte[] glueChopsBackTogether(List byteBlocks) {
+ byte[] byteArray = null;
- if (bytes!=null) {
- Iterator iter = bytes.iterator();
- while (iter.hasNext()) {
- byte[] byteBlock = (byte[]) iter.next();
- if (value==null) {
- value = byteBlock;
- } else {
- byte[] oldValue = value;
- value = new byte[value.length+byteBlock.length];
- System.arraycopy(oldValue, 0, value, 0, oldValue.length);
- System.arraycopy(byteBlock, 0, value, oldValue.length, byteBlock.length);
+ if (byteBlocks != null) {
+ int blockCount = byteBlocks.size();
+ switch (blockCount) {
+ case 0:
+ break;
+ case 1:
+ byteArray = (byte[]) byteBlocks.get(0);
+ log.debug("no need to glue " + byteArray.length + " bytes");
+ break;
+ default:
+ int blockSize = JbpmConfiguration.Configs.getInt("jbpm.byte.block.size");
+ byte[] lastBlock = (byte[]) byteBlocks.get(blockCount - 1);
+ int byteCount = blockSize * (blockCount - 1) + lastBlock.length;
+ log.debug("gluing " + byteCount + " bytes");
+
+ byteArray = new byte[byteCount];
+ int offset = 0;
+ for (int i = 0, n = blockCount; i < n; i++) {
+ byte[] block = (byte[]) byteBlocks.get(i);
+ int length = block.length;
+ System.arraycopy(block, 0, byteArray, offset, length);
+ log.debug("glued " + length + " bytes beggining at " + offset);
+ // JBPM-702 sybase truncates trailing zeros
+ if (length < blockSize && i < n-1) {
+ Arrays.fill(byteArray, offset + length, offset + blockSize, (byte) 0);
+ log.debug("zero filled " + (blockSize - length) + " trailing bytes");
+ offset += blockSize;
+ }
+ else {
+ offset += length;
+ }
}
}
}
-
- return value;
+ return byteArray;
}
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -10,6 +10,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hibernate.HibernateException;
+
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.db.JobSession;
@@ -166,10 +168,16 @@
}
} catch (Exception e) {
log.debug("exception while executing " + job, e);
- StringWriter memoryWriter = new StringWriter();
- e.printStackTrace(new PrintWriter(memoryWriter));
- job.setException(memoryWriter.toString());
- job.setRetries(job.getRetries()-1);
+ if (!isPersistenceException(e)) {
+ StringWriter memoryWriter = new StringWriter();
+ e.printStackTrace(new PrintWriter(memoryWriter));
+ job.setException(memoryWriter.toString());
+ job.setRetries(job.getRetries()-1);
+ }
+ else {
+ // allowing a transaction to proceed after a persistence exception is unsafe
+ jbpmContext.setRollbackOnly();
+ }
}
// if this job is locked too long
@@ -181,7 +189,7 @@
try {
jbpmContext.close();
} catch (JbpmPersistenceException e) {
- // if this is a stale object exception, keep it quiet
+ // if this is a stale state exception, keep it quiet
if (Services.isCausedByStaleState(e)) {
log.debug("optimistic locking failed, couldn't complete job "+job);
} else {
@@ -190,6 +198,16 @@
}
}
}
+
+ private static boolean isPersistenceException(Throwable throwable) {
+ do {
+ if (throwable instanceof HibernateException)
+ return true;
+ throwable = throwable.getCause();
+ } while (throwable != null);
+ return false;
+ }
+
protected Date getNextDueDate() {
Date nextDueDate = null;
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ArrayUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ArrayUtil.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ArrayUtil.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -21,8 +21,12 @@
*/
package org.jbpm.util;
-public abstract class ArrayUtil {
+public class ArrayUtil {
+ private ArrayUtil() {
+ // hide default constructor to prevent instantiation
+ }
+
public static String toString(Object[] array) {
if (array==null) {
return "null";
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ByteUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ByteUtil.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ByteUtil.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -1,7 +1,10 @@
package org.jbpm.util;
+public class ByteUtil {
-public abstract class ByteUtil {
+ private ByteUtil() {
+ // hide default constructor to prevent instantiation
+ }
public static String toString(byte[] bytes) {
if (bytes == null) return "null";
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/ClassLoaderUtil.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -34,6 +34,10 @@
*/
public class ClassLoaderUtil {
+ private ClassLoaderUtil() {
+ // hide default constructor to prevent instantiation
+ }
+
public static Class loadClass(String className) {
try {
return getClassLoader().loadClass(className);
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/EqualsUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/EqualsUtil.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/EqualsUtil.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -21,8 +21,12 @@
*/
package org.jbpm.util;
-public abstract class EqualsUtil {
+public class EqualsUtil {
+ private EqualsUtil() {
+ // hide default constructor to prevent instantiation
+ }
+
public static boolean equals(Object thisObject, Object otherObject) {
if ( (thisObject==null) || (otherObject==null) ) return false;
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/IoUtil.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -28,10 +28,14 @@
import org.jbpm.JbpmException;
-public abstract class IoUtil {
+public class IoUtil {
- public static final int BUFFERSIZE = 4096;
+ private IoUtil() {
+ // hide default constructor to prevent instantiation
+ }
+ private static final int BUFFERSIZE = 4096;
+
public static byte[] readBytes(InputStream inputStream) throws IOException {
byte[] bytes = null;
if (inputStream==null) {
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/JndiUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/JndiUtil.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/JndiUtil.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -27,8 +27,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-public abstract class JndiUtil {
-
+public class JndiUtil {
+
+ private JndiUtil() {
+ // hide default constructor to prevent instantiation
+ }
+
public static Object lookup(String jndiName, Class type) {
Object object = null;
try {
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/StaticUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/StaticUtil.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/StaticUtil.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -26,7 +26,7 @@
import java.util.Iterator;
import java.util.Map;
-public abstract class StaticUtil {
+public class StaticUtil {
/*
public class MyClass ... {
@@ -45,7 +45,7 @@
...
}
*/
-
+
static Map initializers = Collections.synchronizedMap(new HashMap());
public abstract static class Initializer {
@@ -56,6 +56,28 @@
public abstract void init();
}
+ /*
+ public class MyClass ... {
+ static AType aStaticInMyClass = null;
+ static AnotherType anotherStaticInMyClass = null;
+
+ static {
+ new StaticUtil.Initializer(MyClass.class) {
+ public void init() {
+ // initialize static members here
+ aStaticInMyClass = ...;
+ anotherStaticInMyClass = ...;
+ }
+ };
+ }
+ ...
+ }
+ */
+
+ private StaticUtil() {
+ // hide default constructor to prevent instantiation
+ }
+
public static void add(Class clazz, Initializer initializer) {
initializers.put(clazz, initializer);
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/StringUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/StringUtil.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/StringUtil.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -10,6 +10,10 @@
static final byte[] HEX_CHAR_TABLE = { (byte) '0', (byte) '1', (byte) '2', (byte) '3', (byte) '4', (byte) '5', (byte) '6', (byte) '7', (byte) '8',
(byte) '9', (byte) 'a', (byte) 'b', (byte) 'c', (byte) 'd', (byte) 'e', (byte) 'f' };
+ private StringUtil() {
+ // hide default constructor to prevent instantiation
+ }
+
public static String toHexString(byte[] bytes) {
try {
byte[] hex = new byte[2 * bytes.length];
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -47,8 +47,12 @@
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
-public abstract class XmlUtil {
-
+public class XmlUtil {
+
+ private XmlUtil() {
+ // hide default constructor to prevent instantiation
+ }
+
public static Document parseXmlText(String xml) {
ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
return parseXmlInputSource(new InputSource(bais));
Modified: jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.mysql.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.mysql.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.mysql.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -4,8 +4,8 @@
<!-- JDBC connection properties (begin) -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
- <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpmtest</property>
- <property name="hibernate.connection.username">jbpmtest</property>
- <property name="hibernate.connection.password"></property>
+ <property name="hibernate.connection.url">jdbc:mysql://dev02.qa.atl.jboss.com:3306/jbpm</property>
+ <property name="hibernate.connection.username">jbpm</property>
+ <property name="hibernate.connection.password">jbpm</property>
<property name="hibernate.query.substitutions">true 1, false 0</property>
<!-- JDBC connection properties (end) -->
Modified: jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.postgresql.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.postgresql.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.postgresql.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -4,7 +4,7 @@
<!-- JDBC connection properties (begin) -->
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
- <property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/jbpmtest</property>
- <property name="hibernate.connection.username">jbpmtest</property>
- <property name="hibernate.connection.password"></property>
+ <property name="hibernate.connection.url">jdbc:postgresql://dev01.qa.atl.jboss.com:5432/jbpm</property>
+ <property name="hibernate.connection.username">jbpm</property>
+ <property name="hibernate.connection.password">jbpm</property>
<!-- JDBC connection properties (end) -->
Modified: jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.sybase.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.sybase.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/hibernate.properties.sybase.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -10,8 +10,8 @@
<property name="hibernate.dialect">org.hibernate.dialect.SybaseDialect</property>
<!-- JDBC connection properties (begin) -->
- <property name="hibernate.connection.driver_class">com.sybase.jdbc3.jdbc.SybDriver</property>
- <property name="hibernate.connection.url">jdbc:sybase:Tds:dev01.qa.atl.jboss.com:4100/jbpmteam</property>
+ <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
+ <property name="hibernate.connection.url">jdbc:jtds:sybase://dev01.qa.atl.jboss.com:4100/jbpmteam</property>
<property name="hibernate.connection.username">jbpmteam</property>
<property name="hibernate.connection.password">jbpmteam</property>
<!-- JDBC connection properties (end) -->
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -10,7 +10,7 @@
discriminator-value="I">
<any name="value" id-type="string" cascade="save-update">
<column name="STRINGIDCLASS_" />
- <column name="STRINGVALUE_" length="4000" />
+ <column name="STRINGVALUE_"/>
</any>
</subclass>
</hibernate-mapping>
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/JcrNodeInstance.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/JcrNodeInstance.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/JcrNodeInstance.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -17,7 +17,7 @@
<property name="repository" column="LONGIDCLASS_" />
<property name="workspace" column="STRINGIDCLASS_" />
- <property name="path" column="STRINGVALUE_" length="4000" />
+ <property name="path" column="STRINGVALUE_" type="text" />
</subclass>
</hibernate-mapping>
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -8,6 +8,6 @@
<subclass name="org.jbpm.context.exe.variableinstance.StringInstance"
extends="org.jbpm.context.exe.VariableInstance"
discriminator-value="S">
- <property name="value" type="string" column="STRINGVALUE_" length="4000"/>
+ <property name="value" type="text" column="STRINGVALUE_"/>
</subclass>
</hibernate-mapping>
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -9,16 +9,8 @@
<subclass name="org.jbpm.context.log.variableinstance.StringUpdateLog"
extends="org.jbpm.context.log.VariableUpdateLog"
discriminator-value="U">
- <property name="oldValue" column="OLDSTRINGVALUE_" length="4000">
- <type name="string_max">
- <param name="length">4000</param>
- </type>
- </property>
- <property name="newValue" column="NEWSTRINGVALUE_" length="4000">
- <type name="string_max">
- <param name="length">4000</param>
- </type>
- </property>
+ <property name="oldValue" column="OLDSTRINGVALUE_" type="text"/>
+ <property name="newValue" column="NEWSTRINGVALUE_" type="text"/>
</subclass>
</hibernate-mapping>
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -6,8 +6,6 @@
<hibernate-mapping>
- <typedef class="org.jbpm.db.hibernate.StringMax" name="string_max" />
-
<!-- related to ProcessDefintion -->
<!-- ########################### -->
@@ -358,9 +356,9 @@
<query name="TaskMgmtSession.findPooledTaskInstancesByActorId">
<![CDATA[
- select distinct ti
- from org.jbpm.taskmgmt.exe.PooledActor pooledActor
- join pooledActor.taskInstances ti
+ select ti
+ from org.jbpm.taskmgmt.exe.TaskInstance ti
+ join ti.pooledActors pooledActor
where pooledActor.actorId = :swimlaneActorId
and ti.actorId is null
and ti.isSuspended != true
@@ -370,9 +368,9 @@
<query name="TaskMgmtSession.findPooledTaskInstancesByActorIds">
<![CDATA[
- select distinct ti
- from org.jbpm.taskmgmt.exe.PooledActor pooledActor
- join pooledActor.taskInstances ti
+ select ti
+ from org.jbpm.taskmgmt.exe.TaskInstance ti
+ join ti.pooledActors pooledActor
where pooledActor.actorId in ( :actorIds )
and ti.actorId is null
and ti.isSuspended != true
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -30,6 +30,7 @@
<string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
<string name="resource.mail.templates" value="jbpm.mail.templates.xml" />
+ <!-- make sure the block size matches the length in ByteArray.hbm.xml -->
<int name="jbpm.byte.block.size" value="1024" singleton="true" />
<bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
<bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/action/Script.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/action/Script.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/action/Script.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -7,7 +7,7 @@
<subclass name="org.jbpm.graph.action.Script"
discriminator-value="S"
extends="org.jbpm.graph.def.Action">
- <property name="expression" column="EXPRESSION_" length="4000" />
+ <property name="expression" column="EXPRESSION_" type="text" />
<set name="variableAccesses" cascade="all">
<key column="SCRIPT_" foreign-key="FK_VARACC_SCRIPT"/>
<one-to-many class="org.jbpm.context.def.VariableAccess" />
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/ExceptionHandler.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/ExceptionHandler.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/ExceptionHandler.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -8,7 +8,8 @@
table="JBPM_EXCEPTIONHANDLER">
<id name="id" column="ID_"><generator class="native" /></id>
- <property name="exceptionClassName" column="EXCEPTIONCLASSNAME_" length="4000"/>
+ <property name="exceptionClassName" column="EXCEPTIONCLASSNAME_"
+ type="text" />
<any name="graphElement" id-type="long" meta-type="char">
<meta-value value="A" class="org.jbpm.taskmgmt.def.Task"/>
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/Node.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/Node.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/Node.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -25,11 +25,7 @@
<!-- GRAPHELEMENT -->
<property name="name" column="NAME_"/>
- <property name="description" column="DESCRIPTION_" length="4000">
- <type name="string_max">
- <param name="length">4000</param>
- </type>
- </property>
+ <property name="description" column="DESCRIPTION_" type="text"/>
<many-to-one name="processDefinition"
column="PROCESSDEFINITION_"
foreign-key="FK_NODE_PROCDEF"
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/ProcessDefinition.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/ProcessDefinition.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/ProcessDefinition.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -13,11 +13,7 @@
<!-- GRAPHELEMENT -->
<!-- base class fields are mapped here -->
<property name="name" column="NAME_" />
- <property name="description" column="DESCRIPTION_" length="4000">
- <type name="string_max">
- <param name="length">4000</param>
- </type>
- </property>
+ <property name="description" column="DESCRIPTION_" type="text"/>
<map name="events" cascade="all">
<key column="PROCESSDEFINITION_" foreign-key="FK_EVENT_PROCDEF" />
<index column="EVENTTYPE_" type="string"/>
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/Transition.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/Transition.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/def/Transition.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -10,11 +10,7 @@
<!-- GRAPHELEMENT -->
<property name="name" column="NAME_"/>
- <property name="description" column="DESCRIPTION_" length="4000">
- <type name="string_max">
- <param name="length">4000</param>
- </type>
- </property>
+ <property name="description" column="DESCRIPTION_" type="text"></property>
<many-to-one name="processDefinition"
column="PROCESSDEFINITION_"
foreign-key="FK_TRANS_PROCDEF"
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/exe/Comment.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/exe/Comment.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/exe/Comment.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -11,11 +11,7 @@
<property name="actorId" column="ACTORID_"/>
<property name="time" column="TIME_"/>
- <property name="message" column="MESSAGE_" length="4000">
- <type name="string_max">
- <param name="length">4000</param>
- </type>
- </property>
+ <property name="message" column="MESSAGE_" type="text"/>
<many-to-one name="token"
column="TOKEN_"
foreign-key="FK_COMMENT_TOKEN"
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/graph/log/ActionLog.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -10,13 +10,7 @@
extends="org.jbpm.logging.log.ProcessLog"
discriminator-value="A">
- <property name="exception"
- column="EXCEPTION_"
- length="4000">
- <type name="string_max">
- <param name="length">4000</param>
- </type>
- </property>
+ <property name="exception" column="EXCEPTION_" type="text"/>
<many-to-one name="action"
column="ACTION_"
class="org.jbpm.graph.def.Action"
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/instantiation/Delegation.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/instantiation/Delegation.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/instantiation/Delegation.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -8,8 +8,8 @@
table="JBPM_DELEGATION">
<id name="id" column="ID_"><generator class="native" /></id>
- <property name="className" column="CLASSNAME_" length="4000"/>
- <property name="configuration" column="CONFIGURATION_" length="4000"/>
+ <property name="className" column="CLASSNAME_" type="text" />
+ <property name="configuration" column="CONFIGURATION_" type="text" />
<property name="configType" column="CONFIGTYPE_"/>
<many-to-one name="processDefinition"
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/job/Job.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/job/Job.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/job/Job.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -35,11 +35,7 @@
<property name="isExclusive" column="ISEXCLUSIVE_" />
<property name="lockOwner" column="LOCKOWNER_" />
<property name="lockTime" column="LOCKTIME_" />
- <property name="exception" column="EXCEPTION_" length="4000">
- <type name="string_max">
- <param name="length">4000</param>
- </type>
- </property>
+ <property name="exception" column="EXCEPTION_" type="text"/>
<property name="retries" column="RETRIES_" />
</class>
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/logging/log/MessageLog.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/logging/log/MessageLog.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/logging/log/MessageLog.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -9,11 +9,7 @@
<subclass name="org.jbpm.logging.log.MessageLog"
extends="org.jbpm.logging.log.ProcessLog"
discriminator-value="M">
- <property name="message" column="MESSAGE_" length="4000">
- <type name="string_max">
- <param name="length">4000</param>
- </type>
- </property>
+ <property name="message" column="MESSAGE_" type="text"/>
</subclass>
</hibernate-mapping>
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/module/def/ModuleDefinition.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/module/def/ModuleDefinition.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/module/def/ModuleDefinition.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -21,7 +21,7 @@
<!-- : -->
<!-- : -->
- <property name="name" column="NAME_" length="4000"/>
+ <property name="name" column="NAME_"/>
<many-to-one name="processDefinition"
column="PROCESSDEFINITION_"
foreign-key="FK_MODDEF_PROCDEF"
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/taskmgmt/def/Task.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/taskmgmt/def/Task.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/taskmgmt/def/Task.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -12,11 +12,7 @@
<!-- GRAPHELEMENT -->
<property name="name" column="NAME_" />
- <property name="description" column="DESCRIPTION_" length="4000">
- <type name="string_max">
- <param name="length">4000</param>
- </type>
- </property>
+ <property name="description" column="DESCRIPTION_" type="text"/>
<many-to-one name="processDefinition"
column="PROCESSDEFINITION_"
foreign-key="FK_TASK_PROCDEF"
Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -14,11 +14,7 @@
<version name="version" column="VERSION_" />
<property name="name" column="NAME_" />
- <property name="description" column="DESCRIPTION_" length="4000">
- <type name="string_max">
- <param name="length">4000</param>
- </type>
- </property>
+ <property name="description" column="DESCRIPTION_" type="text"/>
<property name="actorId" column="ACTORID_" index="IDX_TASK_ACTORID"/>
<property name="create" column="CREATE_" />
<property name="start" column="START_" />
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -99,7 +99,6 @@
"org.jbpm.security.authorizer.JbpmIdentityAuthorizer",
"org.jbpm.security.authorizer.RolesAuthorizer",
"org.jbpm.security.filter.JbpmAuthenticationFilter",
- "org.jbpm.util.ClassLoaderUtil",
"org.jbpm.command.service.CommandServiceImpl",
"org.jbpm.msg.jms.JmsCommandFactory",
"org.jbpm.msg.jms.JmsMessageConstants",
@@ -147,9 +146,10 @@
private void assertSerializabilityOfClass(String className) {
Class clazz = ClassLoaderUtil.loadClass(className);
- if ( ! ( (Serializable.class.isAssignableFrom(clazz))
- || (Modifier.isAbstract(clazz.getModifiers()))
- || (isExcused(className))
+ if ( ! ( Serializable.class.isAssignableFrom(clazz)
+ || Modifier.isAbstract(clazz.getModifiers())
+ || isExcused(className)
+ || clazz.getConstructors().length == 0
)
) {
fail(className+" is NOT Serializable");
@@ -168,5 +168,4 @@
return isExcused;
}
- // private static final Log log = LogFactory.getLog(SerializabilityTest.class);
}
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/bytes/ByteArrayDbTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/bytes/ByteArrayDbTest.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/bytes/ByteArrayDbTest.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -75,7 +75,7 @@
assertNull(retrievedByteArray.getBytes());
}
- private byte[] getMultipleBlockBytes() {
+ private static byte[] getMultipleBlockBytes() {
String text = "muchos bytes"; // (10 bytes)
for (int i=0; i<8; i++) text+=text;
// now text should be 2560 bytes
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/bytes/ByteArrayTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/bytes/ByteArrayTest.java 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/bytes/ByteArrayTest.java 2008-09-29 17:44:30 UTC (rev 2440)
@@ -21,25 +21,31 @@
*/
package org.jbpm.bytes;
+import java.util.List;
+
import org.jbpm.AbstractJbpmTestCase;
+import org.jbpm.JbpmConfiguration;
public class ByteArrayTest extends AbstractJbpmTestCase {
- public void testByteChopping2Blocks() {
- ByteArray byteArray = new ByteArray(new byte[2048]);
- assertEquals(2, byteArray.byteBlocks.size());
+ public void testByteChoppingBlockCount() {
+ int blockSize = JbpmConfiguration.Configs.getInt("jbpm.byte.block.size");
+ for (int arrayLength = 125; arrayLength <= 1000; arrayLength *= 2) {
+ ByteArray byteArray = new ByteArray(new byte[arrayLength]);
+ int blockCount = arrayLength / blockSize;
+ if (arrayLength % blockSize > 0) blockCount++;
+ List byteBlocks = byteArray.byteBlocks;
+ assertEquals(blockCount, byteBlocks.size());
+ }
}
- public void testByteChopping3Blocks() {
- ByteArray byteArray = new ByteArray(new byte[2049]);
- assertEquals(3, byteArray.byteBlocks.size());
+ public void testReassembling() {
+ for (int arrayLength = 125; arrayLength <= 1000; arrayLength *= 2) {
+ ByteArray byteArray = new ByteArray(new byte[arrayLength]);
+ assertEquals(arrayLength, byteArray.getBytes().length);
+ }
}
- public void testReassembling() {
- ByteArray byteArray = new ByteArray(new byte[2049]);
- assertEquals(2049, byteArray.getBytes().length);
- }
-
public void testEquals() {
ByteArray left = new ByteArray("the same bytes".getBytes());
ByteArray right = new ByteArray("the same bytes".getBytes());
Deleted: jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/package.html
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/package.html 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/package.html 2008-09-29 17:44:30 UTC (rev 2440)
@@ -1,4 +0,0 @@
-<body>
-is the package that contains the context module, adding
-process variables to the graph execution.
-</body>
\ No newline at end of file
Modified: jbpm3/trunk/modules/enterprise/jar/pom.xml
===================================================================
--- jbpm3/trunk/modules/enterprise/jar/pom.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/enterprise/jar/pom.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -227,7 +227,7 @@
</property>
<property>
<name>log4j.output.dir</name>
- <value>${project.build.directory}</value>
+ <value>${basedir}/target</value>
</property>
</systemProperties>
</configuration>
Modified: jbpm3/trunk/modules/simulation/src/tutorial/org/jbpm/sim/tutorial/jbpm.mysql.cfg.xml
===================================================================
--- jbpm3/trunk/modules/simulation/src/tutorial/org/jbpm/sim/tutorial/jbpm.mysql.cfg.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/modules/simulation/src/tutorial/org/jbpm/sim/tutorial/jbpm.mysql.cfg.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -1,51 +1,6 @@
<jbpm-configuration>
- <!--
- This configuration is used when there is no jbpm.cfg.xml file found in the
- root of the classpath. It is a very basic configuration without persistence
- and message services. Only the authorization service installed.
- You can parse and create processes, but when you try to use one of the
- unavailable services, you'll get an exception.
- -->
-
- <jbpm-context>
- <service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />
- <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
- <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
- <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
- <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
- <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
- </jbpm-context>
-
<!-- configuration property used by persistence service impl org.jbpm.persistence.db.DbPersistenceServiceFactory -->
<string name="resource.hibernate.cfg.xml" value="/org/jbpm/sim/tutorial/hibernate.mysql.cfg.xml" />
- <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
- <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
- <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
- <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
- <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
- <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
- <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
- <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
- <string name="resource.mail.templates" value="jbpm.mail.templates.xml" />
-
- <int name="jbpm.byte.block.size" value="1024" singleton="true" />
- <string name="jbpm.mail.smtp.host" value="localhost" />
- <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
- <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
- <bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
-
- <bean name="jbpm.job.executor" class="org.jbpm.job.executor.JobExecutor">
- <field name="jbpmConfiguration"><ref bean="jbpmConfiguration" /></field>
- <field name="name"><string value="JbpmJobExector" /></field>
- <field name="nbrOfThreads"><int value="1" /></field>
- <field name="idleInterval"><int value="5000" /></field>
- <field name="maxIdleInterval"><int value="3600000" /></field> <!-- 1 hour -->
- <field name="historyMaxSize"><int value="20" /></field>
- <field name="maxLockTime"><int value="600000" /></field> <!-- 10 minutes -->
- <field name="lockMonitorInterval"><int value="60000" /></field> <!-- 1 minute -->
- <field name="lockBufferTime"><int value="5000" /></field> <!-- 5 seconds -->
- </bean>
-
</jbpm-configuration>
Modified: jbpm3/trunk/pom.xml
===================================================================
--- jbpm3/trunk/pom.xml 2008-09-29 15:55:54 UTC (rev 2439)
+++ jbpm3/trunk/pom.xml 2008-09-29 17:44:30 UTC (rev 2440)
@@ -566,7 +566,14 @@
<groupId>com.sybase</groupId>
<artifactId>jconnect</artifactId>
<version>6.0.5</version>
+ <scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>net.sourceforge.jtds</groupId>
+ <artifactId>jtds</artifactId>
+ <version>1.2.2</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<repositories>
<repository>
15 years, 8 months
JBoss JBPM SVN: r2439 - in projects/spec/trunk/modules: api/src/main/java/org/jbpm/api/model and 18 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-29 11:55:54 -0400 (Mon, 29 Sep 2008)
New Revision: 2439
Added:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Deployment.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandlerService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/ProcessBuilderTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/TestProcessBuilder.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/PropertyImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MutableToken.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionManagerImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/SignalServiceImpl.java
Removed:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/Deployment.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java
projects/spec/trunk/modules/cts/src/test/java/org/jboss/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processbuilder/
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/Node.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/NodeImpl.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/Process.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcessImpl.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/SequenceFlow.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/SequenceFlowImpl.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/ProcessBuilderTest.java
projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/TestProcessBuilder.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceService.java
Modified:
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Property.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SequenceFlowImpl.java
projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
Log:
wip
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Deployment.java (from rev 2418, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/Deployment.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Deployment.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/Deployment.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Serializable;
+import java.net.URI;
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.service.DialectHandler;
+import org.jbpm.api.service.DialectHandlerService;
+import org.jbpm.api.service.ProcessService;
+
+/**
+ * A deployment, containing all information to create a process that will be deployed to the {@link ProcessService}
+ *
+ * @author Tom Baeyens
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Sep-2008
+ */
+public class Deployment implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private String procXML;
+ private Process process;
+
+ public Deployment(String procXML)
+ {
+ if (procXML == null)
+ throw new IllegalArgumentException("Null process definition");
+
+ this.procXML = procXML;
+ }
+
+ public Deployment(URL procURL) throws IOException
+ {
+ if (procURL == null)
+ throw new IllegalArgumentException("Null process definition");
+
+ StringBuilder strBuilder = new StringBuilder();
+ BufferedReader br = new BufferedReader(new InputStreamReader(procURL.openStream()));
+ String line = br.readLine();
+ while (line != null)
+ {
+ strBuilder.append(line);
+ line = br.readLine();
+ }
+ procXML = strBuilder.toString();
+ }
+
+ public Deployment(Process process)
+ {
+ this.process = process;
+ }
+
+ public Process getProcess()
+ {
+ if (process == null)
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ DialectHandlerService dhService = engine.getService(DialectHandlerService.class);
+ if (dhService == null)
+ throw new IllegalStateException("DialectHandlerService not registered");
+
+ URI nsURI = getNamespaceURI();
+ DialectHandler dialectHandler = dhService.getDialectHandler(nsURI);
+ if (dialectHandler == null)
+ throw new IllegalStateException("Cannot obtain DialectHandler for: " + nsURI);
+
+ process = dialectHandler.createProcess(procXML);
+ }
+ return process;
+ }
+
+ private URI getNamespaceURI()
+ {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ Document doc;
+ try
+ {
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ doc = db.parse(new ByteArrayInputStream(procXML.getBytes()));
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot parse process descriptor", ex);
+ }
+
+ Element root = doc.getDocumentElement();
+ String nsURI = root.getNamespaceURI();
+ if (nsURI == null)
+ throw new IllegalStateException("Cannot get namespace URI from root element");
+
+ return URI.create(nsURI);
+ }
+}
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.client;
+
+//$Id$
+
+import org.jbpm.api.model.Signal;
+
+/**
+ * A signal listener that can be registered with the {@link SignalService}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalListener
+{
+ /**
+ * Returns true if the listener accepts a given signal
+ */
+ boolean acceptSignal(Signal signal);
+
+ /**
+ * Catch a previously accepted signal
+ */
+ void catchSignal(Signal signal);
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/client/SignalListener.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -21,23 +21,32 @@
*/
package org.jbpm.api.model;
-// $Id$
+//$Id$
+import org.jbpm.api.runtime.ExecutionHandler;
+import org.jbpm.api.runtime.FlowHandler;
+import org.jbpm.api.runtime.SignalHandler;
+
/**
* A Node is an abstract element with a name and an associated process
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Node extends AbstractElement
+public interface Node extends AbstractElement, PropertySupport
{
- /**
- * Get the unique name.
- */
+ /** Get the associated Process */
+ Process getProcess();
+
+ /** Get the unique name. */
String getName();
- /**
- * Get the associated Process
- */
- Process getProcess();
+ /** Get the associated ExecutionHandler */
+ ExecutionHandler getExecutionHandler();
+
+ /** Get the associated SignalHandler */
+ SignalHandler getSignalHandler();
+
+ /** Get the associated FlowHandler */
+ FlowHandler getFlowHandler();
}
\ No newline at end of file
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Process.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -35,7 +35,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Process extends AbstractElement
+public interface Process extends AbstractElement, PropertySupport
{
/**
* Defines the status a {@link Process} can be in
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Property.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Property.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/Property.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -21,6 +21,8 @@
*/
package org.jbpm.api.model;
+import java.io.Serializable;
+
// $Id$
/**
@@ -29,7 +31,7 @@
* @author thomas.diesler(a)jboss.com
* @since 21-Jul-2008
*/
-public interface Property
+public interface Property extends Serializable
{
/**
* Each Property has a Name (e.g., name=”Customer Name”).
@@ -37,9 +39,9 @@
String getName();
/**
- * Get the body of the expression value.
+ * Get the property value.
*/
- Object getValue();
+ String getValue();
/**
* If the Correlation attribute is set to True, then the Property is marked to be used for
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -23,7 +23,7 @@
//$Id$
-import java.util.List;
+import java.util.Set;
/**
* Property support
@@ -41,5 +41,5 @@
/**
* Get the list of property names
*/
- List<String> getPropertyNames();
+ Set<String> getPropertyNames();
}
\ No newline at end of file
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+//$Id$
+
+
+/**
+ * The ProcessEngine invokes the ExecutionHandler on a
+ * {@link Node} to execute user provided business logic.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ExecutionHandler
+{
+ /**
+ * Execute the associated business logic.
+ */
+ void execute(Token token);
+
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
+
+/**
+ * The {@link ProcessEngine} invokes the FlowHandler on a {@link Node}
+ * to move the {@link Token} to the next {@link Node}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface FlowHandler
+{
+ /**
+ * Execute the FlowHandler.
+ * <p/>
+ * The FlowHandler typically invoves one of the {@link TokenExecutor}
+ * methods to move the {@link Token} to the next {@link Node}.
+ */
+ void execute(TokenExecutor tokenExecutor, Token token);
+
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Signal;
+
+/**
+ * The {@link ProcessEngine} invokes the SignalHandler on a {@link Node}
+ * to send {@link Signal}s.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalHandler
+{
+ /**
+ * Get signal for enter
+ */
+ void throwEnterSignal(Token token);
+
+ /**
+ * Get signal for exit
+ */
+ void throwExitSignal(Token token);
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/Deployment.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/Deployment.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/Deployment.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,102 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.service;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * A deployment, containing all information to create a process that will be deployed to the {@link ProcessService}
- *
- * @author Tom Baeyens
- * @author thomas.diesler(a)jboss.com
- * @since 25-Sep-2008
- */
-public class Deployment implements Serializable
-{
- private static final long serialVersionUID = 1L;
-
- private String procXML;
-
- public Deployment(String procXML)
- {
- if (procXML == null)
- throw new IllegalArgumentException("Null process definition");
-
- this.procXML = procXML;
- }
-
- public Deployment(URL procURL) throws IOException
- {
- if (procURL == null)
- throw new IllegalArgumentException("Null process definition");
-
- StringBuilder strBuilder = new StringBuilder();
- BufferedReader br = new BufferedReader(new InputStreamReader(procURL.openStream()));
- String line = br.readLine();
- while (line != null)
- {
- strBuilder.append(line);
- line = br.readLine();
- }
- procXML = strBuilder.toString();
- }
-
- public String getProcessXML()
- {
- return procXML;
- }
-
- public URI getNamespaceURI()
- {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
- Document doc;
- try
- {
- DocumentBuilder db = dbf.newDocumentBuilder();
- doc = db.parse(new ByteArrayInputStream(procXML.getBytes()));
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot parse process descriptor", ex);
- }
-
- Element root = doc.getDocumentElement();
- String nsURI = root.getNamespaceURI();
- if (nsURI == null)
- throw new IllegalStateException("Cannot get namespace URI from root element");
-
- return URI.create(nsURI);
- }
-}
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -25,6 +25,7 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Deployment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -27,6 +27,7 @@
import java.io.Writer;
import java.net.URI;
import java.net.URL;
+import org.jbpm.api.model.Process;
/**
* The DialectHandler converts a supported dialect to the Process model.
Copied: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandlerService.java (from rev 2418, projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java)
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandlerService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectHandlerService.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import java.net.URI;
+import java.util.Map;
+
+
+/**
+ * A registry that maps namespaceURI to a {@link DialectHandler}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jul-2008
+ */
+public abstract class DialectHandlerService
+{
+ // Maps namespaceURI to a DialectHandler
+ protected Map<URI, DialectHandler> dialectHandlers;
+
+ /**
+ * Get the handler for the dialect with the given namespace URI
+ */
+ public DialectHandler getDialectHandler(URI nsURI)
+ {
+ DialectHandler dialectHandler = dialectHandlers.get(nsURI);
+ if (dialectHandler == null)
+ throw new IllegalStateException("No dialect handler registered for: " + nsURI);
+
+ return dialectHandler;
+ }
+
+}
Deleted: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.service;
-
-//$Id$
-
-import java.net.URI;
-import java.util.Map;
-
-
-/**
- * A registry that maps namespaceURI to a {@link DialectHandler}
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jul-2008
- */
-public abstract class DialectRegistry
-{
- // Maps namespaceURI to a DialectHandler
- protected Map<URI, DialectHandler> dialectHandlers;
-
- /**
- * Get the handler for the dialect with the given namespace URI
- */
- public DialectHandler getDialectHandler(URI nsURI)
- {
- DialectHandler dialectHandler = dialectHandlers.get(nsURI);
- if (dialectHandler == null)
- throw new IllegalStateException("No dialect handler registered for: " + nsURI);
-
- return dialectHandler;
- }
-
-}
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+// $Id$
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.StartEvent;
+import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.runtime.Attachments;
+
+/**
+ * The ExecutionService executes processes
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public abstract class ExecutionService implements Service
+{
+ private ExecutorService procExecutor = Executors.newCachedThreadPool();
+
+ // Hide public constructor
+ protected ExecutionService()
+ {
+ }
+
+ /**
+ * Get the process executor service
+ */
+ public ExecutorService getProcessExecutor()
+ {
+ return procExecutor;
+ }
+
+ /**
+ * Start the Process
+ *
+ * @param proc The Process to start
+ * @param att The Attachments in the ExecutionContext
+ */
+ public abstract void startProcess(Process proc, Attachments att);
+
+ /**
+ * Start the Process from a given start event
+ *
+ * @param start The StartEvent that triggers the process
+ * @param att The Attachments in the ExecutionContext
+ */
+ public abstract void startProcess(StartEvent start, Attachments att);
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
+ * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends without
+ * timeout.
+ */
+ public abstract ProcessStatus waitForEnd(Process proc);
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event. The
+ * Process will be in a running state until all Tokens are consumed. <p/> This method until the process ends with a
+ * given timeout.
+ */
+ public abstract ProcessStatus waitForEnd(Process proc, long timeout);
+}
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ExecutionService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -31,7 +31,10 @@
import javax.management.ObjectName;
+import org.jbpm.api.client.Deployment;
import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Process.ProcessStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,44 +49,99 @@
// Provide logging
final static Logger log = LoggerFactory.getLogger(ProcessService.class);
- // The associated ProcessEngine
- private ProcessEngine processEngine;
// The set of registered processes
- private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
+ private Map<ObjectName, Process> registeredProcs = new HashMap<ObjectName, Process>();
// Hide public constructor
protected ProcessService()
{
}
+ /**
+ * Deploy a new process to the process service.
+ */
+ public ObjectName deploy(Deployment dep)
+ {
+ // Get the process from the deployment
+ Process proc = dep.getProcess();
+ if (proc == null)
+ throw new IllegalStateException("Cannot obtain process from: " + dep);
+
+ // Save the process if the PersistenceService is registered
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ PersistenceService dbService = engine.getService(PersistenceService.class);
+ if (dbService != null)
+ dbService.saveProcess(proc);
+
+ registerProcess(proc);
+ return proc.getKey();
+ }
+
/**
- * Get the associated ProcessEngine
+ * Register a Process.
*/
- public ProcessEngine getProcessEngine()
+ public void registerProcess(Process proc)
{
- return processEngine;
+ log.debug("registerProcess: " + proc);
+ registeredProcs.put(proc.getKey(), proc);
}
- public void setProcessEngine(ProcessEngine processEngine)
+ /**
+ * Unregister a Process.
+ */
+ public void unregisterProcess(Process proc)
{
- this.processEngine = processEngine;
+ log.debug("unregisterProcess: " + proc);
+ registeredProcs.remove(proc.getKey());
}
-
- /**
- * Deploy a new process to the process service.
+
+ /**
+ * Unregister a set of Processes by name.
*/
- public ObjectName deploy(Deployment deployment)
+ public void unregisterProcess(String procName)
{
+ log.debug("unregisterProcess: " + procName);
- return null;
+ for (Process proc : getProcesses(procName, null))
+ unregisterProcess(proc);
}
-
+
/**
+ * Get a Process for a given id
+ */
+ public Process getProcessByKey(ObjectName procID)
+ {
+ Process proc = registeredProcs.get(procID);
+ return proc;
+ }
+
+ /**
* Get the set of registered Processes
*/
public Set<Process> getProcesses()
{
- Set<Process> procSet = new HashSet<Process>(procs.values());
+ Set<Process> procSet = new HashSet<Process>(registeredProcs.values());
return Collections.unmodifiableSet(procSet);
}
+
+ /**
+ * Find the set of Processes for a given name
+ *
+ * @param name The process name
+ * @param status The optional process status
+ * @return An empty set if the process cannot be found
+ */
+ public Set<Process> getProcesses(String name, ProcessStatus status)
+ {
+ Set<Process> procSet = new HashSet<Process>();
+ for (Process aux : registeredProcs.values())
+ {
+ if (aux.getName().equals(name))
+ {
+ if (status == null || aux.getProcessStatus() == status)
+ procSet.add(aux);
+ }
+ }
+ return procSet;
+ }
}
\ No newline at end of file
Added: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java (rev 0)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Signal;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A {@link Signal} is like an undirected flare shot up
+ * into the air. A component can register a {@link SignalListener} with the SignalService.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public abstract class SignalService implements Service
+{
+ // provide logging
+ final static Logger log = LoggerFactory.getLogger(SignalService.class);
+
+ // The map of registered signal listeners
+ private Set<SignalListener> listeners = new HashSet<SignalListener>();
+
+ /**
+ * Add a SignalListener for a given source
+ */
+ public void addSignalListener(SignalListener listener)
+ {
+ synchronized (listeners)
+ {
+ log.debug("addSignalListener: " + listener);
+ listeners.add(listener);
+ }
+ }
+
+ /**
+ * Get the set of registered SignalListeners
+ */
+ public Set<SignalListener> getSignalListeners()
+ {
+ synchronized (listeners)
+ {
+ HashSet<SignalListener> set = new HashSet<SignalListener>(listeners);
+ return Collections.unmodifiableSet(set);
+ }
+ }
+
+ /**
+ * Remove a SignalListener for a given source
+ */
+ public void removeSignalListener(SignalListener listener)
+ {
+ synchronized (listeners)
+ {
+ log.debug("removeSignalListener: " + listener);
+ listeners.remove(listener);
+ }
+ }
+
+ /**
+ * Throw a signal to all registered listeners
+ */
+ public void throwSignal(Signal signal)
+ {
+ log.debug("throwSignal: " + signal);
+ Set<SignalListener> currentSet = getSignalListeners();
+ for (SignalListener listener : currentSet)
+ {
+ if (failsafeAccept(listener, signal))
+ failsafeThrow(listener, signal);
+ }
+ }
+
+ private boolean failsafeAccept(SignalListener listener, Signal signal)
+ {
+ try
+ {
+ boolean accept = listener.acceptSignal(signal);
+ return accept;
+ }
+ catch (RuntimeException rte)
+ {
+ log.error("Signal processing error", rte);
+ return false;
+ }
+ }
+
+ private void failsafeThrow(SignalListener listener, Signal signal)
+ {
+ try
+ {
+ listener.catchSignal(signal);
+ }
+ catch (RuntimeException rte)
+ {
+ log.error("Signal processing error", rte);
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/service/SignalService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
===================================================================
--- projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -24,9 +24,21 @@
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import javax.management.ObjectName;
+
import junit.framework.TestCase;
+import org.jbpm.api.Constants;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.SignalListener;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.builder.ObjectNameFactory;
+import org.jbpm.api.service.SignalService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -42,18 +54,47 @@
final Logger log = LoggerFactory.getLogger(CTSTestCase.class);
private CTSTestHelper delegate = new CTSTestHelper();
+ // The embedded SignalListener
+ private SignalListener signalListener;
+ // The signals caught by this test case
+ private List<Signal> signals = new ArrayList<Signal>();
@Override
protected void setUp() throws Exception
{
log.debug("### START " + getLongName());
super.setUp();
+
+ // Setup the SignalListener
+ clearAllSignalListeners();
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ SignalService sigService = engine.getService(SignalService.class);
+ sigService.addSignalListener(getSignalListener());
+ synchronized (signals)
+ {
+ signals.clear();
+ }
}
@Override
protected void tearDown() throws Exception
{
super.tearDown();
+
+ // Tear down the SignalListener
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ SignalService sigService = engine.getService(SignalService.class);
+ sigService.removeSignalListener(getSignalListener());
+
+ // Check that there are no registered signal listeners left
+ Set<SignalListener> sigListeners = sigService.getSignalListeners();
+ if (sigListeners.size() > 0)
+ {
+ String logMsg = "Registered signal listeners on tear down of " + getName() + ": " + sigListeners;
+ System.out.println(logMsg);
+ log.warn(logMsg);
+ }
+
log.debug("### END " + getLongName());
}
@@ -67,8 +108,84 @@
return delegate.getResourceFile(resource);
}
+ protected String getShortName()
+ {
+ String shortName = getClass().getName();
+ shortName = shortName.substring(shortName.lastIndexOf(".") + 1);
+ return shortName;
+ }
+
protected String getLongName()
{
return getClass().getName() + "." + getName();
}
+
+ public ObjectName getTestID()
+ {
+ String shortName = getShortName();
+ shortName = shortName.replace("DescriptorTest", "Test");
+ shortName = shortName.replace("MarshallerTest", "Test");
+ return ObjectNameFactory.create(Constants.ID_DOMAIN, "test", shortName);
+ }
+
+ public List<Signal> getSignals()
+ {
+ synchronized (signals)
+ {
+ return Collections.unmodifiableList(signals);
+ }
+ }
+
+ public List<Signal> getSignals(Signal.SignalType type)
+ {
+ synchronized (signals)
+ {
+ List<Signal> retSignals = new ArrayList<Signal>();
+ for (Signal sig : signals)
+ {
+ if (sig.getSignalType() == type)
+ retSignals.add(sig);
+ }
+ return Collections.unmodifiableList(retSignals);
+ }
+ }
+
+ private void clearAllSignalListeners()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ SignalService sigService = engine.getService(SignalService.class);
+ Set<SignalListener> sigListeners = sigService.getSignalListeners();
+ for (SignalListener sigListener : sigListeners)
+ {
+ sigService.removeSignalListener(sigListener);
+ }
+ }
+
+ public SignalListener getSignalListener()
+ {
+ if (signalListener == null)
+ {
+ signalListener = new SignalListener()
+ {
+ public boolean acceptSignal(Signal signal)
+ {
+ return true;
+ }
+
+ public void catchSignal(Signal signal)
+ {
+ synchronized (signals)
+ {
+ signals.add(signal);
+ }
+ }
+
+ public String toString()
+ {
+ return "SignalListener[" + getShortName() + "]";
+ }
+ };
+ }
+ return signalListener;
+ }
}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence (from rev 2418, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence)
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/Node.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/Node.java 2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/Node.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,16 +0,0 @@
-package org.jbpm.test.cts.persistence;
-
-import java.util.List;
-
-public interface Node
-{
-
- public abstract Process getProcess();
-
- public abstract String getName();
-
- public abstract List<SequenceFlow> getInFlows();
-
- public abstract List<SequenceFlow> getOutFlows();
-
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/NodeImpl.java 2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/NodeImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,92 +0,0 @@
-/**
- *
- */
-package org.jbpm.test.cts.persistence;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
-
-import org.hibernate.annotations.IndexColumn;
-
-@Entity
-public class NodeImpl implements Node
-{
- @Id
- @GeneratedValue
- public Integer id;
- @Basic
- private String name;
- @ManyToOne(targetEntity = ProcessImpl.class)
- private Process process;
- @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "target", targetEntity = SequenceFlowImpl.class)
- @IndexColumn(name = "targetIndex")
- private List<SequenceFlow> inFlows = new ArrayList<SequenceFlow>();
- @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "source", targetEntity = SequenceFlowImpl.class)
- @IndexColumn(name = "sourceIndex")
- private List<SequenceFlow> outFlows = new ArrayList<SequenceFlow>();
-
- public NodeImpl()
- {
- }
-
- public NodeImpl(String name)
- {
- this.name = name;
- }
-
- public Process getProcess()
- {
- return process;
- }
-
- public void setProcess(Process process)
- {
- this.process = process;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public List<SequenceFlow> getInFlows()
- {
- return inFlows;
- }
-
- public void setInFlows(List<SequenceFlow> inFlows)
- {
- this.inFlows = inFlows;
- }
-
- public List<SequenceFlow> getOutFlows()
- {
- return outFlows;
- }
-
- public void setOutFlows(List<SequenceFlow> flows)
- {
- this.outFlows = flows;
- }
-
- @Override
- public String toString()
- {
- return "[name=" + name + ",in=" + inFlows + ",out=" + outFlows + "]";
- }
-
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/PersistenceServiceTest.java 2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.cts.persistence;
-
-// $Id$
-
-import javax.management.ObjectName;
-
-import org.jbpm.api.ProcessNotFoundException;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.service.PersistenceService;
-import org.jbpm.api.test.CTSTestCase;
-import org.jbpm.test.cts.processbuilder.TestProcessBuilder;
-
-/**
- * Test the ExecutionManager
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public class PersistenceServiceTest extends CTSTestCase
-{
- /**
- * Test save, load, delete of a trivial process
- */
- public void testSaveLoadDelete() throws Exception
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- PersistenceService service = engine.getService(PersistenceService.class);
-
- // Save the process
- Process proc = TestProcessBuilder.getTrivalProcess();
- service.saveProcess(proc);
-
- // Load the process
- ObjectName procID = proc.getKey();
- Process procLoad = service.loadProcess(procID);
- TestProcessBuilder.validateTrivialProcess(procLoad);
-
- // Delete the process
- service.deleteProcess(proc);
- try
- {
- service.loadProcess(procID);
- fail("ProcessNotFoundException expected");
- }
- catch (ProcessNotFoundException ex)
- {
- // expected
- }
- }
-}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java (from rev 2438, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/PersistenceServiceTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceServiceTest.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -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.jbpm.test.cts.service.persistence;
+
+// $Id: PersistenceServiceTest.java 2419 2008-09-29 07:22:59Z thomas.diesler(a)jboss.com $
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.service.PersistenceService;
+import org.jbpm.api.test.CTSTestCase;
+import org.jbpm.test.cts.service.processbuilder.TestProcessBuilder;
+
+/**
+ * Test the PersistenceService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class PersistenceServiceTest extends CTSTestCase
+{
+ /**
+ * Test save, load, delete of a trivial process
+ */
+ public void testSaveLoadDelete() throws Exception
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ PersistenceService service = engine.getService(PersistenceService.class);
+
+ // Save the process
+ Process proc = TestProcessBuilder.getTrivalProcess();
+ service.saveProcess(proc);
+
+ // Load the process
+ ObjectName procID = proc.getKey();
+ Process procLoad = service.loadProcess(procID);
+ TestProcessBuilder.validateTrivialProcess(procLoad);
+
+ // Delete the process
+ service.deleteProcess(proc);
+ try
+ {
+ service.loadProcess(procID);
+ fail("ProcessNotFoundException expected");
+ }
+ catch (ProcessNotFoundException ex)
+ {
+ // expected
+ }
+ }
+}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/PersistenceTest.java 2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/PersistenceTest.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,142 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.cts.persistence;
-
-// $Id$
-
-import org.hibernate.Hibernate;
-import org.hibernate.ObjectNotFoundException;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.cfg.AnnotationConfiguration;
-import org.hibernate.classic.Session;
-import org.jbpm.api.ProcessNotFoundException;
-import org.jbpm.api.test.CTSTestCase;
-
-/**
- * Test the ExecutionManager
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public class PersistenceTest extends CTSTestCase
-{
- private String hibernateConfig;
- private SessionFactory sessionFactory;
-
- /**
- * Test save, load, delete of a trivial process
- */
- public void testSaveLoadDelete() throws Exception
- {
- NodeImpl na = new NodeImpl("A");
- NodeImpl nb = new NodeImpl("B");
- NodeImpl nc = new NodeImpl("C");
-
- ProcessImpl proc = new ProcessImpl("P");
- proc.addNode(na);
- proc.addNode(nb);
- proc.addNode(nc);
-
- new SequenceFlowImpl(na, nb);
- new SequenceFlowImpl(nb, nc);
-
- System.out.println(proc);
-
- Session session = getSessionFactory().openSession();
- Transaction tx = session.beginTransaction();
- try
- {
- session.save(proc);
-
- tx.commit();
- }
- finally
- {
- session.close();
- }
-
- Process loadProc = loadProcess(proc.id);
-
- System.out.println();
- System.out.println(loadProc);
-
- deleteProcess(proc);
- }
-
- public Process loadProcess(Integer id)
- {
- Process proc = null;
- Session session = getSessionFactory().openSession();
- try
- {
- proc = (Process)session.load(ProcessImpl.class, id);
- Hibernate.initialize(proc);
- }
- catch (ObjectNotFoundException ex)
- {
- throw new ProcessNotFoundException("Cannot find process: " + id);
- }
- finally
- {
- session.close();
- }
- return proc;
- }
-
- public void deleteProcess(Process proc)
- {
- Session session = getSessionFactory().openSession();
- Transaction tx = session.beginTransaction();
- try
- {
- session.delete(proc);
- tx.commit();
- }
- finally
- {
- session.close();
- }
- }
-
- private SessionFactory getSessionFactory()
- {
- // If this property is not explicitly set in the beans config
- // fall back to the -Ddatabase property that also activates
- // the corresponding mvn profiles
- if (hibernateConfig == null)
- {
- String database = System.getProperty("database", "mysql");
- hibernateConfig = "hibernate.cfg." + database + ".xml";
- }
-
- if (sessionFactory == null)
- {
- AnnotationConfiguration anConfig = new AnnotationConfiguration();
- anConfig.addAnnotatedClass(ProcessImpl.class);
- anConfig.addAnnotatedClass(NodeImpl.class);
- anConfig.addAnnotatedClass(SequenceFlowImpl.class);
- sessionFactory = anConfig.configure(hibernateConfig).buildSessionFactory();
- }
- return sessionFactory;
- }
-}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/Process.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/Process.java 2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/Process.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,12 +0,0 @@
-package org.jbpm.test.cts.persistence;
-
-import java.util.List;
-
-public interface Process
-{
-
- public abstract String getName();
-
- public abstract List<Node> getNodes();
-
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/ProcessImpl.java 2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/ProcessImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,69 +0,0 @@
-/**
- *
- */
-package org.jbpm.test.cts.persistence;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.OneToMany;
-
-@Entity
-public class ProcessImpl implements Process
-{
- @Id
- @GeneratedValue
- public Integer id;
- @Basic
- private String name;
- @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "process", targetEntity = NodeImpl.class)
- private List<Node> nodes = new ArrayList<Node>();
-
- public ProcessImpl()
- {
- }
-
- public ProcessImpl(String name)
- {
- this.name = name;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public List<Node> getNodes()
- {
- return nodes;
- }
-
- public void setNodes(List<Node> nodes)
- {
- this.nodes = nodes;
- }
-
- public void addNode(Node node)
- {
- ((NodeImpl)node).setProcess(this);
- nodes.add(node);
- }
-
- @Override
- public String toString()
- {
- return "[name=" + name + ",nodes=" + nodes + "]";
- }
-
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/SequenceFlow.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/SequenceFlow.java 2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/SequenceFlow.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,12 +0,0 @@
-package org.jbpm.test.cts.persistence;
-
-public interface SequenceFlow
-{
-
- public abstract String getTargetName();
-
- public abstract Node getSource();
-
- public abstract Node getTarget();
-
-}
\ No newline at end of file
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/SequenceFlowImpl.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/persistence/SequenceFlowImpl.java 2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/persistence/SequenceFlowImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,109 +0,0 @@
-/**
- *
- */
-package org.jbpm.test.cts.persistence;
-
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.ManyToOne;
-
-@Entity
-public class SequenceFlowImpl implements SequenceFlow
-{
- @Id
- @GeneratedValue
- public Integer id;
- @Basic
- private String targetName;
- @Basic
- private int sourceIndex;
- @Basic
- private int targetIndex;
- @ManyToOne(cascade = CascadeType.ALL, targetEntity = NodeImpl.class)
- private Node source;
- @ManyToOne(cascade = CascadeType.ALL, targetEntity = NodeImpl.class)
- private Node target;
-
- public SequenceFlowImpl()
- {
- }
-
- public SequenceFlowImpl(Node source, Node target)
- {
- this.source = source;
- this.target = target;
- this.targetName = target.getName();
- this.sourceIndex = source.getOutFlows().size();
- this.targetIndex = target.getInFlows().size();
- source.getOutFlows().add(this);
- target.getInFlows().add(this);
- }
-
- public int getSourceIndex()
- {
- return sourceIndex;
- }
-
- public void setSourceIndex(int sourceIndex)
- {
- this.sourceIndex = sourceIndex;
- }
-
- public int getTargetIndex()
- {
- return targetIndex;
- }
-
- public void setTargetIndex(int targetIndex)
- {
- this.targetIndex = targetIndex;
- }
-
- /* (non-Javadoc)
- * @see org.jbpm.test.cts.persistence.SequenceFlow#getTargetName()
- */
- public String getTargetName()
- {
- return targetName;
- }
-
- public void setTargetName(String targetName)
- {
- this.targetName = targetName;
- }
-
- /* (non-Javadoc)
- * @see org.jbpm.test.cts.persistence.SequenceFlow#getSource()
- */
- public Node getSource()
- {
- return source;
- }
-
- public void setSource(Node source)
- {
- this.source = source;
- }
-
- /* (non-Javadoc)
- * @see org.jbpm.test.cts.persistence.SequenceFlow#getTarget()
- */
- public Node getTarget()
- {
- return target;
- }
-
- public void setTarget(Node target)
- {
- this.target = target;
- }
-
- @Override
- public String toString()
- {
- return "[" + source.getName() + "->" + target.getName() + "]";
- }
-}
\ No newline at end of file
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder (from rev 2418, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processbuilder)
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/ProcessBuilderTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processbuilder/ProcessBuilderTest.java 2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/ProcessBuilderTest.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,180 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.cts.processbuilder;
-
-// $Id$
-
-import org.jbpm.api.InvalidProcessException;
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.builder.ProcessBuilder;
-import org.jbpm.api.test.CTSTestCase;
-
-/**
- * Test the ProcessBuilder
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Sep-2008
- */
-public class ProcessBuilderTest extends CTSTestCase
-{
- public void testBasicProcess() throws Exception
- {
- Process proc = TestProcessBuilder.getTrivalProcess();
- TestProcessBuilder.validateTrivialProcess(proc);
- }
-
- public void testNoProcessName() throws Exception
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
- builder.addProcess(null).addStartEvent("Start").addSequenceFlow("Task");
- builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
- try
- {
- builder.getProcess();
- fail("Process name required");
- }
- catch (InvalidProcessException e)
- {
- // expected
- }
- }
-
- public void testNoStartName() throws Exception
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
- builder.addProcess("Proc").addStartEvent(null).addSequenceFlow("Task");
- builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
- try
- {
- builder.getProcess();
- fail("StartEvent name required");
- }
- catch (InvalidProcessException e)
- {
- // expected
- }
- }
-
- public void testNoTaskName() throws Exception
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
- builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
- builder.addTask(null).addSequenceFlow("End").addEndEvent("End");
- try
- {
- builder.getProcess();
- fail("Task name required");
- }
- catch (InvalidProcessException e)
- {
- // expected
- }
- }
-
- public void testNoEndName() throws Exception
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
- builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
- builder.addTask("Task").addSequenceFlow("End").addEndEvent(null);
- try
- {
- builder.getProcess();
- fail("EndEvent name required");
- }
- catch (InvalidProcessException e)
- {
- // expected
- }
- }
-
- public void testNoStartEvent() throws Exception
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
- builder.addProcess("Proc").addTask("Task").addSequenceFlow("End").addEndEvent("End");
- try
- {
- builder.getProcess();
- fail("StartEvent required");
- }
- catch (InvalidProcessException e)
- {
- // expected
- }
- }
-
- public void testNoEndEvent() throws Exception
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
- builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
- builder.addTask("Task");
- try
- {
- builder.getProcess();
- fail("EndEvent required");
- }
- catch (InvalidProcessException e)
- {
- // expected
- }
- }
-
- public void testUnreachableNode() throws Exception
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
- builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task1");
- builder.addTask("Task1").addSequenceFlow("End").addTask("Task2").addSequenceFlow("End").addEndEvent("End");
- try
- {
- builder.getProcess();
- fail("Unreachable node Task2");
- }
- catch (InvalidProcessException e)
- {
- // expected
- }
- }
-
- public void testDeadEndNode() throws Exception
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
- builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
- builder.addTask("Task").addEndEvent("End");
- try
- {
- builder.getProcess();
- fail("Dead end Task");
- }
- catch (InvalidProcessException e)
- {
- // expected
- }
- }
-}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/ProcessBuilderTest.java (from rev 2438, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processbuilder/ProcessBuilderTest.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/ProcessBuilderTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/ProcessBuilderTest.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,180 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.cts.service.processbuilder;
+
+// $Id$
+
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.test.CTSTestCase;
+
+/**
+ * Test the ProcessBuilder
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Sep-2008
+ */
+public class ProcessBuilderTest extends CTSTestCase
+{
+ public void testBasicProcess() throws Exception
+ {
+ Process proc = TestProcessBuilder.getTrivalProcess();
+ TestProcessBuilder.validateTrivialProcess(proc);
+ }
+
+ public void testNoProcessName() throws Exception
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ builder.addProcess(null).addStartEvent("Start").addSequenceFlow("Task");
+ builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
+ try
+ {
+ builder.getProcess();
+ fail("Process name required");
+ }
+ catch (InvalidProcessException e)
+ {
+ // expected
+ }
+ }
+
+ public void testNoStartName() throws Exception
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ builder.addProcess("Proc").addStartEvent(null).addSequenceFlow("Task");
+ builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
+ try
+ {
+ builder.getProcess();
+ fail("StartEvent name required");
+ }
+ catch (InvalidProcessException e)
+ {
+ // expected
+ }
+ }
+
+ public void testNoTaskName() throws Exception
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
+ builder.addTask(null).addSequenceFlow("End").addEndEvent("End");
+ try
+ {
+ builder.getProcess();
+ fail("Task name required");
+ }
+ catch (InvalidProcessException e)
+ {
+ // expected
+ }
+ }
+
+ public void testNoEndName() throws Exception
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
+ builder.addTask("Task").addSequenceFlow("End").addEndEvent(null);
+ try
+ {
+ builder.getProcess();
+ fail("EndEvent name required");
+ }
+ catch (InvalidProcessException e)
+ {
+ // expected
+ }
+ }
+
+ public void testNoStartEvent() throws Exception
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ builder.addProcess("Proc").addTask("Task").addSequenceFlow("End").addEndEvent("End");
+ try
+ {
+ builder.getProcess();
+ fail("StartEvent required");
+ }
+ catch (InvalidProcessException e)
+ {
+ // expected
+ }
+ }
+
+ public void testNoEndEvent() throws Exception
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
+ builder.addTask("Task");
+ try
+ {
+ builder.getProcess();
+ fail("EndEvent required");
+ }
+ catch (InvalidProcessException e)
+ {
+ // expected
+ }
+ }
+
+ public void testUnreachableNode() throws Exception
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task1");
+ builder.addTask("Task1").addSequenceFlow("End").addTask("Task2").addSequenceFlow("End").addEndEvent("End");
+ try
+ {
+ builder.getProcess();
+ fail("Unreachable node Task2");
+ }
+ catch (InvalidProcessException e)
+ {
+ // expected
+ }
+ }
+
+ public void testDeadEndNode() throws Exception
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
+ builder.addTask("Task").addEndEvent("End");
+ try
+ {
+ builder.getProcess();
+ fail("Dead end Task");
+ }
+ catch (InvalidProcessException e)
+ {
+ // expected
+ }
+ }
+}
Deleted: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/TestProcessBuilder.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processbuilder/TestProcessBuilder.java 2008-09-29 05:50:29 UTC (rev 2418)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/TestProcessBuilder.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.test.cts.processbuilder;
-
-// $Id$
-
-import junit.framework.TestCase;
-
-import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.model.EndEvent;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.model.SequenceFlow;
-import org.jbpm.api.model.StartEvent;
-import org.jbpm.api.model.Task;
-import org.jbpm.api.model.builder.ProcessBuilder;
-
-/**
- * A catalog of CTS test processes
- *
- * @author thomas.diesler(a)jboss.com
- * @since 24-Sep-2008
- */
-public abstract class TestProcessBuilder
-{
- public static Process getTrivalProcess()
- {
- ProcessEngine engine = ProcessEngine.getProcessEngine();
- ProcessBuilder builder = engine.getService(ProcessBuilder.class);
- builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
- builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
- Process proc = builder.getProcess();
- return proc;
- }
-
- public static void validateTrivialProcess(Process wasProc)
- {
- TestCase.assertNotNull("Process not null", wasProc);
- TestCase.assertEquals("Proc", wasProc.getName());
-
- StartEvent start = (StartEvent)wasProc.getNode("Start");
- Task task = (Task)wasProc.getNode("Task");
- EndEvent end = (EndEvent)wasProc.getNode("End");
-
- TestCase.assertNotNull("Start not null", start);
- TestCase.assertNotNull("Task not null", task);
- TestCase.assertNotNull("End not null", end);
-
- TestCase.assertSame(wasProc, start.getProcess());
- TestCase.assertSame(wasProc, task.getProcess());
- TestCase.assertSame(wasProc, end.getProcess());
-
- TestCase.assertSame(start, wasProc.getNode(StartEvent.class, "Start"));
- TestCase.assertSame(task, wasProc.getNode(Task.class, "Task"));
- TestCase.assertSame(end, wasProc.getNode(EndEvent.class, "End"));
-
- SequenceFlow startFlow = start.getOutFlow();
- TestCase.assertNotNull("Start flow not null", startFlow);
- TestCase.assertEquals("Task", startFlow.getTargetName());
- TestCase.assertSame(start, startFlow.getSourceRef());
- TestCase.assertSame(task, startFlow.getTargetRef());
-
- SequenceFlow taskFlow = task.getOutFlow();
- TestCase.assertNotNull("Task flow not null", taskFlow);
- TestCase.assertEquals("End", taskFlow.getTargetName());
- TestCase.assertSame(task, taskFlow.getSourceRef());
- TestCase.assertSame(end, taskFlow.getTargetRef());
- }
-}
Copied: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/TestProcessBuilder.java (from rev 2438, projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/processbuilder/TestProcessBuilder.java)
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/TestProcessBuilder.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/processbuilder/TestProcessBuilder.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.cts.service.processbuilder;
+
+// $Id$
+
+import junit.framework.TestCase;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.EndEvent;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.StartEvent;
+import org.jbpm.api.model.Task;
+import org.jbpm.api.model.builder.ProcessBuilder;
+
+/**
+ * A catalog of CTS test processes
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Sep-2008
+ */
+public abstract class TestProcessBuilder
+{
+ public static Process getTrivalProcess()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
+ builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
+ Process proc = builder.getProcess();
+ return proc;
+ }
+
+ public static void validateTrivialProcess(Process wasProc)
+ {
+ TestCase.assertNotNull("Process not null", wasProc);
+ TestCase.assertEquals("Proc", wasProc.getName());
+
+ StartEvent start = (StartEvent)wasProc.getNode("Start");
+ Task task = (Task)wasProc.getNode("Task");
+ EndEvent end = (EndEvent)wasProc.getNode("End");
+
+ TestCase.assertNotNull("Start not null", start);
+ TestCase.assertNotNull("Task not null", task);
+ TestCase.assertNotNull("End not null", end);
+
+ TestCase.assertSame(wasProc, start.getProcess());
+ TestCase.assertSame(wasProc, task.getProcess());
+ TestCase.assertSame(wasProc, end.getProcess());
+
+ TestCase.assertSame(start, wasProc.getNode(StartEvent.class, "Start"));
+ TestCase.assertSame(task, wasProc.getNode(Task.class, "Task"));
+ TestCase.assertSame(end, wasProc.getNode(EndEvent.class, "End"));
+
+ SequenceFlow startFlow = start.getOutFlow();
+ TestCase.assertNotNull("Start flow not null", startFlow);
+ TestCase.assertEquals("Task", startFlow.getTargetName());
+ TestCase.assertSame(start, startFlow.getSourceRef());
+ TestCase.assertSame(task, startFlow.getTargetRef());
+
+ SequenceFlow taskFlow = task.getOutFlow();
+ TestCase.assertNotNull("Task flow not null", taskFlow);
+ TestCase.assertEquals("End", taskFlow.getTargetName());
+ TestCase.assertSame(task, taskFlow.getSourceRef());
+ TestCase.assertSame(end, taskFlow.getTargetRef());
+ }
+}
Added: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.cts.service.signal;
+
+// $Id$
+
+import java.util.List;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.api.test.CTSTestCase;
+
+/**
+ * Test the SignalService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class SignalServiceTest extends CTSTestCase
+{
+ /**
+ * Throw a signal to the automatically registered signal listener
+ */
+ public void testSignalListener() throws Exception
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ SignalService sigService = engine.getService(SignalService.class);
+
+ Signal signal = new Signal(getTestID(), SignalType.USER_SIGNAL, "HelloWorld");
+ sigService.throwSignal(signal);
+
+ List<Signal> signals = getSignals();
+ assertNotNull("Received signals not null", signals);
+ assertEquals("One signal", 1, signals.size());
+ assertEquals("HelloWorld", signals.get(0).getMessage());
+
+ // test the the signal can be retrieved by type
+ assertEquals("No signal", 0, getSignals(SignalType.SYSTEM_PROCESS_ENTER));
+ assertEquals("One signal", 1, getSignals(SignalType.USER_SIGNAL));
+ }
+}
Property changes on: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/cts/service/signal/SignalServiceTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
===================================================================
--- projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java (rev 0)
+++ projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.test.pattern.control.sequence;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.List;
+
+import org.jbpm.api.client.Deployment;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.builder.ProcessBuilder;
+import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.test.CTSTestCase;
+
+
+/**
+ * Test the basic execution sequence
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 03-Jul-2008
+ */
+public class SequenceTest extends CTSTestCase
+{
+ public void testSequence() throws Exception
+ {
+ // Start the Process
+ Process proc = getProcess();
+
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessService procService = engine.getService(ProcessService.class);
+ procService.registerProcess(proc);
+
+ proc.startProcess();
+ proc.waitForEnd();
+
+ // Validate received signals
+ List<Signal> signals = getSignals();
+ assertEquals(SignalType.SYSTEM_PROCESS_ENTER, signals.get(0).getSignalType());
+ assertEquals(SignalType.SYSTEM_START_EVENT_ENTER, signals.get(1).getSignalType());
+ assertEquals(SignalType.SYSTEM_START_EVENT_EXIT, signals.get(2).getSignalType());
+ assertEquals(SignalType.SYSTEM_TASK_ENTER, signals.get(3).getSignalType());
+ assertEquals(SignalType.SYSTEM_TASK_EXIT, signals.get(4).getSignalType());
+ assertEquals(SignalType.SYSTEM_END_EVENT_ENTER, signals.get(5).getSignalType());
+ assertEquals(SignalType.SYSTEM_END_EVENT_EXIT, signals.get(6).getSignalType());
+ assertEquals(SignalType.SYSTEM_PROCESS_EXIT, signals.get(7).getSignalType());
+ }
+
+ public Process getProcess() throws IOException
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessBuilder builder = engine.getService(ProcessBuilder.class);
+ builder.addProcess("Proc").addStartEvent("Start").addSequenceFlow("Task");
+ builder.addTask("Task").addSequenceFlow("End").addEndEvent("End");
+ Process proc = builder.getProcess();
+ return proc;
+ }
+}
Property changes on: projects/spec/trunk/modules/cts/src/test/java/org/jbpm/test/pattern/control/sequence/SequenceTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/NodeImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -24,7 +24,10 @@
//$Id$
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
@@ -34,6 +37,7 @@
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
+import javax.persistence.Transient;
import org.hibernate.annotations.IndexColumn;
import org.jbpm.api.InvalidProcessException;
@@ -41,8 +45,13 @@
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Property;
import org.jbpm.api.model.SequenceFlow;
import org.jbpm.api.model.StartEvent;
+import org.jbpm.api.runtime.ExecutionHandler;
+import org.jbpm.api.runtime.FlowHandler;
+import org.jbpm.api.runtime.SignalHandler;
+import org.jbpm.api.runtime.Token;
import org.jbpm.ri.model.builder.MultipleInFlowSupport;
import org.jbpm.ri.model.builder.MultipleOutFlowSupport;
import org.jbpm.ri.model.builder.SingleInFlowSupport;
@@ -63,17 +72,32 @@
@Basic
private String name;
+
@ManyToOne(targetEntity = ProcessImpl.class)
private Process process;
+
@Basic
private int nodeIndex;
+
+ @IndexColumn(name = "targetIndex")
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "targetRef", targetEntity = SequenceFlowImpl.class)
- @IndexColumn(name = "targetIndex")
protected List<SequenceFlow> inFlows = new ArrayList<SequenceFlow>();
+
+ @IndexColumn(name = "sourceIndex")
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "sourceRef", targetEntity = SequenceFlowImpl.class)
- @IndexColumn(name = "sourceIndex")
protected List<SequenceFlow> outFlows = new ArrayList<SequenceFlow>();
+ @Transient
+ // @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, targetEntity = PropertyImpl.class)
+ private Set<Property> properties = new HashSet<Property>();
+
+ @Basic
+ private String executionHandler;
+ @Basic
+ private String signalHandler;
+ @Basic
+ private String flowHandler;
+
public NodeImpl(String name)
{
this.name = name;
@@ -110,6 +134,26 @@
this.name = name;
}
+ public Property getProperty(String name)
+ {
+ for (Property prop : properties)
+ {
+ if (prop.getName().equals(name))
+ return prop;
+ }
+ return null;
+ }
+
+ public Set<String> getPropertyNames()
+ {
+ Set<String> propNames = new HashSet<String>();
+ for (Property prop : properties)
+ {
+ propNames.add(prop.getName());
+ }
+ return Collections.unmodifiableSet(propNames);
+ }
+
public List<SequenceFlow> getInFlows()
{
return inFlows;
@@ -120,6 +164,21 @@
return outFlows;
}
+ public ExecutionHandler getExecutionHandler()
+ {
+ return new ExecutionHandler()
+ {
+ public void execute(Token token)
+ {
+ // nothing to do
+ }
+ };
+ }
+
+ public abstract FlowHandler getFlowHandler();
+
+ public abstract SignalHandler getSignalHandler();
+
@Override
protected void initialize(Process proc)
{
@@ -180,6 +239,14 @@
throw new InvalidProcessException("Dead end node: " + this);
}
+ /**
+ * Reset the Node's state
+ */
+ public void reset()
+ {
+ // noting to do
+ }
+
private void initFlow(Process proc, SequenceFlowImpl flow)
{
if (flow != null)
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/ProcessImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -24,7 +24,10 @@
//$Id$
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import javax.management.ObjectName;
import javax.persistence.Basic;
@@ -40,12 +43,15 @@
import org.jbpm.api.Constants;
import org.jbpm.api.InvalidProcessException;
import org.jbpm.api.NotImplementedException;
+import org.jbpm.api.client.ProcessEngine;
import org.jbpm.api.model.EndEvent;
import org.jbpm.api.model.Node;
import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Property;
import org.jbpm.api.model.StartEvent;
import org.jbpm.api.model.builder.ObjectNameFactory;
import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.service.ExecutionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -66,13 +72,16 @@
@Basic
private String name;
+ @Enumerated(EnumType.STRING)
+ private ProcessStatus status = ProcessStatus.None;
+
+ @IndexColumn(name = "nodeIndex")
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "process", targetEntity = NodeImpl.class)
- @IndexColumn(name = "nodeIndex")
private List<Node> nodes = new ArrayList<Node>();
- @Enumerated(EnumType.STRING)
- private ProcessStatus status = ProcessStatus.None;
-
+ @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, targetEntity = PropertyImpl.class)
+ private Set<Property> properties = new HashSet<Property>();
+
@Transient
private transient RuntimeException runtimeException;
@@ -116,6 +125,26 @@
this.status = status;
}
+ public Property getProperty(String name)
+ {
+ for (Property prop : properties)
+ {
+ if (prop.getName().equals(name))
+ return prop;
+ }
+ return null;
+ }
+
+ public Set<String> getPropertyNames()
+ {
+ Set<String> propNames = new HashSet<String>();
+ for (Property prop : properties)
+ {
+ propNames.add(prop.getName());
+ }
+ return Collections.unmodifiableSet(propNames);
+ }
+
public void addNode(NodeImpl nodeImpl)
{
if (nodeImpl == null)
@@ -202,6 +231,18 @@
status = ProcessStatus.Ready;
}
+ public void resetProcess()
+ {
+ log.debug("Reset process: " + this);
+ for (Node node : getNodes())
+ {
+ NodeImpl nodeImpl = (NodeImpl)node;
+ nodeImpl.reset();
+ }
+ status = ProcessStatus.Ready;
+ runtimeException = null;
+ }
+
// Runtime Aspects ====================================================================================================
public RuntimeException getRuntimeException()
@@ -227,6 +268,9 @@
private ObjectName startProcessInternal(Attachments att)
{
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ExecutionService exService = engine.getService(ExecutionService.class);
+ exService.startProcess(this, att);
return getKey();
}
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/PropertyImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/PropertyImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/PropertyImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.model;
+
+//$Id$
+
+import javax.persistence.Basic;
+import javax.persistence.Entity;
+
+import org.jbpm.api.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
+ */
+@Entity (name = "Property")
+public class PropertyImpl implements Property
+{
+ private static final long serialVersionUID = 1L;
+
+ @Basic
+ private String name;
+
+ @Basic
+ private String value;
+
+ @Basic
+ private boolean isCorrelation;
+
+ public PropertyImpl(String name, String value)
+ {
+ this.value = value;
+ this.name = name;
+ }
+
+ public PropertyImpl(String name, String value, boolean isCorrelation)
+ {
+ this.name = name;
+ this.value = value;
+ this.isCorrelation = isCorrelation;
+ }
+
+ // persistence ctor
+ protected PropertyImpl()
+ {
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public boolean isCorrelation()
+ {
+ return isCorrelation;
+ }
+}
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/PropertyImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SequenceFlowImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SequenceFlowImpl.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/model/SequenceFlowImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -117,7 +117,7 @@
return sourceRef;
}
- void setSourceRef(Node source)
+ protected void setSourceRef(Node source)
{
this.sourceRef = source;
}
@@ -127,7 +127,7 @@
return targetRef;
}
- void setTargetRef(Node target)
+ protected void setTargetRef(Node target)
{
this.targetRef = target;
}
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,184 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.runtime;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.bpm.model.Activity;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Property;
+import org.jboss.bpm.runtime.ExecutionContext;
+
+/**
+ * An ExecutionContext that delegates to the current {@link Activity} or {@link Process} for property rerieval.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 15-Aug-2008
+ */
+public class DelegatingExecutionContext implements ExecutionContext
+{
+ private FlowObject flowObject;
+ private ExecutionContext delegate;
+ private String activityPrefix;
+ private String procPrefix;
+ private Process proc;
+
+ DelegatingExecutionContext(FlowObject flowObject, ExecutionContext delegate)
+ {
+ this.flowObject = flowObject;
+ this.delegate = delegate;
+
+ proc = flowObject.getProcess();
+ procPrefix = proc.getName() + ".";
+ activityPrefix = procPrefix + flowObject.getName() + ".";
+ }
+
+ public Object getAttachment(String name)
+ {
+ Object value = null;
+
+ // Get activity property
+ if (flowObject instanceof Activity && name.startsWith(activityPrefix))
+ {
+ Activity activity = (Activity)flowObject;
+ String key = name.substring(activityPrefix.length());
+ Property prop = activity.getProperty(key);
+ if (prop != null)
+ {
+ value = prop.getValue();
+ }
+ }
+
+ // Get process property
+ else if (name.startsWith(procPrefix))
+ {
+ String key = name.substring(procPrefix.length());
+ Property prop = proc.getProperty(key);
+ if (prop != null)
+ {
+ value = prop.getValue();
+ }
+ }
+
+ // Fallback to execution context
+ if (value == null)
+ {
+ value = delegate.getAttachment(name);
+ }
+
+ return value;
+ }
+
+ public Collection<Key> getAttachmentKeys()
+ {
+ Collection<Key> keys = new ArrayList<Key>(delegate.getAttachmentKeys());
+
+ // Add activity property keys
+ if (flowObject instanceof Activity)
+ {
+ Activity activity = (Activity)flowObject;
+ for (Property prop : activity.getProperties())
+ {
+ Key key = new Key(null, activityPrefix + prop.getName());
+ keys.add(key);
+ }
+ }
+
+ // Add process property keys
+ for (Property prop : proc.getProperties())
+ {
+ Key key = new Key(null, procPrefix + prop.getName());
+ keys.add(key);
+ }
+
+ return keys;
+ }
+
+ public <T> T getAttachment(Class<T> clazz)
+ {
+ return delegate.getAttachment(clazz);
+ }
+
+ public <T> T getAttachment(Class<T> clazz, String name)
+ {
+ return delegate.getAttachment(clazz, name);
+ }
+
+ public <T> T addAttachment(Class<T> clazz, Object value)
+ {
+ return delegate.addAttachment(clazz, value);
+ }
+
+ public <T> T addAttachment(Class<T> clazz, String name, Object value)
+ {
+ validateAttachmentKey(name);
+ return delegate.addAttachment(clazz, name, value);
+ }
+
+ public Object addAttachment(String name, Object value)
+ {
+ validateAttachmentKey(name);
+ return delegate.addAttachment(name, value);
+ }
+
+ public <T> T removeAttachment(Class<T> clazz)
+ {
+ return delegate.removeAttachment(clazz);
+ }
+
+ public <T> T removeAttachment(Class<T> clazz, String name)
+ {
+ validateAttachmentKey(name);
+ return delegate.removeAttachment(clazz, name);
+ }
+
+ public Object removeAttachment(String name)
+ {
+ validateAttachmentKey(name);
+ return delegate.removeAttachment(name);
+ }
+
+ private void validateAttachmentKey(String name)
+ {
+ if (name.startsWith(procPrefix) || name.startsWith(activityPrefix))
+ throw new IllegalArgumentException("Invalid attachment key: " + name);
+ }
+
+ public String toString()
+ {
+ Map<Key,Object> combined = new HashMap<Key,Object>();
+ for (Key key : getAttachmentKeys())
+ {
+ if (key.getClassPart() != null)
+ combined.put(key, getAttachment(key.getClassPart(), key.getNamePart()));
+ else
+ combined.put(key, getAttachment(key.getNamePart()));
+ }
+ return combined.toString();
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingExecutionContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.runtime;
+
+//$Id$
+
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.runtime.Token;
+
+/**
+ * A {@link Token} that includes properties from the current {@link Activity}
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 15-Aug-2008
+ */
+public class DelegatingToken implements MutableToken
+{
+ private MutableToken delegateToken;
+ private ExecutionContext delegateContext;
+
+ public DelegatingToken(MutableToken token)
+ {
+ this.delegateToken = token;
+
+ Node targetRef = token.getFlow().getTargetRef();
+ ExecutionContext exContext = token.getExecutionContext();
+ this.delegateContext = new DelegatingExecutionContext(targetRef, exContext);
+ }
+
+ public ExecutionContext getExecutionContext()
+ {
+ return delegateContext;
+ }
+
+ public Token copyToken()
+ {
+ return delegateToken.copyToken();
+ }
+
+ public SequenceFlow getFlow()
+ {
+ return delegateToken.getFlow();
+ }
+
+ public String getTokenID()
+ {
+ return delegateToken.getTokenID();
+ }
+
+ public TokenStatus getTokenStatus()
+ {
+ return delegateToken.getTokenStatus();
+ }
+
+ public void mergeToken(Token token)
+ {
+ delegateToken.mergeToken(token);
+ }
+
+ public void setFlow(SequenceFlow flow)
+ {
+ delegateToken.setFlow(flow);
+ }
+
+ public void setTokenStatus(TokenStatus status)
+ {
+ delegateToken.setTokenStatus(status);
+ }
+
+ public String toString()
+ {
+ Node node = getFlow().getTargetRef();
+ return "[fo=" + node + ",ctx=" + getExecutionContext() + "]";
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/DelegatingToken.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MutableToken.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MutableToken.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MutableToken.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.runtime;
+
+//$Id$
+
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.runtime.Token;
+
+/**
+ * A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface MutableToken extends Token
+{
+ void setTokenStatus(TokenStatus status);
+
+ void setFlow(SequenceFlow flow);
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/MutableToken.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -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.ri.runtime;
+
+//$Id$
+
+import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.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.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface RuntimeProcess
+{
+ /**
+ * Get the associated {@link Process}
+ */
+ Process getProcess();
+
+ /**
+ * Get the {@link TokenExecutor} for this {@link Process}
+ */
+ TokenExecutor getTokenExecutor();
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeProcess.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.runtime;
+
+//$Id$
+
+import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.model.Process;
+
+/**
+ * A RuntimeProcess add runtime behaviour to the {@link Process}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class RuntimeProcessImpl implements RuntimeProcess
+{
+ private Process proc;
+ private TokenExecutor tokenExecutor;
+
+ public RuntimeProcessImpl(Process proc)
+ {
+ this.proc = proc;
+ this.tokenExecutor = new TokenExecutorImpl(this);
+ }
+
+ public Process getProcess()
+ {
+ return proc;
+ }
+
+ public TokenExecutor getTokenExecutor()
+ {
+ return tokenExecutor;
+ }
+
+ public String toString()
+ {
+ return "RuntimeProcess[" + proc.getName() + ",status=" + proc.getProcessStatus() + "]";
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/RuntimeProcessImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,314 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.runtime;
+
+//$Id$
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.runtime.Token.TokenStatus;
+import org.jbpm.ri.model.NodeImpl;
+import org.jbpm.ri.model.ProcessImpl;
+import org.jbpm.api.model.Process;
+
+/**
+ * The {@link FlowHandler} invokes the TokenExecutor to schedule {@link ConnectingObject} objects together with their
+ * associated {@link Token}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class TokenExecutorImpl implements TokenExecutor
+{
+ // provide logging
+ private static final Log log = LogFactory.getLog(TokenExecutorImpl.class);
+
+ private RuntimeProcess rtProc;
+ private ExecutorService executor = Executors.newCachedThreadPool();
+ private Map<String, RunnableToken> runnableTokens = new HashMap<String, RunnableToken>();
+
+ public TokenExecutorImpl(RuntimeProcess rtProc)
+ {
+ this.rtProc = rtProc;
+ }
+
+ public Set<Token> getRunnableTokens()
+ {
+ synchronized (runnableTokens)
+ {
+ Set<Token> tokenSet = new HashSet<Token>();
+ for (RunnableToken rt : runnableTokens.values())
+ tokenSet.add(rt.getToken());
+
+ return Collections.unmodifiableSet(tokenSet);
+ }
+ }
+
+ public boolean hasRunnableTokens()
+ {
+ synchronized (runnableTokens)
+ {
+ return runnableTokens.size() > 0;
+ }
+ }
+
+ public void create(Token token, SequenceFlow initialFlow)
+ {
+ synchronized (runnableTokens)
+ {
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Created);
+ mutableToken.setFlow(initialFlow);
+
+ log.debug("Create Token: " + token);
+
+ RunnableToken rtToken = new RunnableToken(rtProc, mutableToken);
+ runnableTokens.put(token.getTokenID(), rtToken);
+ }
+ }
+
+ public void start(Token token)
+ {
+ synchronized (runnableTokens)
+ {
+ ProcessStatus procStatus = getProcess(token).getProcessStatus();
+ if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
+ throw new IllegalStateException("Cannot start token to process in state: " + procStatus);
+
+ log.debug("Sart Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Started);
+
+ RunnableToken rtToken = runnableTokens.get(token.getTokenID());
+ executor.submit(rtToken);
+ }
+ }
+
+ public void move(Token token, SequenceFlow flow)
+ {
+ synchronized (runnableTokens)
+ {
+ if (flow == null)
+ throw new IllegalArgumentException("Flow cannot be null");
+
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setFlow(flow);
+ }
+ }
+
+ public void stop(Token token)
+ {
+ synchronized (runnableTokens)
+ {
+ log.debug("Stop Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Stoped);
+ }
+ }
+
+ public void destroy(Token token)
+ {
+ synchronized (runnableTokens)
+ {
+ log.debug("Destroy Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Destroyed);
+ runnableTokens.remove(token.getTokenID());
+ }
+ }
+
+ public String suspend(Token token)
+ {
+ synchronized (runnableTokens)
+ {
+ log.debug("Suspend Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Suspended);
+ return token.getTokenID();
+ }
+ }
+
+ public Token activate(String tokenID)
+ {
+ synchronized (runnableTokens)
+ {
+ RunnableToken rtToken = runnableTokens.get(tokenID);
+ if (rtToken == null)
+ throw new IllegalStateException("Not a runnable token: " + tokenID);
+
+ Token token = rtToken.getToken();
+ if (token.getTokenStatus() != TokenStatus.Suspended)
+ throw new IllegalStateException("Activate token in state: " + token.getTokenStatus());
+
+ log.debug("Activate Token: " + token);
+ MutableToken mutableToken = (MutableToken)token;
+ mutableToken.setTokenStatus(TokenStatus.Started);
+
+ executor.submit(rtToken);
+ return token;
+ }
+ }
+
+ private Process getProcess(Token token)
+ {
+ return token.getFlow().getTargetRef().getProcess();
+ }
+
+ /****************************************************
+ * The runnable Token
+ */
+ class RunnableToken implements Runnable
+ {
+ private RuntimeProcess rtProc;
+ private TokenExecutor tokenExecutor;
+ private MutableToken token;
+
+ public RunnableToken(RuntimeProcess rtProc, MutableToken token)
+ {
+ this.tokenExecutor = rtProc.getTokenExecutor();
+ this.rtProc = rtProc;
+ this.token = token;
+ }
+
+ public Token getToken()
+ {
+ return token;
+ }
+
+ public void run()
+ {
+ Process proc = rtProc.getProcess();
+ try
+ {
+ SequenceFlow flow = token.getFlow();
+ if (flow == null)
+ throw new IllegalStateException("Cannot obtain initial flow");
+
+ TokenStatus tokStatus = token.getTokenStatus();
+ ProcessStatus procStatus = proc.getProcessStatus();
+ while (procStatus == ProcessStatus.Active && tokStatus == TokenStatus.Started)
+ {
+ // Get the target and its handlers
+ Node flowObject = token.getFlow().getTargetRef();
+ NodeImpl flowObjectImpl = (NodeImpl)flowObject;
+ SignalHandler sigHandler = getSignalHandler(flowObject);
+
+ // Synchronize execution on the target FlowObject
+ synchronized (flowObject)
+ {
+ // Create a Token that includes properties from the current Activity
+ DelegatingToken tokCopy = new DelegatingToken(token);
+
+ // Throw the Enter Signal
+ sigHandler.throwEnterSignal(tokCopy);
+
+ // Execute the target FlowObject
+ flowObjectImpl.execute(tokCopy);
+
+ // Transfer the token to the FlowHandler
+ flowObjectImpl.executeFlowHandler(tokenExecutor, tokCopy);
+
+ // Throw the Exit Signal
+ sigHandler.throwExitSignal(tokCopy);
+
+ tokStatus = token.getTokenStatus();
+ procStatus = proc.getProcessStatus();
+ }
+ }
+
+ // Notify Process on token termination
+ terminateToken(proc);
+ }
+ catch (RuntimeException rte)
+ {
+ log.error("Process aborted: " + proc, rte);
+ ((ProcessImpl)proc).setRuntimeException(rte);
+
+ log.debug("Terminate all suspended tokens");
+ Set<String> keySet = new HashSet<String>(runnableTokens.keySet());
+ for (String tokID : keySet)
+ {
+ RunnableToken rtTok = runnableTokens.get(tokID);
+ Token auxToken = rtTok.getToken();
+ if (auxToken.getTokenStatus() == TokenStatus.Suspended)
+ tokenExecutor.destroy(auxToken);
+ }
+
+ // Notify Process on token termination
+ terminateToken(proc);
+ }
+ }
+
+ private void terminateToken(Process proc)
+ {
+ // Destroy the token if not already done
+ synchronized (runnableTokens)
+ {
+ TokenStatus status = token.getTokenStatus();
+ if (status != TokenStatus.Suspended && status != TokenStatus.Destroyed)
+ tokenExecutor.destroy(token);
+ }
+
+ // Notify the runtime process
+ synchronized (rtProc)
+ {
+ rtProc.notifyAll();
+ }
+ }
+
+ private SignalHandler getSignalHandler(Node target)
+ {
+ HandlerSupport handlerSupport = getHandlerSupport(target);
+ SignalHandler handler = handlerSupport.getSignalHandler();
+ if (handler == null)
+ throw new IllegalStateException("Cannot obtain signal handler from: " + target);
+
+ return handler;
+ }
+
+ private HandlerSupport getHandlerSupport(FlowObject fo)
+ {
+ if (fo instanceof HandlerSupport == false)
+ throw new IllegalStateException("Flow object does not implement handler support: " + fo);
+ return (HandlerSupport)fo;
+ }
+
+ @Override
+ public String toString()
+ {
+ return token.toString();
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenExecutorImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,124 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.runtime;
+
+//$Id$
+
+import org.jboss.util.id.UID;
+import org.jbpm.api.model.SequenceFlow;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.BasicExecutionContext;
+import org.jbpm.api.runtime.ExecutionContext;
+import org.jbpm.api.runtime.Token;
+import org.jbpm.api.runtime.Attachments.Key;
+
+/**
+ * A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
+ *
+ * By tracking how the Token traverses the Flow Objects, gets diverted through alternative paths,
+ * and gets split into parallel paths, the normal Sequence Flow should be completely definable.
+ *
+ * A Token will have a unique identity that can be used to separate multiple Tokens that may exist because of
+ * concurrent process instances or the splitting of the Token for parallel processing within a single process instance.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class TokenImpl implements MutableToken
+{
+ private String id;
+ private SequenceFlow flow;
+ private ExecutionContext context;
+ private TokenStatus status;
+
+ /**
+ * Construct a Token with given {@link Attachments}
+ */
+ public TokenImpl(Attachments att)
+ {
+ this.context = new BasicExecutionContext(att);
+ this.id = new UID().toString();
+ this.status = TokenStatus.Created;
+ }
+
+ public String getTokenID()
+ {
+ return id;
+ }
+
+ public TokenStatus getTokenStatus()
+ {
+ return status;
+ }
+
+ public void setTokenStatus(TokenStatus status)
+ {
+ this.status = status;
+ }
+
+ public ExecutionContext getExecutionContext()
+ {
+ return context;
+ }
+
+ public SequenceFlow getFlow()
+ {
+ return flow;
+ }
+
+ public void setFlow(SequenceFlow flow)
+ {
+ this.flow = flow;
+ }
+
+ /**
+ * Create a schallow copy of this Token.
+ * <p/>
+ * The content in the {@link ExecutionContext} will be copied by reference.
+ */
+ public Token copyToken()
+ {
+ return new TokenImpl(context);
+ }
+
+ /**
+ * Merge this Token with another token.
+ */
+ public void mergeToken(Token token)
+ {
+ ExecutionContext mergeContext = token.getExecutionContext();
+ for(Key key : mergeContext.getAttachmentKeys())
+ {
+ Object mergeValue = mergeContext.getAttachment(key.getClassPart(), key.getNamePart());
+ Object existValue = context.getAttachment(key.getClassPart(), key.getNamePart());
+ if (existValue != null && existValue.equals(mergeValue) == false)
+ throw new IllegalStateException("Cannot merge the same key with different values: " + key);
+
+ context.addAttachment(key.getClassPart(), key.getNamePart(), mergeValue);
+ }
+ }
+
+ public String toString()
+ {
+ return "[sf=" + getFlow() + ",status=" + getTokenStatus() + ",ctx=" + getExecutionContext() + "]";
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/runtime/TokenImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionManagerImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionManagerImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionManagerImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,354 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.service;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.ObjectName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jbpm.api.BPMException;
+import org.jbpm.api.InvalidProcessException;
+import org.jbpm.api.ProcessTimeoutException;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.Signal;
+import org.jbpm.api.model.StartEvent;
+import org.jbpm.api.model.Process.ProcessStatus;
+import org.jbpm.api.model.Signal.SignalType;
+import org.jbpm.api.model.StartEvent.TriggerType;
+import org.jbpm.api.runtime.Attachments;
+import org.jbpm.api.runtime.TokenExecutor;
+import org.jbpm.api.service.ExecutionService;
+import org.jbpm.api.service.ProcessService;
+import org.jbpm.api.service.SignalService;
+import org.jbpm.ri.model.ProcessImpl;
+import org.jbpm.ri.model.SequenceFlowImpl;
+import org.jbpm.ri.runtime.RuntimeProcess;
+import org.jbpm.ri.runtime.RuntimeProcessImpl;
+import org.jbpm.ri.runtime.TokenImpl;
+
+/**
+ * The process manager is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ExecutionManagerImpl extends ExecutionService
+{
+ // provide logging
+ private static final Log log = LogFactory.getLog(ExecutionManagerImpl.class);
+
+ // The map of active runtime processes
+ private Map<ObjectName, RuntimeProcess> runtimeProcesses = new HashMap<ObjectName, RuntimeProcess>();
+
+ @Override
+ public void startProcess(Process proc, Attachments att)
+ {
+ // Prepare the process for start
+ startProcessPrepare(proc);
+
+ // Get the None Start Event if there is one and start the initial flow
+ StartEvent start = getNoneStartEvent(proc);
+ if (start != null)
+ {
+ if (proc.getProcessStatus() == ProcessStatus.Active)
+ throw new IllegalStateException("Cannot start an already active process");
+
+ startProcessInternal(start, att);
+ }
+ }
+
+ @Override
+ public void startProcess(StartEvent start, Attachments att)
+ {
+ // Prepare the process for start
+ startProcessPrepare(start.getProcess());
+
+ startProcessInternal(start, att);
+ }
+
+ private synchronized void startProcessInternal(StartEvent start, Attachments att)
+ {
+ @SuppressWarnings("serial")
+ class InitialFlow extends SequenceFlowImpl
+ {
+ InitialFlow(StartEvent start)
+ {
+ super(start.getName());
+ setTargetRef(start);
+ }
+ }
+
+ Process proc = start.getProcess();
+ RuntimeProcess rtProc = getRuntimeProcess(proc, false);
+ boolean startProcessThread = (rtProc == null);
+
+ // Create initial Token
+ TokenImpl initialToken = new TokenImpl(att);
+ InitialFlow initialFlow = new InitialFlow(start);
+ initialToken.setFlow(initialFlow);
+
+ // Register the initial Token
+ rtProc = getRuntimeProcess(proc, true);
+ TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
+ tokenExecutor.create(initialToken, initialFlow);
+
+ // Start a new process thread
+ if (startProcessThread)
+ {
+ RunnableProcess runnable = new RunnableProcess(rtProc);
+ getProcessExecutor().execute(runnable);
+ synchronized (proc)
+ {
+ while (proc.getProcessStatus() != ProcessStatus.Active)
+ {
+ try
+ {
+ proc.wait();
+ }
+ catch (InterruptedException ex)
+ {
+ log.error(ex);
+ }
+ }
+ }
+ }
+
+ // Do the start time assignments
+ // startTimeAssignments(proc, initialToken);
+
+ // Start the initial token
+ tokenExecutor.start(initialToken);
+ }
+
+ private void startProcessPrepare(Process proc)
+ {
+ // Reset the process if already terminated
+ ProcessImpl procImpl = (ProcessImpl)proc;
+ if (isProcessTerminated(proc))
+ procImpl.resetProcess();
+
+ ProcessStatus procStatus = proc.getProcessStatus();
+ if (procStatus != ProcessStatus.Ready && procStatus != ProcessStatus.Active)
+ throw new IllegalStateException("Cannot start process in state: " + procStatus);
+
+ // Register the process if needed
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessService procService = engine.getService(ProcessService.class);
+ if (procService.getProcessByKey(proc.getKey()) == null)
+ procService.registerProcess(proc);
+ }
+
+ public ProcessStatus waitForEnd(Process proc)
+ {
+ return waitForEndInternal(proc, 0);
+ }
+
+ public ProcessStatus waitForEnd(Process proc, long timeout)
+ {
+ return waitForEndInternal(proc, timeout);
+ }
+
+ /**
+ * 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. If the process was
+ * aborted this method throws the causing RuntimeException if avaialable.
+ */
+ private ProcessStatus waitForEndInternal(Process proc, long timeout)
+ {
+ ProcessImpl procImpl = (ProcessImpl)proc;
+
+ ProcessStatus status = proc.getProcessStatus();
+ if (status == ProcessStatus.None)
+ 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;
+ try
+ {
+ while (forever || now < until)
+ {
+ synchronized (proc)
+ {
+ if (isProcessTerminated(proc))
+ {
+ if (procImpl.getRuntimeException() != null)
+ {
+ throw new BPMException("Process aborted", procImpl.getRuntimeException());
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ // Start waiting to get notified
+ long waitTimeout = forever ? 0 : until - now;
+ proc.wait(waitTimeout);
+ }
+ now = System.currentTimeMillis();
+ }
+
+ // Throw timeout exception if it took too long
+ if (isProcessTerminated(proc) == false)
+ {
+ RuntimeException rte = new ProcessTimeoutException("Process timeout after " + timeout + "ms for: " + proc.getKey());
+ procImpl.setRuntimeException(rte);
+ log.error(rte);
+ throw rte;
+ }
+ }
+ catch (InterruptedException ex)
+ {
+ log.warn(ex);
+ }
+ finally
+ {
+ // Unregister the process if not done already
+ // this could happen when the Process never received a start signal
+ // and then we get here because of a ProcessTimeoutException
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ ProcessService procService = engine.getService(ProcessService.class);
+ if (procService.getProcessByKey(proc.getKey()) != null)
+ procService.unregisterProcess(proc);
+ }
+
+
+ status = proc.getProcessStatus();
+ return status;
+ }
+
+ private boolean isProcessTerminated(Process proc)
+ {
+ ProcessStatus status = proc.getProcessStatus();
+ return status == ProcessStatus.Cancelled || status == ProcessStatus.Completed || status == ProcessStatus.Aborted;
+ }
+
+ private StartEvent getNoneStartEvent(Process proc)
+ {
+ StartEvent start = null;
+ for (StartEvent aux : proc.getNodes(StartEvent.class))
+ {
+ if (aux.getTriggerType() == TriggerType.None)
+ {
+ if (start != null)
+ throw new InvalidProcessException("Process cannot have multiple start events with no trigger");
+ start = aux;
+ }
+ }
+ return start;
+ }
+
+ private RuntimeProcess getRuntimeProcess(Process proc, boolean createNew)
+ {
+ RuntimeProcess rtProcess;
+ synchronized (runtimeProcesses)
+ {
+ rtProcess = runtimeProcesses.get(proc.getKey());
+ if (rtProcess == null && createNew)
+ {
+ rtProcess = new RuntimeProcessImpl(proc);
+ runtimeProcesses.put(proc.getKey(), rtProcess);
+ }
+ }
+ return rtProcess;
+ }
+
+ /***************************************************************
+ * The runnable Process
+ */
+ class RunnableProcess implements Runnable
+ {
+ private RuntimeProcess rtProc;
+
+ public RunnableProcess(RuntimeProcess rtProc)
+ {
+ this.rtProc = rtProc;
+ }
+
+ public void run()
+ {
+ TokenExecutor tokenExecutor = rtProc.getTokenExecutor();
+ ProcessImpl procImpl = (ProcessImpl)rtProc.getProcess();
+ Process proc = rtProc.getProcess();
+
+ ProcessEngine engine = ProcessEngine.getProcessEngine();
+ SignalService sigService = engine.getService(SignalService.class);
+
+ ObjectName procID = proc.getKey();
+ String procName = proc.getName();
+ try
+ {
+ synchronized (proc)
+ {
+ procImpl.setProcessStatus(ProcessStatus.Active);
+ sigService.throwSignal(new Signal(procID, SignalType.SYSTEM_PROCESS_ENTER));
+
+ // Notify that the process is now Active
+ proc.notifyAll();
+ }
+
+ synchronized (rtProc)
+ {
+ // Wait until there are no more runnable tokens
+ while (tokenExecutor.hasRunnableTokens())
+ {
+ try
+ {
+ rtProc.wait();
+ }
+ catch (InterruptedException ex)
+ {
+ log.error(ex);
+ }
+ }
+
+ log.debug("End execution thread [proc=" + procName + ",status=" + proc.getProcessStatus() + "]");
+
+ if (proc.getProcessStatus() == ProcessStatus.Active)
+ procImpl.setProcessStatus(ProcessStatus.Completed);
+ }
+ }
+ finally
+ {
+ sigService.throwSignal(new Signal(procID, Signal.SignalType.SYSTEM_PROCESS_EXIT));
+
+ synchronized (proc)
+ {
+ ProcessService procService = engine.getService(ProcessService.class);
+ procService.unregisterProcess(proc);
+ runtimeProcesses.remove(procID);
+
+ // Notify that the process has now ended
+ proc.notifyAll();
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/ExecutionManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceService.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceService.java 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceService.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -1,149 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.ri.service;
-
-// $Id$
-
-import javax.management.ObjectName;
-
-import org.hibernate.Hibernate;
-import org.hibernate.ObjectNotFoundException;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.cfg.AnnotationConfiguration;
-import org.hibernate.classic.Session;
-import org.jbpm.api.ProcessNotFoundException;
-import org.jbpm.api.model.Process;
-import org.jbpm.api.service.PersistenceService;
-import org.jbpm.ri.model.AbstractElementImpl;
-import org.jbpm.ri.model.EndEventImpl;
-import org.jbpm.ri.model.NodeImpl;
-import org.jbpm.ri.model.ProcessImpl;
-import org.jbpm.ri.model.SequenceFlowImpl;
-import org.jbpm.ri.model.StartEventImpl;
-import org.jbpm.ri.model.TaskImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A Hibernate based persistence service for a process.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 17-Sep-2008
- */
-public class HibernatePersistenceService implements PersistenceService
-{
- // Provide logging
- final Logger log = LoggerFactory.getLogger(HibernatePersistenceService.class);
-
- private String hibernateConfig;
- private SessionFactory sessionFactory;
-
- public void setHibernateConfig(String hibernateConfig)
- {
- this.hibernateConfig = hibernateConfig;
- }
-
- public ObjectName saveProcess(Process proc)
- {
- log.debug("START saveProcess: " + proc.getKey());
- Session session = getSessionFactory().openSession();
- Transaction tx = session.beginTransaction();
- try
- {
- session.saveOrUpdate(proc);
- tx.commit();
- }
- finally
- {
- session.close();
- }
- log.debug("END saveProcess: " + proc.getKey());
- return proc.getKey();
- }
-
- public Process loadProcess(ObjectName procID)
- {
- log.debug("START loadProcess: " + procID);
- ProcessImpl procImpl = null;
- Session session = getSessionFactory().openSession();
- try
- {
- Integer id = Integer.valueOf(procID.getKeyProperty("id"));
- procImpl = (ProcessImpl)session.load(ProcessImpl.class, id);
- Hibernate.initialize(procImpl);
- }
- catch (ObjectNotFoundException ex)
- {
- throw new ProcessNotFoundException("Cannot find process: " + procID);
- }
- finally
- {
- session.close();
- }
- log.debug("END loadProcess: " + procID);
- return procImpl;
- }
-
- public void deleteProcess(Process proc)
- {
- log.debug("START deleteProcess: " + proc.getKey());
- Session session = getSessionFactory().openSession();
- Transaction tx = session.beginTransaction();
- try
- {
- session.delete(proc);
- tx.commit();
- }
- finally
- {
- session.close();
- }
- log.debug("END deleteProcess: " + proc.getKey());
- }
-
- private SessionFactory getSessionFactory()
- {
- // If this property is not explicitly set in the beans config
- // fall back to the -Ddatabase property that also activates
- // the corresponding mvn profiles
- if (hibernateConfig == null)
- {
- String database = System.getProperty("database", "mysql");
- hibernateConfig = "hibernate.cfg." + database + ".xml";
- }
-
- if (sessionFactory == null)
- {
- AnnotationConfiguration anConfig = new AnnotationConfiguration();
- anConfig.addAnnotatedClass(AbstractElementImpl.class);
- anConfig.addAnnotatedClass(EndEventImpl.class);
- anConfig.addAnnotatedClass(NodeImpl.class);
- anConfig.addAnnotatedClass(ProcessImpl.class);
- anConfig.addAnnotatedClass(SequenceFlowImpl.class);
- anConfig.addAnnotatedClass(StartEventImpl.class);
- anConfig.addAnnotatedClass(TaskImpl.class);
- sessionFactory = anConfig.configure(hibernateConfig).buildSessionFactory();
- }
- return sessionFactory;
- }
-}
Copied: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java (from rev 2422, projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/HibernatePersistenceService.java)
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/PersistenceServiceImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.service;
+
+// $Id$
+
+import javax.management.ObjectName;
+
+import org.hibernate.Hibernate;
+import org.hibernate.ObjectNotFoundException;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.cfg.AnnotationConfiguration;
+import org.hibernate.classic.Session;
+import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.service.PersistenceService;
+import org.jbpm.ri.model.AbstractElementImpl;
+import org.jbpm.ri.model.EndEventImpl;
+import org.jbpm.ri.model.NodeImpl;
+import org.jbpm.ri.model.ProcessImpl;
+import org.jbpm.ri.model.SequenceFlowImpl;
+import org.jbpm.ri.model.StartEventImpl;
+import org.jbpm.ri.model.TaskImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A Hibernate based persistence service for a process.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Sep-2008
+ */
+public class PersistenceServiceImpl implements PersistenceService
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(PersistenceServiceImpl.class);
+
+ private String hibernateConfig;
+ private SessionFactory sessionFactory;
+
+ public void setHibernateConfig(String hibernateConfig)
+ {
+ this.hibernateConfig = hibernateConfig;
+ }
+
+ public ObjectName saveProcess(Process proc)
+ {
+ log.debug("START saveProcess: " + proc.getKey());
+ Session session = getSessionFactory().openSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ session.saveOrUpdate(proc);
+ tx.commit();
+ }
+ finally
+ {
+ session.close();
+ }
+ log.debug("END saveProcess: " + proc.getKey());
+ return proc.getKey();
+ }
+
+ public Process loadProcess(ObjectName procID)
+ {
+ log.debug("START loadProcess: " + procID);
+ ProcessImpl procImpl = null;
+ Session session = getSessionFactory().openSession();
+ try
+ {
+ Integer id = Integer.valueOf(procID.getKeyProperty("id"));
+ procImpl = (ProcessImpl)session.load(ProcessImpl.class, id);
+ Hibernate.initialize(procImpl);
+ }
+ catch (ObjectNotFoundException ex)
+ {
+ throw new ProcessNotFoundException("Cannot find process: " + procID);
+ }
+ finally
+ {
+ session.close();
+ }
+ log.debug("END loadProcess: " + procID);
+ return procImpl;
+ }
+
+ public void deleteProcess(Process proc)
+ {
+ log.debug("START deleteProcess: " + proc.getKey());
+ Session session = getSessionFactory().openSession();
+ Transaction tx = session.beginTransaction();
+ try
+ {
+ session.delete(proc);
+ tx.commit();
+ }
+ finally
+ {
+ session.close();
+ }
+ log.debug("END deleteProcess: " + proc.getKey());
+ }
+
+ private SessionFactory getSessionFactory()
+ {
+ // If this property is not explicitly set in the beans config
+ // fall back to the -Ddatabase property that also activates
+ // the corresponding mvn profiles
+ if (hibernateConfig == null)
+ {
+ String database = System.getProperty("database", "mysql");
+ hibernateConfig = "hibernate.cfg." + database + ".xml";
+ }
+
+ if (sessionFactory == null)
+ {
+ AnnotationConfiguration anConfig = new AnnotationConfiguration();
+ anConfig.addAnnotatedClass(AbstractElementImpl.class);
+ anConfig.addAnnotatedClass(EndEventImpl.class);
+ anConfig.addAnnotatedClass(NodeImpl.class);
+ anConfig.addAnnotatedClass(ProcessImpl.class);
+ anConfig.addAnnotatedClass(SequenceFlowImpl.class);
+ anConfig.addAnnotatedClass(StartEventImpl.class);
+ anConfig.addAnnotatedClass(TaskImpl.class);
+ sessionFactory = anConfig.configure(hibernateConfig).buildSessionFactory();
+ }
+ return sessionFactory;
+ }
+}
Added: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/SignalServiceImpl.java
===================================================================
--- projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/SignalServiceImpl.java (rev 0)
+++ projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/SignalServiceImpl.java 2008-09-29 15:55:54 UTC (rev 2439)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.ri.service;
+
+// $Id$
+
+import org.jbpm.api.service.SignalService;
+
+/**
+ * An implementation of the SignalService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 17-Sep-2008
+ */
+public class SignalServiceImpl extends SignalService
+{
+}
Property changes on: projects/spec/trunk/modules/impl/src/main/java/org/jbpm/ri/service/SignalServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-09-29 13:35:02 UTC (rev 2438)
+++ projects/spec/trunk/modules/impl/src/main/resources/jbpm-cfg-beans.xml 2008-09-29 15:55:54 UTC (rev 2439)
@@ -10,12 +10,14 @@
<set elementClass="org.jbpm.api.service.Service">
<inject bean="jBPMProcessBuilder" />
<inject bean="jBPMPersistenceService" />
+ <inject bean="jBPMSignalService" />
</set>
</property>
</bean>
<!-- The Services -->
<bean name="jBPMProcessBuilder" class="org.jbpm.ri.model.builder.ProcessBuilderImpl" />
- <bean name="jBPMPersistenceService" class="org.jbpm.ri.service.HibernatePersistenceService" />
+ <bean name="jBPMPersistenceService" class="org.jbpm.ri.service.PersistenceServiceImpl" />
+ <bean name="jBPMSignalService" class="org.jbpm.ri.service.SignalServiceImpl" />
</deployment>
15 years, 8 months
JBoss JBPM SVN: r2438 - in jbpm4/trunk/modules/pvm/src/main: docs and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-09-29 09:35:02 -0400 (Mon, 29 Sep 2008)
New Revision: 2438
Added:
jbpm4/trunk/modules/pvm/src/main/docs/
jbpm4/trunk/modules/pvm/src/main/docs/glossary.html
Log:
pvm terminology
Added: jbpm4/trunk/modules/pvm/src/main/docs/glossary.html
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/docs/glossary.html (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/docs/glossary.html 2008-09-29 13:35:02 UTC (rev 2438)
@@ -0,0 +1,95 @@
+<html>
+<head>
+<style type="text/css">
+td {
+ border-width: 1 0 0 0;
+ border-style: solid;
+ border-color: gray;
+ padding: 3 0 3 0;
+}
+td.term {
+ white-space: nowrap;
+ font-weight: bold;
+ padding-right: 10px;
+ vertical-align: top;
+ text-align: right;
+}
+th {
+ color: white;
+ background-color: gray;
+}
+</style>
+</head>
+<body>
+<h1>Process Virtual Machine Terminology</h1>
+<table cellspacing="0">
+ <tr>
+ <th>Term</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td class="term">Process definition</td>
+ <td class="description">Executable diagram based on nodes and transitions.</td>
+ </tr>
+ <tr>
+ <td class="term">Node</td>
+ <td>Box in the diagram.</td>
+ </tr>
+ <tr>
+ <td class="term">Transition</td>
+ <td class="description">Arrow in the diagram representing control flow.</td>
+ </tr>
+ <tr>
+ <td class="term">Activity</td>
+ <td class="description">Java class that implements the runtime behaviour for a specific
+ type of process construct.
+ </td>
+ </tr>
+ <tr>
+ <td class="term">Event</td>
+ <td class="description">Position in the process definition to which event listeners
+ can be registered. The event listeners will be notified for each execution
+ that passes the event. Event listeners are not displayed on the diagram.
+ </td>
+ </tr>
+ <tr>
+ <td class="term">Execution</td>
+ <td class="description">A runtime path of execution. One pointer that keeps track of its
+ position in the diagram. An execution takes transitions and
+ executes the activity implementations as the behaviour associated
+ to the nodes.
+ </td>
+ </tr>
+ <tr>
+ <td class="term">Process instance</td>
+ <td class="description">The main path of execution for a complete execution of one process
+ definition. One pointer that keeps track of its
+ position in the diagram. An execution takes transitions and
+ executes the activity implementations as the behaviour associated
+ to the nodes.
+ </td>
+ </tr>
+ <tr>
+ <td class="term">Signal</td>
+ <td class="description">External trigger that can be fed into an execution. A signal
+ can contain arbitrary data. For convenience, the arbitrary data
+ is structured as a signalName (String) and a map of parameters
+ (Map<String,Object>). The information provided with a signal is
+ interpreted and used by the activity.
+ </td>
+ </tr>
+ <tr>
+ <td class="term">Process log</td>
+ <td class="description">Process event that can be observed by transactional, engine scoped listeners.
+ </td>
+ </tr>
+
+<!--
+ <tr>
+ <td class="term"></td>
+ <td class="description"></td>
+ </tr>
+ -->
+</table>
+</body>
+</html>
\ No newline at end of file
15 years, 8 months
JBoss JBPM SVN: r2437 - jbpm3/trunk/modules/enterprise/jar/src/test/resources.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-29 07:27:37 -0400 (Mon, 29 Sep 2008)
New Revision: 2437
Added:
jbpm3/trunk/modules/enterprise/jar/src/test/resources/hibernate.extra.hbm.xml
Log:
Add hibernate.extra.hbm.xml to enterprise
Added: jbpm3/trunk/modules/enterprise/jar/src/test/resources/hibernate.extra.hbm.xml
===================================================================
--- jbpm3/trunk/modules/enterprise/jar/src/test/resources/hibernate.extra.hbm.xml (rev 0)
+++ jbpm3/trunk/modules/enterprise/jar/src/test/resources/hibernate.extra.hbm.xml 2008-09-29 11:27:37 UTC (rev 2437)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+ <!-- ################################################## -->
+ <!-- # Additional mappings defined per module go here # -->
+ <!-- ################################################## -->
+
+</hibernate-mapping>
Property changes on: jbpm3/trunk/modules/enterprise/jar/src/test/resources/hibernate.extra.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 8 months
JBoss JBPM SVN: r2436 - in jbpm3/trunk/modules: examples and 2 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-29 07:12:31 -0400 (Mon, 29 Sep 2008)
New Revision: 2436
Added:
jbpm3/trunk/modules/core/src/main/resources/hibernate.identity.hbm.xml
jbpm3/trunk/modules/identity/src/main/resources/hibernate.identity.hbm.xml
Removed:
jbpm3/trunk/modules/identity/src/main/resources/hibernate.extra.hbm.xml
Modified:
jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml
jbpm3/trunk/modules/examples/pom.xml
jbpm3/trunk/modules/identity/scripts/assembly-config.xml
Log:
[JBPM-1290] Integrate example tests in automated testrun
Modified: jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml 2008-09-29 11:01:34 UTC (rev 2435)
+++ jbpm3/trunk/modules/core/src/main/resources/hibernate.common.xml 2008-09-29 11:12:31 UTC (rev 2436)
@@ -34,3 +34,5 @@
<!-- Additional mappings defined per module go here -->
<mapping resource="hibernate.extra.hbm.xml" />
+ <mapping resource="hibernate.identity.hbm.xml" />
+
\ No newline at end of file
Added: jbpm3/trunk/modules/core/src/main/resources/hibernate.identity.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/hibernate.identity.hbm.xml (rev 0)
+++ jbpm3/trunk/modules/core/src/main/resources/hibernate.identity.hbm.xml 2008-09-29 11:12:31 UTC (rev 2436)
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+
+ <!-- ################################################## -->
+ <!-- # Additional mappings defined per module go here # -->
+ <!-- ################################################## -->
+
+</hibernate-mapping>
Property changes on: jbpm3/trunk/modules/core/src/main/resources/hibernate.identity.hbm.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/examples/pom.xml
===================================================================
--- jbpm3/trunk/modules/examples/pom.xml 2008-09-29 11:01:34 UTC (rev 2435)
+++ jbpm3/trunk/modules/examples/pom.xml 2008-09-29 11:12:31 UTC (rev 2436)
@@ -101,10 +101,6 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <!-- [JBPM-1290] Integrate example tests in automated testrun -->
- <excludes>
- <exclude>org/jbpm/examples/websale/**</exclude>
- </excludes>
</configuration>
</plugin>
</plugins>
Modified: jbpm3/trunk/modules/identity/scripts/assembly-config.xml
===================================================================
--- jbpm3/trunk/modules/identity/scripts/assembly-config.xml 2008-09-29 11:01:34 UTC (rev 2435)
+++ jbpm3/trunk/modules/identity/scripts/assembly-config.xml 2008-09-29 11:12:31 UTC (rev 2436)
@@ -10,7 +10,7 @@
<directory>src/main/resources</directory>
<outputDirectory>/</outputDirectory>
<includes>
- <include>hibernate.extra.hbm.xml</include>
+ <include>hibernate.identity.hbm.xml</include>
</includes>
</fileSet>
</fileSets>
Deleted: jbpm3/trunk/modules/identity/src/main/resources/hibernate.extra.hbm.xml
===================================================================
--- jbpm3/trunk/modules/identity/src/main/resources/hibernate.extra.hbm.xml 2008-09-29 11:01:34 UTC (rev 2435)
+++ jbpm3/trunk/modules/identity/src/main/resources/hibernate.extra.hbm.xml 2008-09-29 11:12:31 UTC (rev 2436)
@@ -1,78 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping auto-import="false" default-access="field">
-
- <class name="org.jbpm.identity.User"
- table="JBPM_ID_USER"
- discriminator-value="U">
- <id name="id" column="ID_"><generator class="native" /></id>
- <discriminator type="char" column="CLASS_"/>
- <property name="name" column="NAME_"/>
- <property name="email" column="EMAIL_"/>
- <property name="password" column="PASSWORD_"/>
- <set name="memberships" cascade="all">
- <key column="USER_" />
- <one-to-many class="org.jbpm.identity.Membership" />
- </set>
- <set name="permissions" cascade="all" table="JBPM_ID_PERMISSIONS">
- <key column="ENTITY_" foreign-key="none" />
- <element type="org.jbpm.identity.hibernate.PermissionUserType">
- <column name="CLASS_"/>
- <column name="NAME_"/>
- <column name="ACTION_"/>
- </element>
- </set>
- </class>
-
- <class name="org.jbpm.identity.Group"
- table="JBPM_ID_GROUP"
- discriminator-value="G">
- <id name="id" column="ID_"><generator class="native" /></id>
- <discriminator type="char" column="CLASS_"/>
- <property name="name" column="NAME_"/>
- <property name="type" column="TYPE_"/>
- <many-to-one name="parent" column="PARENT_" foreign-key="FK_ID_GRP_PARENT"/>
- <set name="children" cascade="all">
- <key column="PARENT_" />
- <one-to-many class="org.jbpm.identity.Group" />
- </set>
- <set name="memberships" cascade="all">
- <key column="GROUP_" />
- <one-to-many class="org.jbpm.identity.Membership" />
- </set>
- <set name="permissions" cascade="all" table="JBPM_ID_PERMISSIONS" >
- <key column="ENTITY_" foreign-key="none" />
- <element type="org.jbpm.identity.hibernate.PermissionUserType">
- <column name="CLASS_"/>
- <column name="NAME_"/>
- <column name="ACTION_"/>
- </element>
- </set>
- </class>
-
- <class name="org.jbpm.identity.Membership"
- table="JBPM_ID_MEMBERSHIP"
- discriminator-value="M">
- <id name="id" column="ID_"><generator class="native" /></id>
- <discriminator type="char" column="CLASS_"/>
- <property name="name" column="NAME_"/>
- <property name="role" column="ROLE_"/>
- <many-to-one name="user" column="USER_" cascade="save-update"
- foreign-key="FK_ID_MEMSHIP_USR"/>
- <many-to-one name="group" column="GROUP_" cascade="save-update"
- foreign-key="FK_ID_MEMSHIP_GRP"/>
- <set name="permissions" cascade="all" table="JBPM_ID_PERMISSIONS">
- <key column="ENTITY_" foreign-key="none" />
- <element type="org.jbpm.identity.hibernate.PermissionUserType">
- <column name="CLASS_"/>
- <column name="NAME_"/>
- <column name="ACTION_"/>
- </element>
- </set>
- </class>
-
-</hibernate-mapping>
Copied: jbpm3/trunk/modules/identity/src/main/resources/hibernate.identity.hbm.xml (from rev 2423, jbpm3/trunk/modules/identity/src/main/resources/hibernate.extra.hbm.xml)
===================================================================
--- jbpm3/trunk/modules/identity/src/main/resources/hibernate.identity.hbm.xml (rev 0)
+++ jbpm3/trunk/modules/identity/src/main/resources/hibernate.identity.hbm.xml 2008-09-29 11:12:31 UTC (rev 2436)
@@ -0,0 +1,78 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+
+ <class name="org.jbpm.identity.User"
+ table="JBPM_ID_USER"
+ discriminator-value="U">
+ <id name="id" column="ID_"><generator class="native" /></id>
+ <discriminator type="char" column="CLASS_"/>
+ <property name="name" column="NAME_"/>
+ <property name="email" column="EMAIL_"/>
+ <property name="password" column="PASSWORD_"/>
+ <set name="memberships" cascade="all">
+ <key column="USER_" />
+ <one-to-many class="org.jbpm.identity.Membership" />
+ </set>
+ <set name="permissions" cascade="all" table="JBPM_ID_PERMISSIONS">
+ <key column="ENTITY_" foreign-key="none" />
+ <element type="org.jbpm.identity.hibernate.PermissionUserType">
+ <column name="CLASS_"/>
+ <column name="NAME_"/>
+ <column name="ACTION_"/>
+ </element>
+ </set>
+ </class>
+
+ <class name="org.jbpm.identity.Group"
+ table="JBPM_ID_GROUP"
+ discriminator-value="G">
+ <id name="id" column="ID_"><generator class="native" /></id>
+ <discriminator type="char" column="CLASS_"/>
+ <property name="name" column="NAME_"/>
+ <property name="type" column="TYPE_"/>
+ <many-to-one name="parent" column="PARENT_" foreign-key="FK_ID_GRP_PARENT"/>
+ <set name="children" cascade="all">
+ <key column="PARENT_" />
+ <one-to-many class="org.jbpm.identity.Group" />
+ </set>
+ <set name="memberships" cascade="all">
+ <key column="GROUP_" />
+ <one-to-many class="org.jbpm.identity.Membership" />
+ </set>
+ <set name="permissions" cascade="all" table="JBPM_ID_PERMISSIONS" >
+ <key column="ENTITY_" foreign-key="none" />
+ <element type="org.jbpm.identity.hibernate.PermissionUserType">
+ <column name="CLASS_"/>
+ <column name="NAME_"/>
+ <column name="ACTION_"/>
+ </element>
+ </set>
+ </class>
+
+ <class name="org.jbpm.identity.Membership"
+ table="JBPM_ID_MEMBERSHIP"
+ discriminator-value="M">
+ <id name="id" column="ID_"><generator class="native" /></id>
+ <discriminator type="char" column="CLASS_"/>
+ <property name="name" column="NAME_"/>
+ <property name="role" column="ROLE_"/>
+ <many-to-one name="user" column="USER_" cascade="save-update"
+ foreign-key="FK_ID_MEMSHIP_USR"/>
+ <many-to-one name="group" column="GROUP_" cascade="save-update"
+ foreign-key="FK_ID_MEMSHIP_GRP"/>
+ <set name="permissions" cascade="all" table="JBPM_ID_PERMISSIONS">
+ <key column="ENTITY_" foreign-key="none" />
+ <element type="org.jbpm.identity.hibernate.PermissionUserType">
+ <column name="CLASS_"/>
+ <column name="NAME_"/>
+ <column name="ACTION_"/>
+ </element>
+ </set>
+ </class>
+
+</hibernate-mapping>
15 years, 8 months