JBoss JBPM SVN: r1564 - jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-09 16:03:53 -0400 (Wed, 09 Jul 2008)
New Revision: 1564
Modified:
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ExecutionContextImpl.java
Log:
Cleanup API
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ExecutionContextImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ExecutionContextImpl.java 2008-07-09 20:03:48 UTC (rev 1563)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ExecutionContextImpl.java 2008-07-09 20:03:53 UTC (rev 1564)
@@ -28,7 +28,7 @@
import java.util.Iterator;
import java.util.Set;
-import org.jboss.bpm.client.Attachments;
+import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.ExecutionContext;
import org.jbpm.context.exe.ContextInstance;
15 years, 10 months
JBoss JBPM SVN: r1563 - in api/trunk: modules/api/src/main/java/org/jboss/bpm/client and 6 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-09 16:03:48 -0400 (Wed, 09 Jul 2008)
New Revision: 1563
Added:
api/trunk/docs/VioletUML/APIModel.class.violet
api/trunk/docs/VioletUML/APIModel.png
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Attachments.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicAttachments.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java
Removed:
api/trunk/docs/VioletUML/APIProcess.class.violet
api/trunk/docs/VioletUML/APIProcess.png
api/trunk/docs/VioletUML/APIRuntime.class.violet
api/trunk/docs/VioletUML/APIRuntime.png
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/Attachments.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/BasicAttachments.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java
Modified:
api/trunk/docs/VioletUML/APIClient.class.violet
api/trunk/docs/VioletUML/APIClient.png
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Result.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEndEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractProcess.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InitialToken.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionContext.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
Log:
Cleanup API
Modified: api/trunk/docs/VioletUML/APIClient.class.violet
===================================================================
--- api/trunk/docs/VioletUML/APIClient.class.violet 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/docs/VioletUML/APIClient.class.violet 2008-07-09 20:03:48 UTC (rev 1563)
@@ -10,15 +10,15 @@
</void>
<void property="name">
<void property="text">
- <string>ProcessDefinition
+ <string>Process
</string>
</void>
</void>
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>520.0</double>
- <double>151.0</double>
+ <double>462.0</double>
+ <double>48.0</double>
</void>
</object>
</void>
@@ -39,7 +39,7 @@
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
<double>12.0</double>
- <double>281.0</double>
+ <double>161.0</double>
</void>
</object>
</void>
@@ -47,62 +47,58 @@
<object id="ClassNode2" class="com.horstmann.violet.ClassNode">
<void property="methods">
<void property="text">
- <string>createProcessDefinition
-findProcessDefinition
-removeProcessDefinition</string>
+ <string>createProcess
+findProcess
+removeProcess</string>
</void>
</void>
<void property="name">
<void property="text">
- <string>ProcessDefinitionManager</string>
+ <string>ProcessManager</string>
</void>
</void>
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>254.0</double>
- <double>123.0</double>
+ <double>251.0</double>
+ <double>30.0</double>
</void>
</object>
</void>
<void method="addNode">
<object id="ClassNode3" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>name
-metadata</string>
- </void>
- </void>
<void property="name">
<void property="text">
- <string>ProcessInstance</string>
+ <string>FlowObject</string>
</void>
</void>
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>521.0</double>
- <double>292.0</double>
+ <double>622.0</double>
+ <double>54.0</double>
</void>
</object>
</void>
<void method="addNode">
<object id="ClassNode4" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
+ <void property="methods">
<void property="text">
- <string>name</string>
+ <string>addListener
+removeListener
+throwSignal</string>
</void>
</void>
<void property="name">
<void property="text">
- <string>Execution</string>
+ <string>SignalManager</string>
</void>
</void>
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>524.0</double>
- <double>425.0</double>
+ <double>253.0</double>
+ <double>226.0</double>
</void>
</object>
</void>
@@ -110,40 +106,42 @@
<object id="ClassNode5" class="com.horstmann.violet.ClassNode">
<void property="methods">
<void property="text">
- <string>createProcessInstance
-</string>
+ <string>catchSignal</string>
</void>
</void>
<void property="name">
<void property="text">
- <string>ProcessInstanceManager</string>
+ <string>SignalListener</string>
</void>
</void>
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>253.0</double>
- <double>288.0</double>
+ <double>245.0</double>
+ <double>380.0</double>
</void>
</object>
</void>
<void method="addNode">
<object id="ClassNode6" class="com.horstmann.violet.ClassNode">
- <void property="methods">
+ <void property="attributes">
<void property="text">
- <string>createExecution</string>
+ <string>process
+message
+type
+</string>
</void>
</void>
<void property="name">
<void property="text">
- <string>ExecutionManager</string>
+ <string>Signal</string>
</void>
</void>
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>250.0</double>
- <double>416.0</double>
+ <double>404.0</double>
+ <double>230.0</double>
</void>
</object>
</void>
@@ -194,14 +192,11 @@
<void property="bentStyle">
<object class="com.horstmann.violet.BentStyle" field="HVH"/>
</void>
- <void property="endLabel">
- <string>0..*</string>
- </void>
<void property="startArrowHead">
<object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
</void>
</object>
- <object idref="ClassNode3"/>
+ <object idref="ClassNode1"/>
<object idref="ClassNode4"/>
</void>
<void method="connect">
@@ -209,23 +204,29 @@
<void property="bentStyle">
<object class="com.horstmann.violet.BentStyle" field="HVH"/>
</void>
- <void property="startArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="V"/>
</void>
+ <void property="endLabel">
+ <string>0..*</string>
+ </void>
</object>
- <object idref="ClassNode1"/>
+ <object idref="ClassNode4"/>
<object idref="ClassNode5"/>
</void>
<void method="connect">
<object class="com.horstmann.violet.ClassRelationshipEdge">
<void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ <object class="com.horstmann.violet.BentStyle" field="HV"/>
</void>
- <void property="startArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="V"/>
</void>
+ <void property="lineStyle">
+ <object class="com.horstmann.violet.LineStyle" field="DOTTED"/>
+ </void>
</object>
- <object idref="ClassNode1"/>
+ <object idref="ClassNode4"/>
<object idref="ClassNode6"/>
</void>
</object>
Modified: api/trunk/docs/VioletUML/APIClient.png
===================================================================
(Binary files differ)
Added: api/trunk/docs/VioletUML/APIModel.class.violet
===================================================================
--- api/trunk/docs/VioletUML/APIModel.class.violet (rev 0)
+++ api/trunk/docs/VioletUML/APIModel.class.violet 2008-07-09 20:03:48 UTC (rev 1563)
@@ -0,0 +1,562 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<java version="1.6.0_06" class="java.beans.XMLDecoder">
+ <object class="com.horstmann.violet.ClassDiagramGraph">
+ <void method="addNode">
+ <object id="ClassNode0" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>ExecutionContext</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>728.0</double>
+ <double>18.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode1" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>Attachments</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>736.0</double>
+ <double>114.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode2" class="com.horstmann.violet.ClassNode">
+ <void property="methods">
+ <void property="text">
+ <string>execute</string>
+ </void>
+ </void>
+ <void property="name">
+ <void property="text">
+ <string>FlowObject</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>351.0</double>
+ <double>20.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode3" class="com.horstmann.violet.ClassNode">
+ <void property="methods">
+ <void property="text">
+ <string>startProcess</string>
+ </void>
+ </void>
+ <void property="name">
+ <void property="text">
+ <string>Process
+</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>211.0</double>
+ <double>354.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode4" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>Event</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>195.0</double>
+ <double>128.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode5" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>StartEvent</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>33.0</double>
+ <double>209.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode6" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>IntermediateEvent</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>9.0</double>
+ <double>134.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode7" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>EndEvent</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>27.0</double>
+ <double>302.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode8" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>Activity</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>349.0</double>
+ <double>240.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode9" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>Gateway
+</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>496.0</double>
+ <double>133.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode10" class="com.horstmann.violet.ClassNode">
+ <void property="attributes">
+ <void property="text">
+ <string>parent</string>
+ </void>
+ </void>
+ <void property="name">
+ <void property="text">
+ <string>SubProcess
+</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>205.0</double>
+ <double>445.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode11" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>Task</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>436.0</double>
+ <double>353.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode12" class="com.horstmann.violet.ClassNode">
+ <void property="attributes">
+ <void property="text">
+ <string>process</string>
+ </void>
+ </void>
+ <void property="name">
+ <void property="text">
+ <string>Token</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>589.0</double>
+ <double>15.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode13" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>ExclusiveGateway</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>643.0</double>
+ <double>237.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode14" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>InclusiveGateway</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>636.0</double>
+ <double>306.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode15" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>ComplexGateway</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>636.0</double>
+ <double>376.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode16" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>ParallelGateway</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>639.0</double>
+ <double>446.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode17" class="com.horstmann.violet.ClassNode">
+ <void property="attributes">
+ <void property="text">
+ <string>name</string>
+ </void>
+ </void>
+ <void property="name">
+ <void property="text">
+ <string>NamedFlowObject
+</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>327.0</double>
+ <double>127.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode18" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>Result</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>28.0</double>
+ <double>396.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ClassNode19" class="com.horstmann.violet.ClassNode">
+ <void property="name">
+ <void property="text">
+ <string>Attachments</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>29.0</double>
+ <double>490.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode5"/>
+ <object idref="ClassNode4"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="VHV"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode4"/>
+ <object idref="ClassNode2"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode6"/>
+ <object idref="ClassNode4"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode7"/>
+ <object idref="ClassNode4"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="VHV"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode9"/>
+ <object idref="ClassNode2"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="VHV"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode3"/>
+ <object idref="ClassNode8"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="VHV"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode10"/>
+ <object idref="ClassNode3"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="VHV"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode11"/>
+ <object idref="ClassNode8"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="V"/>
+ </void>
+ </object>
+ <object idref="ClassNode12"/>
+ <object idref="ClassNode0"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="VHV"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode0"/>
+ <object idref="ClassNode1"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode13"/>
+ <object idref="ClassNode9"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode14"/>
+ <object idref="ClassNode9"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode15"/>
+ <object idref="ClassNode9"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode16"/>
+ <object idref="ClassNode9"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="VHV"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode17"/>
+ <object idref="ClassNode2"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="VHV"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
+ </void>
+ </object>
+ <object idref="ClassNode8"/>
+ <object idref="ClassNode17"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="V"/>
+ </void>
+ </object>
+ <object idref="ClassNode7"/>
+ <object idref="ClassNode18"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="V"/>
+ </void>
+ </object>
+ <object idref="ClassNode2"/>
+ <object idref="ClassNode12"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.ClassRelationshipEdge">
+ <void property="bentStyle">
+ <object class="com.horstmann.violet.BentStyle" field="HVH"/>
+ </void>
+ <void property="endArrowHead">
+ <object class="com.horstmann.violet.ArrowHead" field="V"/>
+ </void>
+ </object>
+ <object idref="ClassNode18"/>
+ <object idref="ClassNode19"/>
+ </void>
+ </object>
+</java>
Added: api/trunk/docs/VioletUML/APIModel.png
===================================================================
(Binary files differ)
Property changes on: api/trunk/docs/VioletUML/APIModel.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: api/trunk/docs/VioletUML/APIProcess.class.violet
===================================================================
--- api/trunk/docs/VioletUML/APIProcess.class.violet 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/docs/VioletUML/APIProcess.class.violet 2008-07-09 20:03:48 UTC (rev 1563)
@@ -1,329 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<java version="1.6.0_06" class="java.beans.XMLDecoder">
- <object class="com.horstmann.violet.ClassDiagramGraph">
- <void method="addNode">
- <object id="ClassNode0" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>name</string>
- </void>
- </void>
- <void property="methods">
- <void property="text">
- <string>createProcessInstance
-findProcessInstance
-removeProcessInstance</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>ProcessDefinition
-</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>162.0</double>
- <double>210.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode1" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>name</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>Node</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>394.0</double>
- <double>232.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode2" class="com.horstmann.violet.ClassNode">
- <void property="name">
- <void property="text">
- <string>StartNode
-</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>304.0</double>
- <double>69.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode3" class="com.horstmann.violet.ClassNode">
- <void property="name">
- <void property="text">
- <string>EndNode</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>470.0</double>
- <double>74.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode4" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>name</string>
- </void>
- </void>
- <void property="methods">
- <void property="text">
- <string>createExecution
-findExecution
-removeExecution</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>ProcessInstance</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>170.0</double>
- <double>362.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode5" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>name</string>
- </void>
- </void>
- <void property="methods">
- <void property="text">
- <string>signal()</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>Execution</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>388.0</double>
- <double>377.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="NoteNode0" class="com.horstmann.violet.NoteNode">
- <void property="text">
- <void property="text">
- <string>The client signals the
-Excecution without
-parameters. </string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>437.0</double>
- <double>491.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode6" class="com.horstmann.violet.ClassNode">
- <void property="name">
- <void property="text">
- <string>ExecutionContext</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>547.0</double>
- <double>375.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode7" class="com.horstmann.violet.ClassNode">
- <void property="name">
- <void property="text">
- <string>Attachments</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>9.0</double>
- <double>371.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode8" class="com.horstmann.violet.ClassNode">
- <void property="name">
- <void property="text">
- <string>Attachments</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>550.0</double>
- <double>270.0</double>
- </void>
- </object>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
- </void>
- <void property="endLabel">
- <string>1..*</string>
- </void>
- <void property="startArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
- </void>
- </object>
- <object idref="ClassNode0"/>
- <object idref="ClassNode1"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="VHV"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
- </void>
- </object>
- <object idref="ClassNode2"/>
- <object idref="ClassNode1"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="VHV"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
- </void>
- </object>
- <object idref="ClassNode3"/>
- <object idref="ClassNode1"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="V"/>
- </void>
- <void property="endLabel">
- <string>current</string>
- </void>
- </object>
- <object idref="ClassNode5"/>
- <object idref="ClassNode1"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
- </void>
- <void property="endLabel">
- <string>0..*</string>
- </void>
- <void property="startArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
- </void>
- </object>
- <object idref="ClassNode0"/>
- <object idref="ClassNode4"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
- </void>
- <void property="endLabel">
- <string>0..*</string>
- </void>
- <void property="startArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
- </void>
- </object>
- <object idref="ClassNode4"/>
- <object idref="ClassNode5"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.NoteEdge"/>
- <object idref="ClassNode5"/>
- <object idref="NoteNode0"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="VHV"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
- </void>
- <void property="lineStyle">
- <object class="com.horstmann.violet.LineStyle" field="DOTTED"/>
- </void>
- </object>
- <object idref="ClassNode4"/>
- <object idref="ClassNode7"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
- </void>
- <void property="startArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="DIAMOND"/>
- </void>
- </object>
- <object idref="ClassNode5"/>
- <object idref="ClassNode6"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="VHV"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
- </void>
- <void property="lineStyle">
- <object class="com.horstmann.violet.LineStyle" field="DOTTED"/>
- </void>
- </object>
- <object idref="ClassNode6"/>
- <object idref="ClassNode8"/>
- </void>
- </object>
-</java>
Deleted: api/trunk/docs/VioletUML/APIProcess.png
===================================================================
(Binary files differ)
Deleted: api/trunk/docs/VioletUML/APIRuntime.class.violet
===================================================================
--- api/trunk/docs/VioletUML/APIRuntime.class.violet 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/docs/VioletUML/APIRuntime.class.violet 2008-07-09 20:03:48 UTC (rev 1563)
@@ -1,330 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<java version="1.6.0_06" class="java.beans.XMLDecoder">
- <object class="com.horstmann.violet.ClassDiagramGraph">
- <void method="addNode">
- <object id="ClassNode0" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>name</string>
- </void>
- </void>
- <void property="methods">
- <void property="text">
- <string>signal(name)</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>RuntimeExecution</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>172.0</double>
- <double>355.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode1" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>name</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>RuntimeNode</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>171.0</double>
- <double>243.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode2" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>name</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>Transition</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>12.0</double>
- <double>241.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode3" class="com.horstmann.violet.ClassNode">
- <void property="methods">
- <void property="text">
- <string>execute</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>Activity</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>397.0</double>
- <double>209.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode4" class="com.horstmann.violet.ClassNode">
- <void property="methods">
- <void property="text">
- <string>choosePath</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>TransitionRouter</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>395.0</double>
- <double>297.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="NoteNode0" class="com.horstmann.violet.NoteNode">
- <void property="text">
- <void property="text">
- <string>Executes business logic.
-Has access to the execution
-context, but not the definition.</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>291.0</double>
- <double>100.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="NoteNode1" class="com.horstmann.violet.NoteNode">
- <void property="text">
- <void property="text">
- <string>Chooses the leaving
-Transition.</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>459.0</double>
- <double>415.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode5" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>
-</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>ExecutionContext</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>562.0</double>
- <double>254.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode6" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>name</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>Node</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>559.0</double>
- <double>163.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object id="ClassNode7" class="com.horstmann.violet.ClassNode">
- <void property="attributes">
- <void property="text">
- <string>name</string>
- </void>
- </void>
- <void property="methods">
- <void property="text">
- <string>signal()</string>
- </void>
- </void>
- <void property="name">
- <void property="text">
- <string>Execution</string>
- </void>
- </void>
- </object>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>16.0</double>
- <double>356.0</double>
- </void>
- </object>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="V"/>
- </void>
- <void property="endLabel">
- <string>current</string>
- </void>
- </object>
- <object idref="ClassNode0"/>
- <object idref="ClassNode1"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="V"/>
- </void>
- <void property="endLabel">
- <string>0..*</string>
- </void>
- </object>
- <object idref="ClassNode1"/>
- <object idref="ClassNode2"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="VHV"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="V"/>
- </void>
- </object>
- <object idref="ClassNode1"/>
- <object idref="ClassNode3"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="V"/>
- </void>
- </object>
- <object idref="ClassNode1"/>
- <object idref="ClassNode4"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="VH"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="V"/>
- </void>
- <void property="lineStyle">
- <object class="com.horstmann.violet.LineStyle" field="DOTTED"/>
- </void>
- </object>
- <object idref="ClassNode4"/>
- <object idref="ClassNode0"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.NoteEdge"/>
- <object idref="ClassNode3"/>
- <object idref="NoteNode0"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.NoteEdge"/>
- <object idref="ClassNode4"/>
- <object idref="NoteNode1"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="V"/>
- </void>
- <void property="lineStyle">
- <object class="com.horstmann.violet.LineStyle" field="DOTTED"/>
- </void>
- </object>
- <object idref="ClassNode3"/>
- <object idref="ClassNode5"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="HVH"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="V"/>
- </void>
- <void property="lineStyle">
- <object class="com.horstmann.violet.LineStyle" field="DOTTED"/>
- </void>
- </object>
- <object idref="ClassNode3"/>
- <object idref="ClassNode6"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.ClassRelationshipEdge">
- <void property="bentStyle">
- <object class="com.horstmann.violet.BentStyle" field="VHV"/>
- </void>
- <void property="endArrowHead">
- <object class="com.horstmann.violet.ArrowHead" field="TRIANGLE"/>
- </void>
- </object>
- <object idref="ClassNode0"/>
- <object idref="ClassNode7"/>
- </void>
- </object>
-</java>
Deleted: api/trunk/docs/VioletUML/APIRuntime.png
===================================================================
(Binary files differ)
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/Attachments.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/Attachments.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/Attachments.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -1,134 +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.client;
-
-//$Id$
-
-import java.util.Collection;
-
-/**
- * An interface for general Attachments
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public interface Attachments
-{
- /** Get attachment keys */
- Collection<Key> getAttachmentKeys();
-
- /** Add arbitrary attachment */
- <T> T addAttachment(Class<T> clazz, Object value);
-
- /** Add arbitrary attachment with name */
- <T> T addAttachment(Class<T> clazz, String name, Object value);
-
- /** Add arbitrary attachment with name */
- <T> T addAttachment(String name, Object value);
-
- /** Get an arbitrary attachment */
- <T> T getAttachment(Class<T> clazz);
-
- /** Get an arbitrary attachment */
- <T> T getAttachment(Class<T> clazz, String name);
-
- /** Get an arbitrary attachment */
- <T> T getAttachment(String name);
-
- /** Remove arbitrary attachments */
- <T> T removeAttachment(Class<T> clazz);
-
- /** Remove arbitrary attachments */
- <T> T removeAttachment(Class<T> clazz, String name);
-
- /** Remove arbitrary attachments */
- <T> T removeAttachment(String name);
-
- /**
- * A key for attachements
- */
- public static class Key
- {
- private Class<?> clazz;
- private String name;
-
- /**
- * Construct the key with optional class and name
- */
- public Key(Class<?> clazz, String name)
- {
- this.clazz = clazz;
- this.name = name;
- }
-
- /**
- * Get the class part for this key
- *
- * @return maybe null
- */
- public Class<?> getClassPart()
- {
- return clazz;
- }
-
- /**
- * Get the name part for this key
- *
- * @return maybe null
- */
- public String getNamePart()
- {
- return name;
- }
-
- /**
- * Two keys are equal if their {@link #toString()} is equal
- */
- public boolean equals(Object obj)
- {
- if (!(obj instanceof Key))
- return false;
- if (obj == this)
- return true;
- return obj.toString().equals(toString());
- }
-
- /**
- * Two keys have the same hashCode if their {@link #toString()} is equal
- */
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- /**
- * Returns the String repesentation of this Key. <p/>
- * <pre>
- * "[" + clazz + "," + name + "]"
- * </pre>
- */
- public String toString()
- {
- return "[" + (clazz != null ? clazz.getName() : null) + "," + name + "]";
- }
- }
-}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/BasicAttachments.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/BasicAttachments.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/BasicAttachments.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -1,118 +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.client;
-
-//$Id$
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-
-/**
- * Basic attachments.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class BasicAttachments implements Attachments
-{
- private Map<Key, Object> attachments = new HashMap<Key, Object>();
-
- /** Construct the execution context with no attachments */
- public BasicAttachments()
- {
-
- }
-
- /** Construct the execution context with given attachments */
- public BasicAttachments(Attachments att)
- {
- if (att != null)
- {
- for (Key key : att.getAttachmentKeys())
- {
- Object value = att.getAttachment(key.getClassPart(), key.getNamePart());
- this.attachments.put(key, value);
- }
- }
- }
-
- public Collection<Key> getAttachmentKeys()
- {
- return attachments.keySet();
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getAttachment(Class<T> clazz)
- {
- return (T)attachments.get(new Key(clazz, null));
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getAttachment(Class<T> clazz, String name)
- {
- return (T)attachments.get(new Key(clazz, name));
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getAttachment(String name)
- {
- return (T)attachments.get(new Key(null, name));
- }
-
- @SuppressWarnings("unchecked")
- public <T> T addAttachment(Class<T> clazz, Object obj)
- {
- return (T)attachments.put(new Key(clazz, null), obj);
- }
-
- @SuppressWarnings("unchecked")
- public <T> T addAttachment(Class<T> clazz, String name, Object obj)
- {
- return (T)attachments.put(new Key(clazz, name), obj);
- }
-
- @SuppressWarnings("unchecked")
- public <T> T addAttachment(String name, Object obj)
- {
- return (T)attachments.put(new Key(null, name), obj);
- }
-
- @SuppressWarnings("unchecked")
- public <T> T removeAttachment(Class<T> clazz)
- {
- return (T)attachments.remove(new Key(clazz, null));
- }
-
- @SuppressWarnings("unchecked")
- public <T> T removeAttachment(Class<T> clazz, String name)
- {
- return (T)attachments.remove(new Key(clazz, name));
- }
-
- @SuppressWarnings("unchecked")
- public <T> T removeAttachment(String name)
- {
- return (T)attachments.remove(new Key(null, name));
- }
-}
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -1,38 +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.client;
-
-//$Id$
-
-import org.jboss.bpm.runtime.Signal;
-
-/**
- * A signal listener that can be registered with the ProcessEngine
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface SignalListener
-{
- /** Catch a signal from the process that this listener is registered with */
- void catchSignal(Signal signal);
-}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -31,6 +31,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.runtime.Signal;
+import org.jboss.bpm.runtime.SignalListener;
/**
* The signal manager is the entry point for signal processing
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -24,7 +24,7 @@
import java.util.Set;
import java.util.concurrent.Future;
-import org.jboss.bpm.client.Attachments;
+import org.jboss.bpm.runtime.Attachments;
// $Id$
@@ -35,7 +35,7 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Process extends Activity, NamedFlowObject
+public interface Process extends Activity
{
/** Start the process */
Future<Result> startProcess();
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Result.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Result.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Result.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -23,7 +23,7 @@
//$Id$
-import org.jboss.bpm.client.Attachments;
+import org.jboss.bpm.runtime.Attachments;
/**
* A Result is consequence of reaching an End Event.
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEndEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEndEvent.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEndEvent.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -23,9 +23,9 @@
// $Id$
-import org.jboss.bpm.client.Attachments;
import org.jboss.bpm.model.EndEvent;
import org.jboss.bpm.model.Result;
+import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.Signal;
import org.jboss.bpm.runtime.Token;
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractProcess.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractProcess.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -33,7 +33,6 @@
import org.jboss.bpm.InvalidProcessException;
import org.jboss.bpm.NameNotUniqueException;
import org.jboss.bpm.NotImplementedException;
-import org.jboss.bpm.client.Attachments;
import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.model.EndEvent;
import org.jboss.bpm.model.FlowObject;
@@ -41,6 +40,7 @@
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.StartEvent;
+import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.Signal;
/**
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InitialToken.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InitialToken.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InitialToken.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -23,9 +23,9 @@
// $Id$
-import org.jboss.bpm.client.Attachments;
-import org.jboss.bpm.client.BasicAttachments;
import org.jboss.bpm.model.Process;
+import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.BasicAttachments;
import org.jboss.bpm.runtime.ExecutionContext;
import org.jboss.bpm.runtime.Token;
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Attachments.java (from rev 1561, api/trunk/modules/api/src/main/java/org/jboss/bpm/client/Attachments.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Attachments.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Attachments.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.runtime;
+
+//$Id$
+
+import java.util.Collection;
+
+/**
+ * An interface for general Attachments
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface Attachments
+{
+ /** Get attachment keys */
+ Collection<Key> getAttachmentKeys();
+
+ /** Add arbitrary attachment */
+ <T> T addAttachment(Class<T> clazz, Object value);
+
+ /** Add arbitrary attachment with name */
+ <T> T addAttachment(Class<T> clazz, String name, Object value);
+
+ /** Add arbitrary attachment with name */
+ <T> T addAttachment(String name, Object value);
+
+ /** Get an arbitrary attachment */
+ <T> T getAttachment(Class<T> clazz);
+
+ /** Get an arbitrary attachment */
+ <T> T getAttachment(Class<T> clazz, String name);
+
+ /** Get an arbitrary attachment */
+ <T> T getAttachment(String name);
+
+ /** Remove arbitrary attachments */
+ <T> T removeAttachment(Class<T> clazz);
+
+ /** Remove arbitrary attachments */
+ <T> T removeAttachment(Class<T> clazz, String name);
+
+ /** Remove arbitrary attachments */
+ <T> T removeAttachment(String name);
+
+ /**
+ * A key for attachements
+ */
+ public static class Key
+ {
+ private Class<?> clazz;
+ private String name;
+
+ /**
+ * Construct the key with optional class and name
+ */
+ public Key(Class<?> clazz, String name)
+ {
+ this.clazz = clazz;
+ this.name = name;
+ }
+
+ /**
+ * Get the class part for this key
+ *
+ * @return maybe null
+ */
+ public Class<?> getClassPart()
+ {
+ return clazz;
+ }
+
+ /**
+ * Get the name part for this key
+ *
+ * @return maybe null
+ */
+ public String getNamePart()
+ {
+ return name;
+ }
+
+ /**
+ * Two keys are equal if their {@link #toString()} is equal
+ */
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof Key))
+ return false;
+ if (obj == this)
+ return true;
+ return obj.toString().equals(toString());
+ }
+
+ /**
+ * Two keys have the same hashCode if their {@link #toString()} is equal
+ */
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ /**
+ * Returns the String repesentation of this Key. <p/>
+ * <pre>
+ * "[" + clazz + "," + name + "]"
+ * </pre>
+ */
+ public String toString()
+ {
+ return "[" + (clazz != null ? clazz.getName() : null) + "," + name + "]";
+ }
+ }
+}
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicAttachments.java (from rev 1561, api/trunk/modules/api/src/main/java/org/jboss/bpm/client/BasicAttachments.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicAttachments.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicAttachments.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.runtime;
+
+//$Id$
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+
+
+/**
+ * Basic attachments.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class BasicAttachments implements Attachments
+{
+ private Map<Key, Object> attachments = new HashMap<Key, Object>();
+
+ /** Construct the execution context with no attachments */
+ public BasicAttachments()
+ {
+
+ }
+
+ /** Construct the execution context with given attachments */
+ public BasicAttachments(Attachments att)
+ {
+ if (att != null)
+ {
+ for (Key key : att.getAttachmentKeys())
+ {
+ Object value = att.getAttachment(key.getClassPart(), key.getNamePart());
+ this.attachments.put(key, value);
+ }
+ }
+ }
+
+ public Collection<Key> getAttachmentKeys()
+ {
+ return attachments.keySet();
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(Class<T> clazz)
+ {
+ return (T)attachments.get(new Key(clazz, null));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(Class<T> clazz, String name)
+ {
+ return (T)attachments.get(new Key(clazz, name));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(String name)
+ {
+ return (T)attachments.get(new Key(null, name));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(Class<T> clazz, Object obj)
+ {
+ return (T)attachments.put(new Key(clazz, null), obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(Class<T> clazz, String name, Object obj)
+ {
+ return (T)attachments.put(new Key(clazz, name), obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(String name, Object obj)
+ {
+ return (T)attachments.put(new Key(null, name), obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(Class<T> clazz)
+ {
+ return (T)attachments.remove(new Key(clazz, null));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(Class<T> clazz, String name)
+ {
+ return (T)attachments.remove(new Key(clazz, name));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(String name)
+ {
+ return (T)attachments.remove(new Key(null, name));
+ }
+}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionContext.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionContext.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionContext.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -23,7 +23,6 @@
//$Id$
-import org.jboss.bpm.client.Attachments;
/**
* An execution context that can take attachments.
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java (from rev 1561, api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/SignalListener.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.runtime;
+
+//$Id$
+
+
+/**
+ * A signal listener that can be registered with the ProcessEngine
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalListener
+{
+ /** Catch a signal from the process that this listener is registered with */
+ void catchSignal(Signal signal);
+}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -29,9 +29,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.client.SignalListener;
import org.jboss.bpm.client.ProcessEngine;
import org.jboss.bpm.runtime.Signal;
+import org.jboss.bpm.runtime.SignalListener;
public abstract class DefaultEngineTestCase extends AbstractAPITestCase implements SignalListener
{
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -26,12 +26,12 @@
import java.net.URL;
import java.util.concurrent.Future;
-import org.jboss.bpm.client.Attachments;
-import org.jboss.bpm.client.BasicAttachments;
import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.client.SignalManager;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
+import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.BasicAttachments;
import org.jboss.bpm.test.DefaultEngineTestCase;
/**
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-09 19:14:53 UTC (rev 1562)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-09 20:03:48 UTC (rev 1563)
@@ -27,11 +27,11 @@
import java.util.List;
import java.util.concurrent.Future;
-import org.jboss.bpm.client.Attachments;
import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.client.SignalManager;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
+import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.Signal;
import org.jboss.bpm.test.DefaultEngineTestCase;
15 years, 10 months
JBoss JBPM SVN: r1562 - in api/trunk: modules/testsuite/src/test/java/org/jboss/bpm/samples/engine and 3 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-09 15:14:53 -0400 (Wed, 09 Jul 2008)
New Revision: 1562
Added:
api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.bpmn
api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.bpmn_diagram
api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.png
api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.bpmn
api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.bpmn_diagram
api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.png
Modified:
api/trunk/.project
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/engine/EngineShutdownTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
Log:
Add BPMN resources
Modified: api/trunk/.project
===================================================================
--- api/trunk/.project 2008-07-09 18:27:25 UTC (rev 1561)
+++ api/trunk/.project 2008-07-09 19:14:53 UTC (rev 1562)
@@ -15,9 +15,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.stp.bpmn.validation.BatchValidationBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.stp.bpmn.validation.BatchValidationBuildAbleNature</nature>
</natures>
</projectDescription>
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/engine/EngineShutdownTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/engine/EngineShutdownTest.java 2008-07-09 18:27:25 UTC (rev 1561)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/engine/EngineShutdownTest.java 2008-07-09 19:14:53 UTC (rev 1562)
@@ -53,9 +53,9 @@
}
/**
- * Try to create a ProcessDefinition during shutdown
+ * Try to create a Process during shutdown
*/
- public void testCreateProcessDefinition() throws Exception
+ public void testCreateProcess() throws Exception
{
// Create a Process through the ProcessManager
ProcessManager pm = ProcessManager.locateProcessManager();
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-09 18:27:25 UTC (rev 1561)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-09 19:14:53 UTC (rev 1562)
@@ -55,10 +55,10 @@
}
/**
- * Test that the execution context variables set by the Activity
+ * Test that the execution context variables set by the Task
* are visible to the client.
*/
- public void testBasicActivity() throws Exception
+ public void testBasicTask() throws Exception
{
// Create a Process through the ProcessManager
ProcessManager pm = ProcessManager.locateProcessManager();
Added: api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.bpmn
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.bpmn (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.bpmn 2008-07-09 19:14:53 UTC (rev 1562)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:BpmnDiagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:bpmn="http://stp.eclipse.org/bpmn" xmi:id="_UstEIE3nEd2LNJlZf0NQOw" iD="_UspZwE3nEd2LNJlZf0NQOw">
+ <pools xmi:type="bpmn:Pool" xmi:id="_Ut2ToE3nEd2LNJlZf0NQOw" iD="_Ut1skE3nEd2LNJlZf0NQOw" name="Pool">
+ <vertices xmi:type="bpmn:Activity" xmi:id="_UuUNsU3nEd2LNJlZf0NQOw" iD="_UuUNsE3nEd2LNJlZf0NQOw" outgoingEdges="_c8S7wU3nEd2LNJlZf0NQOw" incomingEdges="_bWie4E3nEd2LNJlZf0NQOw" name="StateA" activityType="Task"/>
+ <vertices xmi:type="bpmn:Activity" xmi:id="_aeNvwE3nEd2LNJlZf0NQOw" iD="_aeNIsE3nEd2LNJlZf0NQOw" outgoingEdges="_bWie4E3nEd2LNJlZf0NQOw" activityType="EventStartEmpty"/>
+ <vertices xmi:type="bpmn:Activity" xmi:id="_cUlbgU3nEd2LNJlZf0NQOw" iD="_cUlbgE3nEd2LNJlZf0NQOw" incomingEdges="_c8S7wU3nEd2LNJlZf0NQOw" activityType="EventEndEmpty"/>
+ <sequenceEdges xmi:type="bpmn:SequenceEdge" xmi:id="_bWie4E3nEd2LNJlZf0NQOw" iD="_bWh30E3nEd2LNJlZf0NQOw" source="_aeNvwE3nEd2LNJlZf0NQOw" target="_UuUNsU3nEd2LNJlZf0NQOw"/>
+ <sequenceEdges xmi:type="bpmn:SequenceEdge" xmi:id="_c8S7wU3nEd2LNJlZf0NQOw" iD="_c8S7wE3nEd2LNJlZf0NQOw" source="_UuUNsU3nEd2LNJlZf0NQOw" target="_cUlbgU3nEd2LNJlZf0NQOw"/>
+ </pools>
+</bpmn:BpmnDiagram>
Added: api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.bpmn_diagram
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.bpmn_diagram (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.bpmn_diagram 2008-07-09 19:14:53 UTC (rev 1562)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:bpmn="http://stp.eclipse.org/bpmn" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation" xmi:id="_UtiKkE3nEd2LNJlZf0NQOw" type="Bpmn" name="basic-sequence.bpmn_diagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Node" xmi:id="_Uufz4E3nEd2LNJlZf0NQOw" type="1001">
+ <children xmi:type="notation:Node" xmi:id="_UuksYE3nEd2LNJlZf0NQOw" type="4008"/>
+ <children xmi:type="notation:Node" xmi:id="_UunIoE3nEd2LNJlZf0NQOw" type="5001">
+ <children xmi:type="notation:Node" xmi:id="_Uupk4E3nEd2LNJlZf0NQOw" type="2001">
+ <children xmi:type="notation:Node" xmi:id="_UuqL8E3nEd2LNJlZf0NQOw" type="4001"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_Uupk4U3nEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_Uupk4k3nEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_Uupk403nEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_Uupk5E3nEd2LNJlZf0NQOw" lineColor="0"/>
+ <element xmi:type="bpmn:Activity" href="basic-sequence.bpmn#_UuUNsU3nEd2LNJlZf0NQOw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_UuqL8U3nEd2LNJlZf0NQOw" x="84" y="28" width="111" height="61"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_aeUdcE3nEd2LNJlZf0NQOw" type="2001">
+ <children xmi:type="notation:Node" xmi:id="_aeW5sE3nEd2LNJlZf0NQOw" type="4001"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_aeVEgE3nEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_aeVEgU3nEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_aeVEgk3nEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_aeVEg03nEd2LNJlZf0NQOw" lineColor="0"/>
+ <element xmi:type="bpmn:Activity" href="basic-sequence.bpmn#_aeNvwE3nEd2LNJlZf0NQOw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aeVEhE3nEd2LNJlZf0NQOw" x="12" y="40"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_cUmpoE3nEd2LNJlZf0NQOw" type="2001">
+ <children xmi:type="notation:Node" xmi:id="_cUnQsE3nEd2LNJlZf0NQOw" type="4001"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_cUmpoU3nEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_cUmpok3nEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_cUmpo03nEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_cUmppE3nEd2LNJlZf0NQOw" lineColor="0"/>
+ <element xmi:type="bpmn:Activity" href="basic-sequence.bpmn#_cUlbgU3nEd2LNJlZf0NQOw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cUmppU3nEd2LNJlZf0NQOw" x="240" y="40"/>
+ </children>
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_UunvsE3nEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_UunvsU3nEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_Uunvsk3nEd2LNJlZf0NQOw"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_Uufz4U3nEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_Uufz4k3nEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_Uufz403nEd2LNJlZf0NQOw" fillColor="16771304"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_Uufz5E3nEd2LNJlZf0NQOw" lineColor="11119017"/>
+ <element xmi:type="bpmn:Pool" href="basic-sequence.bpmn#_Ut2ToE3nEd2LNJlZf0NQOw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Uunvs03nEd2LNJlZf0NQOw" x="16" y="16" width="333" height="129"/>
+ </children>
+ <styles xmi:type="notation:PageStyle" xmi:id="_UtiKkU3nEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:GuideStyle" xmi:id="_UtiKkk3nEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_UtiKk03nEd2LNJlZf0NQOw"/>
+ <element xmi:type="bpmn:BpmnDiagram" href="basic-sequence.bpmn#_UstEIE3nEd2LNJlZf0NQOw"/>
+ <edges xmi:type="notation:Edge" xmi:id="_bWolgE3nEd2LNJlZf0NQOw" type="3001" source="_aeUdcE3nEd2LNJlZf0NQOw" target="_Uupk4E3nEd2LNJlZf0NQOw">
+ <children xmi:type="notation:Node" xmi:id="_bWqasE3nEd2LNJlZf0NQOw" type="4012">
+ <styles xmi:type="notation:FillStyle" xmi:id="_bWqasU3nEd2LNJlZf0NQOw" fillColor="16776959"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_bWqask3nEd2LNJlZf0NQOw" lineColor="16776959"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_bWqas03nEd2LNJlZf0NQOw" y="-10"/>
+ </children>
+ <styles xmi:type="notation:RoutingStyle" xmi:id="_bWolgU3nEd2LNJlZf0NQOw" routing="Rectilinear" smoothness="Normal" closestDistance="true"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_bWolgk3nEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_bWolg03nEd2LNJlZf0NQOw" lineColor="0"/>
+ <element xmi:type="bpmn:SequenceEdge" href="basic-sequence.bpmn#_bWie4E3nEd2LNJlZf0NQOw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_bWolhE3nEd2LNJlZf0NQOw" points="[0, -15, -110, -16]$[57, -2, -53, -3]"/>
+ </edges>
+ <edges xmi:type="notation:Edge" xmi:id="_c8Uw8E3nEd2LNJlZf0NQOw" type="3001" source="_Uupk4E3nEd2LNJlZf0NQOw" target="_cUmpoE3nEd2LNJlZf0NQOw">
+ <children xmi:type="notation:Node" xmi:id="_c8VYAE3nEd2LNJlZf0NQOw" type="4012">
+ <styles xmi:type="notation:FillStyle" xmi:id="_c8VYAU3nEd2LNJlZf0NQOw" fillColor="16776959"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_c8VYAk3nEd2LNJlZf0NQOw" lineColor="16776959"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_c8VYA03nEd2LNJlZf0NQOw" y="-10"/>
+ </children>
+ <styles xmi:type="notation:RoutingStyle" xmi:id="_c8Uw8U3nEd2LNJlZf0NQOw" routing="Rectilinear" smoothness="Normal" closestDistance="true"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_c8Uw8k3nEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_c8Uw803nEd2LNJlZf0NQOw" lineColor="0"/>
+ <element xmi:type="bpmn:SequenceEdge" href="basic-sequence.bpmn#_c8S7wU3nEd2LNJlZf0NQOw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_c8Uw9E3nEd2LNJlZf0NQOw" points="[54, -8, -64, -7]$[103, -2, -15, -1]"/>
+ </edges>
+</notation:Diagram>
Added: api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.png
===================================================================
(Binary files differ)
Property changes on: api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.bpmn
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.bpmn (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.bpmn 2008-07-09 19:14:53 UTC (rev 1562)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:BpmnDiagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:bpmn="http://stp.eclipse.org/bpmn" xmi:id="_v3HKgE3oEd2LNJlZf0NQOw" iD="_v3GjcE3oEd2LNJlZf0NQOw">
+ <pools xmi:type="bpmn:Pool" xmi:id="_v3IYoE3oEd2LNJlZf0NQOw" iD="_v3HKhU3oEd2LNJlZf0NQOw" name="Pool">
+ <vertices xmi:type="bpmn:Activity" xmi:id="_v3IYok3oEd2LNJlZf0NQOw" iD="_v3IYoU3oEd2LNJlZf0NQOw" outgoingEdges="_z-pnoU3oEd2LNJlZf0NQOw" incomingEdges="_yiytoU3oEd2LNJlZf0NQOw" name="TaskA" activityType="Task"/>
+ <vertices xmi:type="bpmn:Activity" xmi:id="_x8eUgU3oEd2LNJlZf0NQOw" iD="_x8eUgE3oEd2LNJlZf0NQOw" outgoingEdges="_yiytoU3oEd2LNJlZf0NQOw" activityType="EventStartEmpty"/>
+ <vertices xmi:type="bpmn:Activity" xmi:id="_zOy4AU3oEd2LNJlZf0NQOw" iD="_zOy4AE3oEd2LNJlZf0NQOw" incomingEdges="_z-pnoU3oEd2LNJlZf0NQOw" activityType="EventEndEmpty"/>
+ <sequenceEdges xmi:type="bpmn:SequenceEdge" xmi:id="_yiytoU3oEd2LNJlZf0NQOw" iD="_yiytoE3oEd2LNJlZf0NQOw" source="_x8eUgU3oEd2LNJlZf0NQOw" target="_v3IYok3oEd2LNJlZf0NQOw"/>
+ <sequenceEdges xmi:type="bpmn:SequenceEdge" xmi:id="_z-pnoU3oEd2LNJlZf0NQOw" iD="_z-pnoE3oEd2LNJlZf0NQOw" source="_v3IYok3oEd2LNJlZf0NQOw" target="_zOy4AU3oEd2LNJlZf0NQOw"/>
+ </pools>
+</bpmn:BpmnDiagram>
Added: api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.bpmn_diagram
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.bpmn_diagram (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.bpmn_diagram 2008-07-09 19:14:53 UTC (rev 1562)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:bpmn="http://stp.eclipse.org/bpmn" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation" xmi:id="_v3HKgU3oEd2LNJlZf0NQOw" type="Bpmn" name="basic-task.bpmn_diagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Node" xmi:id="_v3I_sE3oEd2LNJlZf0NQOw" type="1001">
+ <children xmi:type="notation:Node" xmi:id="_v3I_tk3oEd2LNJlZf0NQOw" type="4008"/>
+ <children xmi:type="notation:Node" xmi:id="_v3I_t03oEd2LNJlZf0NQOw" type="5001">
+ <children xmi:type="notation:Node" xmi:id="_v3JmwE3oEd2LNJlZf0NQOw" type="2001">
+ <children xmi:type="notation:Node" xmi:id="_v3Jmxk3oEd2LNJlZf0NQOw" type="4001"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_v3JmwU3oEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_v3Jmwk3oEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_v3Jmw03oEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_v3JmxE3oEd2LNJlZf0NQOw" lineColor="0"/>
+ <element xmi:type="bpmn:Activity" href="basic-task.bpmn#_v3IYok3oEd2LNJlZf0NQOw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_v3Jmx03oEd2LNJlZf0NQOw" x="84" y="36" width="111" height="61"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_x8fioE3oEd2LNJlZf0NQOw" type="2001">
+ <children xmi:type="notation:Node" xmi:id="_x8gwwE3oEd2LNJlZf0NQOw" type="4001"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_x8fioU3oEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_x8fiok3oEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_x8fio03oEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_x8fipE3oEd2LNJlZf0NQOw" lineColor="0"/>
+ <element xmi:type="bpmn:Activity" href="basic-task.bpmn#_x8eUgU3oEd2LNJlZf0NQOw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_x8fipU3oEd2LNJlZf0NQOw" x="10" y="47"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_zO0GIE3oEd2LNJlZf0NQOw" type="2001">
+ <children xmi:type="notation:Node" xmi:id="_zO0tME3oEd2LNJlZf0NQOw" type="4001"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_zO0GIU3oEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_zO0GIk3oEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_zO0GI03oEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_zO0GJE3oEd2LNJlZf0NQOw" lineColor="0"/>
+ <element xmi:type="bpmn:Activity" href="basic-task.bpmn#_zOy4AU3oEd2LNJlZf0NQOw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_zO0GJU3oEd2LNJlZf0NQOw" x="240" y="48"/>
+ </children>
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_v3I_uE3oEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_v3I_uU3oEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_v3I_uk3oEd2LNJlZf0NQOw"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_v3I_sU3oEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_v3I_sk3oEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:FillStyle" xmi:id="_v3I_s03oEd2LNJlZf0NQOw" fillColor="16771304"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_v3I_tE3oEd2LNJlZf0NQOw" lineColor="11119017"/>
+ <element xmi:type="bpmn:Pool" href="basic-task.bpmn#_v3IYoE3oEd2LNJlZf0NQOw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_v3I_u03oEd2LNJlZf0NQOw" x="16" y="16" width="345" height="141"/>
+ </children>
+ <styles xmi:type="notation:PageStyle" xmi:id="_v3HKgk3oEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:GuideStyle" xmi:id="_v3HKg03oEd2LNJlZf0NQOw"/>
+ <styles xmi:type="notation:DescriptionStyle" xmi:id="_v3HKhE3oEd2LNJlZf0NQOw"/>
+ <element xmi:type="bpmn:BpmnDiagram" href="basic-task.bpmn#_v3HKgE3oEd2LNJlZf0NQOw"/>
+ <edges xmi:type="notation:Edge" xmi:id="_yiz7wE3oEd2LNJlZf0NQOw" type="3001" source="_x8fioE3oEd2LNJlZf0NQOw" target="_v3JmwE3oEd2LNJlZf0NQOw">
+ <children xmi:type="notation:Node" xmi:id="_yi0i0E3oEd2LNJlZf0NQOw" type="4012">
+ <styles xmi:type="notation:FillStyle" xmi:id="_yi0i0U3oEd2LNJlZf0NQOw" fillColor="16776959"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_yi0i0k3oEd2LNJlZf0NQOw" lineColor="16776959"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_yi0i003oEd2LNJlZf0NQOw" y="-10"/>
+ </children>
+ <styles xmi:type="notation:RoutingStyle" xmi:id="_yiz7wU3oEd2LNJlZf0NQOw" routing="Rectilinear" smoothness="Normal" closestDistance="true"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_yiz7wk3oEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_yiz7w03oEd2LNJlZf0NQOw" lineColor="0"/>
+ <element xmi:type="bpmn:SequenceEdge" href="basic-task.bpmn#_yiytoU3oEd2LNJlZf0NQOw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_yiz7xE3oEd2LNJlZf0NQOw" points="[15, -2, -97, -4]$[59, 0, -53, -2]"/>
+ </edges>
+ <edges xmi:type="notation:Edge" xmi:id="_z-q1wE3oEd2LNJlZf0NQOw" type="3001" source="_v3JmwE3oEd2LNJlZf0NQOw" target="_zO0GIE3oEd2LNJlZf0NQOw">
+ <children xmi:type="notation:Node" xmi:id="_z-sD4E3oEd2LNJlZf0NQOw" type="4012">
+ <styles xmi:type="notation:FillStyle" xmi:id="_z-sD4U3oEd2LNJlZf0NQOw" fillColor="16776959"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_z-sD4k3oEd2LNJlZf0NQOw" lineColor="16776959"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_z-sD403oEd2LNJlZf0NQOw" y="-10"/>
+ </children>
+ <styles xmi:type="notation:RoutingStyle" xmi:id="_z-rc0E3oEd2LNJlZf0NQOw" routing="Rectilinear" smoothness="Normal" closestDistance="true"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_z-rc0U3oEd2LNJlZf0NQOw" fontName="Arial"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_z-rc0k3oEd2LNJlZf0NQOw" lineColor="0"/>
+ <element xmi:type="bpmn:SequenceEdge" href="basic-task.bpmn#_z-pnoU3oEd2LNJlZf0NQOw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_z-rc003oEd2LNJlZf0NQOw" points="[-53, -22, -171, -21]$[103, -2, -15, -1]"/>
+ </edges>
+</notation:Diagram>
Added: api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.png
===================================================================
(Binary files differ)
Property changes on: api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 10 months
JBoss JBPM SVN: r1561 - in api/trunk/modules/testsuite/src/test/java/org/jboss/bpm: model and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-09 14:27:25 -0400 (Wed, 09 Jul 2008)
New Revision: 1561
Added:
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessTest.java
Removed:
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/client/
Log:
Align API with BPMN
Copied: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessTest.java (from rev 1559, api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/client/ProcessTest.java)
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessTest.java (rev 0)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/ProcessTest.java 2008-07-09 18:27:25 UTC (rev 1561)
@@ -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.jboss.bpm.model;
+
+// $Id$
+
+import java.util.Set;
+
+import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.model.EndEvent;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.NamedFlowObject;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.StartEvent;
+import org.jboss.bpm.model.Task;
+import org.jboss.bpm.test.DefaultEngineTestCase;
+
+public class ProcessTest extends DefaultEngineTestCase
+{
+ public void testBasicSequence() throws Exception
+ {
+ String jpdl =
+ "<process-definition>" +
+ " <start-state>" +
+ " <transition to='stateA' />" +
+ " </start-state>" +
+ " <state name='stateA'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end-state name='end' />" +
+ "</process-definition>";
+
+ // Create a Process through the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ Process proc = pm.createProcess(jpdl);
+ assertEquals("AnonymousProcess#0", proc.getName());
+
+ StartEvent start = proc.getStartEvent();
+ assertNotNull("Start expected", start);
+
+ Set<FlowObject> fos = proc.getFlowObjects();
+ assertEquals(3, fos.size());
+
+ NamedFlowObject nfo = proc.findFlowObject("stateA");
+ assertNotNull("FlowObject expected", nfo);
+ assertTrue("Task expected", nfo instanceof Task);
+
+ Set<EndEvent> ends = proc.getEndEvents();
+ assertEquals(1, ends.size());
+ }
+
+ public void testNoStartState() throws Exception
+ {
+ String jpdl =
+ "<process-definition>" +
+ " <state>" +
+ " <transition to='stateA' />" +
+ " </state>" +
+ " <state name='stateA'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end-state name='end' />" +
+ "</process-definition>";
+
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ try
+ {
+ pm.createProcess(jpdl);
+ fail("InvalidProcessException expected");
+ }
+ catch (InvalidProcessException ex)
+ {
+ assertTrue("Unexpected message: " + ex.getMessage(), ex.getMessage().indexOf("start event") > 0);
+ }
+ }
+
+ public void testNoEndState() throws Exception
+ {
+ String jpdl =
+ "<process-definition>" +
+ " <start-state>" +
+ " <transition to='stateA' />" +
+ " </start-state>" +
+ " <state name='stateA'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <state name='end' />" +
+ "</process-definition>";
+
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ try
+ {
+ pm.createProcess(jpdl);
+ fail("InvalidProcessException expected");
+ }
+ catch (InvalidProcessException ex)
+ {
+ assertTrue("Unexpected message: " + ex.getMessage(), ex.getMessage().indexOf("end event") > 0);
+ }
+ }
+
+ public void testNodeNameUniqueness() throws Exception
+ {
+ String jpdl =
+ "<process-definition>" +
+ " <start-state>" +
+ " <transition to='stateA' />" +
+ " </start-state>" +
+ " <state name='stateA'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <state name='stateA'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end-state name='end' />" +
+ "</process-definition>";
+
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ try
+ {
+ pm.createProcess(jpdl);
+ fail("InvalidProcessException expected");
+ }
+ catch (InvalidProcessException ex)
+ {
+ // expected;
+ }
+ }
+}
15 years, 10 months
JBoss JBPM SVN: r1560 - in jbpm3/trunk: modules/jpdl/core and 7 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-09 14:23:16 -0400 (Wed, 09 Jul 2008)
New Revision: 1560
Added:
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessManagerImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/EndEventImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessAdapter.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/StartEventImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ExecutionContextImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/TaskWrapper.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/TokenImpl.java
Removed:
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ExecutionImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ExecutionManagerImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessDefinitionManagerImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessInstanceImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessInstanceManagerImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/def/
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ActivityWrapper.java
Modified:
jbpm3/trunk/.classpath
jbpm3/trunk/modules/jpdl/core/pom.xml
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/def/Action.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/def/Node.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/node/EndState.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/node/State.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/resources/jbpm-beans.xml
Log:
Align API with BPMN
Modified: jbpm3/trunk/.classpath
===================================================================
--- jbpm3/trunk/.classpath 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/.classpath 2008-07-09 18:23:16 UTC (rev 1560)
@@ -1,34 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="modules/jpdl/core/target/classes" path="modules/jpdl/core/src/main/java"/>
+ <classpathentry kind="src" output="modules/jpdl/core/target/test-classes" path="modules/jpdl/core/src/testsuite/java"/>
<classpathentry kind="src" output="modules/jpdl/core/target/test-classes" path="modules/jpdl/core/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="modules/jpdl/core/target/classes" path="modules/jpdl/core/src/main/resources"/>
- <classpathentry excluding="**" kind="src" output="modules/jpdl/core/target/test-classes" path="modules/jpdl/core/src/test/resources"/>
- <classpathentry excluding="**" kind="src" output="modules/jpdl/db/target/classes" path="modules/jpdl/db/src/main/resources"/>
- <classpathentry kind="src" output="modules/jpdl/examples/target/test-classes" path="modules/jpdl/examples/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="modules/jpdl/examples/target/test-classes" path="modules/jpdl/examples/src/test/resources"/>
- <classpathentry kind="src" output="modules/jpdl/identity/target/classes" path="modules/jpdl/identity/src/main/java"/>
- <classpathentry kind="src" output="modules/jpdl/identity/target/test-classes" path="modules/jpdl/identity/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="modules/jpdl/identity/target/classes" path="modules/jpdl/identity/src/main/resources"/>
- <classpathentry excluding="**" kind="src" output="modules/jpdl/identity/target/test-classes" path="modules/jpdl/identity/src/test/resources"/>
- <classpathentry kind="src" output="modules/jpdl/simulation/target/classes" path="modules/jpdl/simulation/src/main/java"/>
- <classpathentry kind="src" output="modules/jpdl/simulation/target/test-classes" path="modules/jpdl/simulation/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="modules/jpdl/simulation/target/classes" path="modules/jpdl/simulation/src/main/resources"/>
- <classpathentry kind="src" output="modules/jpdl/ws/target/classes" path="modules/jpdl/ws/src/main/java"/>
- <classpathentry excluding="**" kind="src" output="modules/jpdl/ws/target/classes" path="modules/jpdl/ws/src/main/resources"/>
- <classpathentry excluding="**" kind="src" output="modules/console/target/classes" path="modules/console/src/main/resources"/>
- <classpathentry kind="src" output="modules/enterprise/target/classes" path="modules/enterprise/src/main/java"/>
- <classpathentry kind="src" output="modules/enterprise/target/test-classes" path="modules/enterprise/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="modules/enterprise/target/classes" path="modules/enterprise/src/main/resources"/>
- <classpathentry excluding="**" kind="src" output="modules/enterprise/target/test-classes" path="modules/enterprise/src/test/resources"/>
- <classpathentry kind="src" output="modules/jbpm4jsf/target/classes" path="modules/jbpm4jsf/src/main/java"/>
- <classpathentry excluding="**" kind="src" output="modules/jbpm4jsf/target/classes" path="modules/jbpm4jsf/src/main/resources"/>
- <classpathentry kind="src" output="modules/bamconsole/ejb/target/classes" path="modules/bamconsole/ejb/src/main/java"/>
- <classpathentry kind="src" output="modules/bamconsole/ejb/target/test-classes" path="modules/bamconsole/ejb/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="modules/bamconsole/ejb/target/classes" path="modules/bamconsole/ejb/src/main/resources"/>
- <classpathentry excluding="**" kind="src" output="modules/bamconsole/ejb/target/test-classes" path="modules/bamconsole/ejb/src/test/resources"/>
- <classpathentry excluding="**" kind="src" output="modules/bamconsole/war/target/classes" path="modules/bamconsole/war/src/main/resources"/>
- <classpathentry excluding="**" kind="src" output="modules/bamconsole/ear/target/classes" path="modules/bamconsole/ear/src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: jbpm3/trunk/modules/jpdl/core/pom.xml
===================================================================
--- jbpm3/trunk/modules/jpdl/core/pom.xml 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/pom.xml 2008-07-09 18:23:16 UTC (rev 1560)
@@ -117,6 +117,11 @@
<!-- Plugins -->
<build>
+ <testResources>
+ <testResource>
+ <directory>src/testsuite/resources</directory>
+ </testResource>
+ </testResources>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/def/Action.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/def/Action.java 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/def/Action.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -25,10 +25,10 @@
import java.util.Map;
import org.dom4j.Element;
-import org.jboss.bpm.runtime.Activity;
+import org.jboss.bpm.model.Task;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.instantiation.Delegation;
-import org.jbpm.integration.runtime.ActivityWrapper;
+import org.jbpm.integration.runtime.TaskWrapper;
import org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator;
import org.jbpm.jpdl.xml.JpdlXmlReader;
import org.jbpm.jpdl.xml.Parsable;
@@ -152,9 +152,9 @@
{
ActionHandler actionHandler;
Object obj = actionDelegation.getInstance();
- if (obj instanceof Activity)
+ if (obj instanceof Task)
{
- actionHandler = new ActivityWrapper(this, (Activity)obj);
+ actionHandler = new TaskWrapper(this);
}
else
{
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/def/Node.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/def/Node.java 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/def/Node.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -32,11 +32,16 @@
import java.util.Set;
import org.dom4j.Element;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Process;
import org.jbpm.JbpmException;
+import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.action.ActionTypes;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.Token;
import org.jbpm.graph.log.NodeLog;
+import org.jbpm.integration.model.ProcessImpl;
+import org.jbpm.integration.runtime.TokenImpl;
import org.jbpm.job.ExecuteNodeJob;
import org.jbpm.jpdl.xml.JpdlXmlReader;
import org.jbpm.jpdl.xml.Parsable;
@@ -44,10 +49,11 @@
import org.jbpm.svc.Services;
import org.jbpm.util.Clock;
-public class Node extends GraphElement implements Parsable {
-
+public class Node extends GraphElement implements Parsable
+{
+
private static final long serialVersionUID = 1L;
-
+
protected List leavingTransitions = null;
transient Map leavingTransitionMap = null;
protected Set arrivingTransitions = null;
@@ -58,8 +64,12 @@
// event types //////////////////////////////////////////////////////////////
- public static final String[] supportedEventTypes = new String[]{Event.EVENTTYPE_NODE_ENTER,Event.EVENTTYPE_NODE_LEAVE,Event.EVENTTYPE_BEFORE_SIGNAL,Event.EVENTTYPE_AFTER_SIGNAL};
- public String[] getSupportedEventTypes() {
+ public static final String[] supportedEventTypes = new String[] {
+ Event.EVENTTYPE_NODE_ENTER, Event.EVENTTYPE_NODE_LEAVE,
+ Event.EVENTTYPE_BEFORE_SIGNAL,Event.EVENTTYPE_AFTER_SIGNAL };
+
+ public String[] getSupportedEventTypes()
+ {
return supportedEventTypes;
}
@@ -68,22 +78,27 @@
/**
* creates an unnamed node.
*/
- public Node() {
+ public Node()
+ {
}
/**
* creates a node with the given name.
*/
- public Node(String name) {
+ public Node(String name)
+ {
super(name);
}
- public void read(Element nodeElement, JpdlXmlReader jpdlXmlReader) {
+ public void read(Element nodeElement, JpdlXmlReader jpdlXmlReader)
+ {
action = jpdlXmlReader.readSingleAction(nodeElement);
}
-
- public void write(Element nodeElement) {
- if (action!=null) {
+
+ public void write(Element nodeElement)
+ {
+ if (action != null)
+ {
String actionName = ActionTypes.getActionName(action.getClass());
Element actionElement = nodeElement.addElement(actionName);
action.write(actionElement);
@@ -91,22 +106,25 @@
}
// leaving transitions //////////////////////////////////////////////////////
-
- public List getLeavingTransitions() {
+
+ public List getLeavingTransitions()
+ {
return leavingTransitions;
}
/**
* are the leaving {@link Transition}s, mapped by their name (java.lang.String).
*/
- public Map getLeavingTransitionsMap() {
- if ( (leavingTransitionMap==null)
- && (leavingTransitions!=null) ){
+ public Map getLeavingTransitionsMap()
+ {
+ if ((leavingTransitionMap == null) && (leavingTransitions != null))
+ {
// initialize the cached leaving transition map
leavingTransitionMap = new HashMap();
ListIterator iter = leavingTransitions.listIterator(leavingTransitions.size());
- while (iter.hasPrevious()) {
- Transition leavingTransition = (Transition) iter.previous();
+ while (iter.hasPrevious())
+ {
+ Transition leavingTransition = (Transition)iter.previous();
leavingTransitionMap.put(leavingTransition.getName(), leavingTransition);
}
}
@@ -115,11 +133,15 @@
/**
* creates a bidirection relation between this node and the given leaving transition.
+ *
* @throws IllegalArgumentException if leavingTransition is null.
*/
- public Transition addLeavingTransition(Transition leavingTransition) {
- if (leavingTransition == null) throw new IllegalArgumentException("can't add a null leaving transition to an node");
- if (leavingTransitions == null) leavingTransitions = new ArrayList();
+ public Transition addLeavingTransition(Transition leavingTransition)
+ {
+ if (leavingTransition == null)
+ throw new IllegalArgumentException("can't add a null leaving transition to an node");
+ if (leavingTransitions == null)
+ leavingTransitions = new ArrayList();
leavingTransitions.add(leavingTransition);
leavingTransition.from = this;
leavingTransitionMap = null;
@@ -128,12 +150,17 @@
/**
* removes the bidirection relation between this node and the given leaving transition.
+ *
* @throws IllegalArgumentException if leavingTransition is null.
*/
- public void removeLeavingTransition(Transition leavingTransition) {
- if (leavingTransition == null) throw new IllegalArgumentException("can't remove a null leavingTransition from an node");
- if (leavingTransitions != null) {
- if (leavingTransitions.remove(leavingTransition)) {
+ public void removeLeavingTransition(Transition leavingTransition)
+ {
+ if (leavingTransition == null)
+ throw new IllegalArgumentException("can't remove a null leavingTransition from an node");
+ if (leavingTransitions != null)
+ {
+ if (leavingTransitions.remove(leavingTransition))
+ {
leavingTransition.from = null;
leavingTransitionMap = null;
}
@@ -142,61 +169,69 @@
/**
* checks for the presence of a leaving transition with the given name.
- * @return true if this node has a leaving transition with the given name,
- * false otherwise.
+ *
+ * @return true if this node has a leaving transition with the given name, false otherwise.
*/
- public boolean hasLeavingTransition(String transitionName) {
- if (leavingTransitions==null) return false;
+ public boolean hasLeavingTransition(String transitionName)
+ {
+ if (leavingTransitions == null)
+ return false;
return getLeavingTransitionsMap().containsKey(transitionName);
}
/**
- * retrieves a leaving transition by name. note that also the leaving
- * transitions of the supernode are taken into account.
+ * retrieves a leaving transition by name. note that also the leaving transitions of the supernode are taken into account.
*/
- public Transition getLeavingTransition(String transitionName) {
+ public Transition getLeavingTransition(String transitionName)
+ {
Transition transition = null;
- if (leavingTransitions!=null) {
- transition = (Transition) getLeavingTransitionsMap().get(transitionName);
+ if (leavingTransitions != null)
+ {
+ transition = (Transition)getLeavingTransitionsMap().get(transitionName);
}
- if ( (transition==null)
- && (superState!=null)
- ) {
- transition = superState.getLeavingTransition(transitionName);
+ if ((transition == null) && (superState != null))
+ {
+ transition = superState.getLeavingTransition(transitionName);
}
return transition;
}
/**
- * true if this transition has leaving transitions.
+ * true if this transition has leaving transitions.
*/
- public boolean hasNoLeavingTransitions() {
- return ( ( (leavingTransitions == null)
- || (leavingTransitions.size() == 0) )
- && ( (superState==null)
- || (superState.hasNoLeavingTransitions() ) ) );
+ public boolean hasNoLeavingTransitions()
+ {
+ return (((leavingTransitions == null) || (leavingTransitions.size() == 0)) && ((superState == null) || (superState.hasNoLeavingTransitions())));
}
/**
- * generates a new name for a transition that will be added as a leaving transition.
+ * generates a new name for a transition that will be added as a leaving transition.
*/
- public String generateNextLeavingTransitionName() {
+ public String generateNextLeavingTransitionName()
+ {
String name = null;
- if (leavingTransitions!=null && containsName(leavingTransitions, null)) {
+ if (leavingTransitions != null && containsName(leavingTransitions, null))
+ {
int n = 1;
- while (containsName(leavingTransitions, Integer.toString(n))) n++;
+ while (containsName(leavingTransitions, Integer.toString(n)))
+ n++;
name = Integer.toString(n);
}
return name;
}
- boolean containsName(List leavingTransitions, String name) {
+ boolean containsName(List leavingTransitions, String name)
+ {
Iterator iter = leavingTransitions.iterator();
- while (iter.hasNext()) {
- Transition transition = (Transition) iter.next();
- if ( (name==null) && (transition.getName()==null) ) {
+ while (iter.hasNext())
+ {
+ Transition transition = (Transition)iter.next();
+ if ((name == null) && (transition.getName() == null))
+ {
return true;
- } else if ( (name!=null) && (name.equals(transition.getName())) ) {
+ }
+ else if ((name != null) && (name.equals(transition.getName())))
+ {
return true;
}
}
@@ -208,12 +243,15 @@
/**
* is the default leaving transition.
*/
- public Transition getDefaultLeavingTransition() {
+ public Transition getDefaultLeavingTransition()
+ {
Transition defaultTransition = null;
- if ( (leavingTransitions!=null)
- && (leavingTransitions.size()>0) ) {
- defaultTransition = (Transition) leavingTransitions.get(0);
- } else if ( superState!=null ){
+ if ((leavingTransitions != null) && (leavingTransitions.size() > 0))
+ {
+ defaultTransition = (Transition)leavingTransitions.get(0);
+ }
+ else if (superState != null)
+ {
defaultTransition = superState.getDefaultLeavingTransition();
}
return defaultTransition;
@@ -222,16 +260,17 @@
/**
* moves one leaving transition from the oldIndex and inserts it at the newIndex.
*/
- public void reorderLeavingTransition( int oldIndex, int newIndex ) {
- if ( (leavingTransitions!=null)
- && (Math.min(oldIndex, newIndex)>=0)
- && (Math.max(oldIndex, newIndex)<leavingTransitions.size()) ) {
+ public void reorderLeavingTransition(int oldIndex, int newIndex)
+ {
+ if ((leavingTransitions != null) && (Math.min(oldIndex, newIndex) >= 0) && (Math.max(oldIndex, newIndex) < leavingTransitions.size()))
+ {
Object o = leavingTransitions.remove(oldIndex);
leavingTransitions.add(newIndex, o);
}
}
- public List getLeavingTransitionsList() {
+ public List getLeavingTransitionsList()
+ {
return leavingTransitions;
}
@@ -240,46 +279,55 @@
/**
* are the arriving transitions.
*/
- public Set getArrivingTransitions() {
+ public Set getArrivingTransitions()
+ {
return arrivingTransitions;
}
/**
- * add a bidirection relation between this node and the given arriving
- * transition.
+ * add a bidirection relation between this node and the given arriving transition.
+ *
* @throws IllegalArgumentException if t is null.
*/
- public Transition addArrivingTransition(Transition arrivingTransition) {
- if (arrivingTransition == null) throw new IllegalArgumentException("can't add a null arrivingTransition to a node");
- if (arrivingTransitions == null) arrivingTransitions = new HashSet();
+ public Transition addArrivingTransition(Transition arrivingTransition)
+ {
+ if (arrivingTransition == null)
+ throw new IllegalArgumentException("can't add a null arrivingTransition to a node");
+ if (arrivingTransitions == null)
+ arrivingTransitions = new HashSet();
arrivingTransitions.add(arrivingTransition);
arrivingTransition.to = this;
return arrivingTransition;
}
/**
- * removes the bidirection relation between this node and the given arriving
- * transition.
+ * removes the bidirection relation between this node and the given arriving transition.
+ *
* @throws IllegalArgumentException if t is null.
*/
- public void removeArrivingTransition(Transition arrivingTransition) {
- if (arrivingTransition == null) throw new IllegalArgumentException("can't remove a null arrivingTransition from a node");
- if (arrivingTransitions != null) {
- if (arrivingTransitions.remove(arrivingTransition)) {
+ public void removeArrivingTransition(Transition arrivingTransition)
+ {
+ if (arrivingTransition == null)
+ throw new IllegalArgumentException("can't remove a null arrivingTransition from a node");
+ if (arrivingTransitions != null)
+ {
+ if (arrivingTransitions.remove(arrivingTransition))
+ {
arrivingTransition.to = null;
}
}
}
-
+
// various //////////////////////////////////////////////////////////////////
/**
- * is the {@link SuperState} or the {@link ProcessDefinition} in which this
- * node is contained.
+ * is the {@link SuperState} or the {@link ProcessDefinition} in which this node is contained.
*/
- public GraphElement getParent() {
+ public GraphElement getParent()
+ {
GraphElement parent = processDefinition;
- if (superState!=null) parent = superState;
+ if (superState != null)
+ parent = superState;
return parent;
}
@@ -288,7 +336,8 @@
/**
* called by a transition to pass execution to this node.
*/
- public void enter(ExecutionContext executionContext) {
+ public void enter(ExecutionContext executionContext)
+ {
Token token = executionContext.getToken();
// update the runtime context information
@@ -296,7 +345,7 @@
// fire the leave-node event for this node
fireEvent(Event.EVENTTYPE_NODE_ENTER, executionContext);
-
+
// keep track of node entrance in the token, so that a node-log can be generated at node leave time.
token.setNodeEnter(Clock.getCurrentTime());
@@ -305,61 +354,94 @@
executionContext.setTransitionSource(null);
// execute the node
- if (isAsync) {
+ if (isAsync)
+ {
ExecuteNodeJob job = createAsyncContinuationJob(token);
- MessageService messageService = (MessageService) Services.getCurrentService(Services.SERVICENAME_MESSAGE);
+ MessageService messageService = (MessageService)Services.getCurrentService(Services.SERVICENAME_MESSAGE);
messageService.send(job);
token.lock(job.toString());
- } else {
+ }
+ else
+ {
execute(executionContext);
}
}
- protected ExecuteNodeJob createAsyncContinuationJob(Token token) {
+ protected ExecuteNodeJob createAsyncContinuationJob(Token token)
+ {
ExecuteNodeJob job = new ExecuteNodeJob(token);
job.setNode(this);
job.setDueDate(new Date());
job.setExclusive(isAsyncExclusive);
return job;
}
-
+
/**
* override this method to customize the node behaviour.
*/
- public void execute(ExecutionContext executionContext) {
+ public void execute(ExecutionContext executionContext)
+ {
+ // Call execute on an API FlowObject
+ callExecutableFlowObject(executionContext);
+
// if there is a custom action associated with this node
- if (action!=null) {
- try {
+ if (action != null)
+ {
+ try
+ {
// execute the action
executeAction(action, executionContext);
- } catch (Exception exception) {
+ }
+ catch (Exception exception)
+ {
// NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
// search for an exception handler or throw to the client
raiseException(exception, executionContext);
}
- } else {
+ }
+ else
+ {
// let this node handle the token
// the default behaviour is to leave the node over the default transition.
leave(executionContext);
}
}
+ // Call execute on an API FlowObject
+ protected void callExecutableFlowObject(ExecutionContext executionContext)
+ {
+ ContextInstance ctxInst = executionContext.getContextInstance();
+ ProcessImpl proc = (ProcessImpl)ctxInst.getTransientVariable(Process.class.getName());
+ if (proc != null)
+ {
+ FlowObject fo = proc.findFlowObject(this);
+ if (fo == null)
+ throw new IllegalStateException("Cannot find flow object: " + getName());
+
+ TokenImpl token = new TokenImpl(proc, ctxInst);
+ fo.execute(token);
+ }
+ }
+
/**
* called by the implementation of this node to continue execution over the default transition.
*/
- public void leave(ExecutionContext executionContext) {
+ public void leave(ExecutionContext executionContext)
+ {
leave(executionContext, getDefaultLeavingTransition());
}
/**
* called by the implementation of this node to continue execution over the specified transition.
*/
- public void leave(ExecutionContext executionContext, String transitionName) {
+ public void leave(ExecutionContext executionContext, String transitionName)
+ {
Transition transition = getLeavingTransition(transitionName);
- if (transition==null) {
- throw new JbpmException("transition '"+transitionName+"' is not a leaving transition of node '"+this+"'");
+ if (transition == null)
+ {
+ throw new JbpmException("transition '" + transitionName + "' is not a leaving transition of node '" + this + "'");
}
leave(executionContext, transition);
}
@@ -367,17 +449,20 @@
/**
* called by the implementation of this node to continue execution over the given transition.
*/
- public void leave(ExecutionContext executionContext, Transition transition) {
- if (transition==null) throw new JbpmException("can't leave node '"+this+"' without leaving transition");
+ public void leave(ExecutionContext executionContext, Transition transition)
+ {
+ if (transition == null)
+ throw new JbpmException("can't leave node '" + this + "' without leaving transition");
Token token = executionContext.getToken();
token.setNode(this);
executionContext.setTransition(transition);
-
+
// fire the leave-node event for this node
fireEvent(Event.EVENTTYPE_NODE_LEAVE, executionContext);
-
+
// log this node
- if (token.getNodeEnter()!=null) {
+ if (token.getNodeEnter() != null)
+ {
addNodeLog(token);
}
@@ -389,15 +474,18 @@
transition.take(executionContext);
}
- protected void addNodeLog(Token token) {
+ protected void addNodeLog(Token token)
+ {
token.addLog(new NodeLog(this, token.getNodeEnter(), Clock.getCurrentTime()));
}
- /////////////////////////////////////////////////////////////////////////////
-
- public ProcessDefinition getProcessDefinition() {
+ // ///////////////////////////////////////////////////////////////////////////
+
+ public ProcessDefinition getProcessDefinition()
+ {
ProcessDefinition pd = this.processDefinition;
- if (superState!=null) {
+ if (superState != null)
+ {
pd = superState.getProcessDefinition();
}
return pd;
@@ -407,34 +495,45 @@
/**
* updates the name of this node
*/
- public void setName(String name) {
- if (isDifferent(this.name, name)) {
+ public void setName(String name)
+ {
+ if (isDifferent(this.name, name))
+ {
String oldName = this.name;
- if (superState!=null) {
- if ( superState.hasNode(name) ) {
- throw new IllegalArgumentException("couldn't set name '"+name+"' on node '"+this+"'cause the superState of this node has already another child node with the same name");
+ if (superState != null)
+ {
+ if (superState.hasNode(name))
+ {
+ throw new IllegalArgumentException("couldn't set name '" + name + "' on node '" + this
+ + "'cause the superState of this node has already another child node with the same name");
}
Map nodes = superState.getNodesMap();
nodes.remove(oldName);
- nodes.put(name,this);
- } else if (processDefinition!=null) {
- if ( processDefinition.hasNode(name) ) {
- throw new IllegalArgumentException("couldn't set name '"+name+"' on node '"+this+"'cause the process definition of this node has already another node with the same name");
+ nodes.put(name, this);
+ }
+ else if (processDefinition != null)
+ {
+ if (processDefinition.hasNode(name))
+ {
+ throw new IllegalArgumentException("couldn't set name '" + name + "' on node '" + this
+ + "'cause the process definition of this node has already another node with the same name");
}
Map nodeMap = processDefinition.getNodesMap();
nodeMap.remove(oldName);
- nodeMap.put(name,this);
+ nodeMap.put(name, this);
}
this.name = name;
}
}
-
- boolean isDifferent(String name1, String name2) {
- if ((name1!=null)
- && (name1.equals(name2))) {
+
+ boolean isDifferent(String name1, String name2)
+ {
+ if ((name1 != null) && (name1.equals(name2)))
+ {
return false;
- } else if ( (name1==null)
- && (name2==null) ) {
+ }
+ else if ((name1 == null) && (name2 == null))
+ {
return false;
}
return true;
@@ -443,45 +542,62 @@
/**
* the slash separated name that includes all the superstate names.
*/
- public String getFullyQualifiedName() {
+ public String getFullyQualifiedName()
+ {
String fullyQualifiedName = name;
- if (superState!=null) {
- fullyQualifiedName = superState.getFullyQualifiedName()+"/"+name;
+ if (superState != null)
+ {
+ fullyQualifiedName = superState.getFullyQualifiedName() + "/" + name;
}
return fullyQualifiedName;
}
/** indicates wether this node is a superstate. */
- public boolean isSuperStateNode() {
+ public boolean isSuperStateNode()
+ {
return false;
}
/** returns a list of child nodes (only applicable for {@link SuperState})s. */
- public List getNodes() {
+ public List getNodes()
+ {
return null;
}
// getters and setters //////////////////////////////////////////////////////
-
- public SuperState getSuperState() {
+
+ public SuperState getSuperState()
+ {
return superState;
}
- public Action getAction() {
+
+ public Action getAction()
+ {
return action;
}
- public void setAction(Action action) {
+
+ public void setAction(Action action)
+ {
this.action = action;
}
- public boolean isAsync() {
+
+ public boolean isAsync()
+ {
return isAsync;
}
- public void setAsync(boolean isAsync) {
+
+ public void setAsync(boolean isAsync)
+ {
this.isAsync = isAsync;
}
- public boolean isAsyncExclusive() {
+
+ public boolean isAsyncExclusive()
+ {
return isAsyncExclusive;
}
- public void setAsyncExclusive(boolean isAsyncExclusive) {
+
+ public void setAsyncExclusive(boolean isAsyncExclusive)
+ {
this.isAsyncExclusive = isAsyncExclusive;
}
}
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/node/EndState.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/node/EndState.java 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/node/EndState.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -25,42 +25,54 @@
import org.jbpm.graph.def.Event;
import org.jbpm.graph.def.Node;
import org.jbpm.graph.def.Transition;
-import org.jbpm.graph.exe.*;
+import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.jpdl.xml.JpdlXmlReader;
-public class EndState extends Node {
+public class EndState extends Node
+{
private static final long serialVersionUID = 1L;
-
+
String endCompleteProcess = null;
- public EndState() {
+ public EndState()
+ {
}
-
- public static final String[] supportedEventTypes = new String[]{Event.EVENTTYPE_NODE_ENTER};
- public String[] getSupportedEventTypes() {
+
+ public static final String[] supportedEventTypes = new String[] { Event.EVENTTYPE_NODE_ENTER };
+
+ public String[] getSupportedEventTypes()
+ {
return supportedEventTypes;
}
- public EndState(String name) {
+ public EndState(String name)
+ {
super(name);
}
-
- public void read(Element nodeElement, JpdlXmlReader jpdlXmlReader) {
+
+ public void read(Element nodeElement, JpdlXmlReader jpdlXmlReader)
+ {
endCompleteProcess = nodeElement.attributeValue("end-complete-process");
}
- public void execute(ExecutionContext executionContext) {
- if ( (endCompleteProcess!=null)
- && (endCompleteProcess.equalsIgnoreCase("true"))
- ) {
+ public void execute(ExecutionContext executionContext)
+ {
+ if ((endCompleteProcess != null) && (endCompleteProcess.equalsIgnoreCase("true")))
+ {
executionContext.getProcessInstance().end();
- } else {
+ }
+ else
+ {
executionContext.getToken().end();
}
+
+ // Call execute on an API FlowObject
+ callExecutableFlowObject(executionContext);
}
-
- public Transition addLeavingTransition(Transition t) {
+
+ public Transition addLeavingTransition(Transition t)
+ {
throw new UnsupportedOperationException("can't add a leaving transition to an end-state");
}
}
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/node/State.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/node/State.java 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/node/State.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -21,21 +21,26 @@
*/
package org.jbpm.graph.node;
-import org.jbpm.graph.def.*;
-import org.jbpm.graph.exe.*;
+import org.jbpm.graph.def.Node;
+import org.jbpm.graph.exe.ExecutionContext;
-public class State extends Node {
-
+public class State extends Node
+{
private static final long serialVersionUID = 1L;
- public State() {
+ public State()
+ {
this(null);
}
-
- public State(String name) {
- super( name );
+
+ public State(String name)
+ {
+ super(name);
}
- public void execute(ExecutionContext executionContext) {
+ public void execute(ExecutionContext executionContext)
+ {
+ // Call execute on an API FlowObject
+ callExecutableFlowObject(executionContext);
}
}
Deleted: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ExecutionImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ExecutionImpl.java 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ExecutionImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -1,177 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.client;
-
-//$Id$
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.jboss.bpm.client.ProcessInstance;
-import org.jboss.bpm.client.internal.AbstractExecution;
-import org.jboss.bpm.process.Execution;
-import org.jboss.bpm.process.Node;
-import org.jboss.bpm.runtime.Token;
-
-/**
- * Represents an execution of a process instance.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class ExecutionImpl extends AbstractExecution
-{
- private org.jbpm.graph.exe.Execution oldEx;
- private Token context = new ContextImpl();
-
- ExecutionImpl(ProcessInstance pi, org.jbpm.graph.exe.Execution oldEx)
- {
- super(pi);
- this.oldEx = oldEx;
- init(oldEx.getKey());
- }
-
- @Override
- protected Node getNodeOverride()
- {
- org.jbpm.graph.def.Node oldNode = oldEx.getRootToken().getNode();
- Node apiNode = getProcessInstance().getProcessDefinition().findNode(oldNode.getName());
- return apiNode;
- }
-
- @Override
- protected void signalOverride()
- {
- oldEx.getContextInstance().setTransientVariable(Execution.class.getName(), this);
- oldEx.signal();
- }
-
- @Override
- public String getName()
- {
- return oldEx.getKey();
- }
-
- @Override
- protected void setName(String name)
- {
- oldEx.setKey(name);
- }
-
- @Override
- public Token getContext()
- {
- return context;
- }
-
- private class ContextImpl extends Token
- {
- @SuppressWarnings("unchecked")
- public <T> T addAttachment(Class<T> clazz, Object value)
- {
- Key key = new Key(clazz, null);
- oldEx.getContextInstance().setTransientVariable(key, value);
- return (T)value;
- }
-
- @SuppressWarnings("unchecked")
- public <T> T addAttachment(Class<T> clazz, String name, Object value)
- {
- Key key = new Key(clazz, name);
- oldEx.getContextInstance().setTransientVariable(key, value);
- return (T)value;
- }
-
- @SuppressWarnings("unchecked")
- public <T> T addAttachment(String name, Object value)
- {
- Key key = new Key(null, name);
- oldEx.getContextInstance().setTransientVariable(key, value);
- return (T)value;
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getAttachment(Class<T> clazz)
- {
- Key key = new Key(clazz, null);
- Object value = oldEx.getContextInstance().getTransientVariable(key);
- return (T)value;
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getAttachment(Class<T> clazz, String name)
- {
- Key key = new Key(clazz, name);
- Object value = oldEx.getContextInstance().getTransientVariable(key);
- return (T)value;
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getAttachment(String name)
- {
- Key key = new Key(null, name);
- Object value = oldEx.getContextInstance().getTransientVariable(key);
- return (T)value;
- }
-
- public Collection<Key> getAttachmentKeys()
- {
- Set<Key> keys = new HashSet<Key>();
- Iterator<?> itKeys = oldEx.getContextInstance().getTransientVariables().keySet().iterator();
- while (itKeys.hasNext())
- {
- Object key = itKeys.next();
- if (key instanceof Key)
- {
- keys.add((Key)key);
- }
- }
- return keys;
- }
-
- @SuppressWarnings("unchecked")
- public <T> T removeAttachment(Class<T> clazz)
- {
- Key key = new Key(clazz, null);
- Object value = oldEx.getContextInstance().deleteTransientVariable(key);
- return (T)value;
- }
-
- @SuppressWarnings("unchecked")
- public <T> T removeAttachment(Class<T> clazz, String name)
- {
- Key key = new Key(clazz, name);
- Object value = oldEx.getContextInstance().deleteTransientVariable(key);
- return (T)value;
- }
-
- @SuppressWarnings("unchecked")
- public <T> T removeAttachment(String name)
- {
- Key key = new Key(null, name);
- Object value = oldEx.getContextInstance().deleteTransientVariable(key);
- return (T)value;
- }
- }
-}
Deleted: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ExecutionManagerImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ExecutionManagerImpl.java 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ExecutionManagerImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -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.jbpm.integration.client;
-
-// $Id$
-
-import org.jboss.bpm.client.ExecutionManager;
-import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.client.ProcessInstance;
-import org.jboss.bpm.process.Execution;
-import org.jbpm.integration.def.ProcessDefinitionImpl;
-
-/**
- * TODO
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class ExecutionManagerImpl extends ExecutionManager
-{
-
- public void setProcessEngine(ProcessEngine engine)
- {
- this.engine = engine;
- }
-
- @Override
- protected Execution createExecutionOverride(ProcessInstance pi)
- {
- ProcessDefinitionImpl apiPD = (ProcessDefinitionImpl)pi.getProcessDefinition();
- org.jbpm.graph.exe.Execution oldEx = new org.jbpm.graph.exe.Execution(apiPD.oldPD);
- ExecutionImpl ex = new ExecutionImpl(pi, oldEx);
- return ex;
- }
-}
Deleted: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessDefinitionManagerImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessDefinitionManagerImpl.java 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessDefinitionManagerImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -1,83 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.client;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.bpm.InvalidProcessDefinitionException;
-import org.jboss.bpm.client.ProcessDefinitionManager;
-import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.process.ProcessDefinition;
-import org.jbpm.integration.def.ProcessDefinitionAdapter;
-import org.jbpm.jpdl.JpdlException;
-
-/**
- * An implementation of a process definition manager
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class ProcessDefinitionManagerImpl extends ProcessDefinitionManager
-{
-
- public void setProcessEngine(ProcessEngine engine)
- {
- this.engine = engine;
- }
-
- @Override
- protected ProcessDefinition createProcessDefinitionOverride(String jpdl)
- {
- org.jbpm.graph.def.ProcessDefinition oldPD;
- try
- {
- oldPD = org.jbpm.graph.def.ProcessDefinition.parseXmlString(jpdl);
- }
- catch (JpdlException ex)
- {
- throw new InvalidProcessDefinitionException(ex);
- }
- ProcessDefinition pdef = ProcessDefinitionAdapter.buildProcessDefinition(oldPD);
- addProcessDefinition(pdef);
- return pdef;
- }
-
- @Override
- protected ProcessDefinition createProcessDefinitionOverride(URL jpdl) throws IOException
- {
- org.jbpm.graph.def.ProcessDefinition oldPD;
- try
- {
- oldPD = org.jbpm.graph.def.ProcessDefinition.parseXmlInputStream(jpdl.openStream());
- }
- catch (JpdlException ex)
- {
- throw new InvalidProcessDefinitionException(ex);
- }
- ProcessDefinition pdef = ProcessDefinitionAdapter.buildProcessDefinition(oldPD);
- addProcessDefinition(pdef);
- return pdef;
- }
-}
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -23,10 +23,9 @@
//$Id$
-import org.jboss.bpm.client.ExecutionManager;
-import org.jboss.bpm.client.ProcessDefinitionManager;
import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.client.ProcessInstanceManager;
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.client.SignalManager;
/**
* A process engine with public access
@@ -36,19 +35,13 @@
*/
public class ProcessEngineImpl extends ProcessEngine
{
-
- public void setProcessDefinitionManager(ProcessDefinitionManager processDefinitionManager)
+ public void setProcessManager(ProcessManager processManager)
{
- this.processDefinitionManager = processDefinitionManager;
+ this.processManager = processManager;
}
- public void setProcessInstanceManager(ProcessInstanceManager processInstanceManager)
+ public void setSignalManager(SignalManager signalManager)
{
- this.processInstanceManager = processInstanceManager;
+ this.signalManager = signalManager;
}
-
- public void setExecutionManager(ExecutionManager executionManager)
- {
- this.executionManager = executionManager;
- }
}
Deleted: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessInstanceImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessInstanceImpl.java 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessInstanceImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.client;
-
-//$Id$
-
-import org.jboss.bpm.client.internal.AbstractProcessInstance;
-import org.jboss.bpm.process.ProcessDefinition;
-
-/**
- * TODO
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class ProcessInstanceImpl extends AbstractProcessInstance
-{
- ProcessInstanceImpl(ProcessDefinition pdef)
- {
- super(pdef);
- init(null);
- }
-}
Deleted: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessInstanceManagerImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessInstanceManagerImpl.java 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessInstanceManagerImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.client;
-
-// $Id$
-
-import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.client.ProcessInstance;
-import org.jboss.bpm.client.ProcessInstanceManager;
-import org.jboss.bpm.process.ProcessDefinition;
-
-/**
- * TODO
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class ProcessInstanceManagerImpl extends ProcessInstanceManager
-{
- public void setProcessEngine(ProcessEngine engine)
- {
- this.engine = engine;
- }
-
- @Override
- protected ProcessInstance createProcessInstanceOverride(ProcessDefinition pdef)
- {
- ProcessInstance pinst = new ProcessInstanceImpl(pdef);
- return pinst;
- }
-}
Added: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessManagerImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessManagerImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessManagerImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.client;
+
+// $Id$
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.client.ProcessEngine;
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.model.Process;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.integration.model.ProcessAdapter;
+import org.jbpm.jpdl.JpdlException;
+
+/**
+ * An implementation of a process manager
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessManagerImpl extends ProcessManager
+{
+
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ this.engine = engine;
+ }
+
+ @Override
+ protected Process createProcessOverride(String jpdl)
+ {
+ ProcessDefinition oldPD;
+ try
+ {
+ oldPD = ProcessDefinition.parseXmlString(jpdl);
+ }
+ catch (JpdlException ex)
+ {
+ throw new InvalidProcessException(ex);
+ }
+ Process pdef = ProcessAdapter.buildProcess(oldPD);
+ addProcess(pdef);
+ return pdef;
+ }
+
+ @Override
+ protected Process createProcessOverride(URL jpdl) throws IOException
+ {
+ ProcessDefinition oldPD;
+ try
+ {
+ oldPD = ProcessDefinition.parseXmlInputStream(jpdl.openStream());
+ }
+ catch (JpdlException ex)
+ {
+ throw new InvalidProcessException(ex);
+ }
+ Process pdef = ProcessAdapter.buildProcess(oldPD);
+ addProcess(pdef);
+ return pdef;
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -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.integration.client;
+
+// $Id$
+
+import org.jboss.bpm.client.ProcessEngine;
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.runtime.Signal;
+
+/**
+ * An implementation of a signal manager
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class SignalManagerImpl extends SignalManager
+{
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ this.engine = engine;
+ }
+
+ @Override
+ public void throwSignal(Signal signal)
+ {
+ super.throwSignal(signal);
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/SignalManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/EndEventImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/EndEventImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/EndEventImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.model;
+
+//$Id$
+
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.internal.AbstractEndEvent;
+import org.jboss.bpm.runtime.Token;
+import org.jbpm.graph.def.Node;
+
+/**
+ * TODO
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class EndEventImpl extends AbstractEndEvent
+{
+ EndEventImpl(Process proc, Node oldNode)
+ {
+ setProcess(proc);
+ setImplObject(oldNode);
+ }
+
+ @Override
+ protected void executeOverwrite(Token token)
+ {
+ // nothing to do
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/EndEventImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessAdapter.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessAdapter.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessAdapter.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.model;
+
+// $Id$
+
+import java.util.List;
+
+import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Task;
+import org.jboss.bpm.model.internal.AbstractFlowObject;
+import org.jboss.bpm.runtime.BasicTask;
+import org.jbpm.graph.def.Action;
+import org.jbpm.graph.def.Event;
+import org.jbpm.graph.def.Node;
+import org.jbpm.graph.node.EndState;
+import org.jbpm.graph.node.StartState;
+import org.jbpm.graph.node.State;
+
+/**
+ * Adapts on jBPM3 ProcessDefinition to an API Process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessAdapter
+{
+
+ public static Process buildProcess(org.jbpm.graph.def.ProcessDefinition oldPD)
+ {
+ ProcessImpl apiProc = new ProcessImpl(oldPD);
+ List<org.jbpm.graph.def.Node> oldNodes = oldPD.getNodes();
+ for (org.jbpm.graph.def.Node oldNode : oldNodes)
+ {
+ AbstractFlowObject flowObject = NodeAdapter.adaptNode(apiProc, oldNode);
+ apiProc.addFlowObject(flowObject);
+ }
+
+ // validate
+ validateProcess(apiProc);
+
+ return apiProc;
+ }
+
+ private static void validateProcess(Process apiProc)
+ {
+ // These methods are expected to throw exceptions if there are no such states
+ apiProc.getStartEvent();
+ apiProc.getEndEvents();
+ }
+
+ static class NodeAdapter
+ {
+ static AbstractFlowObject adaptNode(Process apiProc, Node oldNode)
+ {
+ AbstractFlowObject flowObject;
+ if (oldNode instanceof StartState)
+ {
+ flowObject = new StartEventImpl(apiProc, oldNode);
+ }
+ else if (oldNode instanceof EndState)
+ {
+ flowObject = new EndEventImpl(apiProc, oldNode);
+ }
+ else if (oldNode instanceof State)
+ {
+ Task delegate = null;
+ Event event = oldNode.getEvent(Event.EVENTTYPE_NODE_ENTER);
+ if (event != null)
+ {
+ List actions = event.getActions();
+ if (actions == null || actions.size() == 0)
+ throw new InvalidProcessException("Cannot find action on event: " + event);
+ if (actions.size() > 1)
+ throw new InvalidProcessException("Multiple actions not supported: " + event);
+
+ Action action = (Action)actions.get(0);
+ Object obj = action.getActionDelegation().getInstance();
+ if (obj instanceof Task == false)
+ throw new InvalidProcessException("Node action is not of type Task");
+
+ delegate = (Task)obj;
+ }
+ flowObject = new TaskImpl(apiProc, oldNode, delegate);
+ if (delegate instanceof BasicTask)
+ {
+ BasicTask basic = (BasicTask)delegate;
+ basic.setProcess(apiProc);
+ basic.setName(oldNode.getName());
+ }
+ }
+ else
+ {
+ throw new InvalidProcessException("Unsupported node type: " + oldNode);
+ }
+ return flowObject;
+ }
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessAdapter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.model;
+
+//$Id$
+
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.internal.AbstractFlowObject;
+import org.jboss.bpm.model.internal.AbstractProcess;
+import org.jboss.bpm.runtime.Token;
+import org.jbpm.graph.def.GraphElement;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.Execution;
+
+/**
+ * A jBPM3 implementation of a process definition
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessImpl extends AbstractProcess
+{
+ public ProcessImpl(ProcessDefinition oldPD)
+ {
+ setImplObject(oldPD);
+ init(oldPD.getName());
+ }
+
+ // Provide public access
+ public void addFlowObject(AbstractFlowObject flowObject)
+ {
+ super.addFlowObject(flowObject);
+ }
+
+ public FlowObject findFlowObject(GraphElement graphElement)
+ {
+ FlowObject fo = null;
+ for (FlowObject aux : getFlowObjects())
+ {
+ if (((AbstractFlowObject)aux).getImplObject() == graphElement)
+ {
+ fo = aux;
+ break;
+ }
+ }
+ return fo;
+ }
+
+ public String getName()
+ {
+ GraphElement oldEl = (GraphElement)getImplObject();
+ return oldEl.getName();
+ }
+
+ public void setName(String name)
+ {
+ GraphElement oldEl = (GraphElement)getImplObject();
+ oldEl.setName(name);
+ }
+
+ public void executeOverwrite(Token token)
+ {
+ Process proc = token.getProcess();
+ StartEventImpl start = (StartEventImpl)proc.getStartEvent();
+ start.execute(token);
+
+ // Repeatetly signal the Execution until we reach the end
+ Execution oldEx = start.getExecution();
+ while (oldEx.getRootToken().hasEnded() == false)
+ {
+ oldEx.signal();
+ }
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/StartEventImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/StartEventImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/StartEventImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.model;
+
+//$Id$
+
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.internal.AbstractStartEvent;
+import org.jboss.bpm.runtime.Token;
+import org.jbpm.context.exe.ContextInstance;
+import org.jbpm.graph.def.GraphElement;
+import org.jbpm.graph.def.Node;
+import org.jbpm.graph.exe.Execution;
+import org.jbpm.integration.runtime.ExecutionContextImpl;
+
+/**
+ * TODO
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class StartEventImpl extends AbstractStartEvent
+{
+ private Execution oldEx;
+
+ StartEventImpl(Process proc, Node oldNode)
+ {
+ setProcess(proc);
+ setImplObject(oldNode);
+ }
+
+ @Override
+ public void execute(Token token)
+ {
+ super.execute(token);
+ oldEx.signal();
+ }
+
+ @Override
+ protected void executeOverwrite(Token token)
+ {
+ // Create a new Execution and copy the attachments
+ GraphElement oldEl = (GraphElement)getImplObject();
+ oldEx = new Execution(oldEl.getProcessDefinition());
+ ContextInstance ctxInst = oldEx.getContextInstance();
+ new ExecutionContextImpl(ctxInst).copyAttachments(token.getExecutionContext());
+ ctxInst.setTransientVariable(Process.class.getName(), getProcess());
+ }
+
+ public Execution getExecution()
+ {
+ return oldEx;
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/StartEventImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.model;
+
+//$Id$
+
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Task;
+import org.jboss.bpm.model.internal.AbstractTask;
+import org.jboss.bpm.runtime.Token;
+import org.jbpm.graph.def.GraphElement;
+import org.jbpm.graph.def.Node;
+
+/**
+ * A jBPM3 implementation of a flow object
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class TaskImpl extends AbstractTask
+{
+ private Task delegate;
+
+ TaskImpl(Process proc, Node oldNode, Task task)
+ {
+ setProcess(proc);
+ setImplObject(oldNode);
+ init(oldNode.getName());
+ this.delegate = task;
+ }
+
+ public String getName()
+ {
+ GraphElement oldEl = (GraphElement)getImplObject();
+ return oldEl.getName();
+ }
+
+ public void setName(String name)
+ {
+ GraphElement oldEl = (GraphElement)getImplObject();
+ oldEl.setName(name);
+ }
+
+ @Override
+ public void execute(Token token)
+ {
+ if (delegate != null)
+ {
+ delegate.execute(token);
+ }
+ else
+ {
+ super.execute(token);
+ }
+ }
+
+ @Override
+ protected void executeOverwrite(Token token)
+ {
+ // nothing to do
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ActivityWrapper.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ActivityWrapper.java 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ActivityWrapper.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.integration.runtime;
-
-// $Id$
-
-import org.jboss.bpm.process.Execution;
-import org.jboss.bpm.runtime.Activity;
-import org.jbpm.context.exe.ContextInstance;
-import org.jbpm.graph.def.Action;
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.exe.ExecutionContext;
-
-/**
- * This is a wrapper arround an API Activity
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class ActivityWrapper implements ActionHandler
-{
- private static final long serialVersionUID = 3617376097428098837L;
-
- private Activity activity;
-
- public ActivityWrapper(Action action, Activity activity)
- {
- this.activity = activity;
- }
-
- public void execute(ExecutionContext executionContext) throws Exception
- {
- ContextInstance ctxInst = executionContext.getContextInstance();
- Execution ex = (Execution)ctxInst.getTransientVariable(Execution.class.getName());
- if (ex == null)
- throw new IllegalStateException("Cannot obtain API Execution");
-
- activity.execute(ex.getNode(), ex.getContext());
- }
-}
Added: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ExecutionContextImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ExecutionContextImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ExecutionContextImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -0,0 +1,145 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.runtime;
+
+//$Id$
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.jboss.bpm.client.Attachments;
+import org.jboss.bpm.runtime.ExecutionContext;
+import org.jbpm.context.exe.ContextInstance;
+
+/**
+ * An implementation that delegates to the jBPM3 ContextInstance
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ExecutionContextImpl implements ExecutionContext
+{
+ private ContextInstance ctxInst;
+
+ public ExecutionContextImpl(ContextInstance ctxInst)
+ {
+ this.ctxInst = ctxInst;
+ }
+
+ public void copyAttachments(Attachments att)
+ {
+ for (Key key : att.getAttachmentKeys())
+ {
+ Object value = att.getAttachment(key.getClassPart(), key.getNamePart());
+ addAttachment(key.getClassPart(), key.getNamePart(), value);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(Class<T> clazz, Object value)
+ {
+ Key key = new Key(clazz, null);
+ ctxInst.setTransientVariable(key, value);
+ return (T)value;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(Class<T> clazz, String name, Object value)
+ {
+ Key key = new Key(clazz, name);
+ ctxInst.setTransientVariable(key, value);
+ return (T)value;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(String name, Object value)
+ {
+ Key key = new Key(null, name);
+ ctxInst.setTransientVariable(key, value);
+ return (T)value;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(Class<T> clazz)
+ {
+ Key key = new Key(clazz, null);
+ Object value = ctxInst.getTransientVariable(key);
+ return (T)value;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(Class<T> clazz, String name)
+ {
+ Key key = new Key(clazz, name);
+ Object value = ctxInst.getTransientVariable(key);
+ return (T)value;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(String name)
+ {
+ Key key = new Key(null, name);
+ Object value = ctxInst.getTransientVariable(key);
+ return (T)value;
+ }
+
+ public Collection<Key> getAttachmentKeys()
+ {
+ Set<Key> keys = new HashSet<Key>();
+ Iterator<?> itKeys = ctxInst.getTransientVariables().keySet().iterator();
+ while (itKeys.hasNext())
+ {
+ Object key = itKeys.next();
+ if (key instanceof Key)
+ {
+ keys.add((Key)key);
+ }
+ }
+ return keys;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(Class<T> clazz)
+ {
+ Key key = new Key(clazz, null);
+ Object value = ctxInst.deleteTransientVariable(key);
+ return (T)value;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(Class<T> clazz, String name)
+ {
+ Key key = new Key(clazz, name);
+ Object value = ctxInst.deleteTransientVariable(key);
+ return (T)value;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(String name)
+ {
+ Key key = new Key(null, name);
+ Object value = ctxInst.deleteTransientVariable(key);
+ return (T)value;
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/ExecutionContextImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/TaskWrapper.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/TaskWrapper.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/TaskWrapper.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -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.integration.runtime;
+
+// $Id$
+
+import org.jbpm.graph.def.Action;
+import org.jbpm.graph.def.ActionHandler;
+import org.jbpm.graph.exe.ExecutionContext;
+
+/**
+ * This is a wrapper arround an API Task
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class TaskWrapper implements ActionHandler
+{
+ private static final long serialVersionUID = -1;
+
+ public TaskWrapper(Action action)
+ {
+ }
+
+ public void execute(ExecutionContext oldContext) throws Exception
+ {
+ // nothing to do
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/TaskWrapper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/TokenImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/TokenImpl.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/TokenImpl.java 2008-07-09 18:23:16 UTC (rev 1560)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.runtime;
+
+// $Id$
+
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.runtime.ExecutionContext;
+import org.jboss.bpm.runtime.internal.AbstractToken;
+import org.jbpm.context.exe.ContextInstance;
+
+/**
+ * An implementation of an API token
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class TokenImpl extends AbstractToken
+{
+ private Process proc;
+
+ public TokenImpl(Process proc, ContextInstance ctxInst)
+ {
+ this.proc = proc;
+ setImplObject(ctxInst);
+ }
+
+ public Process getProcess()
+ {
+ return proc;
+ }
+
+ public ExecutionContext getExecutionContext()
+ {
+ ContextInstance ctxInst = (ContextInstance)getImplObject();
+ return new ExecutionContextImpl(ctxInst);
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/TokenImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/jpdl/core/src/main/resources/jbpm-beans.xml
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/resources/jbpm-beans.xml 2008-07-09 18:22:54 UTC (rev 1559)
+++ jbpm3/trunk/modules/jpdl/core/src/main/resources/jbpm-beans.xml 2008-07-09 18:23:16 UTC (rev 1560)
@@ -6,23 +6,17 @@
<!-- The process engine -->
<bean name="jBPMProcessEngine" class="org.jbpm.integration.client.ProcessEngineImpl">
- <property name="processDefinitionManager"><inject bean="jBPMProcessDefinitionManager"/></property>
- <property name="processInstanceManager"><inject bean="jBPMProcessInstanceManager"/></property>
- <property name="executionManager"><inject bean="jBPMExecutionManager"/></property>
+ <property name="processManager"><inject bean="jBPMProcessManager"/></property>
+ <property name="signalManager"><inject bean="jBPMSignalManager"/></property>
</bean>
<!-- The process definition manager -->
- <bean name="jBPMProcessDefinitionManager" class="org.jbpm.integration.client.ProcessDefinitionManagerImpl">
+ <bean name="jBPMProcessManager" class="org.jbpm.integration.client.ProcessManagerImpl">
<property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
</bean>
- <!-- The process instance manager -->
- <bean name="jBPMProcessInstanceManager" class="org.jbpm.integration.client.ProcessInstanceManagerImpl">
- <property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
- </bean>
-
<!-- The execution manager -->
- <bean name="jBPMExecutionManager" class="org.jbpm.integration.client.ExecutionManagerImpl">
+ <bean name="jBPMSignalManager" class="org.jbpm.integration.client.SignalManagerImpl">
<property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
</bean>
15 years, 10 months
JBoss JBPM SVN: r1559 - in api/trunk/modules: api/src/main/java/org/jboss/bpm/client and 20 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-09 14:22:54 -0400 (Wed, 09 Jul 2008)
New Revision: 1559
Added:
api/trunk/modules/api/src/main/java/org/jboss/bpm/InvalidProcessException.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/BasicAttachments.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/NamedFlowObject.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractActivity.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEndEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractFlowObject.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractProcess.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractStartEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractTask.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InitialToken.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicTask.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractToken.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/client/ProcessTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
api/trunk/modules/testsuite/src/test/resources/model/
api/trunk/modules/testsuite/src/test/resources/model/basic-sequence.xml
api/trunk/modules/testsuite/src/test/resources/samples/
api/trunk/modules/testsuite/src/test/resources/samples/context/
api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context.xml
api/trunk/modules/testsuite/src/test/resources/samples/engine/
api/trunk/modules/testsuite/src/test/resources/samples/engine/basic-engine.xml
api/trunk/modules/testsuite/src/test/resources/samples/sequence/
api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.xml
api/trunk/modules/testsuite/src/test/resources/samples/task/
api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.xml
Removed:
api/trunk/modules/api/src/main/java/org/jboss/bpm/InvalidProcessDefinitionException.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessDefinitionManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessInstance.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessInstanceManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/AbstractExecution.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/AbstractProcessInstance.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessInstanceContext.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/process/
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Activity.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/EndSignal.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeExecution.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeNode.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/StartSignal.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Transition.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/TransitionRouter.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractRuntimeNode.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/client/ProcessDefinitionTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/activity/
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/basic/
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ContextActivity.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java
Modified:
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessEngine.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Activity.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Result.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionContext.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Signal.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/client/MockProcessEngine.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/client/ProcessEngineLocatorTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/engine/EngineShutdownTest.java
Log:
Align API with BPMN
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/InvalidProcessDefinitionException.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/InvalidProcessDefinitionException.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/InvalidProcessDefinitionException.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,59 +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;
-
-
-// $Id$
-
-/**
- * A RuntimeException that is thrown for invalid process definitions
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class InvalidProcessDefinitionException extends JBPMException
-{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public InvalidProcessDefinitionException()
- {
- super();
- }
-
- public InvalidProcessDefinitionException(String message)
- {
- super(message);
- }
-
- public InvalidProcessDefinitionException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public InvalidProcessDefinitionException(Throwable cause)
- {
- super(cause);
- }
-}
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/InvalidProcessException.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/InvalidProcessException.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/InvalidProcessException.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -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.jboss.bpm;
+
+
+// $Id$
+
+/**
+ * A RuntimeException that is thrown for invalid processes
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class InvalidProcessException extends JBPMException
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public InvalidProcessException()
+ {
+ super();
+ }
+
+ public InvalidProcessException(String message)
+ {
+ super(message);
+ }
+
+ public InvalidProcessException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public InvalidProcessException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/InvalidProcessException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/BasicAttachments.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/BasicAttachments.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/BasicAttachments.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,118 @@
+/*
+ * 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.client;
+
+//$Id$
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * Basic attachments.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class BasicAttachments implements Attachments
+{
+ private Map<Key, Object> attachments = new HashMap<Key, Object>();
+
+ /** Construct the execution context with no attachments */
+ public BasicAttachments()
+ {
+
+ }
+
+ /** Construct the execution context with given attachments */
+ public BasicAttachments(Attachments att)
+ {
+ if (att != null)
+ {
+ for (Key key : att.getAttachmentKeys())
+ {
+ Object value = att.getAttachment(key.getClassPart(), key.getNamePart());
+ this.attachments.put(key, value);
+ }
+ }
+ }
+
+ public Collection<Key> getAttachmentKeys()
+ {
+ return attachments.keySet();
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(Class<T> clazz)
+ {
+ return (T)attachments.get(new Key(clazz, null));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(Class<T> clazz, String name)
+ {
+ return (T)attachments.get(new Key(clazz, name));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(String name)
+ {
+ return (T)attachments.get(new Key(null, name));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(Class<T> clazz, Object obj)
+ {
+ return (T)attachments.put(new Key(clazz, null), obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(Class<T> clazz, String name, Object obj)
+ {
+ return (T)attachments.put(new Key(clazz, name), obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(String name, Object obj)
+ {
+ return (T)attachments.put(new Key(null, name), obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(Class<T> clazz)
+ {
+ return (T)attachments.remove(new Key(clazz, null));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(Class<T> clazz, String name)
+ {
+ return (T)attachments.remove(new Key(clazz, name));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(String name)
+ {
+ return (T)attachments.remove(new Key(null, name));
+ }
+}
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/BasicAttachments.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.client;
-
-// $Id$
-
-import org.jboss.bpm.EngineShutdownException;
-import org.jboss.bpm.client.Attachments.Key;
-import org.jboss.bpm.process.Execution;
-
-/**
- * The execution manager is the entry point to create, find and otherwise manage process executions.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class ExecutionManager
-{
- // Injected through the MC
- protected ProcessEngine engine;
-
- // Hide public constructor
- protected ExecutionManager()
- {
- }
-
- /**
- * Get the associated process engine
- */
- public ProcessEngine getProcessEngine()
- {
- if (engine == null)
- throw new IllegalStateException("ProcessEngine not available through kernel configuration");
-
- return engine;
- }
-
- /**
- * Locate the execution manager
- */
- public static ExecutionManager locateExecutionManager()
- {
- ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
- return engine.getExecutionManager();
- }
-
- /**
- * Create an execution for a given process instance.
- * The process instance context is copied to the execution context.
- * Note, that this is a shallow copy. Mutable objects should generally not be put into the context.
- */
- public final Execution createExecution(ProcessInstance pinst)
- {
- // TODO: test this
- if (engine.isPrepareForShutdown())
- throw new EngineShutdownException("Cannot create new Execution while engine is shutting down");
-
- // Copy the instance context to the execution context
- Attachments context = pinst.getAttachments();
- Execution ex = createExecutionOverride(pinst);
- for (Key key : context.getAttachmentKeys())
- {
- Object att = context.getAttachment(key.getClassPart(), key.getNamePart());
- ex.getContext().addAttachment(key.getClassPart(), key.getNamePart(), att);
- }
-
- return ex;
- }
-
- // Override to implement execution creation
- protected abstract Execution createExecutionOverride(ProcessInstance pinst);
-}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessDefinitionManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessDefinitionManager.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessDefinitionManager.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,146 +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.client;
-
-// $Id$
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.jboss.bpm.EngineShutdownException;
-import org.jboss.bpm.process.ProcessDefinition;
-
-/**
- * The process definition manager is the entry point to create, find and otherwise manage process definitions.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class ProcessDefinitionManager
-{
- // Injected through the MC
- protected ProcessEngine engine;
- // The set of process definitions
- private Set<ProcessDefinition> pdefs = new HashSet<ProcessDefinition>();
-
- // Hide public constructor
- protected ProcessDefinitionManager()
- {
- }
-
- /* Get the associated process engine */
- public ProcessEngine getProcessEngine()
- {
- if (engine == null)
- throw new IllegalStateException("ProcessEngine not available through kernel configuration");
-
- return engine;
- }
-
- /* Locate the process definition manager */
- public static ProcessDefinitionManager locateProcessDefinitionManager()
- {
- ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
- return engine.getProcessDefinitionManager();
- }
-
- /*
- * Create a process defintion from a XML string in one of the supported formats
- */
- public final ProcessDefinition createProcessDefinition(String pdDescriptor)
- {
- // TODO: test this
- if (engine.isPrepareForShutdown())
- throw new EngineShutdownException("Cannot create new ProcessDefinition while engine is shutting down");
-
- ProcessDefinition pd = createProcessDefinitionOverride(pdDescriptor);
- return pd;
- }
-
- /*
- * Override to implement process definition creation
- */
- protected abstract ProcessDefinition createProcessDefinitionOverride(String pdDescriptor);
-
- /*
- * Create a process defintion from an URL to a XML descritor in one of the supported formats
- */
- public final ProcessDefinition createProcessDefinition(URL pdURL) throws IOException
- {
- // TODO: test this
- if (engine.isPrepareForShutdown())
- throw new EngineShutdownException("Cannot create new ProcessDefinition while engine is shutting down");
-
- ProcessDefinition pd = createProcessDefinitionOverride(pdURL);
- return pd;
- }
-
- /*
- * Override to implement process definition creation
- */
- protected abstract ProcessDefinition createProcessDefinitionOverride(URL pdURL) throws IOException;
-
- /*
- * Get the set of registered process definitions
- */
- public Set<ProcessDefinition> getProcessDefinitions()
- {
- return Collections.unmodifiableSet(pdefs);
- }
-
- /*
- * Find a process definition for a given name
- *
- * @return null if the process definition is not defined
- */
- public ProcessDefinition findProcessDefinition(String name)
- {
- ProcessDefinition pdef = null;
- for (ProcessDefinition aux : pdefs)
- {
- if (aux.getName().equals(name))
- {
- pdef = aux;
- break;
- }
- }
- return pdef;
- }
-
- /*
- * Remove a process definition and all its associated process instances
- */
- public void removeProcessDefinition(ProcessDefinition pdef)
- {
- // Remove the preocess definition
- pdefs.remove(pdef.getName());
- }
-
- // Add a process definition
- protected void addProcessDefinition(ProcessDefinition pdef)
- {
- pdefs.add(pdef);
- }
-}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessEngine.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessEngine.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessEngine.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -36,15 +36,8 @@
/** The default bean config: jbpm-beans.xml */
public static final String JBPM_ENGINE_CONFIG = "jbpm-beans.xml";
- // Injected through the MC
- protected ProcessDefinitionManager processDefinitionManager;
- // Injected through the MC
protected ProcessManager processManager;
// Injected through the MC
- protected ProcessInstanceManager processInstanceManager;
- // Injected through the MC
- protected ExecutionManager executionManager;
- // Injected through the MC
protected SignalManager signalManager;
// Flag to indicate that the Engine is shutting down
private boolean prepareForShutdown;
@@ -79,23 +72,9 @@
}
/**
- * Get the configured instance of the process definition manager
- *
- * @return The process definition manager
+ * Get the configured instance of the process manager
+ * @return The process manager
*/
- public ProcessDefinitionManager getProcessDefinitionManager()
- {
- if (processDefinitionManager == null)
- throw new IllegalStateException("ProcessDefinitionManager not available through kernel configuration");
-
- return processDefinitionManager;
- }
-
- /**
- * Get the configured instance of the process definition manager
- *
- * @return The process definition manager
- */
public ProcessManager getProcessManager()
{
if (processManager == null)
@@ -105,31 +84,9 @@
}
/**
- * Get the configured instance of the process instance manager
- *
- * @return The process instance manager
+ * Get the configured instance of the signal manager
+ * @return The signal manager
*/
- public ProcessInstanceManager getProcessInstanceManager()
- {
- if (processInstanceManager == null)
- throw new IllegalStateException("ProcessInstanceManager not available through kernel configuration");
-
- return processInstanceManager;
- }
-
- /**
- * Get the configured instance of the execution manager
- *
- * @return The execution manager
- */
- public ExecutionManager getExecutionManager()
- {
- if (executionManager == null)
- throw new IllegalStateException("ExecutionManager not available through kernel configuration");
-
- return executionManager;
- }
-
public SignalManager getSignalManager()
{
if (signalManager == null)
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessInstance.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessInstance.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessInstance.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.client;
-
-//$Id$
-
-import java.util.Set;
-
-import org.jboss.bpm.process.Execution;
-import org.jboss.bpm.process.ProcessDefinition;
-
-/**
- * Represents an instance of a BPM process.
- *
- * It is the combination of a process definition plus its associated instance data
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public interface ProcessInstance
-{
- /**
- * Get the associated process definition
- */
- ProcessDefinition getProcessDefinition();
-
- /**
- * Get the name of this process instance
- */
- String getName();
-
- /**
- * Get the attachments for this process instance
- */
- Attachments getAttachments();
-
- /**
- * Create an execution for this process instance
- */
- Execution createExecution();
-
- /**
- * Get the set of registered executions
- */
- Set<Execution> getExecutions();
-
- /**
- * Find an execution for a given name
- *
- * @return null if it cannot be found
- */
- Execution findExecution(String name);
-
- /**
- * Remove an execution for a given name
- */
- void removeExecution(String name);
-
-}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessInstanceManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessInstanceManager.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessInstanceManager.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,84 +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.client;
-
-//$Id$
-
-import org.jboss.bpm.EngineShutdownException;
-import org.jboss.bpm.process.ProcessDefinition;
-
-/**
- * The process instance manager is the entry point to create process instances.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class ProcessInstanceManager
-{
- // Injected through the MC
- protected ProcessEngine engine;
-
- // Hide public constructor
- protected ProcessInstanceManager()
- {
- }
-
- /**
- * Get the associated process engine
- */
- public ProcessEngine getProcessEngine()
- {
- if (engine == null)
- throw new IllegalStateException("ProcessEngine not available through kernel configuration");
-
- return engine;
- }
-
- /**
- * Locate the process instance manager
- */
- public static ProcessInstanceManager locateProcessInstanceManager()
- {
- ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
- return engine.getProcessInstanceManager();
- }
-
- /**
- * Create a process instance for a given process definition
- *
- * @param pdef the process definition
- * @return A process instance
- */
- public final ProcessInstance createProcessInstance(ProcessDefinition pdef)
- {
- // TODO: test this
- if (engine.isPrepareForShutdown())
- throw new EngineShutdownException("Cannot create new ProcessInstance while engine is shutting down");
-
- ProcessInstance pinst = createProcessInstanceOverride(pdef);
- return pinst;
- }
-
- // Override to implement process instance creation
- protected abstract ProcessInstance createProcessInstanceOverride(ProcessDefinition pdef);
-
-}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -105,7 +105,7 @@
/*
* Get the set of registered process definitions
*/
- public Set<Process> getProcesss()
+ public Set<Process> getProcesses()
{
return Collections.unmodifiableSet(procs);
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -28,6 +28,8 @@
import java.util.Map;
import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.runtime.Signal;
/**
@@ -38,10 +40,13 @@
*/
public abstract class SignalManager
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(SignalManager.class);
+
// Injected through the MC
protected ProcessEngine engine;
// The map of registered signal listeners
- private Map<String,Set<SignalListener>> listeners = new HashMap<String,Set<SignalListener>>();
+ private Map<String, Set<SignalListener>> listeners = new HashMap<String, Set<SignalListener>>();
// Hide public constructor
protected SignalManager()
@@ -67,10 +72,11 @@
ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
return engine.getSignalManager();
}
-
+
/** Add a signal listener for a given process */
public void addListener(String procName, SignalListener listener)
{
+ log.debug("addListener: " + listener);
Set<SignalListener> set = listeners.get(procName);
if (set == null)
{
@@ -79,27 +85,30 @@
}
set.add(listener);
}
-
+
/** Remove an signal listener for a given process */
public void removeListener(String procName, SignalListener listener)
{
+ log.debug("removeListener: " + listener);
Set<SignalListener> set = listeners.get(procName);
if (set != null)
{
set.remove(listener);
}
}
-
+
/** Remove all signal listeners for a given process */
public void removeListeners(String procName)
{
+ log.debug("removeListeners: " + procName);
listeners.remove(procName);
}
-
+
/** Throw a signal to all registered listeners */
public void throwSignal(Signal signal)
{
- String procName = signal.getProcessName();
+ log.debug("throwSignal: " + signal);
+ String procName = signal.getProcess().getName();
Set<SignalListener> set = listeners.get(procName);
if (set != null)
{
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/AbstractExecution.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/AbstractExecution.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/AbstractExecution.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,116 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.client.internal;
-
-//$Id$
-
-import org.jboss.bpm.client.ProcessInstance;
-import org.jboss.bpm.process.Execution;
-import org.jboss.bpm.process.Node;
-import org.jboss.bpm.runtime.Token;
-
-/**
- * Represents an execution of a process instance.
- *
- * The name of an execution is unique in the scope of the process instance.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class AbstractExecution implements Execution
-{
- // The associated process instance
- private ProcessInstance pinst;
-
- // Construct the execution
- protected AbstractExecution(ProcessInstance pinst)
- {
- if (pinst == null)
- throw new IllegalArgumentException("Process instance cannot be null");
-
- this.pinst = pinst;
- }
-
- // Construct the execution from a copy
- protected AbstractExecution(Execution ex)
- {
- this(ex.getProcessInstance());
- }
-
- // Call to initialize fully
- protected void init(String name)
- {
- if (name == null)
- {
- name = "AnonymousExecution#" + pinst.getExecutions().size();
- setName(name);
- }
- }
-
- /*
- * Get the associated process instance
- */
- /* (non-Javadoc)
- * @see org.jboss.bpm.client.Execution#getProcessInstance()
- */
- public ProcessInstance getProcessInstance()
- {
- return pinst;
- }
-
- /**
- * Get the name for the execution
- */
- public abstract String getName();
-
- /**
- * Get the context for this execution
- */
- public abstract Token getContext();
-
- // Set the name for the execution
- protected abstract void setName(String name);
-
- /**
- * Get the current node for this execution
- */
- public final Node getNode()
- {
- Node node = getNodeOverride();
- return node;
- }
-
- // Override to get the node
- protected abstract Node getNodeOverride();
-
- /**
- * Signal this execution
- */
- public final void signal()
- {
- signalOverride();
- }
-
- // Override to implement execution signalling
- protected abstract void signalOverride();
-
-}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/AbstractProcessInstance.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/AbstractProcessInstance.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/AbstractProcessInstance.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -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.jboss.bpm.client.internal;
-
-// $Id$
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.jboss.bpm.client.Attachments;
-import org.jboss.bpm.client.ExecutionManager;
-import org.jboss.bpm.client.ProcessInstance;
-import org.jboss.bpm.process.Execution;
-import org.jboss.bpm.process.ProcessDefinition;
-
-/**
- * Represents an instance of a BPM process.
- *
- * It is the combination of a process definition plus its associated instance data
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class AbstractProcessInstance implements ProcessInstance
-{
- // The process definition
- private ProcessDefinition pdef;
- // The name
- private String name;
- // The map of executions
- private Set<Execution> execs = new HashSet<Execution>();
- // The meta data for this process instance
- private Attachments attachments = new ProcessInstanceContext();
-
- // Construct a process instance with a given process definition
- protected AbstractProcessInstance(ProcessDefinition pdef)
- {
- if (pdef == null)
- throw new IllegalArgumentException("Process definition cannot be null");
-
- this.pdef = pdef;
- }
-
- // Call to initialize fully
- protected void init(String name)
- {
- if (name == null)
- {
- name = "AnonymousInst#" + pdef.getProcessInstances().size();
- setName(name);
- }
- }
-
- /**
- * Get the associated process definition
- */
- public ProcessDefinition getProcessDefinition()
- {
- return pdef;
- }
-
- /**
- * Get the name of this process instance
- */
- public String getName()
- {
- return name;
- }
-
- // This is private and MUST NOT leak into the public API
- private void setName(String name)
- {
- this.name = name;
- }
-
- /**
- * Get the context for this process instance
- */
- public Attachments getAttachments()
- {
- return attachments;
- }
-
- /**
- * Create an execution for this process instance
- */
- public Execution createExecution()
- {
- ExecutionManager exm = ExecutionManager.locateExecutionManager();
- return exm.createExecution(this);
- }
-
- /**
- * Get the set of registered executions
- */
- public Set<Execution> getExecutions()
- {
- return Collections.unmodifiableSet(execs);
- }
-
- /**
- * Find an execution for a given name
- *
- * @return null if it cannot be found
- */
- public Execution findExecution(String name)
- {
- for (Execution ex : execs)
- {
- if (ex.getName() == name)
- return ex;
- }
- return null;
- }
-
- /**
- * Remove an execution for a given name
- */
- public void removeExecution(String name)
- {
- for (Execution ex : execs)
- {
- if (ex.getName() == name)
- {
- execs.remove(ex);
- }
- }
- }
-}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessInstanceContext.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessInstanceContext.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessInstanceContext.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,100 +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.client.internal;
-
-//$Id$
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.bpm.client.Attachments;
-
-/**
- * An process instance context that can take attachments.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 20-Apr-2007
- */
-public class ProcessInstanceContext implements Attachments
-{
- private Map<Key, Object> attachments = new HashMap<Key, Object>();
-
- public Collection<Key> getAttachmentKeys()
- {
- return attachments.keySet();
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getAttachment(Class<T> clazz)
- {
- return (T)attachments.get(new Key(clazz, null));
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getAttachment(Class<T> clazz, String name)
- {
- return (T)attachments.get(new Key(clazz, name));
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getAttachment(String name)
- {
- return (T)attachments.get(new Key(null, name));
- }
-
- @SuppressWarnings("unchecked")
- public <T> T addAttachment(Class<T> clazz, Object obj)
- {
- return (T)attachments.put(new Key(clazz, null), obj);
- }
-
- @SuppressWarnings("unchecked")
- public <T> T addAttachment(Class<T> clazz, String name, Object obj)
- {
- return (T)attachments.put(new Key(clazz, name), obj);
- }
-
- @SuppressWarnings("unchecked")
- public <T> T addAttachment(String name, Object obj)
- {
- return (T)attachments.put(new Key(null, name), obj);
- }
-
- @SuppressWarnings("unchecked")
- public <T> T removeAttachment(Class<T> clazz)
- {
- return (T)attachments.remove(new Key(clazz, null));
- }
-
- @SuppressWarnings("unchecked")
- public <T> T removeAttachment(Class<T> clazz, String name)
- {
- return (T)attachments.remove(new Key(clazz, name));
- }
-
- @SuppressWarnings("unchecked")
- public <T> T removeAttachment(String name)
- {
- return (T)attachments.remove(new Key(null, name));
- }
-}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Activity.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Activity.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Activity.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -22,6 +22,7 @@
package org.jboss.bpm.model;
+
// $Id$
/**
@@ -32,8 +33,6 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Activity extends FlowObject
+public interface Activity extends NamedFlowObject
{
- /** Get the name */
- String getName();
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -22,6 +22,7 @@
package org.jboss.bpm.model;
+
// $Id$
/**
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -21,15 +21,28 @@
*/
package org.jboss.bpm.model;
+import org.jboss.bpm.runtime.Signal;
+import org.jboss.bpm.runtime.Token;
-// $Id$
+//$Id$
/**
- * A Flow Object is one of the set of following graphical objects: Event, Activity, and Gateway.
+ * A Flow Object is one of the set of following graphical objects: Event, Activity, and Gateway.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
public interface FlowObject
{
+ /** Get the associated Process */
+ Process getProcess();
+
+ /** Get signal for enter */
+ Signal getEnterSignal();
+
+ /** Get signal for exit */
+ Signal getExitSignal();
+
+ /** Execute this flow object*/
+ void execute(Token token);
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -22,6 +22,7 @@
package org.jboss.bpm.model;
+
// $Id$
/**
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/NamedFlowObject.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/NamedFlowObject.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/NamedFlowObject.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model;
+
+//$Id$
+
+
+/**
+ * A Flow Object with a name
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface NamedFlowObject extends FlowObject
+{
+ /** Get the name */
+ String getName();
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/NamedFlowObject.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -21,7 +21,12 @@
*/
package org.jboss.bpm.model;
+import java.util.Set;
+import java.util.concurrent.Future;
+import org.jboss.bpm.client.Attachments;
+
+
// $Id$
/**
@@ -30,8 +35,26 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Process extends Activity
+public interface Process extends Activity, NamedFlowObject
{
+ /** Start the process */
+ Future<Result> startProcess();
+
+ /** Start the process, with a given execution context */
+ Future<Result> startProcess(Attachments att);
+
/** Get the start event */
StartEvent getStartEvent();
+
+ /** Get the set of end events */
+ Set<EndEvent> getEndEvents();
+
+ /** Get the set of flow objects */
+ Set<FlowObject> getFlowObjects();
+
+ /**
+ * Find a flow object by name
+ * @return null if not found
+ */
+ NamedFlowObject findFlowObject(String name);
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Result.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Result.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Result.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -26,13 +26,15 @@
import org.jboss.bpm.client.Attachments;
/**
- * A Result is consequence of reaching an End Event.
+ * A Result is consequence of reaching an End Event.
*
- * Results can be of different types, including: Message, Error, Compensation, Link, and Multiple.
+ * Results can be of different types, including: Message, Error, Compensation, Link, and Multiple.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface Result extends Attachments
+public interface Result
{
+ /** Get the Attachments from the result */
+ Attachments getAttachments();
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -23,7 +23,6 @@
//$Id$
-import org.jboss.bpm.runtime.ExecutionContext;
/**
* A Start Event indicates where a particular Process will start.
@@ -36,9 +35,4 @@
*/
public interface StartEvent extends Event
{
- /** Start the flow of the process */
- void execute();
-
- /** Start the flow of the process, with a given execution context */
- void execute(ExecutionContext ctx);
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -21,7 +21,6 @@
*/
package org.jboss.bpm.model;
-
// $Id$
/**
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -23,8 +23,6 @@
//$Id$
-import org.jboss.bpm.runtime.ExecutionContext;
-
/**
* A Task is an Atomic Activity that is included within a Process.
*
@@ -36,6 +34,4 @@
*/
public interface Task extends Activity
{
- /** Execute the task */
- void execute(ExecutionContext ctx);
}
\ No newline at end of file
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractActivity.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractActivity.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractActivity.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+// $Id$
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.Activity;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * Extend to implement an Activity
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class AbstractActivity extends AbstractFlowObject implements Activity
+{
+ // Construct the Activity
+ protected AbstractActivity()
+ {
+ }
+
+ // Call to initialize fully
+ protected void init(String name)
+ {
+ if (name == null)
+ {
+ Process proc = getProcess();
+ name = "AnonymousActivity#" + proc.getFlowObjects().size();
+ setName(name);
+ }
+ }
+
+ // Set the name. Note, this MUST NOT leak into the public API
+ public abstract void setName(String name);
+
+ /** Execute the activity with a given token */
+ public void execute(Token token)
+ {
+ SignalManager sm = SignalManager.locateSignalManager();
+ try
+ {
+ sm.throwSignal(getEnterSignal());
+ executeOverwrite(token);
+ }
+ finally
+ {
+ sm.throwSignal(getExitSignal());
+ }
+ }
+
+ // Overwrite to implement execute
+ protected abstract void executeOverwrite(Token token);
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractActivity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEndEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEndEvent.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEndEvent.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+// $Id$
+
+import org.jboss.bpm.client.Attachments;
+import org.jboss.bpm.model.EndEvent;
+import org.jboss.bpm.model.Result;
+import org.jboss.bpm.runtime.Signal;
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * Extend to implement an EndEvent
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class AbstractEndEvent extends AbstractEvent implements EndEvent
+{
+ private Result result;
+
+ // Construct the StartEvent
+ protected AbstractEndEvent()
+ {
+ }
+
+ /** Get signal for enter */
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_END_EVENT);
+ }
+
+ /** Get signal for exit */
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_END_EVENT);
+ }
+
+ @Override
+ public void execute(final Token token)
+ {
+ super.execute(token);
+
+ // Provide the result
+ result = new Result()
+ {
+ public Attachments getAttachments()
+ {
+ return token.getExecutionContext();
+ }
+ };
+ }
+
+ public Result getResult()
+ {
+ return result;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEndEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEvent.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEvent.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+// $Id$
+
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.Event;
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * Extend to implement an Event
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class AbstractEvent extends AbstractFlowObject implements Event
+{
+ // Construct the Event
+ protected AbstractEvent()
+ {
+ }
+
+ /** Execute the task with a given token */
+ public void execute(Token token)
+ {
+ SignalManager sm = SignalManager.locateSignalManager();
+ try
+ {
+ sm.throwSignal(getEnterSignal());
+ executeOverwrite(token);
+ }
+ finally
+ {
+ sm.throwSignal(getExitSignal());
+ }
+ }
+
+ // Overwrite to implement execute
+ protected abstract void executeOverwrite(Token token);
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractFlowObject.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractFlowObject.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractFlowObject.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+// $Id$
+
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Process;
+
+/**
+ * Extend to implement a FlowObject
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class AbstractFlowObject implements FlowObject
+{
+ // The Process this flow object is associated with
+ private Process process;
+ // The implementaion object
+ private Object implObject;
+
+ // Construct the FlowObject
+ protected AbstractFlowObject()
+ {
+ }
+
+ public Process getProcess()
+ {
+ return process;
+ }
+
+ public void setProcess(Process process)
+ {
+ if (this.process != null)
+ throw new IllegalStateException("Cannot reassign task to process");
+
+ this.process = process;
+ }
+
+ public Object getImplObject()
+ {
+ return implObject;
+ }
+
+ public void setImplObject(Object implObject)
+ {
+ this.implObject = implObject;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractFlowObject.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractProcess.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractProcess.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,231 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+// $Id$
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.NameNotUniqueException;
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.client.Attachments;
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.model.EndEvent;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.NamedFlowObject;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Result;
+import org.jboss.bpm.model.StartEvent;
+import org.jboss.bpm.runtime.Signal;
+
+/**
+ * Extend to implement a Process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class AbstractProcess extends AbstractActivity implements Process
+{
+ // The list of nodes
+ private Set<FlowObject> flowObjects = new HashSet<FlowObject>();
+
+ // Construct the process
+ protected AbstractProcess()
+ {
+ }
+
+ // Call to initialize fully
+ protected void init(String name)
+ {
+ if (name == null)
+ {
+ ProcessManager pdm = ProcessManager.locateProcessManager();
+ name = "AnonymousProcess#" + pdm.getProcesses().size();
+ setName(name);
+ }
+ }
+
+ /** Get the set of flow objects */
+ public Set<FlowObject> getFlowObjects()
+ {
+ return Collections.unmodifiableSet(flowObjects);
+ }
+
+ // Add a flow object. Note, this MUST NOT leak into the public API
+ protected void addFlowObject(AbstractFlowObject flowObject)
+ {
+ if (flowObject instanceof StartEvent && getStartEventInternal() != null)
+ throw new InvalidProcessException("Process cannot have multiple start events: " + flowObject);
+
+ if (flowObject instanceof NamedFlowObject)
+ {
+ String name = ((NamedFlowObject)flowObject).getName();
+ if (findFlowObject(name) != null)
+ throw new NameNotUniqueException("NamedFlowObject: " + name);
+ }
+
+ flowObjects.add(flowObject);
+ }
+
+ /** Start the process */
+ public Future<Result> startProcess()
+ {
+ return startProcess(null);
+ }
+
+ /** Start the process with given attachments */
+ public Future<Result> startProcess(Attachments att)
+ {
+ execute(new InitialToken(this, att));
+ return new ResultFuture();
+ }
+
+ /** Get the start event */
+ public StartEvent getStartEvent()
+ {
+ StartEvent start = getStartEventInternal();
+ if (start == null)
+ throw new InvalidProcessException("Process does not have a start event");
+
+ return start;
+ }
+
+ private StartEvent getStartEventInternal()
+ {
+ StartEvent start = null;
+ for (FlowObject aux : flowObjects)
+ {
+ if (aux instanceof StartEvent)
+ {
+ start = (StartEvent)aux;
+ break;
+ }
+ }
+ return start;
+ }
+
+ /** Get the set of end events */
+ public Set<EndEvent> getEndEvents()
+ {
+ Set<EndEvent> ends = getEndEventsInternal();
+ if (ends.size() == 0)
+ throw new InvalidProcessException("Process does not have end events");
+
+ return ends;
+ }
+
+ private Set<EndEvent> getEndEventsInternal()
+ {
+ Set<EndEvent> ends = new HashSet<EndEvent>();
+ for (FlowObject aux : flowObjects)
+ {
+ if (aux instanceof EndEvent)
+ {
+ ends.add((EndEvent)aux);
+ }
+ }
+ return ends;
+ }
+
+ /** Get signal for enter */
+ public Signal getEnterSignal()
+ {
+ return new Signal(this, Signal.Type.ENTER_PROCESS);
+ }
+
+ /** Get signal for exit */
+ public Signal getExitSignal()
+ {
+ return new Signal(this, Signal.Type.EXIT_PROCESS);
+ }
+
+ /**
+ * Find a flow object by name
+ * @return null if not found
+ */
+ public NamedFlowObject findFlowObject(String name)
+ {
+ NamedFlowObject nfo = null;
+ for (FlowObject aux : flowObjects)
+ {
+ if (aux instanceof NamedFlowObject && ((NamedFlowObject)aux).getName().equals(name))
+ {
+ nfo = (NamedFlowObject)aux;
+ break;
+ }
+ }
+ return nfo;
+ }
+
+ class ResultFuture implements Future<Result>
+ {
+ private Result result;
+
+ public boolean cancel(boolean mayInterruptIfRunning)
+ {
+ throw new NotImplementedException();
+ }
+
+ public Result get() throws InterruptedException, ExecutionException
+ {
+ return getResult();
+ }
+
+ public Result get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
+ {
+ throw new NotImplementedException();
+ }
+
+ public boolean isCancelled()
+ {
+ return false;
+ }
+
+ public boolean isDone()
+ {
+ return getResult() != null;
+ }
+
+ private Result getResult()
+ {
+ if (result == null)
+ {
+ Set<EndEvent> ends = getEndEventsInternal();
+ for (EndEvent aux : ends)
+ {
+ result = aux.getResult();
+ if (result != null)
+ {
+ break;
+ }
+ }
+ }
+ return result;
+ }
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractProcess.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractStartEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractStartEvent.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractStartEvent.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -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.jboss.bpm.model.internal;
+
+// $Id$
+import org.jboss.bpm.model.StartEvent;
+import org.jboss.bpm.runtime.Signal;
+
+/**
+ * Extend to implement an StartEvent
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class AbstractStartEvent extends AbstractEvent implements StartEvent
+{
+ // Construct the StartEvent
+ protected AbstractStartEvent()
+ {
+ }
+
+ /** Get signal for enter */
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_START_EVENT);
+ }
+
+ /** Get signal for exit */
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_START_EVENT);
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractStartEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractTask.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractTask.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractTask.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+// $Id$
+
+import org.jboss.bpm.model.Task;
+import org.jboss.bpm.runtime.Signal;
+
+/**
+ * Extend to implement an Task
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public abstract class AbstractTask extends AbstractActivity implements Task
+{
+ // Construct the Task
+ protected AbstractTask()
+ {
+ }
+
+ /** Get signal for enter */
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_TASK, getName());
+ }
+
+ /** Get signal for exit */
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_TASK, getName());
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/AbstractTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InitialToken.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InitialToken.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InitialToken.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model.internal;
+
+// $Id$
+
+import org.jboss.bpm.client.Attachments;
+import org.jboss.bpm.client.BasicAttachments;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.runtime.ExecutionContext;
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * An initial token
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+class InitialToken implements Token
+{
+ private Process proc;
+ private ExecutionContext context;
+
+ public InitialToken(Process proc, Attachments att)
+ {
+ this.proc = proc;
+ this.context = new InitialContext(att);
+ }
+
+ public Process getProcess()
+ {
+ return proc;
+ }
+
+ public ExecutionContext getExecutionContext()
+ {
+ return context;
+ }
+
+ class InitialContext extends BasicAttachments implements ExecutionContext
+ {
+ InitialContext(Attachments att)
+ {
+ super(att);
+ }
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/internal/InitialToken.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Activity.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Activity.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Activity.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.runtime;
-
-//$Id$
-
-import org.jboss.bpm.process.Node;
-
-/**
- * An Activity is associated with a node to execute arbitrary business logic.
- *
- * It does not effect the execution of the process graph. Instead it reads/writes
- * values from/to the execution context and leaves it to the Engine
- * to proceed to the next node.
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public interface Activity
-{
- /**
- * Execute business logic associated with a Node
- * @param node The node this activity is associated with
- * @param ctx The execution context
- */
- void execute(Node node, Token ctx);
-}
\ No newline at end of file
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicTask.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicTask.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicTask.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -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.jboss.bpm.runtime;
+
+//$Id$
+
+import org.jboss.bpm.model.internal.AbstractTask;
+
+/**
+ * Extend to implement a named task
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class BasicTask extends AbstractTask
+{
+ private String name;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ if (this.name != null)
+ throw new IllegalStateException("Cannot rename task");
+
+ this.name = name;
+ }
+
+ // Overwrite to implement execute
+ protected void executeOverwrite(Token token)
+ {
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/BasicTask.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/EndSignal.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/EndSignal.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/EndSignal.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -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.runtime;
-
-//$Id$
-
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.Result;
-
-/**
- * A Signal thrown when the Process ends
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public class EndSignal extends Signal
-{
- private Result result;
-
- /** Create the signal for a given process */
- public EndSignal(Process proc, Result result)
- {
- super(proc);
- this.result = result;
- }
-
- /** Get the result */
- public Result getResult()
- {
- return result;
- }
-}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionContext.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionContext.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/ExecutionContext.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -21,20 +21,16 @@
*/
package org.jboss.bpm.runtime;
-import org.jboss.bpm.client.Attachments;
-
//$Id$
+import org.jboss.bpm.client.Attachments;
+
/**
* An execution context that can take attachments.
*
* @author Thomas.Diesler(a)jboss.com
* @since 20-Apr-2007
*/
-public abstract class ExecutionContext implements Attachments
+public interface ExecutionContext extends Attachments
{
- // Hide public constructor
- protected ExecutionContext()
- {
- }
}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeExecution.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeExecution.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeExecution.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.runtime;
-
-//$Id$
-
-import org.jboss.bpm.process.Execution;
-
-/**
- * Represents a runtime execution in the process definition.
- *
- * A runtime node gives access to its leaving transitions.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public interface RuntimeExecution extends Execution
-{
- /**
- * Signal this execution with a named transition
- */
- void signal(String name);
-}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeNode.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeNode.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/RuntimeNode.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.runtime;
-
-//$Id$
-
-import java.util.List;
-
-/**
- * Represents a runtime node in the process definition.
- *
- * A runtime node gives access to its leaving transitions.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public interface RuntimeNode
-{
- /**
- * Get the unmodifieable list of leaving transitions
- * @return an empty list if there are none
- */
- List<Transition> getLeavingTransitions();
-
-}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Signal.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Signal.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Signal.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -26,39 +26,69 @@
import org.jboss.bpm.model.Process;
/**
- * A Signal thrown by the ProcessEngine
+ * A Signal thrown by the ProcessEngine
*
* @author Thomas.Diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public abstract class Signal
+public class Signal
{
- private String shortName;
- private String procName;
-
+ public enum Type
+ {
+ ENTER_START_EVENT, EXIT_START_EVENT,
+ ENTER_EVENT, EXIT_EVENT,
+ ENTER_END_EVENT, EXIT_END_EVENT,
+ ENTER_GATEWAY, EXIT_GATEWAY,
+ ENTER_PROCESS, EXIT_PROCESS,
+ ENTER_SUB_PROCESS, EXIT_SUB_PROCESS,
+ ENTER_TASK, EXIT_TASK,
+ USER_SIGNAL
+ }
+
+ private Process proc;
+ private Type type;
+ private String message;
+
/** Create the signal for a given process */
- public Signal(Process proc)
+ public Signal(Process proc, Type type)
{
- this.procName = proc.getName();
+ this.proc = proc;
+ this.type = type;
+ }
+
+ /** Create the signal for a given process */
+ public Signal(Process proc, Type type, String message)
+ {
+ this.proc = proc;
+ this.type = type;
+ this.message = message;
- shortName = getClass().getName();
- shortName = shortName.substring(shortName.lastIndexOf('.') + 1);
}
- /** Get the short name for this signal */
- public String getShortName()
+ /** Get the proccess */
+ public Process getProcess()
{
- return shortName;
+ return proc;
}
- /** Get the proccess name */
- public String getProcessName()
+ public Type getType()
{
- return procName;
+ return type;
}
-
+
+ public String getMessage()
+ {
+ return message;
+ }
+
public String toString()
{
- return shortName + "[" + procName + "]";
+ StringBuilder string = new StringBuilder(type + "[" + proc.getName());
+ if (message != null)
+ {
+ string.append(":" + message);
+ }
+ string.append("]");
+ return string.toString();
}
}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/StartSignal.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/StartSignal.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/StartSignal.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.runtime;
-
-//$Id$
-
-import org.jboss.bpm.model.Process;
-
-/**
- * A signal thrown by the Process starts
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public class StartSignal extends Signal
-{
- /** Create the signal for a given process */
- public StartSignal(Process proc)
- {
- super(proc);
- }
-}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -23,20 +23,25 @@
//$Id$
-import org.jboss.bpm.client.Attachments;
+import org.jboss.bpm.model.Process;
/**
* 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.
*
+ * 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 abstract class Token implements Attachments
+public interface Token
{
+ /** Get the associated execution context */
+ ExecutionContext getExecutionContext();
+
+ /** Get the current process */
+ Process getProcess();
}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Transition.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Transition.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Transition.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.runtime;
-
-//$Id$
-
-/**
- * Represents the named connection between two nodes
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public abstract class Transition
-{
- // Hide public constructor
- protected Transition()
- {
- }
-
- /**
- * Get the name for this transition
- */
- public abstract String getName();
-}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/TransitionRouter.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/TransitionRouter.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/TransitionRouter.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.runtime;
-
-// $Id$
-
-/**
- * A TransitionRouter is responsible for choosing the leaving transition on a node.
- * <p/>
- * A typical implementation would signal the RuntimeExecution with a named Transition.
- *
- * <pre>
- * public void choosePath(RuntimeNode node, RuntimeExecution ex)
- * {
- * Boolean flag = ex.getContext().getAttachment(Boolean.class);
- * if (flag == true)
- * {
- * ex.signal("good");
- * }
- * else
- * {
- * ex.signal("bad");
- * }
- * }
- * </pre>
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public interface TransitionRouter
-{
- /**
- * Implement to signal the RuntimeExecution with a named Transition
- */
- void choosePath(RuntimeNode node, RuntimeExecution ex);
-}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractRuntimeNode.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractRuntimeNode.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractRuntimeNode.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,61 +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.runtime.internal;
-
-//$Id$
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.jboss.bpm.process.Node;
-import org.jboss.bpm.process.internal.AbstractNode;
-import org.jboss.bpm.runtime.RuntimeNode;
-import org.jboss.bpm.runtime.Transition;
-
-/**
- * Represents a runtime node in the process definition.
- *
- * A runtime node gives access to its leaving transitions.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public abstract class AbstractRuntimeNode extends AbstractNode implements RuntimeNode
-{
- private List<Transition> leavingTransitions = new ArrayList<Transition>();
-
- // Contruct the runtime node for a copy
- protected AbstractRuntimeNode(Node node)
- {
- super(node);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.bpm.runtime.internal.RuntimeNode#getLeavingTransitions()
- */
- public List<Transition> getLeavingTransitions()
- {
- return Collections.unmodifiableList(leavingTransitions);
- }
-
-}
\ No newline at end of file
Added: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractToken.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractToken.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractToken.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.runtime.internal;
+
+//$Id$
+
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * 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 abstract class AbstractToken implements Token
+{
+ // The implementaion object
+ private Object implObject;
+
+ public Object getImplObject()
+ {
+ return implObject;
+ }
+
+ public void setImplObject(Object implObject)
+ {
+ this.implObject = implObject;
+ }
+}
\ No newline at end of file
Property changes on: api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractToken.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -75,6 +75,17 @@
deployer = null;
}
+ // Get the URL for an resource
+ protected URL getResourceURL(String resource)
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ URL url = ctxLoader.getResource(resource);
+ if (url == null)
+ throw new IllegalStateException("Cannot find resource: " + resource);
+
+ return url;
+ }
+
private URL getBeansConfigURL(String resourceName)
{
URL url = Thread.currentThread().getContextClassLoader().getResource(resourceName);
@@ -82,4 +93,5 @@
throw new JBPMException("Cannot find resource: " + resourceName);
return url;
}
+
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -56,7 +56,7 @@
public void catchSignal(Signal signal)
{
signals.add(signal);
- log.debug(signal);
+ log.debug("catchSignal: " + signal);
}
public List<Signal> getCaughtSignals()
Modified: api/trunk/modules/api/src/test/java/org/jboss/bpm/client/MockProcessEngine.java
===================================================================
--- api/trunk/modules/api/src/test/java/org/jboss/bpm/client/MockProcessEngine.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/client/MockProcessEngine.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -23,28 +23,13 @@
//$Id$
-import org.jboss.bpm.client.ExecutionManager;
-import org.jboss.bpm.client.ProcessDefinitionManager;
-import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.client.ProcessInstanceManager;
-
/**
* A process engine with public access
*
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
*/
-public class MockProcessEngine extends ProcessEngine {
+public class MockProcessEngine extends ProcessEngine
+{
- public void setProcessDefinitionManager(ProcessDefinitionManager processDefinitionManager) {
- this.processDefinitionManager = processDefinitionManager;
- }
-
- public void setProcessInstanceFactory(ProcessInstanceManager processInstanceFactory) {
- this.processInstanceManager = processInstanceFactory;
- }
-
- public void setExecutionManager(ExecutionManager executionManager) {
- this.executionManager = executionManager;
- }
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/test/java/org/jboss/bpm/client/ProcessEngineLocatorTest.java
===================================================================
--- api/trunk/modules/api/src/test/java/org/jboss/bpm/client/ProcessEngineLocatorTest.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/client/ProcessEngineLocatorTest.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -24,8 +24,6 @@
// $Id$
import org.jboss.bpm.AbstractMockEngineTestCase;
-import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.client.ProcessEngineLocator;
public class ProcessEngineLocatorTest extends AbstractMockEngineTestCase
{
Deleted: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/client/ProcessDefinitionTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/client/ProcessDefinitionTest.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/client/ProcessDefinitionTest.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,148 +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.client;
-
-// $Id$
-
-import java.util.List;
-import java.util.Set;
-
-import org.jboss.bpm.InvalidProcessDefinitionException;
-import org.jboss.bpm.process.EndNode;
-import org.jboss.bpm.process.Node;
-import org.jboss.bpm.process.ProcessDefinition;
-import org.jboss.bpm.process.StartNode;
-import org.jboss.bpm.test.DefaultEngineTestCase;
-
-public class ProcessDefinitionTest extends DefaultEngineTestCase
-{
-
- public void testBasicSequence() throws Exception
- {
- String jpdl =
- "<process-definition>" +
- " <start-state>" +
- " <transition to='stateA' />" +
- " </start-state>" +
- " <state name='stateA'>" +
- " <transition to='end' />" +
- " </state>" +
- " <end-state name='end' />" +
- "</process-definition>";
-
- ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
- ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
- assertEquals("AnonymousDef#0", pd.getName());
-
- StartNode startState = pd.getStartNode();
- assertEquals("AnonymousNode#0", startState.getName());
-
- List<Node> nodes = pd.getNodes();
- assertEquals(3, nodes.size());
-
- assertNotNull(pd.findNode("stateA"));
-
- Set<EndNode> endStates = pd.getEndNodes();
- assertEquals(1, endStates.size());
-
- EndNode endState = endStates.iterator().next();
- assertEquals(endState, pd.findNode("end"));
- }
-
- public void testNoStartState() throws Exception
- {
- String jpdl =
- "<process-definition>" +
- " <state>" +
- " <transition to='stateA' />" +
- " </state>" +
- " <state name='stateA'>" +
- " <transition to='end' />" +
- " </state>" +
- " <end-state name='end' />" +
- "</process-definition>";
-
- ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
- try
- {
- pdm.createProcessDefinition(jpdl);
- fail("InvalidProcessDefinitionException expected");
- }
- catch (InvalidProcessDefinitionException ex)
- {
- assertTrue("Unexpected message: " + ex.getMessage(), ex.getMessage().indexOf("start node") > 0);
- }
- }
-
- public void testNoEndState() throws Exception
- {
- String jpdl =
- "<process-definition>" +
- " <start-state>" +
- " <transition to='stateA' />" +
- " </start-state>" +
- " <state name='stateA'>" +
- " <transition to='end' />" +
- " </state>" +
- " <state name='end' />" +
- "</process-definition>";
-
- ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
- try
- {
- pdm.createProcessDefinition(jpdl);
- fail("InvalidProcessDefinitionException expected");
- }
- catch (InvalidProcessDefinitionException ex)
- {
- assertTrue("Unexpected message: " + ex.getMessage(), ex.getMessage().indexOf("end node") > 0);
- }
- }
-
- public void testNodeNameUniqueness() throws Exception
- {
- String jpdl =
- "<process-definition>" +
- " <start-state>" +
- " <transition to='stateA' />" +
- " </start-state>" +
- " <state name='stateA'>" +
- " <transition to='end' />" +
- " </state>" +
- " <state name='stateA'>" +
- " <transition to='end' />" +
- " </state>" +
- " <end-state name='end' />" +
- "</process-definition>";
-
- ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
- try
- {
- pdm.createProcessDefinition(jpdl);
- fail("InvalidProcessDefinitionException expected");
- }
- catch (InvalidProcessDefinitionException ex)
- {
- // expected;
- }
- }
-}
Copied: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/client/ProcessTest.java (from rev 1541, api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/client/ProcessDefinitionTest.java)
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/client/ProcessTest.java (rev 0)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/client/ProcessTest.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,148 @@
+/*
+ * 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.client;
+
+// $Id$
+
+import java.util.Set;
+
+import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.model.EndEvent;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.NamedFlowObject;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.StartEvent;
+import org.jboss.bpm.model.Task;
+import org.jboss.bpm.test.DefaultEngineTestCase;
+
+public class ProcessTest extends DefaultEngineTestCase
+{
+ public void testBasicSequence() throws Exception
+ {
+ String jpdl =
+ "<process-definition>" +
+ " <start-state>" +
+ " <transition to='stateA' />" +
+ " </start-state>" +
+ " <state name='stateA'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end-state name='end' />" +
+ "</process-definition>";
+
+ // Create a Process through the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ Process proc = pm.createProcess(jpdl);
+ assertEquals("AnonymousProcess#0", proc.getName());
+
+ StartEvent start = proc.getStartEvent();
+ assertNotNull("Start expected", start);
+
+ Set<FlowObject> fos = proc.getFlowObjects();
+ assertEquals(3, fos.size());
+
+ NamedFlowObject nfo = proc.findFlowObject("stateA");
+ assertNotNull("FlowObject expected", nfo);
+ assertTrue("Task expected", nfo instanceof Task);
+
+ Set<EndEvent> ends = proc.getEndEvents();
+ assertEquals(1, ends.size());
+ }
+
+ public void testNoStartState() throws Exception
+ {
+ String jpdl =
+ "<process-definition>" +
+ " <state>" +
+ " <transition to='stateA' />" +
+ " </state>" +
+ " <state name='stateA'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end-state name='end' />" +
+ "</process-definition>";
+
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ try
+ {
+ pm.createProcess(jpdl);
+ fail("InvalidProcessException expected");
+ }
+ catch (InvalidProcessException ex)
+ {
+ assertTrue("Unexpected message: " + ex.getMessage(), ex.getMessage().indexOf("start event") > 0);
+ }
+ }
+
+ public void testNoEndState() throws Exception
+ {
+ String jpdl =
+ "<process-definition>" +
+ " <start-state>" +
+ " <transition to='stateA' />" +
+ " </start-state>" +
+ " <state name='stateA'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <state name='end' />" +
+ "</process-definition>";
+
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ try
+ {
+ pm.createProcess(jpdl);
+ fail("InvalidProcessException expected");
+ }
+ catch (InvalidProcessException ex)
+ {
+ assertTrue("Unexpected message: " + ex.getMessage(), ex.getMessage().indexOf("end event") > 0);
+ }
+ }
+
+ public void testNodeNameUniqueness() throws Exception
+ {
+ String jpdl =
+ "<process-definition>" +
+ " <start-state>" +
+ " <transition to='stateA' />" +
+ " </start-state>" +
+ " <state name='stateA'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <state name='stateA'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end-state name='end' />" +
+ "</process-definition>";
+
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ try
+ {
+ pm.createProcess(jpdl);
+ fail("InvalidProcessException expected");
+ }
+ catch (InvalidProcessException ex)
+ {
+ // expected;
+ }
+ }
+}
Deleted: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ContextActivity.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ContextActivity.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ContextActivity.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,38 +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.samples.context;
-
-// $Id$
-
-import org.jboss.bpm.process.Node;
-import org.jboss.bpm.runtime.Activity;
-import org.jboss.bpm.runtime.Token;
-
-public class ContextActivity implements Activity
-{
- public void execute(Node node, Token ctx)
- {
- String name = node.getName();
- ctx.addAttachment(String.class, "ActivityMessage", "Activity on '" + name + "' has: " + ctx.getAttachmentKeys());
- ctx.addAttachment(ContextValue.class, "ActivityAttachment", new ContextValue("bar"));
- }
-}
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -23,9 +23,15 @@
// $Id$
-import org.jboss.bpm.client.ProcessDefinitionManager;
-import org.jboss.bpm.process.Execution;
-import org.jboss.bpm.process.ProcessDefinition;
+import java.net.URL;
+import java.util.concurrent.Future;
+
+import org.jboss.bpm.client.Attachments;
+import org.jboss.bpm.client.BasicAttachments;
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Result;
import org.jboss.bpm.test.DefaultEngineTestCase;
/**
@@ -36,46 +42,44 @@
*/
public class ExecutionContextTest extends DefaultEngineTestCase
{
- String jpdl =
- "<process-definition>" +
- " <start-state>" +
- " <transition to='stateA' />" +
- " </start-state>" +
- " <state name='stateA'>" +
- " <event type='node-enter'>" +
- " <action class='org.jboss.bpm.samples.context.ContextActivity' />" +
- " </event>" +
- " <transition to='end'/>" +
- " </state>" +
- " <end-state name='end' />" +
- "</process-definition>";
+ private URL jpdlURL;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ jpdlURL = getResourceURL("samples/context/basic-context.xml");
+ SignalManager em = SignalManager.locateSignalManager();
+ em.addListener("basic-context", this);
+ }
/**
* Test that the execution context variables
*/
public void testTransientValues() throws Exception
{
- // Create an Execution through the ProcessDefinition
- ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
- ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
- Execution ex = pd.createExecution();
+ // Create a Process through the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ Process proc = pm.createProcess(jpdlURL);
- // Set a context variable
- ex.getContext().addAttachment(ContextValue.class, new ContextValue("foo"));
+ BasicAttachments inCtx = new BasicAttachments();
+ inCtx.addAttachment(ContextValue.class, new ContextValue("foo"));
- // Signal the execution
- ex.signal();
+ // Start the Process
+ Future<Result> end = proc.startProcess(inCtx);
+ Result result = end.get();
// Verify context variables
- String msg = ex.getContext().getAttachment(String.class, "ActivityMessage");
- assertEquals("Activity on 'stateA' has: [[org.jboss.bpm.samples.context.ContextValue,null]]", msg);
+ Attachments att = result.getAttachments();
+ String msg = att.getAttachment(String.class, "TaskMessage");
+ assertEquals("stateA has: [[org.jboss.bpm.samples.context.ContextValue,null]]", msg);
// Validate original attachement
- ContextValue att1 = ex.getContext().getAttachment(ContextValue.class);
+ ContextValue att1 = att.getAttachment(ContextValue.class);
assertEquals("foo", att1.getMsg());
// Validate activity attachement
- ContextValue att2 = ex.getContext().getAttachment(ContextValue.class, "ActivityAttachment");
+ ContextValue att2 = att.getAttachment(ContextValue.class, "TaskAttachment");
assertEquals("bar", att2.getMsg());
}
}
Added: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java (rev 0)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -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.jboss.bpm.samples.context;
+
+// $Id$
+
+import org.jboss.bpm.runtime.BasicTask;
+import org.jboss.bpm.runtime.ExecutionContext;
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * A task that adds stuff to the execution context
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 04-Jul-2008
+ */
+public class TaskA extends BasicTask
+{
+ protected void executeOverwrite(Token token)
+ {
+ ExecutionContext ctx = token.getExecutionContext();
+ ctx.addAttachment(String.class, "TaskMessage", getName() + " has: " + ctx.getAttachmentKeys());
+ ctx.addAttachment(ContextValue.class, "TaskAttachment", new ContextValue("bar"));
+ }
+}
Property changes on: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/engine/EngineShutdownTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/engine/EngineShutdownTest.java 2008-07-09 07:28:58 UTC (rev 1558)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/engine/EngineShutdownTest.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -23,12 +23,12 @@
// $Id$
+import java.net.URL;
+
import org.jboss.bpm.EngineShutdownException;
-import org.jboss.bpm.client.ProcessDefinitionManager;
import org.jboss.bpm.client.ProcessEngine;
import org.jboss.bpm.client.ProcessEngineLocator;
-import org.jboss.bpm.client.ProcessInstance;
-import org.jboss.bpm.process.ProcessDefinition;
+import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.test.DefaultEngineTestCase;
/**
@@ -41,22 +41,13 @@
{
private ProcessEngine engine;
- String jpdl =
- "<process-definition>" +
- " <start-state>" +
- " <transition to='stateA' />" +
- " </start-state>" +
- " <state name='stateA'>" +
- " <transition to='end' />" +
- " </state>" +
- " <end-state name='end' />" +
- "</process-definition>";
-
+ private URL jpdlURL;
+
@Override
protected void setUp() throws Exception
{
super.setUp();
-
+ jpdlURL = getResourceURL("samples/engine/basic-engine.xml");
engine = ProcessEngineLocator.locateProcessEngine();
engine.cancelShutdown();
}
@@ -66,64 +57,19 @@
*/
public void testCreateProcessDefinition() throws Exception
{
- // Create a ProcessDefinition through the ProcessDefinitionManager
- ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
- assertNotNull("ProcessDefinition expected", pdm.createProcessDefinition(jpdl));
+ // Create a Process through the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ assertNotNull("ProcessDefinition expected", pm.createProcess(jpdlURL));
// Try to create a ProcessDefinition during shutdown
try
{
engine.prepareForShutdown();
- pdm.createProcessDefinition(jpdl);
+ pm.createProcess(jpdlURL);
}
catch (EngineShutdownException ex)
{
- assertEquals("Cannot create new ProcessDefinition while engine is shutting down", ex.getMessage());
+ assertEquals("Cannot create new Process while engine is shutting down", ex.getMessage());
}
}
-
- /**
- * Try to create a ProcessInstance during shutdown
- */
- public void testCreateProcessInstance() throws Exception
- {
- // Create a ProcessDefinition through the ProcessDefinitionManager
- ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
- ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
- assertNotNull("ProcessInstance expected", pd.createProcessInstance());
-
- // Try to create a ProcessInstance during shutdown
- try
- {
- engine.prepareForShutdown();
- pd.createProcessInstance();
- }
- catch (EngineShutdownException ex)
- {
- assertEquals("Cannot create new ProcessInstance while engine is shutting down", ex.getMessage());
- }
- }
-
- /**
- * Try to create a Execution during shutdown
- */
- public void testCreateExecution() throws Exception
- {
- // Create a ProcessDefinition through the ProcessDefinitionManager
- ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
- ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
- assertNotNull("Execution expected", pd.createExecution());
-
- // Try to create a Execution during shutdown
- try
- {
- ProcessInstance pinst = pd.createProcessInstance();
- engine.prepareForShutdown();
- pinst.createExecution();
- }
- catch (EngineShutdownException ex)
- {
- assertEquals("Cannot create new Execution while engine is shutting down", ex.getMessage());
- }
- }
}
Copied: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence (from rev 1541, api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/basic)
Deleted: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/basic/BasicSequenceTest.java 2008-07-08 09:21:42 UTC (rev 1541)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -1,109 +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.samples.basic;
-
-// $Id$
-
-import org.jboss.bpm.client.ExecutionManager;
-import org.jboss.bpm.client.ProcessDefinitionManager;
-import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.client.ProcessEngineLocator;
-import org.jboss.bpm.client.ProcessInstance;
-import org.jboss.bpm.client.ProcessInstanceManager;
-import org.jboss.bpm.process.Execution;
-import org.jboss.bpm.process.ProcessDefinition;
-import org.jboss.bpm.test.DefaultEngineTestCase;
-
-/**
- * Test the basic execution sequence
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class BasicSequenceTest extends DefaultEngineTestCase
-{
- String jpdl =
- "<process-definition>" +
- " <start-state>" +
- " <transition to='stateA' />" +
- " </start-state>" +
- " <state name='stateA'>" +
- " <transition to='end' />" +
- " </state>" +
- " <end-state name='end' />" +
- "</process-definition>";
-
- /**
- * Test basic sequence doing it the long way
- */
- public void testBasicSequenceLong() throws Exception
- {
-
- // Locate the ProcessEngine
- ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
-
- // Create a ProcessDefinition through the ProcessDefinitionManager
- ProcessDefinitionManager pdm = engine.getProcessDefinitionManager();
- ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
-
- // Create a ProcessInstance through the ProcessInstanceManager
- ProcessInstanceManager pim = engine.getProcessInstanceManager();
- ProcessInstance pi = pim.createProcessInstance(pd);
-
- // Create an Execution through the ExecutionManager
- ExecutionManager pem = engine.getExecutionManager();
- Execution ex = pem.createExecution(pi);
- assertEquals(pd.getStartNode(), ex.getNode());
-
- // Signal the execution
- ex.signal();
- assertEquals(pd.findNode("stateA"), ex.getNode());
-
- // Signal the execution
- ex.signal();
- assertEquals(pd.findNode("end"), ex.getNode());
- assertEquals(pd.getEndNodes().iterator().next(), ex.getNode());
- }
-
- /**
- * Test basic sequence doing it the short way
- */
- public void testBasicSequence() throws Exception
- {
- // Create a ProcessDefinition through the ProcessDefinitionManager
- ProcessDefinitionManager pdm = ProcessDefinitionManager.locateProcessDefinitionManager();
- ProcessDefinition pd = pdm.createProcessDefinition(jpdl);
-
- // Create an Execution through the ProcessDefinition
- Execution ex = pd.createExecution();
- assertEquals(pd.getStartNode(), ex.getNode());
-
- // Signal the execution
- ex.signal();
- assertEquals(pd.findNode("stateA"), ex.getNode());
-
- // Signal the execution
- ex.signal();
- assertEquals(pd.findNode("end"), ex.getNode());
- assertEquals(pd.getEndNodes().iterator().next(), ex.getNode());
- }
-}
Copied: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java (from rev 1558, api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/basic/BasicSequenceTest.java)
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java (rev 0)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.samples.sequence;
+
+// $Id$
+
+import java.net.URL;
+import java.util.List;
+import java.util.concurrent.Future;
+
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Result;
+import org.jboss.bpm.runtime.Signal;
+import org.jboss.bpm.test.DefaultEngineTestCase;
+
+/**
+ * Test the basic execution sequence
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 03-Jul-2008
+ */
+public class BasicSequenceTest extends DefaultEngineTestCase
+{
+ private URL jpdlURL;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ jpdlURL = getResourceURL("samples/sequence/basic-sequence.xml");
+ SignalManager em = SignalManager.locateSignalManager();
+ em.addListener("basic-sequence", this);
+ }
+
+ /**
+ * Test a basic sequence
+ */
+ public void testBasicSequence() throws Exception
+ {
+ // Create a Process through the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ Process proc = pm.createProcess(jpdlURL);
+
+ // Start the Process
+ Future<Result> end = proc.startProcess();
+ Result result = end.get();
+
+ // Validate the Result
+ assertNotNull("Result expected", result);
+ assertEquals("No attachments expected", 0, result.getAttachments().getAttachmentKeys().size());
+
+ // Validate received signals
+ List<Signal> signals = getCaughtSignals();
+ assertEquals("ENTER_PROCESS[basic-sequence]", signals.get(0).toString());
+ assertEquals("ENTER_START_EVENT[basic-sequence]", signals.get(1).toString());
+ assertEquals("EXIT_START_EVENT[basic-sequence]", signals.get(2).toString());
+ assertEquals("ENTER_TASK[basic-sequence:stateA]", signals.get(3).toString());
+ assertEquals("EXIT_TASK[basic-sequence:stateA]", signals.get(4).toString());
+ assertEquals("ENTER_END_EVENT[basic-sequence]", signals.get(5).toString());
+ assertEquals("EXIT_END_EVENT[basic-sequence]", signals.get(6).toString());
+ assertEquals("EXIT_PROCESS[basic-sequence]", signals.get(7).toString());
+ }
+}
Added: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java (rev 0)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.samples.task;
+
+// $Id$
+
+import java.net.URL;
+import java.util.List;
+import java.util.concurrent.Future;
+
+import org.jboss.bpm.client.Attachments;
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Result;
+import org.jboss.bpm.runtime.Signal;
+import org.jboss.bpm.test.DefaultEngineTestCase;
+
+/**
+ * Test the basic activity execution
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 03-Jul-2008
+ */
+public class BasicTaskTest extends DefaultEngineTestCase
+{
+ private URL jpdlURL;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ jpdlURL = getResourceURL("samples/task/basic-task.xml");
+ SignalManager em = SignalManager.locateSignalManager();
+ em.addListener("basic-task", this);
+ }
+
+ /**
+ * Test that the execution context variables set by the Activity
+ * are visible to the client.
+ */
+ public void testBasicActivity() throws Exception
+ {
+ // Create a Process through the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ Process proc = pm.createProcess(jpdlURL);
+
+ // Start the Process
+ Future<Result> end = proc.startProcess();
+ Result result = end.get();
+
+ // Validate the Result
+ assertNotNull("Result expected", result);
+ Attachments att = result.getAttachments();
+ assertEquals("Attachments expected", 1, att.getAttachmentKeys().size());
+ assertEquals("Task: stateA", att.getAttachment(String.class));
+
+ // Validate received signals
+ List<Signal> signals = getCaughtSignals();
+ assertEquals("ENTER_PROCESS[basic-task]", signals.get(0).toString());
+ assertEquals("ENTER_START_EVENT[basic-task]", signals.get(1).toString());
+ assertEquals("EXIT_START_EVENT[basic-task]", signals.get(2).toString());
+ assertEquals("ENTER_TASK[basic-task:stateA]", signals.get(3).toString());
+ assertEquals("EXIT_TASK[basic-task:stateA]", signals.get(4).toString());
+ assertEquals("ENTER_END_EVENT[basic-task]", signals.get(5).toString());
+ assertEquals("EXIT_END_EVENT[basic-task]", signals.get(6).toString());
+ assertEquals("EXIT_PROCESS[basic-task]", signals.get(7).toString());
+ }
+}
Property changes on: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
===================================================================
--- api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java (rev 0)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.samples.task;
+
+// $Id$
+
+import org.jboss.bpm.runtime.BasicTask;
+import org.jboss.bpm.runtime.ExecutionContext;
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * A task that adds stuff to the execution context
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 04-Jul-2008
+ */
+public class TaskA extends BasicTask
+{
+ protected void executeOverwrite(Token token)
+ {
+ ExecutionContext ctx = token.getExecutionContext();
+ ctx.addAttachment(String.class, "Task: " + getName());
+ }
+}
Property changes on: api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/testsuite/src/test/resources/model/basic-sequence.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/model/basic-sequence.xml (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/model/basic-sequence.xml 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,9 @@
+<process-definition xmlns='urn:jbpm.org:jpdl-3.2' name='basic-sequence'>
+ <start-state>
+ <transition to='stateA' />
+ </start-state>
+ <state name='stateA'>
+ <transition to='end' />
+ </state>
+ <end-state name='end' />
+</process-definition>
\ No newline at end of file
Property changes on: api/trunk/modules/testsuite/src/test/resources/model/basic-sequence.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context.xml (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context.xml 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,12 @@
+<process-definition xmlns='urn:jbpm.org:jpdl-3.2' name='basic-context'>
+ <start-state>
+ <transition to='stateA' />
+ </start-state>
+ <state name='stateA'>
+ <event type='node-enter'>
+ <action class='org.jboss.bpm.samples.context.TaskA' />
+ </event>
+ <transition to='end' />
+ </state>
+ <end-state name='end' />
+</process-definition>
\ No newline at end of file
Property changes on: api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/testsuite/src/test/resources/samples/engine/basic-engine.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/engine/basic-engine.xml (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/engine/basic-engine.xml 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,9 @@
+<process-definition xmlns='urn:jbpm.org:jpdl-3.2' name='basic-engine'>
+ <start-state>
+ <transition to='stateA' />
+ </start-state>
+ <state name='stateA'>
+ <transition to='end' />
+ </state>
+ <end-state name='end' />
+</process-definition>
\ No newline at end of file
Property changes on: api/trunk/modules/testsuite/src/test/resources/samples/engine/basic-engine.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.xml (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.xml 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,9 @@
+<process-definition xmlns='urn:jbpm.org:jpdl-3.2' name='basic-sequence'>
+ <start-state>
+ <transition to='stateA' />
+ </start-state>
+ <state name='stateA'>
+ <transition to='end' />
+ </state>
+ <end-state name='end' />
+</process-definition>
\ No newline at end of file
Property changes on: api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.xml (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.xml 2008-07-09 18:22:54 UTC (rev 1559)
@@ -0,0 +1,12 @@
+<process-definition xmlns='urn:jbpm.org:jpdl-3.2' name='basic-task'>
+ <start-state>
+ <transition to='stateA' />
+ </start-state>
+ <state name='stateA'>
+ <event type='node-enter'>
+ <action class='org.jboss.bpm.samples.task.TaskA' />
+ </event>
+ <transition to='end' />
+ </state>
+ <end-state name='end' />
+</process-definition>
\ No newline at end of file
Property changes on: api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 10 months
JBoss JBPM SVN: r1558 - in jbpm3/trunk/modules/jpdl/core/src: main/java/org/jbpm/job and 8 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-07-09 03:28:58 -0400 (Wed, 09 Jul 2008)
New Revision: 1558
Added:
jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/TimerOnTimerDbTest.java
jbpm3/trunk/modules/jpdl/core/src/test/resources/org/jbpm/job/executor/timerOnTimer.jpdl.xml
Modified:
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/db/JobSession.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/ExecuteActionJob.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/Timer.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/msg/db/DbMessageService.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/scheduler/db/DbSchedulerService.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/svc/Services.java
jbpm3/trunk/modules/jpdl/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
jbpm3/trunk/modules/jpdl/core/src/test/resources/log4j.xml
Log:
stale state exception was still thrown when the timer on timer process ended inside a timer execution, got rid of it by not deleting locked jobs: JBPM-1135
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/db/JobSession.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/db/JobSession.java 2008-07-09 00:45:51 UTC (rev 1557)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/db/JobSession.java 2008-07-09 07:28:58 UTC (rev 1558)
@@ -15,7 +15,6 @@
import org.jbpm.graph.def.Action;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
-import org.jbpm.job.ExecuteNodeJob;
import org.jbpm.job.Job;
import org.jbpm.job.Timer;
import org.jbpm.svc.save.SaveOperation;
@@ -194,30 +193,18 @@
return;
}
- // the bulk delete was replaced with a query and session.deletes on
- // the retrieved elements to prevent stale object exceptions.
- // With a bulk delete, the hibernate session is not aware and gives a problem
- // if a later session.delete doesn't return 1.
log.debug("deleting timers for process instance "+processInstance);
Session session = jbpmContext.getSession();
- Query query = session.getNamedQuery("JobSession.getTimersForProcessInstance");
+ Query query = session.getNamedQuery("JobSession.deleteTimersForProcessInstance");
query.setParameter("processInstance", processInstance);
- List timers = query.list();
- for (Iterator i = timers.iterator(); i.hasNext();) {
- Timer timer = (Timer) i.next();
- session.delete(timer);
- }
- log.debug(timers.size()+" remaining timers for '"+processInstance+"' were deleted");
+ int entityCount = query.executeUpdate();
+ log.debug(entityCount+" remaining timers for '"+processInstance+"' were deleted");
log.debug("deleting execute-node-jobs for process instance "+processInstance);
- query = session.getNamedQuery("JobSession.getExecuteNodeJobsForProcessInstance");
+ query = session.getNamedQuery("JobSession.deleteExecuteNodeJobsForProcessInstance");
query.setParameter("processInstance", processInstance);
- List jobs = query.list();
- for (Iterator i = jobs.iterator(); i.hasNext();) {
- ExecuteNodeJob job = (ExecuteNodeJob) i.next();
- session.delete(job);
- }
- log.debug(jobs.size()+" remaining execute-node-jobs for '"+processInstance+"' are deleted");
+ entityCount = query.executeUpdate();
+ log.debug(entityCount+" remaining execute-node-jobs for '"+processInstance+"' are deleted");
}
}
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/ExecuteActionJob.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/ExecuteActionJob.java 2008-07-09 00:45:51 UTC (rev 1557)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/ExecuteActionJob.java 2008-07-09 07:28:58 UTC (rev 1558)
@@ -34,7 +34,7 @@
action.execute(executionContext);
}
- jbpmContext.save(token);
+ jbpmContext.save(processInstance);
return true;
}
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java 2008-07-09 00:45:51 UTC (rev 1557)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/ExecuteNodeJob.java 2008-07-09 07:28:58 UTC (rev 1558)
@@ -25,7 +25,7 @@
token.unlock(this.toString());
ExecutionContext executionContext = new ExecutionContext(token);
node.execute(executionContext);
- jbpmContext.save(token);
+ jbpmContext.save(processInstance);
return true;
}
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/Timer.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/Timer.java 2008-07-09 00:45:51 UTC (rev 1557)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/Timer.java 2008-07-09 07:28:58 UTC (rev 1558)
@@ -35,7 +35,10 @@
}
public boolean execute(JbpmContext jbpmContext) throws Exception {
- boolean deleteThisJob = true;
+ if (processInstance.hasEnded()) {
+ // happens when a repeating timer is blocked at the time the process instance ends
+ return true;
+ }
ExecutionContext executionContext = new ExecutionContext(token);
executionContext.setTimer(this);
@@ -52,7 +55,7 @@
// then execute the action if there is one
if (action!=null) {
try {
- log.debug("executing timer '"+this+"'");
+ log.debug("executing '"+this+"'");
if (graphElement!=null) {
graphElement.executeAction(action, executionContext);
} else {
@@ -61,28 +64,19 @@
} catch (Exception actionException) {
// NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
log.warn("timer action threw exception", actionException);
-
- // we put the exception in t
- Exception t = actionException;
- try {
- // if there is a graphElement connected to this timer...
- if (graphElement != null) {
+ // if there is a graphElement connected to this timer...
+ if (graphElement != null) {
+ try {
// we give that graphElement a chance to catch the exception
graphElement.raiseException(actionException, executionContext);
log.debug("timer exception got handled by '"+graphElement+"'");
- t = null;
+ } catch (Exception handlerException) {
+ // if the exception handler rethrows or the original exception results in a DelegationException...
+ throw handlerException;
}
- } catch (Exception rethrowOrDelegationException) {
- // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
- // if the exception handler rethrows or the original exception results in a DelegationException...
- t = rethrowOrDelegationException;
+ } else {
+ throw actionException;
}
-
- if (t!=null) {
- // This is either the original exception wrapped as a delegation exception
- // or an exception that was throws from an exception handler
- throw t;
- }
}
}
@@ -100,20 +94,17 @@
// if repeat is specified, reschedule the job
if (repeat!=null) {
- deleteThisJob = false;
-
// suppose that it took the timer runner thread a
// very long time to execute the timers.
// then the repeat action dueDate could already have passed.
while (dueDate.getTime()<=System.currentTimeMillis()) {
- dueDate = businessCalendar
- .add(dueDate,
- new Duration(repeat));
+ dueDate = businessCalendar.add(dueDate, new Duration(repeat));
}
- log.debug("updated timer for repetition '"+this+"' in '"+(dueDate.getTime()-System.currentTimeMillis())+"' millis");
- }
+ log.debug("updated '"+this+"' for repetition on '"+formatDueDate(dueDate)+"'");
+ return false;
+ }
- return deleteThisJob;
+ return true;
}
public String toString() {
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2008-07-09 00:45:51 UTC (rev 1557)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2008-07-09 07:28:58 UTC (rev 1558)
@@ -2,7 +2,6 @@
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
@@ -19,6 +18,7 @@
import org.jbpm.job.Timer;
import org.jbpm.persistence.JbpmPersistenceException;
import org.jbpm.persistence.db.StaleObjectLogConfigurer;
+import org.jbpm.svc.Services;
public class JobExecutorThread extends Thread {
@@ -48,65 +48,59 @@
volatile boolean isActive = true;
public void run() {
- try {
- currentIdleInterval = idleInterval;
- while (isActive) {
- try {
- Collection acquiredJobs = acquireJobs();
+ currentIdleInterval = idleInterval;
+ while (isActive) {
+ try {
+ Collection acquiredJobs = acquireJobs();
- if (! acquiredJobs.isEmpty()) {
- Iterator iter = acquiredJobs.iterator();
- while (iter.hasNext() && isActive) {
- Job job = (Job) iter.next();
- executeJob(job);
- }
+ if (! acquiredJobs.isEmpty()) {
+ Iterator iter = acquiredJobs.iterator();
+ while (iter.hasNext() && isActive) {
+ Job job = (Job) iter.next();
+ executeJob(job);
+ }
- } else { // no jobs acquired
- if (isActive) {
- long waitPeriod = getWaitPeriod();
- if (waitPeriod>0) {
- synchronized(jobExecutor) {
- jobExecutor.wait(waitPeriod);
- }
+ } else { // no jobs acquired
+ if (isActive) {
+ long waitPeriod = getWaitPeriod();
+ if (waitPeriod>0) {
+ synchronized(jobExecutor) {
+ jobExecutor.wait(waitPeriod);
}
}
}
-
- // no exception so resetting the currentIdleInterval
- currentIdleInterval = idleInterval;
+ }
+
+ // no exception so resetting the currentIdleInterval
+ currentIdleInterval = idleInterval;
- } catch (InterruptedException e) {
- log.info((isActive? "active" : "inactive")+" job executor thread '"+getName()+"' got interrupted");
- } catch (Exception e) {
- log.error("exception in job executor thread. waiting "+currentIdleInterval+" milliseconds", e);
- try {
- synchronized(jobExecutor) {
- jobExecutor.wait(currentIdleInterval);
- }
- } catch (InterruptedException e2) {
- log.debug("delay after exception got interrupted", e2);
+ } catch (InterruptedException e) {
+ log.info((isActive? "active" : "inactive")+" job executor thread '"+getName()+"' got interrupted");
+ } catch (Exception e) {
+ log.error("exception in job executor thread. waiting "+currentIdleInterval+" milliseconds", e);
+ try {
+ synchronized(jobExecutor) {
+ jobExecutor.wait(currentIdleInterval);
}
- // after an exception, the current idle interval is doubled to prevent
- // continuous exception generation when e.g. the db is unreachable
- currentIdleInterval <<= 1;
- if (currentIdleInterval > maxIdleInterval || currentIdleInterval < 0) {
- currentIdleInterval = maxIdleInterval;
- }
+ } catch (InterruptedException e2) {
+ log.debug("delay after exception got interrupted", e2);
}
+ // after an exception, the current idle interval is doubled to prevent
+ // continuous exception generation when e.g. the db is unreachable
+ currentIdleInterval <<= 1;
+ if (currentIdleInterval > maxIdleInterval || currentIdleInterval < 0) {
+ currentIdleInterval = maxIdleInterval;
+ }
}
- } catch (Exception e) {
- // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
- log.error("exception in job executor thread", e);
- } finally {
- log.info(getName()+" leaves cyberspace");
}
+ log.info(getName()+" leaves cyberspace");
}
protected Collection acquireJobs() {
Collection acquiredJobs;
synchronized (jobExecutor) {
- Collection jobsToLock = new ArrayList();
log.debug("acquiring jobs for execution...");
+ Collection jobsToLock = Collections.EMPTY_LIST;
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
JobSession jobSession = jbpmContext.getJobSession();
@@ -116,11 +110,11 @@
if (job.isExclusive()) {
log.debug("exclusive acquirable job found ("+job+"). querying for other exclusive jobs to lock them all in one tx...");
List otherExclusiveJobs = jobSession.findExclusiveJobs(getName(), job.getProcessInstance());
- jobsToLock.addAll(otherExclusiveJobs);
+ jobsToLock = otherExclusiveJobs;
log.debug("trying to obtain a process-instance exclusive locks for '"+otherExclusiveJobs+"'");
} else {
log.debug("trying to obtain a lock for '"+job+"'");
- jobsToLock.add(job);
+ jobsToLock = Collections.singletonList(job);
}
Iterator iter = jobsToLock.iterator();
@@ -145,17 +139,13 @@
log.debug("obtained lock on jobs: "+acquiredJobs);
}
catch (JbpmPersistenceException e) {
- // if this is a stale object exception, the jbpm configuration has control over the logging
- if ("org.hibernate.StaleObjectStateException".equals(e.getCause().getClass().getName())) {
- log.info("problem committing job acquisition transaction: optimistic locking failed");
- StaleObjectLogConfigurer.staleObjectExceptionsLog.error("problem committing job acquisition transaction: optimistic locking failed", e);
+ // if this is a stale object exception, keep it quiet
+ if (Services.isCausedByStaleState(e)) {
+ log.debug("optimistic locking failed, couldn't obtain lock on jobs: "+jobsToLock);
+ acquiredJobs = Collections.EMPTY_LIST;
} else {
- // TODO run() will log this exception, log it here too?
- log.error("problem committing job acquisition transaction", e);
throw e;
}
- acquiredJobs = Collections.EMPTY_LIST;
- log.debug("couldn't obtain lock on jobs: "+jobsToLock);
}
}
}
@@ -173,7 +163,6 @@
if (job.execute(jbpmContext)) {
jobSession.deleteJob(job);
}
-
} catch (Exception e) {
log.debug("exception while executing '"+job+"'", e);
StringWriter sw = new StringWriter();
@@ -187,7 +176,6 @@
if (totalLockTimeInMillis>maxLockTime) {
jbpmContext.setRollbackOnly();
}
-
} finally {
try {
jbpmContext.close();
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/msg/db/DbMessageService.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/msg/db/DbMessageService.java 2008-07-09 00:45:51 UTC (rev 1557)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/msg/db/DbMessageService.java 2008-07-09 07:28:58 UTC (rev 1558)
@@ -37,9 +37,8 @@
private static final long serialVersionUID = 1L;
- JbpmConfiguration jbpmConfiguration;
JobSession jobSession = null;
- Collection destinations = null;
+ JobExecutor jobExecutor = null;
boolean hasProducedJobs = false;
public DbMessageService() {
@@ -47,8 +46,8 @@
if (jbpmContext==null) {
throw new JbpmException("instantiation of the DbMessageService requires a current JbpmContext");
}
- this.jbpmConfiguration = jbpmContext.getJbpmConfiguration();
- this.jobSession = jbpmContext.getJobSession();
+ jobSession = jbpmContext.getJobSession();
+ jobExecutor = jbpmContext.getJbpmConfiguration().getJobExecutor();
}
public void send(Job job) {
@@ -58,11 +57,10 @@
}
public void close() {
- JobExecutor jobExecutor = jbpmConfiguration.getJobExecutor();
if ( (hasProducedJobs)
&& (jobExecutor!=null)
) {
- log.debug("messages were produced the jobExecutor will be signalled");
+ log.debug("messages were produced, job executor will be signalled");
synchronized(jobExecutor) {
jobExecutor.notify();
}
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/scheduler/db/DbSchedulerService.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/scheduler/db/DbSchedulerService.java 2008-07-09 00:45:51 UTC (rev 1557)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/scheduler/db/DbSchedulerService.java 2008-07-09 07:28:58 UTC (rev 1558)
@@ -21,26 +21,39 @@
*/
package org.jbpm.scheduler.db;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.db.JobSession;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
import org.jbpm.job.Timer;
+import org.jbpm.job.executor.JobExecutor;
import org.jbpm.scheduler.SchedulerService;
public class DbSchedulerService implements SchedulerService {
private static final long serialVersionUID = 1L;
+
+ private static final Log log = LogFactory.getLog(DbSchedulerService.class);
JobSession jobSession = null;
-
+ JobExecutor jobExecutor = null;
+ boolean hasProducedJobs = false;
+
public DbSchedulerService() {
- this.jobSession = JbpmContext.getCurrentJbpmContext().getJobSession();
+ JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
+ if (jbpmContext==null) {
+ throw new JbpmException("instantiation of the DbSchedulerService requires a current JbpmContext");
+ }
+ this.jobSession = jbpmContext.getJobSession();
+ this.jobExecutor = jbpmContext.getJbpmConfiguration().getJobExecutor();
}
public void createTimer(Timer timerJob) {
jobSession.saveJob(timerJob);
+ hasProducedJobs = true;
}
public void deleteTimersByName(String timerName, Token token) {
@@ -55,5 +68,11 @@
}
public void close() {
+ if (hasProducedJobs && jobExecutor != null) {
+ log.debug("timers were produced, job executor will be signalled");
+ synchronized (jobExecutor) {
+ jobExecutor.notify();
+ }
+ }
}
}
Modified: jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/svc/Services.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/svc/Services.java 2008-07-09 00:45:51 UTC (rev 1557)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/svc/Services.java 2008-07-09 07:28:58 UTC (rev 1558)
@@ -31,6 +31,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hibernate.StaleStateException;
import org.jbpm.JbpmContext;
import org.jbpm.JbpmException;
import org.jbpm.graph.exe.ProcessInstance;
@@ -234,8 +235,8 @@
log.debug("closing service '"+serviceName+"': "+service);
service.close();
} catch (JbpmPersistenceException e) {
- // if this is a stale object exception, the jbpm configuration has control over the logging
- if ("org.hibernate.StaleObjectStateException".equals(e.getCause().getClass().getName())) {
+ // if this is a stale state exception, the jbpm configuration has control over the logging
+ if (isCausedByStaleState(e)) {
log.info("problem closing service '"+serviceName+"': optimistic locking failed");
StaleObjectLogConfigurer.staleObjectExceptionsLog.error("problem closing service '"+serviceName+"': optimistic locking failed", e);
} else {
@@ -263,6 +264,14 @@
}
}
+ public static boolean isCausedByStaleState(JbpmPersistenceException persistenceException) {
+ for (Throwable cause = persistenceException.getCause(); cause != null; cause = cause.getCause()) {
+ if (cause instanceof StaleStateException)
+ return true;
+ }
+ return false;
+ }
+
public static void assignId(Object object) {
JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
if (jbpmContext!=null) {
Modified: jbpm3/trunk/modules/jpdl/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-07-09 00:45:51 UTC (rev 1557)
+++ jbpm3/trunk/modules/jpdl/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-07-09 07:28:58 UTC (rev 1558)
@@ -314,19 +314,19 @@
]]>
</query>
- <query name="JobSession.getTimersForProcessInstance">
+ <query name="JobSession.deleteTimersForProcessInstance">
<![CDATA[
- select timer
- from org.jbpm.job.Timer timer
+ delete from org.jbpm.job.Timer timer
where timer.processInstance = :processInstance
+ and timer.lockOwner is null
]]>
</query>
- <query name="JobSession.getExecuteNodeJobsForProcessInstance">
+ <query name="JobSession.deleteExecuteNodeJobsForProcessInstance">
<![CDATA[
- select job
- from org.jbpm.job.ExecuteNodeJob job
+ delete from org.jbpm.job.ExecuteNodeJob job
where job.processInstance = :processInstance
+ and job.lockOwner is null
]]>
</query>
Added: jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/TimerOnTimerDbTest.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/TimerOnTimerDbTest.java (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/TimerOnTimerDbTest.java 2008-07-09 07:28:58 UTC (rev 1558)
@@ -0,0 +1,105 @@
+/*
+ * 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.job.executor;
+
+import java.io.Serializable;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * Test case for JBPM-1135
+ * @author Alejandro Guizar
+ */
+public class TimerOnTimerDbTest extends AbstractDbTestCase {
+
+ private static final Log log = LogFactory.getLog(TimerOnTimerDbTest.class);
+
+ public void testTimerOnTimer() {
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource("org/jbpm/job/executor/timerOnTimer.jpdl.xml");
+ jbpmContext.deployProcessDefinition(processDefinition);
+
+ ProcessInstance processInstance = jbpmContext.newProcessInstanceForUpdate("timerTest");
+ processInstance.getContextInstance().setVariable("timerTestWorkflow", new WorkflowLogger());
+ processInstance.signal();
+ commitAndCloseSession();
+ long tokenId = processInstance.getRootToken().getId();
+
+ startJobExecutor();
+ try {
+ sleep(500);
+ beginSessionTransaction();
+ assertEquals("timerTest", jbpmContext.loadToken(tokenId).getNode().getName());
+ commitAndCloseSession();
+
+ sleep(1000);
+ beginSessionTransaction();
+ assertEquals("secondTimerTest", jbpmContext.loadToken(tokenId).getNode().getName());
+ commitAndCloseSession();
+
+ sleep(1000);
+ beginSessionTransaction();
+ assertTrue(jbpmContext.loadToken(tokenId).getProcessInstance().hasEnded());
+ }
+ finally {
+ stopJobExecutor();
+ }
+ }
+
+ private void sleep(long millis) {
+ try {
+ Thread.sleep(millis);
+ }
+ catch (InterruptedException e) {
+ // reassert interruption
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ public static final class WorkflowLogger implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public void logNodeEnter() {
+ log.info("entered node");
+ }
+
+ public void logNodeLeave() {
+ log.info("left node");
+ }
+
+ public void logTaskCreate() {
+ log.info("created task");
+ }
+
+ public void logTimerCreate() {
+ log.info("created timer");
+ }
+
+ public void logTimerFired() {
+ log.info("fired timer");
+ }
+ }
+}
Property changes on: jbpm3/trunk/modules/jpdl/core/src/test/java/org/jbpm/job/executor/TimerOnTimerDbTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm3/trunk/modules/jpdl/core/src/test/resources/log4j.xml
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/test/resources/log4j.xml 2008-07-09 00:45:51 UTC (rev 1557)
+++ jbpm3/trunk/modules/jpdl/core/src/test/resources/log4j.xml 2008-07-09 07:28:58 UTC (rev 1558)
@@ -12,7 +12,7 @@
<param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d %-5p [%c:%L] %m%n"/>
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
</layout>
</appender>
@@ -24,7 +24,7 @@
<param name="Target" value="System.out" />
<param name="Threshold" value="INFO" />
<layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} [%t] %-5p %C{1} : %m%n" />
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
</layout>
</appender>
@@ -40,11 +40,17 @@
<priority value="INFO" />
</category>
- <!-- hide optimistic locking failures -->
+ <!-- hide optimistic locking failures
<category name="org.hibernate.event.def.AbstractFlushingEventListener">
<priority value="FATAL" />
</category>
+ -->
+ <!-- hide proxy narrowing warns -->
+ <category name="org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog">
+ <priority value="ERROR" />
+ </category>
+
<!-- show SQL DML statements as they are executed -->
<category name="org.hibernate.SQL">
<priority value="DEBUG" />
Added: jbpm3/trunk/modules/jpdl/core/src/test/resources/org/jbpm/job/executor/timerOnTimer.jpdl.xml
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/test/resources/org/jbpm/job/executor/timerOnTimer.jpdl.xml (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/test/resources/org/jbpm/job/executor/timerOnTimer.jpdl.xml 2008-07-09 07:28:58 UTC (rev 1558)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<process-definition name="timerTest" xmlns="urn:jbpm.org:jpdl-3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd">
+
+ <start-state name="start">
+ <transition name="" to="timerTest" />
+ </start-state>
+
+ <task-node name="timerTest" end-tasks="true">
+ <event type="node-enter">
+ <action expression="#{timerTestWorkflow.logNodeEnter}" />
+ </event>
+ <event type="node-leave">
+ <action expression="#{timerTestWorkflow.logNodeLeave}" />
+ </event>
+ <transition name="doneFirst" to="secondTimerTest" />
+ <task name="timerTestTask" description="TimerTestTask">
+ <assignment actor-id="admin" />
+ <event type="task-create">
+ <action expression="#{timerTestWorkflow.logTaskCreate}" />
+ </event>
+ <event type="timer-create">
+ <action expression="#{timerTestWorkflow.logTimerCreate}" />
+ </event>
+ <timer duedate="1 second" transition="doneFirst">
+ <action expression="#{timerTestWorkflow.logTimerFired}" />
+ </timer>
+ </task>
+ </task-node>
+
+ <task-node name="secondTimerTest">
+ <task name="secondTimerTestTask" description="SecondTimerTestTask">
+ <assignment actor-id="admin" />
+ <event type="task-create">
+ <action expression="#{timerTestWorkflow.logTaskCreate}" />
+ </event>
+ <event type="timer-create">
+ <action expression="#{timerTestWorkflow.logTimerCreate}" />
+ </event>
+ <timer duedate="1 second" transition="doneSecond">
+ <action expression="#{timerTestWorkflow.logTimerFired}" />
+ </timer>
+ </task>
+ <transition name="doneSecond" to="end" />
+ </task-node>
+
+ <end-state name="end" />
+
+</process-definition>
\ No newline at end of file
Property changes on: jbpm3/trunk/modules/jpdl/core/src/test/resources/org/jbpm/job/executor/timerOnTimer.jpdl.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
15 years, 10 months
JBoss JBPM SVN: r1557 - pvm/trunk.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-07-08 20:45:51 -0400 (Tue, 08 Jul 2008)
New Revision: 1557
Modified:
pvm/trunk/.classpath
Log:
added output directories to pvm classpath
Modified: pvm/trunk/.classpath
===================================================================
--- pvm/trunk/.classpath 2008-07-09 00:44:19 UTC (rev 1556)
+++ pvm/trunk/.classpath 2008-07-09 00:45:51 UTC (rev 1557)
@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="modules/core/src/main/java"/>
- <classpathentry kind="src" path="modules/core/src/main/resources"/>
- <classpathentry kind="src" path="modules/core/src/test/java"/>
- <classpathentry kind="src" path="modules/core/src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="modules/core/target/classes" path="modules/core/src/main/java"/>
+ <classpathentry kind="src" output="modules/core/target/classes" path="modules/core/src/main/resources"/>
+ <classpathentry kind="src" output="modules/core/target/test-classes" path="modules/core/src/test/java"/>
+ <classpathentry kind="src" output="modules/core/target/test-classes" path="modules/core/src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
15 years, 10 months
JBoss JBPM SVN: r1556 - in jbpm4/trunk/modules: jpdl and 1 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-07-08 20:44:19 -0400 (Tue, 08 Jul 2008)
New Revision: 1556
Modified:
jbpm4/trunk/modules/identity/
jbpm4/trunk/modules/jpdl/
jbpm4/trunk/modules/task/
Log:
excluded output directories from version control
Property changes on: jbpm4/trunk/modules/identity
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: jbpm4/trunk/modules/jpdl
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: jbpm4/trunk/modules/task
___________________________________________________________________
Name: svn:ignore
+ target
15 years, 10 months
JBoss JBPM SVN: r1555 - pvm/trunk/modules/core.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-07-08 20:44:13 -0400 (Tue, 08 Jul 2008)
New Revision: 1555
Modified:
pvm/trunk/modules/core/
Log:
excluded output directories from version control
Property changes on: pvm/trunk/modules/core
___________________________________________________________________
Name: svn:ignore
+ target
15 years, 10 months