JBoss JBPM SVN: r1604 - jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/engine.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-13 10:46:47 -0400 (Sun, 13 Jul 2008)
New Revision: 1604
Added:
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/engine/basic-engine-jbpm32.xml
Removed:
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/engine/basic-engine.xml
Log:
Copied: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/engine/basic-engine-jbpm32.xml (from rev 1603, jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/engine/basic-engine.xml)
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/engine/basic-engine-jbpm32.xml (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/engine/basic-engine-jbpm32.xml 2008-07-13 14:46:47 UTC (rev 1604)
@@ -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
Deleted: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/engine/basic-engine.xml
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/engine/basic-engine.xml 2008-07-13 14:46:12 UTC (rev 1603)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/engine/basic-engine.xml 2008-07-13 14:46:47 UTC (rev 1604)
@@ -1,9 +0,0 @@
-<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
17 years, 9 months
JBoss JBPM SVN: r1603 - in jbpm3/trunk/modules/jpdl/core/src: testsuite and 4 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-13 10:46:12 -0400 (Sun, 13 Jul 2008)
New Revision: 1603
Added:
jbpm3/trunk/modules/jpdl/core/src/testsuite/
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/context/basic-context-jbpm32.xml
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence-jbpm32.xml
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task-jbpm32.xml
Removed:
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/log4j.xml
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/model/
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/context/basic-context.xml
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence.bpmn
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence.bpmn_diagram
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence.png
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence.xml
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task.bpmn
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task.bpmn_diagram
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task.png
jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task.xml
Log:
Add jbpm32 dialect descriptors
Copied: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources (from rev 1598, api/trunk/modules/testsuite/src/test/resources)
Deleted: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/log4j.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/log4j.xml 2008-07-12 12:45:25 UTC (rev 1598)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/log4j.xml 2008-07-13 14:46:12 UTC (rev 1603)
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <appender name="FILE" class="org.apache.log4j.FileAppender">
- <param name="File" value="${log4j.output.dir}/test.log"/>
- <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"/>
- </layout>
- </appender>
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <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" />
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.jbpm">
- <priority value="DEBUG" />
- </category>
-
- <category name="org.hibernate">
- <priority value="INFO" />
- </category>
-
- <!-- hide optimistic locking failures -->
- <category name="org.hibernate.event.def.AbstractFlushingEventListener">
- <priority value="FATAL" />
- </category>
-
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <!--appender-ref ref="CONSOLE"/-->
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
Copied: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/context/basic-context-jbpm32.xml (from rev 1602, api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context-jbpm32.xml)
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/context/basic-context-jbpm32.xml (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/context/basic-context-jbpm32.xml 2008-07-13 14:46:12 UTC (rev 1603)
@@ -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
Deleted: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/context/basic-context.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context.xml 2008-07-12 12:45:25 UTC (rev 1598)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/context/basic-context.xml 2008-07-13 14:46:12 UTC (rev 1603)
@@ -1,12 +0,0 @@
-<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
Copied: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence-jbpm32.xml (from rev 1602, api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence-jbpm32.xml)
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence-jbpm32.xml (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence-jbpm32.xml 2008-07-13 14:46:12 UTC (rev 1603)
@@ -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
Deleted: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence.bpmn
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.bpmn 2008-07-12 12:45:25 UTC (rev 1598)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence.bpmn 2008-07-13 14:46:12 UTC (rev 1603)
@@ -1,10 +0,0 @@
-<?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>
Deleted: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence.bpmn_diagram
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.bpmn_diagram 2008-07-12 12:45:25 UTC (rev 1598)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence.bpmn_diagram 2008-07-13 14:46:12 UTC (rev 1603)
@@ -1,72 +0,0 @@
-<?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>
Deleted: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence.png
===================================================================
(Binary files differ)
Deleted: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.xml 2008-07-12 12:45:25 UTC (rev 1598)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/sequence/basic-sequence.xml 2008-07-13 14:46:12 UTC (rev 1603)
@@ -1,9 +0,0 @@
-<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
Copied: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task-jbpm32.xml (from rev 1602, api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task-jbpm32.xml)
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task-jbpm32.xml (rev 0)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task-jbpm32.xml 2008-07-13 14:46:12 UTC (rev 1603)
@@ -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
Deleted: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task.bpmn
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.bpmn 2008-07-12 12:45:25 UTC (rev 1598)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task.bpmn 2008-07-13 14:46:12 UTC (rev 1603)
@@ -1,10 +0,0 @@
-<?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>
Deleted: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task.bpmn_diagram
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.bpmn_diagram 2008-07-12 12:45:25 UTC (rev 1598)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task.bpmn_diagram 2008-07-13 14:46:12 UTC (rev 1603)
@@ -1,72 +0,0 @@
-<?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>
Deleted: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task.png
===================================================================
(Binary files differ)
Deleted: jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.xml 2008-07-12 12:45:25 UTC (rev 1598)
+++ jbpm3/trunk/modules/jpdl/core/src/testsuite/resources/samples/task/basic-task.xml 2008-07-13 14:46:12 UTC (rev 1603)
@@ -1,12 +0,0 @@
-<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
17 years, 9 months
JBoss JBPM SVN: r1602 - in api/trunk/modules: api/src/main/java/org/jboss/bpm/client and 15 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-13 10:41:10 -0400 (Sun, 13 Jul 2008)
New Revision: 1602
Added:
api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessIntegrityTest.java
api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context-jbpm32.xml
api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence-jbpm32.xml
api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task-jbpm32.xml
Removed:
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/model/
api/trunk/modules/testsuite/src/test/resources/model/
api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context.xml
api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.xml
api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.xml
Modified:
api/trunk/modules/api/src/main/java/org/jboss/bpm/NameNotUniqueException.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlow.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/Process.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/main/java/org/jboss/bpm/util/ProcessMarshaller.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java
api/trunk/modules/testsuite/pom.xml
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
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/BasicTaskTest.java
Log:
Add descriptor dialects
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/NameNotUniqueException.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/NameNotUniqueException.java 2008-07-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/NameNotUniqueException.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -29,18 +29,17 @@
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
*/
-public class NameNotUniqueException extends JBPMException {
-
- /**
- *
- */
+public class NameNotUniqueException extends InvalidProcessException
+{
private static final long serialVersionUID = 1L;
- public NameNotUniqueException() {
+ public NameNotUniqueException()
+ {
super();
}
- public NameNotUniqueException(String message) {
+ public NameNotUniqueException(String message)
+ {
super(message);
}
}
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-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -83,7 +83,6 @@
*/
public final Process createProcess(String procDescriptor)
{
- // TODO: test this
if (engine.isPrepareForShutdown())
throw new EngineShutdownException("Cannot create new Process while engine is shutting down");
@@ -97,7 +96,6 @@
*/
public final Process createProcess(URL procURL) throws IOException
{
- // TODO: test this
if (engine.isPrepareForShutdown())
throw new EngineShutdownException("Cannot create new Process while engine is shutting down");
@@ -169,9 +167,12 @@
try
{
File file = new File("target/" + proc.getName() + ".xml").getCanonicalFile();
+ log.debug("Generate: " + file);
+
+ FileWriter writer = new FileWriter(file);
ProcessMarshaller marshaller = new ProcessMarshaller();
- marshaller.marshallProcess(proc, new FileWriter(file));
- log.info("Generated: " + file);
+ marshaller.marshallProcess(proc, writer);
+ writer.close();
}
catch (Exception ex)
{
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlow.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlow.java 2008-07-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractFlow.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -24,33 +24,30 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
-
-
// $Id$
/**
- * A Flow is a graphical line connecting two objects in a BPD.
+ * A Flow is a graphical line connecting two objects in a BPD.
*
- * There are two types of Flow: Sequence Flow and Message Flow, each with their own line style.
- * Flow is also used in a generic sense (and lowercase) to describe how Tokens will traverse
- * Sequence Flow from the Start Event to an End Event.
+ * There are two types of Flow: Sequence Flow and Message Flow, each with their own line style. Flow is also used in a generic sense (and lowercase) to describe how
+ * Tokens will traverse Sequence Flow from the Start Event to an End Event.
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-@XmlType(name="AbstractFlow")
+@XmlType(name = "AbstractFlow")
abstract class AbstractFlow
{
private String name;
private String targetName;
-
+
/**
* Construct a flow with no target
*/
public AbstractFlow()
{
}
-
+
/**
* Construct a flow with a given target
*/
@@ -66,10 +63,9 @@
{
return name;
}
-
+
/**
- * Set the optional name
- * Note, this MUST NOT leak into the public API.
+ * Set the optional name Note, this MUST NOT leak into the public API.
*/
@XmlAttribute(required = false)
protected void setName(String name)
@@ -86,10 +82,9 @@
}
/**
- * Set the target name
- * Note, this MUST NOT leak into the public API.
+ * Set the target name Note, this MUST NOT leak into the public API.
*/
- @XmlAttribute(required = true)
+ @XmlAttribute(name = "to", required = true)
protected void setTargetName(String targetName)
{
this.targetName = targetName;
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-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowObject.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -24,6 +24,7 @@
import javax.xml.bind.annotation.XmlType;
import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.NameNotUniqueException;
//$Id$
@@ -53,9 +54,21 @@
if (this instanceof NamedFlowObject)
{
- NamedFlowObject nfo = (NamedFlowObject)this;
- if (nfo.getName() == null)
+ // Check required name
+ String name = ((NamedFlowObject)this).getName();
+ if (name == null)
throw new InvalidProcessException("Name is required for: " + this);
+
+ // Check name uniqueness
+ for (FlowObject aux : proc.getFlowObjects())
+ {
+ if (aux != this && aux instanceof NamedFlowObject)
+ {
+ String auxName = ((NamedFlowObject)aux).getName();
+ if (name.equals(auxName))
+ throw new NameNotUniqueException("NamedFlowObject: " + this);
+ }
+ }
}
// Initialize in/out flows
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-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -32,8 +32,8 @@
import javax.xml.bind.annotation.XmlType;
import org.jboss.bpm.InvalidProcessException;
-import org.jboss.bpm.NameNotUniqueException;
import org.jboss.bpm.client.ExecutionManager;
+import org.jboss.bpm.client.ProcessManager;
import org.jboss.bpm.runtime.Attachments;
/**
@@ -75,13 +75,6 @@
*/
protected void addFlowObject(FlowObject flowObject)
{
- if (flowObject instanceof NamedFlowObject)
- {
- NamedFlowObject nfo = (NamedFlowObject)flowObject;
- if (nfo.getName() != null && findFlowObject(nfo.getName()) != null)
- throw new NameNotUniqueException("NamedFlowObject: " + nfo.getName());
- }
-
flowObjects.add(flowObject);
}
@@ -188,6 +181,13 @@
if (processState != ProcessState.CREATED)
throw new IllegalStateException("Cannot initialize process in state: " + processState);
+ // Set the anonymous default name
+ if (getName() == null)
+ {
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ setName("AnonymousProcess#" + pm.getProcesses().size());
+ }
+
if (getStartEvent() == null)
throw new InvalidProcessException("Process does not have a start event");
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-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -56,7 +56,7 @@
super.setUp();
log.debug("setUp: " + getName());
deployer = new EmbeddedBeansDeployer();
- deployTestBeans(getBeansConfig());
+ deployBeans(getBeansConfig());
signals.clear();
}
@@ -64,19 +64,19 @@
protected void tearDown() throws Exception
{
log.debug("tearDown: " + getName());
- undeployTestBeans(getBeansConfig());
+ undeployBeans(getBeansConfig());
super.tearDown();
}
// Deploy a beans config
- protected void deployTestBeans(String resourceName)
+ protected void deployBeans(String resourceName)
{
URL url = getBeansConfigURL(resourceName);
deployer.deploy(url);
}
// Undeploy a beans config
- protected void undeployTestBeans(String resourceName)
+ protected void undeployBeans(String resourceName)
{
URL url = getBeansConfigURL(resourceName);
deployer.undeploy(url);
@@ -108,7 +108,7 @@
log.debug("catchSignal: " + signal);
}
- public List<Signal> getCaughtSignals()
+ public List<Signal> getSignals()
{
return Collections.unmodifiableList(signals);
}
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-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -32,4 +32,16 @@
{
return ProcessEngine.JBPM_ENGINE_CONFIG;
}
+
+ /**
+ * Get the jBPM descriptor dialect.
+ */
+ protected String getDialect()
+ {
+ String dialect = System.getProperty("jbpm.dialect");
+ if (dialect == null)
+ throw new IllegalStateException ("Cannot obtain jbpm.dialect");
+
+ return dialect;
+ }
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessMarshaller.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessMarshaller.java 2008-07-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessMarshaller.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -49,12 +49,14 @@
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
+ marshaller.marshal(proc, out);
+
// Add xmlns:xsi to the top level element and remove it from all others
- StringWriter strwr = new StringWriter();
- marshaller.marshal(proc, strwr);
- String str = strwr.toString();
- String xsi = " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
- str = new StringBuilder(str.replace(xsi, "")).insert(str.indexOf(">"), xsi).toString();
- out.write(str);
+ //StringWriter strwr = new StringWriter();
+ //marshaller.marshal(proc, strwr);
+ //String str = strwr.toString();
+ //String xsi = " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
+ //str = new StringBuilder(str.replace(xsi, "")).insert(str.indexOf(">"), xsi).toString();
+ //out.write(str);
}
}
Added: api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessIntegrityTest.java
===================================================================
--- api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessIntegrityTest.java (rev 0)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessIntegrityTest.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -0,0 +1,146 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * 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.List;
+
+import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.MockEngineTestCase;
+import org.jboss.bpm.client.ProcessManager;
+
+/**
+ * Test the intergety of various process definitions
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public class ProcessIntegrityTest extends MockEngineTestCase
+{
+ public void testBasicSequence() throws Exception
+ {
+ String jpdl =
+ "<ns2:process xmlns:ns2='urn:api.bpm.jboss:jpdl-0.1'>" +
+ " <start>" +
+ " <sequence to='taskA' />" +
+ " </start>" +
+ " <task name='taskA'>" +
+ " <sequence to='end' />" +
+ " </task>" +
+ " <end name='end' />" +
+ "</ns2:process>";
+
+ // 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);
+
+ FlowObject nfo = proc.findFlowObject("taskA");
+ assertNotNull("FlowObject expected", nfo);
+ assertTrue("Task expected", nfo instanceof Task);
+
+ List<EndEvent> ends = proc.getEndEvents();
+ assertEquals(1, ends.size());
+ }
+
+ public void testNoStartState() throws Exception
+ {
+ String jpdl =
+ "<ns2:process xmlns:ns2='urn:api.bpm.jboss:jpdl-0.1'>" +
+ " <task>" +
+ " <sequence to='taskA' />" +
+ " </task>" +
+ " <task name='taskA'>" +
+ " <sequence to='end' />" +
+ " </task>" +
+ " <end name='end' />" +
+ "</ns2:process>";
+
+ 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 =
+ "<ns2:process xmlns:ns2='urn:api.bpm.jboss:jpdl-0.1'>" +
+ " <start>" +
+ " <sequence to='taskA' />" +
+ " </start>" +
+ " <task name='taskA'>" +
+ " <sequence to='end' />" +
+ " </task>" +
+ " <task name='end' />" +
+ "</ns2:process>";
+
+ 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 =
+ "<ns2:process xmlns:ns2='urn:api.bpm.jboss:jpdl-0.1'>" +
+ " <start>" +
+ " <sequence to='taskA' />" +
+ " </start>" +
+ " <task name='taskA'>" +
+ " <sequence to='end' />" +
+ " </task>" +
+ " <task name='taskA'>" +
+ " <sequence to='end' />" +
+ " </task>" +
+ " <end name='end' />" +
+ "</ns2:process>";
+
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ try
+ {
+ pm.createProcess(jpdl);
+ fail("InvalidProcessException expected");
+ }
+ catch (InvalidProcessException ex)
+ {
+ // expected;
+ }
+ }
+}
Property changes on: api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessIntegrityTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
===================================================================
--- api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java 2008-07-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -51,7 +51,7 @@
marshaller.marshallProcess(inProc, strwr);
String xml = strwr.toString();
- System.out.println(xml);
+ //System.out.println(xml);
ProcessUnmarshaller unmarshaller = new ProcessUnmarshaller();
Process outProc = unmarshaller.unmarshallProcess(new StringReader(xml));
Modified: api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java
===================================================================
--- api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java 2008-07-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -35,7 +35,7 @@
import org.jboss.bpm.model.Signal;
/**
- * Test the basic execution sequence
+ * Test the basic sequence
*
* @author thomas.diesler(a)jboss.com
* @since 03-Jul-2008
@@ -71,7 +71,7 @@
assertEquals("No attachments expected", 0, result.getAttachments().getAttachmentKeys().size());
// Validate received signals
- List<Signal> signals = getCaughtSignals();
+ List<Signal> signals = getSignals();
assertEquals(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
assertEquals(Signal.Type.ENTER_START_EVENT, signals.get(1).getType());
assertEquals(Signal.Type.EXIT_START_EVENT, signals.get(2).getType());
Modified: api/trunk/modules/testsuite/pom.xml
===================================================================
--- api/trunk/modules/testsuite/pom.xml 2008-07-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/testsuite/pom.xml 2008-07-13 14:41:10 UTC (rev 1602)
@@ -116,6 +116,21 @@
<scope>test</scope>
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>jbpm.dialect</name>
+ <value>jbpm32</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</profile>
</profiles>
</project>
\ No newline at end of file
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-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -48,7 +48,7 @@
protected void setUp() throws Exception
{
super.setUp();
- jpdlURL = getResourceURL("samples/context/basic-context.xml");
+ jpdlURL = getResourceURL("samples/context/basic-context-" + getDialect() + ".xml");
SignalManager em = SignalManager.locateSignalManager();
em.addListener("basic-context", this);
}
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-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/engine/EngineShutdownTest.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -59,9 +59,9 @@
{
// Create a Process through the ProcessManager
ProcessManager pm = ProcessManager.locateProcessManager();
- assertNotNull("ProcessDefinition expected", pm.createProcess(jpdlURL));
+ assertNotNull("Process expected", pm.createProcess(jpdlURL));
- // Try to create a ProcessDefinition during shutdown
+ // Try to create a Process during shutdown
try
{
engine.prepareForShutdown();
Modified: 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/sequence/BasicSequenceTest.java 2008-07-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -48,7 +48,7 @@
protected void setUp() throws Exception
{
super.setUp();
- jpdlURL = getResourceURL("samples/sequence/basic-sequence.xml");
+ jpdlURL = getResourceURL("samples/sequence/basic-sequence-" + getDialect() + ".xml");
SignalManager em = SignalManager.locateSignalManager();
em.addListener("basic-sequence", this);
}
@@ -71,7 +71,7 @@
assertEquals("No attachments expected", 0, result.getAttachments().getAttachmentKeys().size());
// Validate received signals
- List<Signal> signals = getCaughtSignals();
+ List<Signal> signals = getSignals();
assertEquals(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
assertEquals(Signal.Type.ENTER_START_EVENT, signals.get(1).getType());
assertEquals(Signal.Type.EXIT_START_EVENT, signals.get(2).getType());
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-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-13 14:41:10 UTC (rev 1602)
@@ -49,7 +49,7 @@
protected void setUp() throws Exception
{
super.setUp();
- jpdlURL = getResourceURL("samples/task/basic-task.xml");
+ jpdlURL = getResourceURL("samples/task/basic-task-" + getDialect() + ".xml");
SignalManager em = SignalManager.locateSignalManager();
em.addListener("basic-task", this);
}
@@ -75,7 +75,7 @@
assertEquals("Task: TaskA", att.getAttachment(String.class));
// Validate received signals
- List<Signal> signals = getCaughtSignals();
+ List<Signal> signals = getSignals();
assertEquals(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
assertEquals(Signal.Type.ENTER_START_EVENT, signals.get(1).getType());
assertEquals(Signal.Type.EXIT_START_EVENT, signals.get(2).getType());
Added: api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context-jbpm32.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context-jbpm32.xml (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context-jbpm32.xml 2008-07-13 14:41:10 UTC (rev 1602)
@@ -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-jbpm32.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context.xml 2008-07-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/testsuite/src/test/resources/samples/context/basic-context.xml 2008-07-13 14:41:10 UTC (rev 1602)
@@ -1,12 +0,0 @@
-<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
Copied: api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence-jbpm32.xml (from rev 1598, api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.xml)
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence-jbpm32.xml (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence-jbpm32.xml 2008-07-13 14:41:10 UTC (rev 1602)
@@ -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
Deleted: api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.xml 2008-07-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/testsuite/src/test/resources/samples/sequence/basic-sequence.xml 2008-07-13 14:41:10 UTC (rev 1602)
@@ -1,9 +0,0 @@
-<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
Copied: api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task-jbpm32.xml (from rev 1598, api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.xml)
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task-jbpm32.xml (rev 0)
+++ api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task-jbpm32.xml 2008-07-13 14:41:10 UTC (rev 1602)
@@ -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
Deleted: api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.xml
===================================================================
--- api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.xml 2008-07-13 13:29:02 UTC (rev 1601)
+++ api/trunk/modules/testsuite/src/test/resources/samples/task/basic-task.xml 2008-07-13 14:41:10 UTC (rev 1602)
@@ -1,12 +0,0 @@
-<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
17 years, 9 months
JBoss JBPM SVN: r1601 - in api/trunk: modules/api/src/main/java/org/jboss/bpm/client and 15 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-13 09:29:02 -0400 (Sun, 13 Jul 2008)
New Revision: 1601
Added:
api/trunk/docs/VioletUML/APIExecution.png
api/trunk/docs/VioletUML/APIExecution.seq.violet
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Executable.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Handler.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/MockEngineTestCase.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/
api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/
api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java
Removed:
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/InitialToken.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutableFlowObject.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractToken.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/AbstractMockEngineTestCase.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/client/MockProcessEngine.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/
api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java
Modified:
api/trunk/docs/VioletUML/APIModel.class.violet
api/trunk/docs/VioletUML/APIModel.png
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.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/Gateway.java
api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.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/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/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/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/client/ProcessEngineLocatorTest.java
api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
api/trunk/modules/api/src/test/resources/jbpm-mock-beans.xml
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/TaskA.java
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/BasicTaskTest.java
api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
Log:
Provide an implementation of an ExecutionManager
Copied: api/trunk/docs/VioletUML/APIExecution.png (from rev 1599, api/branches/tdiesler/docs/VioletUML/APIExecution.png)
===================================================================
(Binary files differ)
Copied: api/trunk/docs/VioletUML/APIExecution.seq.violet (from rev 1599, api/branches/tdiesler/docs/VioletUML/APIExecution.seq.violet)
===================================================================
--- api/trunk/docs/VioletUML/APIExecution.seq.violet (rev 0)
+++ api/trunk/docs/VioletUML/APIExecution.seq.violet 2008-07-13 13:29:02 UTC (rev 1601)
@@ -0,0 +1,507 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<java version="1.6.0_06" class="java.beans.XMLDecoder">
+ <object class="com.horstmann.violet.SequenceDiagramGraph">
+ <void method="addNode">
+ <object id="LifelineNode0" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>Process</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>37.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ActivationBarNode0" class="com.horstmann.violet.CallNode">
+ <void method="addChild">
+ <object id="ActivationBarNode1" class="com.horstmann.violet.CallNode">
+ <void method="addChild">
+ <object id="ActivationBarNode2" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object id="LifelineNode1" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>Token</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode3" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode1"/>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode4" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode1"/>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode5" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object id="LifelineNode2" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>Flow
+</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode6" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object id="LifelineNode3" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>FlowObject</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode7" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object id="LifelineNode4" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>Execution
+Handler</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode8" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode3"/>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode9" class="com.horstmann.violet.CallNode">
+ <void method="addChild">
+ <object id="ActivationBarNode10" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode1"/>
+ </void>
+ </object>
+ </void>
+ <void property="implicitParameter">
+ <object id="LifelineNode5" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>FlowHandler</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode11" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode1"/>
+ </void>
+ <void property="openBottom">
+ <boolean>true</boolean>
+ </void>
+ </object>
+ </void>
+ <void property="implicitParameter">
+ <object id="LifelineNode6" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>Execution
+Manager</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ <void property="openBottom">
+ <boolean>true</boolean>
+ </void>
+ </object>
+ </void>
+ <void property="implicitParameter">
+ <object idref="LifelineNode0"/>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>69.0</double>
+ <double>80.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="LifelineNode6"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>230.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="LifelineNode3"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>561.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="LifelineNode5"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>782.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="LifelineNode1"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>343.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode1"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>262.0</double>
+ <double>103.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode4"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>375.0</double>
+ <double>232.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="LifelineNode2"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>455.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode5"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>487.0</double>
+ <double>285.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode8"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>593.0</double>
+ <double>444.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode9"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>814.0</double>
+ <double>497.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode10"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>375.0</double>
+ <double>520.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode11"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>375.0</double>
+ <double>593.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="NoteNode0" class="com.horstmann.violet.NoteNode">
+ <void property="text">
+ <void property="text">
+ <string>The FlowHandler adds all
+active outgoing Flows to the
+FlowQueue in the Token</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>831.0</double>
+ <double>352.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="PointNode0" class="com.horstmann.violet.PointNode">
+ <void id="Rectangle2D$Double0" property="bounds">
+ <void method="setRect">
+ <double>822.0</double>
+ <double>521.0</double>
+ <double>0.0</double>
+ <double>0.0</double>
+ </void>
+ </void>
+ <void property="bounds">
+ <object idref="Rectangle2D$Double0"/>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>822.0</double>
+ <double>521.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="PointNode1" class="com.horstmann.violet.PointNode">
+ <void id="Rectangle2D$Double1" property="bounds">
+ <void method="setRect">
+ <double>270.0</double>
+ <double>593.0</double>
+ <double>0.0</double>
+ <double>0.0</double>
+ </void>
+ </void>
+ <void property="bounds">
+ <object idref="Rectangle2D$Double1"/>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>270.0</double>
+ <double>593.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="NoteNode1" class="com.horstmann.violet.NoteNode">
+ <void property="text">
+ <void property="text">
+ <string>The ExecutionManager
+executes Flows while
+there are any in the
+FlowQueue.</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>96.0</double>
+ <double>429.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="LifelineNode4"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>670.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode6"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>593.0</double>
+ <double>338.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode7"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>702.0</double>
+ <double>391.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode2"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>375.0</double>
+ <double>126.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode0"/>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>69.0</double>
+ <double>753.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode3"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>375.0</double>
+ <double>179.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>startProcess</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode0"/>
+ <object idref="ActivationBarNode1"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>getHeadFlow</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode4"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>getTarget</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode5"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>getFlowHandler</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode8"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>transfer(tok)</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode9"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>addTailFlows</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode9"/>
+ <object idref="ActivationBarNode10"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>getHeadFlow</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode11"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.NoteEdge"/>
+ <object idref="NoteNode0"/>
+ <object idref="PointNode0"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.NoteEdge"/>
+ <object idref="NoteNode1"/>
+ <object idref="PointNode1"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>getExecutionHandler</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode6"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>execute(tok)</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode7"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>createToken</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode2"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>addTailFlow</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode3"/>
+ </void>
+ </object>
+</java>
Modified: api/trunk/docs/VioletUML/APIModel.class.violet
===================================================================
--- api/trunk/docs/VioletUML/APIModel.class.violet 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/docs/VioletUML/APIModel.class.violet 2008-07-13 13:29:02 UTC (rev 1601)
@@ -74,6 +74,11 @@
</void>
<void method="addNode">
<object id="ClassNode4" class="com.horstmann.violet.ClassNode">
+ <void property="methods">
+ <void property="text">
+ <string>execute</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>Event</string>
@@ -179,6 +184,11 @@
outFlows</string>
</void>
</void>
+ <void property="methods">
+ <void property="text">
+ <string>execute</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>Gateway
@@ -202,6 +212,11 @@
outFlow</string>
</void>
</void>
+ <void property="methods">
+ <void property="text">
+ <string>execute</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>SubProcess
@@ -224,6 +239,11 @@
outFlow</string>
</void>
</void>
+ <void property="methods">
+ <void property="text">
+ <string>execute</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>Task</string>
Modified: api/trunk/docs/VioletUML/APIModel.png
===================================================================
(Binary files differ)
Modified: 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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -23,35 +23,26 @@
// $Id$
-import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.NotImplementedException;
-import org.jboss.bpm.client.internal.InitialToken;
-import org.jboss.bpm.model.EndEvent;
-import org.jboss.bpm.model.ExecutableFlowObject;
+import org.jboss.bpm.model.Executable;
+import org.jboss.bpm.model.ExecutionHandler;
+import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.runtime.Attachments;
-import org.jboss.bpm.runtime.Token;
/**
- * The process manager is the entry point to create, find and otherwise manage processes.
+ * The ExecutionManager executes processes
*
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
*/
public abstract class ExecutionManager
{
- // provide logging
- private static final Log log = LogFactory.getLog(ExecutionManager.class);
-
// Injected through the MC
protected ProcessEngine engine;
@@ -61,6 +52,14 @@
}
/**
+ * Start the Process and return a Future
+ * @param proc The Process to start
+ * @param att The Attachments in the ExecutionContext
+ * @return The Future from which to obtain the process result
+ */
+ public abstract Future<Result> startProcess(Process proc, Attachments att);
+
+ /**
* Locate the signal manager
*/
public static ExecutionManager locateExecutionManager()
@@ -68,101 +67,38 @@
ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
return engine.getExecutionManager();
}
-
- public Future<Result> startProcess(Process proc, Attachments att)
+
+ protected ExecutionHandler getExecutionHandler(FlowObject target)
{
- throwSignal(new Signal(proc, Signal.Type.ENTER_PROCESS));
- try
- {
- FlowObject fo = proc.getStartEvent();
- ExecutableFlowObject exfo = getExecutable(fo);
- Token token = new InitialToken(proc, att);
-
- boolean hasEnded = false;
- while(hasEnded == false)
- {
- try
- {
- throwSignal(exfo.getEnterSignal());
- exfo.execute(token);
- }
- finally
- {
- throwSignal(exfo.getExitSignal());
- }
- }
- }
- finally
- {
- throwSignal(new Signal(proc, Signal.Type.EXIT_PROCESS));
- }
- return new ResultFuture(proc);
+ Executable exfo = getExecutable(target);
+ ExecutionHandler handler = exfo.getExecutionHandler();
+ return handler != null ? handler : exfo.getDefaultExecutionHandler();
}
- protected ExecutableFlowObject getExecutable(FlowObject fo)
+ protected SignalHandler getSignalHandler(FlowObject target)
{
- if (fo instanceof ExecutableFlowObject == false)
- throw new IllegalStateException("Flow object is not executable: " + fo);
-
- return (ExecutableFlowObject)fo;
+ Executable exfo = getExecutable(target);
+ SignalHandler handler = exfo.getSignalHandler();
+ return handler != null ? handler : exfo.getDefaultSignalHandler();
}
+ protected FlowHandler getFlowHandler(FlowObject target)
+ {
+ Executable exfo = getExecutable(target);
+ FlowHandler handler = exfo.getFlowHandler();
+ return handler != null ? handler : exfo.getDefaultFlowHandler();
+ }
+
protected void throwSignal(Signal signal)
{
SignalManager sm = SignalManager.locateSignalManager();
sm.throwSignal(signal);
}
-
- public class ResultFuture implements Future<Result>
- {
- private Result result;
- private Process proc;
- public ResultFuture(Process proc)
- {
- this.proc = proc;
- }
-
- 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()
- {
- boolean isDone = getResult() != null;
- return isDone;
- }
-
- private Result getResult()
- {
- if (result == null)
- {
- for (EndEvent aux : proc.getEndEvents())
- {
- result = aux.getResult();
- if (result != null)
- {
- break;
- }
- }
- }
- return result;
- }
+ private Executable getExecutable(FlowObject fo)
+ {
+ if (fo instanceof Executable == false)
+ throw new IllegalStateException("Flow object is not executable: " + fo);
+ return (Executable)fo;
}
}
\ No newline at end of file
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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -47,7 +47,7 @@
{
// provide logging
private static final Log log = LogFactory.getLog(ProcessManager.class);
-
+
// Injected through the MC
protected ProcessEngine engine;
// The set of process definitions
@@ -58,7 +58,9 @@
{
}
- /* Get the associated process engine */
+ /**
+ * Get the associated process engine
+ */
public ProcessEngine getProcessEngine()
{
if (engine == null)
@@ -67,15 +69,17 @@
return engine;
}
- /* Locate the process definition manager */
+ /**
+ * Locate the process definition manager
+ */
public static ProcessManager locateProcessManager()
{
ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
return engine.getProcessManager();
}
- /*
- * Create a process defintion from a XML string in one of the supported formats
+ /**
+ * Create a Process from a XML string in one of the supported formats
*/
public final Process createProcess(String procDescriptor)
{
@@ -84,15 +88,12 @@
throw new EngineShutdownException("Cannot create new Process while engine is shutting down");
Process proc = createProcessOverride(procDescriptor);
- proc.initialize();
-
- marshallProcess(proc);
-
+ registerProcess(proc);
return proc;
}
- /*
- * Create a process defintion from an URL to a XML descritor in one of the supported formats
+ /**
+ * Create a Process from an URL to a XML descritor in one of the supported formats
*/
public final Process createProcess(URL procURL) throws IOException
{
@@ -101,48 +102,30 @@
throw new EngineShutdownException("Cannot create new Process while engine is shutting down");
Process proc = createProcessOverride(procURL);
- proc.initialize();
-
- marshallProcess(proc);
-
+ registerProcess(proc);
return proc;
}
/**
- * Override to implement process definition creation
+ * Override to implement Process creation
*/
- protected abstract Process createProcessOverride(String procDescriptor);
+ protected abstract Process createProcessOverride(String pXML);
- private void marshallProcess(Process proc)
- {
- try
- {
- File file = new File("target/" + proc.getName() + ".xml").getCanonicalFile();
- ProcessMarshaller marshaller = new ProcessMarshaller();
- marshaller.marshallProcess(proc, new FileWriter(file));
- log.info("Generated: " + file);
- }
- catch (Exception ex)
- {
- log.error("Cannot marshall: " + proc);
- }
- }
-
- /*
- * Override to implement process definition creation
+ /**
+ * Override to implement Process creation
*/
- protected abstract Process createProcessOverride(URL pdURL) throws IOException;
+ protected abstract Process createProcessOverride(URL pURL) throws IOException;
- /*
- * Get the set of registered process definitions
+ /**
+ * Get the set of registered Processes
*/
public Set<Process> getProcesses()
{
return Collections.unmodifiableSet(procs);
}
- /*
- * Find a process definition for a given name
+ /**
+ * Find a Process for a given name
*
* @return null if the process definition is not defined
*/
@@ -160,18 +143,39 @@
return proc;
}
- /*
- * Remove a process definition and all its associated process instances
+ /**
+ * Register a Process
*/
+ public final boolean registerProcess(Process proc)
+ {
+ // Only initialize if this has not already been done
+ if (proc.getProcessState() == Process.ProcessState.CREATED)
+ proc.initialize();
+
+ marshallProcess(proc);
+ return procs.add(proc);
+ }
+
+ /**
+ * Remove a Process
+ */
public void removeProcess(Process proc)
{
- // Remove the preocess definition
procs.remove(proc.getName());
}
- // Add a process definition
- protected void addProcess(Process proc)
+ private void marshallProcess(Process proc)
{
- procs.add(proc);
+ try
+ {
+ File file = new File("target/" + proc.getName() + ".xml").getCanonicalFile();
+ ProcessMarshaller marshaller = new ProcessMarshaller();
+ marshaller.marshallProcess(proc, new FileWriter(file));
+ log.info("Generated: " + file);
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot marshall: " + proc);
+ }
}
}
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java (from rev 1599, api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -0,0 +1,178 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * 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.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.client.ExecutionManager;
+import org.jboss.bpm.client.ProcessEngine;
+import org.jboss.bpm.model.EndEvent;
+import org.jboss.bpm.model.ExecutionHandler;
+import org.jboss.bpm.model.Flow;
+import org.jboss.bpm.model.FlowHandler;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Result;
+import org.jboss.bpm.model.SequenceFlow;
+import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.model.SignalHandler;
+import org.jboss.bpm.model.StartEvent;
+import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * The process manager is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ExecutionManagerImpl extends ExecutionManager
+{
+ // provide logging
+ private static final Log log = LogFactory.getLog(ExecutionManager.class);
+
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ this.engine = engine;
+ }
+
+ @Override
+ public Future<Result> startProcess(Process proc, Attachments att)
+ {
+ throwSignal(new Signal(proc, Signal.Type.ENTER_PROCESS));
+ try
+ {
+ Token token = new Token(proc, att);
+ StartEvent start = proc.getStartEvent();
+ token.addTailFlow(new InitialFlow(start));
+
+ while (token.peekHeadFlow() != null)
+ {
+ // Peek the head flow
+ Flow flow = token.peekHeadFlow();
+
+ // Get the target and its handlers
+ FlowObject target = flow.getTarget();
+ ExecutionHandler exHandler = getExecutionHandler(target);
+ SignalHandler sigHandler = getSignalHandler(target);
+ FlowHandler flowHandler = getFlowHandler(target);
+
+ // Execute the FlowObject's ExecutionHandler
+ try
+ {
+ throwSignal(sigHandler.getEnterSignal());
+ exHandler.execute(token);
+ }
+ finally
+ {
+ throwSignal(sigHandler.getExitSignal());
+ }
+
+ // Remove the head flow
+ token.removeHeadFlow();
+
+ // Transfer the token to the FlowHandler
+ flowHandler.transfer(token);
+ }
+ }
+ finally
+ {
+ throwSignal(new Signal(proc, Signal.Type.EXIT_PROCESS));
+ }
+ return new ResultFuture(proc);
+ }
+
+ /**
+ * The initial flow 'to' the StartEvent
+ */
+ class InitialFlow extends SequenceFlow
+ {
+ InitialFlow(StartEvent start)
+ {
+ setTarget(start);
+ }
+ }
+
+ /**
+ * A basic implementation of a Future
+ */
+ class ResultFuture implements Future<Result>
+ {
+ private Result result;
+ private Process proc;
+
+ public ResultFuture(Process proc)
+ {
+ this.proc = proc;
+ }
+
+ 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()
+ {
+ boolean isDone = getResult() != null;
+ return isDone;
+ }
+
+ private Result getResult()
+ {
+ if (result == null)
+ {
+ for (EndEvent aux : proc.getEndEvents())
+ {
+ result = aux.getResult();
+ if (result != null)
+ {
+ break;
+ }
+ }
+ }
+ return result;
+ }
+ }
+}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/InitialToken.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/InitialToken.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/InitialToken.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -1,66 +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.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;
-
-/**
- * An initial token
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public 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;
- }
-
- static class InitialContext extends BasicAttachments implements ExecutionContext
- {
- InitialContext(Attachments att)
- {
- super(att);
- }
- }
-}
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java (from rev 1599, api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * 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.io.IOException;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.net.URL;
+
+import javax.xml.bind.JAXBException;
+
+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.jboss.bpm.util.ProcessUnmarshaller;
+
+/**
+ * The process manager is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessManagerImpl extends ProcessManager
+{
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ this.engine = engine;
+ }
+
+ /**
+ * Override to implement process definition creation
+ */
+ public Process createProcessOverride(String pXML)
+ {
+ try
+ {
+ ProcessUnmarshaller unmarschaller = new ProcessUnmarshaller();
+ Process proc = unmarschaller.unmarshallProcess(new StringReader(pXML));
+ return proc;
+ }
+ catch (JAXBException ex)
+ {
+ throw new InvalidProcessException("Cannot unmarschall: " + pXML, ex);
+ }
+ }
+
+ /**
+ * Override to implement process definition creation
+ */
+ public Process createProcessOverride(URL pURL) throws IOException
+ {
+ try
+ {
+ ProcessUnmarshaller unmarschaller = new ProcessUnmarshaller();
+ Process proc = unmarschaller.unmarshallProcess(new InputStreamReader(pURL.openStream()));
+ return proc;
+ }
+ catch (JAXBException ex)
+ {
+ throw new InvalidProcessException("Cannot unmarschall: " + pURL, ex);
+ }
+ }
+}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -21,6 +21,7 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@@ -37,4 +38,58 @@
@XmlType(name="AbstractEvent")
abstract class AbstractEvent extends FlowObject
{
+ protected ExecutionHandler executionHandler;
+ protected FlowHandler flowHandler;
+ protected SignalHandler signalHandler;
+
+ /**
+ * Get the ExecutionHandler for this Event
+ */
+ public ExecutionHandler getExecutionHandler()
+ {
+ return executionHandler;
+ }
+
+ /**
+ * Set the ExecutionHandler for this Event
+ */
+ @XmlElement(name = "execution-handler", required = false)
+ protected void setExecutionHandler(ExecutionHandler executionHandler)
+ {
+ this.executionHandler = executionHandler;
+ }
+
+ /**
+ * Get the FlowHandler for this Event
+ */
+ public FlowHandler getFlowHandler()
+ {
+ return flowHandler;
+ }
+
+ /**
+ * Set the FlowHandler for this Event
+ */
+ @XmlElement(name = "flow-handler", required = false)
+ protected void setFlowHandler(FlowHandler flowHandler)
+ {
+ this.flowHandler = flowHandler;
+ }
+
+ /**
+ * Get the SignalHandler for this Event
+ */
+ public SignalHandler getSignalHandler()
+ {
+ return signalHandler;
+ }
+
+ /**
+ * Set the SignalHandler for this Event
+ */
+ @XmlElement(name = "signal-handler", required = false)
+ protected void setSignalHandler(SignalHandler signalHandler)
+ {
+ this.signalHandler = signalHandler;
+ }
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -42,6 +42,9 @@
abstract class AbstractGateway extends FlowObject implements NamedFlowObject, MultipleOutFlowSupport, MultipleInFlowSupport
{
private String name;
+ protected ExecutionHandler executionHandler;
+ protected FlowHandler flowHandler;
+ protected SignalHandler signalHandler;
@XmlElements( {
@XmlElement(name = "sequence", type = SequenceFlow.class),
@@ -94,4 +97,55 @@
{
this.outFlows = outFlow;
}
+
+ /**
+ * Get the ExecutionHandler for this Event
+ */
+ public ExecutionHandler getExecutionHandler()
+ {
+ return executionHandler;
+ }
+
+ /**
+ * Set the ExecutionHandler for this Event
+ */
+ @XmlElement(name = "execution-handler")
+ protected void setExecutionHandler(ExecutionHandler executionHandler)
+ {
+ this.executionHandler = executionHandler;
+ }
+
+ /**
+ * Get the FlowHandler for this Event
+ */
+ public FlowHandler getFlowHandler()
+ {
+ return flowHandler;
+ }
+
+ /**
+ * Set the FlowHandler for this Event
+ */
+ @XmlElement(name = "flow-handler")
+ protected void setFlowHandler(FlowHandler flowHandler)
+ {
+ this.flowHandler = flowHandler;
+ }
+
+ /**
+ * Get the SignalHandler for this Event
+ */
+ public SignalHandler getSignalHandler()
+ {
+ return signalHandler;
+ }
+
+ /**
+ * Set the SignalHandler for this Event
+ */
+ @XmlElement(name = "signal-handler")
+ protected void setSignalHandler(SignalHandler signalHandler)
+ {
+ this.signalHandler = signalHandler;
+ }
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -37,6 +37,10 @@
@XmlType(name="AbstractSubProcess")
abstract class AbstractSubProcess extends Process implements SingleOutFlowSupport
{
+ protected ExecutionHandler executionHandler;
+ protected FlowHandler flowHandler;
+ protected SignalHandler signalHandler;
+
@XmlElements( {
@XmlElement(name = "sequence", type = SequenceFlow.class),
@XmlElement(name = "message", type = MessageFlow.class)
@@ -76,4 +80,55 @@
{
this.outFlow = outFlow;
}
+
+ /**
+ * Get the ExecutionHandler for this Event
+ */
+ public ExecutionHandler getExecutionHandler()
+ {
+ return executionHandler;
+ }
+
+ /**
+ * Set the ExecutionHandler for this Event
+ */
+ @XmlElement(name = "execution-handler")
+ protected void setExecutionHandler(ExecutionHandler executionHandler)
+ {
+ this.executionHandler = executionHandler;
+ }
+
+ /**
+ * Get the FlowHandler for this Event
+ */
+ public FlowHandler getFlowHandler()
+ {
+ return flowHandler;
+ }
+
+ /**
+ * Set the FlowHandler for this Event
+ */
+ @XmlElement(name = "flow-handler")
+ protected void setFlowHandler(FlowHandler flowHandler)
+ {
+ this.flowHandler = flowHandler;
+ }
+
+ /**
+ * Get the SignalHandler for this Event
+ */
+ public SignalHandler getSignalHandler()
+ {
+ return signalHandler;
+ }
+
+ /**
+ * Set the SignalHandler for this Event
+ */
+ @XmlElement(name = "signal-handler")
+ protected void setSignalHandler(SignalHandler signalHandler)
+ {
+ this.signalHandler = signalHandler;
+ }
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -40,6 +40,10 @@
@XmlType(name = "AbstractTask")
abstract class AbstractTask extends Activity implements SingleOutFlowSupport
{
+ protected ExecutionHandler executionHandler;
+ protected FlowHandler flowHandler;
+ protected SignalHandler signalHandler;
+
@XmlElements( {
@XmlElement(name = "sequence", type = SequenceFlow.class),
@XmlElement(name = "message", type = MessageFlow.class)
@@ -77,4 +81,55 @@
{
this.outFlow = outFlow;
}
+
+ /**
+ * Get the ExecutionHandler for this Event
+ */
+ public ExecutionHandler getExecutionHandler()
+ {
+ return executionHandler;
+ }
+
+ /**
+ * Set the ExecutionHandler for this Event
+ */
+ @XmlElement(name = "execution-handler")
+ protected void setExecutionHandler(ExecutionHandler executionHandler)
+ {
+ this.executionHandler = executionHandler;
+ }
+
+ /**
+ * Get the FlowHandler for this Event
+ */
+ public FlowHandler getFlowHandler()
+ {
+ return flowHandler;
+ }
+
+ /**
+ * Set the FlowHandler for this Event
+ */
+ @XmlElement(name = "flow-handler")
+ protected void setFlowHandler(FlowHandler flowHandler)
+ {
+ this.flowHandler = flowHandler;
+ }
+
+ /**
+ * Get the SignalHandler for this Event
+ */
+ public SignalHandler getSignalHandler()
+ {
+ return signalHandler;
+ }
+
+ /**
+ * Set the SignalHandler for this Event
+ */
+ @XmlElement(name = "signal-handler")
+ protected void setSignalHandler(SignalHandler signalHandler)
+ {
+ this.signalHandler = signalHandler;
+ }
}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -26,6 +26,8 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.Token;
@@ -42,6 +44,9 @@
@XmlType(name="EndEvent")
public class EndEvent extends AbstractEndEvent implements SingleInFlowSupport
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(EndEvent.class);
+
private Result result;
private Flow inFlow;
@@ -88,26 +93,51 @@
return result;
}
- /** Get signal for enter */
- public Signal getEnterSignal()
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
{
- return new Signal(getProcess(), Signal.Type.ENTER_END_EVENT);
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ log.debug("End reached in: " + getName());
+ }
+ };
}
-
- /** Get signal for exit */
- public Signal getExitSignal()
+
+ public SignalHandler getDefaultSignalHandler()
{
- return new Signal(getProcess(), Signal.Type.EXIT_END_EVENT);
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_END_EVENT);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_END_EVENT);
+ }
+ };
}
- public void execute(final Token token)
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
{
- // Provide the result
- result = new Result()
+ return new ExecutionHandler()
{
- public Attachments getAttachments()
+ @Override
+ public void execute(final Token token)
{
- return token.getExecutionContext();
+ // Provide the result
+ result = new Result()
+ {
+ public Attachments getAttachments()
+ {
+ return token.getExecutionContext();
+ }
+ };
}
};
}
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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -21,12 +21,10 @@
*/
package org.jboss.bpm.model;
+//$Id$
+
import javax.xml.bind.annotation.XmlType;
-
-
-// $Id$
-
/**
* An Event is something that “happens” during the course of a business process.
* These Events affect the flow of the Process and usually have a cause or an impact.
@@ -35,7 +33,7 @@
* @since 08-Jul-2008
*/
@XmlType(name="Event")
-public abstract class Event extends AbstractEvent implements ExecutableFlowObject
+public abstract class Event extends AbstractEvent implements Executable
{
/**
* Construct an anonymous StartEvent.
@@ -44,20 +42,4 @@
protected Event()
{
}
-
- /**
- * Get signal for enter
- */
- public Signal getEnterSignal()
- {
- return new Signal(getProcess(), Signal.Type.ENTER_EVENT);
- }
-
- /**
- * Get signal for exit
- */
- public Signal getExitSignal()
- {
- return new Signal(getProcess(), Signal.Type.EXIT_EVENT);
- }
}
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Executable.java (from rev 1599, api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Executable.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Executable.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Executable.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model;
+
+//$Id$
+
+/**
+ * A combined interface for execution aspects
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Executable
+{
+ /** Get the associated ExecutionHandler */
+ ExecutionHandler getExecutionHandler();
+
+ /** Get the default ExecutionHandler */
+ ExecutionHandler getDefaultExecutionHandler();
+
+ /** Get the associated SignalHandler */
+ SignalHandler getSignalHandler();
+
+ /** Get the default SignalHandler */
+ SignalHandler getDefaultSignalHandler();
+
+ /** Get the associated FlowHandler */
+ FlowHandler getFlowHandler();
+
+ /** Get the default FlowHandler */
+ FlowHandler getDefaultFlowHandler();
+}
\ No newline at end of file
Deleted: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutableFlowObject.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutableFlowObject.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutableFlowObject.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.model;
-
-import org.jboss.bpm.runtime.Token;
-
-//$Id$
-
-/**
- * Implement to make the FlowObject executable
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface ExecutableFlowObject
-{
- /**
- * 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
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java (from rev 1599, api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model;
+
+//$Id$
+
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * Implement to make the FlowObject executable
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+@XmlType(name = "ExecutionHandler")
+public abstract class ExecutionHandler extends Handler
+{
+ @XmlTransient
+ private ExecutionHandler delegate;
+
+ /**
+ * Execute this flow object
+ */
+ public void execute(Token token)
+ {
+ if (delegate == null)
+ {
+ delegate = newInstance(ExecutionHandler.class);
+ }
+ delegate.execute(token);
+ }
+}
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java (from rev 1599, api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -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.model;
+
+//$Id$
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * Implement to handle the outgoing Flows for an FlowObject
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+@XmlType(name = "FlowHandler")
+public abstract class FlowHandler extends Handler
+{
+ private FlowHandler delegate;
+
+ /**
+ * Transfer the token to the FlowHandler.
+ * <p/>
+ * The FlowHandler will add the active outgoing @{link Flow}s to
+ * @{link Token}'s flow queue.
+ */
+ public void transfer(Token token)
+ {
+ if (delegate == null)
+ {
+ delegate = newInstance(FlowHandler.class);
+ }
+ delegate.transfer(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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -30,6 +30,10 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.runtime.Token;
+
/**
* Gateways are modelling elements that are used to control how Sequence Flow interact as they converge and diverge within a Process.
* If the flow does not need to be controlled, then a Gateway is not needed.
@@ -38,8 +42,11 @@
* @since 08-Jul-2008
*/
@XmlType(name="Gateway")
-public abstract class Gateway extends AbstractGateway implements NamedFlowObject, ExecutableFlowObject
+public abstract class Gateway extends AbstractGateway implements NamedFlowObject, Executable
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(Gateway.class);
+
@XmlTransient
protected List<Flow> inFlows = new ArrayList<Flow>();
@@ -59,19 +66,7 @@
{
super(name);
}
-
- @Override
- public Signal getEnterSignal()
- {
- return new Signal(getProcess(), Signal.Type.ENTER_GATEWAY);
- }
- @Override
- public Signal getExitSignal()
- {
- return new Signal(getProcess(), Signal.Type.EXIT_GATEWAY);
- }
-
public void addOutFlow(Flow flow)
{
outFlows.add(flow);
@@ -86,4 +81,48 @@
{
this.inFlows.add(inFlow);
}
-}
\ No newline at end of file
+
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
+ {
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ List<Flow> outFlows = getOutFlows();
+ if (outFlows.size() == 1)
+ token.addTailFlow(outFlows.get(0));
+ }
+ };
+ }
+
+ public SignalHandler getDefaultSignalHandler()
+ {
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_GATEWAY);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_GATEWAY);
+ }
+ };
+ }
+
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
+ {
+ return new ExecutionHandler()
+ {
+ @Override
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in gateway: " + getName());
+ }
+ };
+ }
+ }
\ No newline at end of file
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Handler.java (from rev 1599, api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Handler.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Handler.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Handler.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -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;
+
+//$Id$
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.bpm.NotImplementedException;
+
+/**
+ * Implement to handle the outgoing Flows for an FlowObject
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+@XmlType(name = "Handler")
+public abstract class Handler
+{
+ @XmlElement(name = "class")
+ private String className;
+ @XmlElement(name = "bean")
+ private String beanRef;
+
+ @SuppressWarnings("unchecked")
+ protected <T> T newInstance(Class<T> clazz)
+ {
+ try
+ {
+ if (className != null)
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ return (T)ctxLoader.loadClass(className).newInstance();
+ }
+ else if (beanRef != null)
+ {
+ throw new NotImplementedException();
+ }
+ else
+ {
+ throw new IllegalStateException("There is no 'class' nor 'bean' attribute set for this handler");
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot instanciate the handler", ex);
+ }
+ }
+}
\ No newline at end of file
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -28,7 +28,11 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.runtime.Token;
+
// $Id$
/**
@@ -44,6 +48,9 @@
@XmlType(name="ItermediateEvent")
public class ItermediateEvent extends AbstractItermediateEvent
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(ItermediateEvent.class);
+
@XmlTransient
protected List<Flow> inFlows = new ArrayList<Flow>();
@@ -79,6 +86,50 @@
this.inFlows.add(inFlow);
}
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
+ {
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ List<Flow> outFlows = getOutFlows();
+ if (outFlows.size() == 1)
+ token.addTailFlow(outFlows.get(0));
+ }
+ };
+ }
+
+ public SignalHandler getDefaultSignalHandler()
+ {
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_EVENT);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_EVENT);
+ }
+ };
+ }
+
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
+ {
+ return new ExecutionHandler()
+ {
+ @Override
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in start-event");
+ }
+ };
+ }
+
public String toString()
{
return "ItermediateEvent[" + getName() + "]";
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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -35,7 +35,6 @@
import org.jboss.bpm.NameNotUniqueException;
import org.jboss.bpm.client.ExecutionManager;
import org.jboss.bpm.runtime.Attachments;
-import org.jboss.bpm.runtime.Token;
/**
* A Process is any Activity performed within a company or organization.
@@ -181,12 +180,6 @@
return processState;
}
- // Overwrite to prevent execution
- public void execute(Token token)
- {
- throw new IllegalStateException("A Process cannot get executed. Go through startProcess");
- }
-
/**
* Set the process state
*/
Copied: api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java (from rev 1599, api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java)
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java (rev 0)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model;
+
+import javax.xml.bind.annotation.XmlType;
+
+
+//$Id$
+
+/**
+ * Implement to get signals on enter and exit.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+@XmlType(name = "SignalHandler")
+public abstract class SignalHandler extends Handler
+{
+ private SignalHandler delegate;
+
+ /**
+ * Get signal for enter
+ */
+ public Signal getEnterSignal()
+ {
+ if (delegate == null)
+ {
+ delegate = newInstance(SignalHandler.class);
+ }
+ return delegate.getEnterSignal();
+ }
+
+ /**
+ * Get signal for exit
+ */
+ public Signal getExitSignal()
+ {
+ if (delegate == null)
+ {
+ delegate = newInstance(SignalHandler.class);
+ }
+ return delegate.getExitSignal();
+ }
+}
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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -23,8 +23,13 @@
//$Id$
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.runtime.Token;
+
/**
* A Start Event indicates where a particular Process will start.
*
@@ -37,6 +42,9 @@
@XmlType(name = "StartEvent")
public class StartEvent extends AbstractStartEvent
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(StartEvent.class);
+
/**
* Construct a StartEvent with a constant name: 'start'
* Note, this MUST NOT leak into the public API.
@@ -45,22 +53,48 @@
{
}
- /**
- * Get signal for enter
- */
- public Signal getEnterSignal()
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
{
- return new Signal(getProcess(), Signal.Type.ENTER_START_EVENT);
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ token.addTailFlow(getOutFlow());
+ }
+ };
}
- /**
- * Get signal for exit
- */
- public Signal getExitSignal()
+ public SignalHandler getDefaultSignalHandler()
{
- return new Signal(getProcess(), Signal.Type.EXIT_START_EVENT);
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_START_EVENT);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_START_EVENT);
+ }
+ };
}
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
+ {
+ return new ExecutionHandler()
+ {
+ @Override
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in start-event");
+ }
+ };
+ }
+
public String toString()
{
return "StartEvent[]";
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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -35,7 +35,7 @@
* @since 08-Jul-2008
*/
@XmlType(name="SubProcess")
-public class SubProcess extends AbstractSubProcess implements SingleInFlowSupport, ExecutableFlowObject
+public class SubProcess extends AbstractSubProcess implements SingleInFlowSupport, Executable
{
private Flow inFlow;
@@ -73,23 +73,47 @@
this.inFlow = inFlow;
}
- /** Get signal for enter */
- public Signal getEnterSignal()
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
{
- return new Signal(getProcess(), Signal.Type.ENTER_SUB_PROCESS, getName());
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ token.addTailFlow(getOutFlow());
+ }
+ };
}
- /** Get signal for exit */
- public Signal getExitSignal()
+ public SignalHandler getDefaultSignalHandler()
{
- return new Signal(getProcess(), Signal.Type.EXIT_SUB_PROCESS, getName());
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_SUB_PROCESS);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_SUB_PROCESS);
+ }
+ };
}
- public void execute(Token token)
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
{
- startProcess(token.getExecutionContext());
+ return new ExecutionHandler()
+ {
+ @Override
+ public void execute(Token token)
+ {
+ startProcess(token.getExecutionContext());
+ }
+ };
}
-
public String toString()
{
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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -24,6 +24,8 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.runtime.Token;
//$Id$
@@ -38,8 +40,11 @@
* @since 08-Jul-2008
*/
@XmlType(name = "Task")
-public class Task extends AbstractTask implements SingleInFlowSupport, ExecutableFlowObject
+public class Task extends AbstractTask implements SingleInFlowSupport, Executable
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(Task.class);
+
private Flow inFlow;
/**
@@ -76,25 +81,52 @@
this.inFlow = inFlow;
}
- /** Get signal for enter */
- public Signal getEnterSignal()
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
{
- return new Signal(getProcess(), Signal.Type.ENTER_TASK, getName());
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ token.addTailFlow(getOutFlow());
+ }
+ };
}
- /** Get signal for exit */
- public Signal getExitSignal()
+ @XmlTransient
+ public SignalHandler getDefaultSignalHandler()
{
- return new Signal(getProcess(), Signal.Type.EXIT_TASK, getName());
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_TASK);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_TASK);
+ }
+ };
}
- public void execute(Token token)
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
{
- throw new IllegalStateException("Overwrite to impolement the task");
+ return new ExecutionHandler()
+ {
+ @Override
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in task: " + getName());
+ }
+ };
}
public String toString()
{
return "Task[" + getName() + "]";
}
+
}
\ 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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -23,6 +23,10 @@
//$Id$
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import org.jboss.bpm.model.Flow;
import org.jboss.bpm.model.Process;
/**
@@ -37,11 +41,48 @@
* @author Thomas.Diesler(a)jboss.com
* @since 20-Apr-2007
*/
-public interface Token
+public class Token
{
- /** Get the associated execution context */
- ExecutionContext getExecutionContext();
+ private Process proc;
+ private ExecutionContext context;
+ private Queue<Flow> flowQueue = new ConcurrentLinkedQueue<Flow>();
- /** Get the current process */
- Process getProcess();
+ public Token(Process proc, Attachments att)
+ {
+ this.proc = proc;
+ this.context = new InitialContext(att);
+ }
+
+ public Process getProcess()
+ {
+ return proc;
+ }
+
+ public ExecutionContext getExecutionContext()
+ {
+ return context;
+ }
+
+ public Flow peekHeadFlow()
+ {
+ return flowQueue.peek();
+ }
+
+ public Flow removeHeadFlow()
+ {
+ return flowQueue.remove();
+ }
+
+ public void addTailFlow(Flow flow)
+ {
+ flowQueue.add(flow);
+ }
+
+ static class InitialContext extends BasicAttachments implements ExecutionContext
+ {
+ InitialContext(Attachments att)
+ {
+ super(att);
+ }
+ }
}
\ No newline at end of file
Deleted: 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 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractToken.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.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
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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -24,6 +24,9 @@
// $Id$
import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import junit.framework.TestCase;
@@ -31,14 +34,18 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.JBPMException;
import org.jboss.bpm.client.internal.EmbeddedBeansDeployer;
+import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.runtime.SignalListener;
-public abstract class AbstractAPITestCase extends TestCase
+public abstract class AbstractAPITestCase extends TestCase implements SignalListener
{
// provide logging
private static final Log log = LogFactory.getLog(AbstractAPITestCase.class);
// Every test case has a deployer
private EmbeddedBeansDeployer deployer;
+ // The signals caught by this test case
+ private List<Signal> signals = new ArrayList<Signal>();
/** Overwrite to provide beans config */
protected abstract String getBeansConfig();
@@ -50,6 +57,7 @@
log.debug("setUp: " + getName());
deployer = new EmbeddedBeansDeployer();
deployTestBeans(getBeansConfig());
+ signals.clear();
}
@Override
@@ -94,4 +102,14 @@
return url;
}
+ public void catchSignal(Signal signal)
+ {
+ signals.add(signal);
+ log.debug("catchSignal: " + signal);
+ }
+
+ public List<Signal> getCaughtSignals()
+ {
+ return Collections.unmodifiableList(signals);
+ }
}
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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -23,44 +23,13 @@
// $Id$
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.runtime.SignalListener;
-public abstract class DefaultEngineTestCase extends AbstractAPITestCase implements SignalListener
+public abstract class DefaultEngineTestCase extends AbstractAPITestCase
{
- // provide logging
- private static final Log log = LogFactory.getLog(DefaultEngineTestCase.class);
-
- private List<Signal> signals = new ArrayList<Signal>();
-
@Override
protected String getBeansConfig()
{
return ProcessEngine.JBPM_ENGINE_CONFIG;
}
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- signals.clear();
- }
-
- public void catchSignal(Signal signal)
- {
- signals.add(signal);
- log.debug("catchSignal: " + signal);
- }
-
- public List<Signal> getCaughtSignals()
- {
- return Collections.unmodifiableList(signals);
- }
}
Modified: api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java
===================================================================
--- api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -26,6 +26,7 @@
import java.io.Reader;
import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.jboss.bpm.model.ObjectFactory;
@@ -39,7 +40,7 @@
*/
public class ProcessUnmarshaller
{
- public Process unmarshallProcess(Reader xml) throws Exception
+ public Process unmarshallProcess(Reader xml) throws JAXBException
{
JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
Deleted: api/trunk/modules/api/src/test/java/org/jboss/bpm/AbstractMockEngineTestCase.java
===================================================================
--- api/trunk/modules/api/src/test/java/org/jboss/bpm/AbstractMockEngineTestCase.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/AbstractMockEngineTestCase.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm;
-
-//$Id$
-
-import org.jboss.bpm.test.AbstractAPITestCase;
-
-public abstract class AbstractMockEngineTestCase extends AbstractAPITestCase
-{
-
- @Override
- protected String getBeansConfig()
- {
- return "jbpm-mock-beans.xml";
- }
-
-}
Copied: api/trunk/modules/api/src/test/java/org/jboss/bpm/MockEngineTestCase.java (from rev 1599, api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/MockEngineTestCase.java)
===================================================================
--- api/trunk/modules/api/src/test/java/org/jboss/bpm/MockEngineTestCase.java (rev 0)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/MockEngineTestCase.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -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;
+
+//$Id$
+
+import org.jboss.bpm.test.AbstractAPITestCase;
+
+public abstract class MockEngineTestCase extends AbstractAPITestCase
+{
+
+ @Override
+ protected String getBeansConfig()
+ {
+ return "jbpm-mock-beans.xml";
+ }
+
+}
Deleted: 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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/client/MockProcessEngine.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.client;
-
-//$Id$
-
-/**
- * A process engine with public access
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class MockProcessEngine extends ProcessEngine
-{
-
-}
\ 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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/client/ProcessEngineLocatorTest.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -23,9 +23,9 @@
// $Id$
-import org.jboss.bpm.AbstractMockEngineTestCase;
+import org.jboss.bpm.MockEngineTestCase;
-public class ProcessEngineLocatorTest extends AbstractMockEngineTestCase
+public class ProcessEngineLocatorTest extends MockEngineTestCase
{
public void testLocateProcessEngine() throws Exception
Modified: api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
===================================================================
--- api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -51,7 +51,7 @@
marshaller.marshallProcess(inProc, strwr);
String xml = strwr.toString();
- //System.out.println(xml);
+ System.out.println(xml);
ProcessUnmarshaller unmarshaller = new ProcessUnmarshaller();
Process outProc = unmarshaller.unmarshallProcess(new StringReader(xml));
Copied: api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern (from rev 1599, api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/pattern)
Copied: api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence (from rev 1599, api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/pattern/sequence)
Deleted: api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java
===================================================================
--- api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java 2008-07-13 13:23:02 UTC (rev 1599)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -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.pattern.sequence;
-
-// $Id$
-
-import java.util.List;
-import java.util.concurrent.Future;
-
-import org.jboss.bpm.MockEngineTestCase;
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.ProcessBuilder;
-import org.jboss.bpm.model.Result;
-import org.jboss.bpm.model.Signal;
-
-/**
- * Test the basic execution sequence
- *
- * @author thomas.diesler(a)jboss.com
- * @since 03-Jul-2008
- */
-public class SequenceTest extends MockEngineTestCase
-{
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- SignalManager em = SignalManager.locateSignalManager();
- em.addListener(getName(), this);
- }
-
- /**
- * Test a basic sequence
- */
- public void testBasicSequence() throws Exception
- {
- Process proc = new ProcessBuilder(getName()).addStartEvent().addSequenceFlow("task").addTask("task").
- addSequenceFlow("end").addEndEvent("end").getProcess();
-
- // Create a Process through the ProcessManager
- ProcessManager pm = ProcessManager.locateProcessManager();
- pm.registerProcess(proc);
-
- // 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(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
- assertEquals(Signal.Type.ENTER_START_EVENT, signals.get(1).getType());
- assertEquals(Signal.Type.EXIT_START_EVENT, signals.get(2).getType());
- assertEquals(Signal.Type.ENTER_TASK, signals.get(3).getType());
- assertEquals(Signal.Type.EXIT_TASK, signals.get(4).getType());
- assertEquals(Signal.Type.ENTER_END_EVENT, signals.get(5).getType());
- assertEquals(Signal.Type.EXIT_END_EVENT, signals.get(6).getType());
- assertEquals(Signal.Type.EXIT_PROCESS, signals.get(7).getType());
- }
-}
Copied: api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java (from rev 1599, api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java)
===================================================================
--- api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java (rev 0)
+++ api/trunk/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -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.pattern.sequence;
+
+// $Id$
+
+import java.util.List;
+import java.util.concurrent.Future;
+
+import org.jboss.bpm.MockEngineTestCase;
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.Result;
+import org.jboss.bpm.model.Signal;
+
+/**
+ * Test the basic execution sequence
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 03-Jul-2008
+ */
+public class SequenceTest extends MockEngineTestCase
+{
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ SignalManager em = SignalManager.locateSignalManager();
+ em.addListener(getName(), this);
+ }
+
+ /**
+ * Test a basic sequence
+ */
+ public void testBasicSequence() throws Exception
+ {
+ Process proc = new ProcessBuilder(getName()).addStartEvent().addSequenceFlow("task").addTask("task").
+ addSequenceFlow("end").addEndEvent("end").getProcess();
+
+ // Create a Process through the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ pm.registerProcess(proc);
+
+ // 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(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
+ assertEquals(Signal.Type.ENTER_START_EVENT, signals.get(1).getType());
+ assertEquals(Signal.Type.EXIT_START_EVENT, signals.get(2).getType());
+ assertEquals(Signal.Type.ENTER_TASK, signals.get(3).getType());
+ assertEquals(Signal.Type.EXIT_TASK, signals.get(4).getType());
+ assertEquals(Signal.Type.ENTER_END_EVENT, signals.get(5).getType());
+ assertEquals(Signal.Type.EXIT_END_EVENT, signals.get(6).getType());
+ assertEquals(Signal.Type.EXIT_PROCESS, signals.get(7).getType());
+ }
+}
Modified: api/trunk/modules/api/src/test/resources/jbpm-mock-beans.xml
===================================================================
--- api/trunk/modules/api/src/test/resources/jbpm-mock-beans.xml 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/api/src/test/resources/jbpm-mock-beans.xml 2008-07-13 13:29:02 UTC (rev 1601)
@@ -3,8 +3,26 @@
<!-- The Kernel Locator -->
<bean name="KernelLocator" class="org.jboss.kernel.plugins.util.KernelLocator"/>
- <!-- The BPM Process Engine -->
- <bean name="jBPMProcessEngine" class="org.jboss.bpm.client.MockProcessEngine">
+ <!-- The process engine -->
+ <bean name="jBPMProcessEngine" class="org.jboss.bpm.client.internal.ProcessEngineImpl">
+ <property name="processManager"><inject bean="jBPMProcessManager"/></property>
+ <property name="executionManager"><inject bean="jBPMExecutionManager"/></property>
+ <property name="signalManager"><inject bean="jBPMSignalManager"/></property>
</bean>
+
+ <!-- The process manager -->
+ <bean name="jBPMProcessManager" class="org.jboss.bpm.client.internal.ProcessManagerImpl">
+ <property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
+ </bean>
+
+ <!-- The execution manager -->
+ <bean name="jBPMExecutionManager" class="org.jboss.bpm.client.internal.ExecutionManagerImpl">
+ <property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
+ </bean>
+
+ <!-- The execution manager -->
+ <bean name="jBPMSignalManager" class="org.jboss.bpm.client.internal.SignalManagerImpl">
+ <property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
+ </bean>
</deployment>
\ No newline at end of file
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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -72,7 +72,7 @@
// Verify context variables
Attachments att = result.getAttachments();
String msg = att.getAttachment(String.class, "TaskMessage");
- assertEquals("stateA has: [[org.jboss.bpm.samples.context.ContextValue,null]]", msg);
+ assertEquals("TaskA has: [[org.jboss.bpm.samples.context.ContextValue,null]]", msg);
// Validate original attachement
ContextValue att1 = att.getAttachment(ContextValue.class);
Modified: 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 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -23,7 +23,7 @@
// $Id$
-import org.jboss.bpm.model.Task;
+import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.runtime.ExecutionContext;
import org.jboss.bpm.runtime.Token;
@@ -33,13 +33,13 @@
* @author Thomas.Diesler(a)jboss.com
* @since 04-Jul-2008
*/
-public class TaskA extends Task
+public class TaskA extends ExecutionHandler
{
@Override
public void execute(Token token)
{
ExecutionContext ctx = token.getExecutionContext();
- ctx.addAttachment(String.class, "TaskMessage", getName() + " has: " + ctx.getAttachmentKeys());
+ ctx.addAttachment(String.class, "TaskMessage", "TaskA has: " + ctx.getAttachmentKeys());
ctx.addAttachment(ContextValue.class, "TaskAttachment", new ContextValue("bar"));
}
}
Modified: 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/sequence/BasicSequenceTest.java 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -72,13 +72,13 @@
// 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());
+ assertEquals(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
+ assertEquals(Signal.Type.ENTER_START_EVENT, signals.get(1).getType());
+ assertEquals(Signal.Type.EXIT_START_EVENT, signals.get(2).getType());
+ assertEquals(Signal.Type.ENTER_TASK, signals.get(3).getType());
+ assertEquals(Signal.Type.EXIT_TASK, signals.get(4).getType());
+ assertEquals(Signal.Type.ENTER_END_EVENT, signals.get(5).getType());
+ assertEquals(Signal.Type.EXIT_END_EVENT, signals.get(6).getType());
+ assertEquals(Signal.Type.EXIT_PROCESS, signals.get(7).getType());
}
}
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-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -72,17 +72,17 @@
assertNotNull("Result expected", result);
Attachments att = result.getAttachments();
assertEquals("Attachments expected", 1, att.getAttachmentKeys().size());
- assertEquals("Task: stateA", att.getAttachment(String.class));
+ assertEquals("Task: TaskA", 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());
+ assertEquals(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
+ assertEquals(Signal.Type.ENTER_START_EVENT, signals.get(1).getType());
+ assertEquals(Signal.Type.EXIT_START_EVENT, signals.get(2).getType());
+ assertEquals(Signal.Type.ENTER_TASK, signals.get(3).getType());
+ assertEquals(Signal.Type.EXIT_TASK, signals.get(4).getType());
+ assertEquals(Signal.Type.ENTER_END_EVENT, signals.get(5).getType());
+ assertEquals(Signal.Type.EXIT_END_EVENT, signals.get(6).getType());
+ assertEquals(Signal.Type.EXIT_PROCESS, signals.get(7).getType());
}
}
Modified: 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 2008-07-13 13:27:59 UTC (rev 1600)
+++ api/trunk/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java 2008-07-13 13:29:02 UTC (rev 1601)
@@ -23,7 +23,7 @@
// $Id$
-import org.jboss.bpm.model.Task;
+import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.runtime.ExecutionContext;
import org.jboss.bpm.runtime.Token;
@@ -33,12 +33,12 @@
* @author Thomas.Diesler(a)jboss.com
* @since 04-Jul-2008
*/
-public class TaskA extends Task
+public class TaskA extends ExecutionHandler
{
@Override
public void execute(Token token)
{
ExecutionContext ctx = token.getExecutionContext();
- ctx.addAttachment(String.class, "Task: " + getName());
+ ctx.addAttachment(String.class, "Task: TaskA");
}
}
17 years, 9 months
JBoss JBPM SVN: r1600 - in jbpm3/trunk/modules/jpdl/core/src/main: java/org/jbpm/graph/node and 4 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-13 09:27:59 -0400 (Sun, 13 Jul 2008)
New Revision: 1600
Removed:
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/runtime/TokenImpl.java
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/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/ProcessManagerImpl.java
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/StartEventImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java
jbpm3/trunk/modules/jpdl/core/src/main/resources/jbpm-beans.xml
Log:
Provide an implementation of an ExecutionManager
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-13 13:23:02 UTC (rev 1599)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/def/Node.java 2008-07-13 13:27:59 UTC (rev 1600)
@@ -32,17 +32,11 @@
import java.util.Set;
import org.dom4j.Element;
-import org.jboss.bpm.model.ExecutableFlowObject;
-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;
@@ -382,9 +376,6 @@
*/
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)
{
@@ -410,22 +401,6 @@
}
}
- // 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(getName());
- if (fo == null)
- throw new IllegalStateException("Cannot find flow object: " + getName());
-
- TokenImpl token = new TokenImpl(proc, ctxInst);
- ((ExecutableFlowObject)fo).execute(token);
- }
- }
-
/**
* called by the implementation of this node to continue execution over the default transition.
*/
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-13 13:23:02 UTC (rev 1599)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/node/EndState.java 2008-07-13 13:27:59 UTC (rev 1600)
@@ -66,9 +66,6 @@
{
executionContext.getToken().end();
}
-
- // Call execute on an API FlowObject
- callExecutableFlowObject(executionContext);
}
public Transition addLeavingTransition(Transition t)
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-13 13:23:02 UTC (rev 1599)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/graph/node/State.java 2008-07-13 13:27:59 UTC (rev 1600)
@@ -22,7 +22,6 @@
package org.jbpm.graph.node;
import org.jbpm.graph.def.Node;
-import org.jbpm.graph.exe.ExecutionContext;
public class State extends Node
{
@@ -37,10 +36,4 @@
{
super(name);
}
-
- 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/ExecutionManagerImpl.java
===================================================================
--- jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ExecutionManagerImpl.java 2008-07-13 13:23:02 UTC (rev 1599)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ExecutionManagerImpl.java 2008-07-13 13:27:59 UTC (rev 1600)
@@ -1,81 +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.concurrent.Future;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.client.ExecutionManager;
-import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.client.internal.InitialToken;
-import org.jboss.bpm.model.ExecutableFlowObject;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.Result;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.runtime.Attachments;
-import org.jboss.bpm.runtime.Token;
-import org.jbpm.graph.exe.Execution;
-import org.jbpm.integration.model.StartEventImpl;
-
-/**
- * The process manager is the entry point to create, find and otherwise manage processes.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class ExecutionManagerImpl extends ExecutionManager
-{
- // provide logging
- private static final Log log = LogFactory.getLog(ExecutionManagerImpl.class);
-
- public void setProcessEngine(ProcessEngine engine)
- {
- this.engine = engine;
- }
-
- public Future<Result> startProcess(Process proc, Attachments att)
- {
- throwSignal(new Signal(proc, Signal.Type.ENTER_PROCESS));
- try
- {
- // Repeatetly signal the Execution until we reach the end
- StartEventImpl start = (StartEventImpl)proc.getStartEvent();
-
- Token token = new InitialToken(proc, att);
- start.execute(token);
-
- Execution oldEx = start.getExecution();
- while (oldEx.getRootToken().hasEnded() == false)
- {
- oldEx.signal();
- }
- }
- finally
- {
- throwSignal(new Signal(proc, Signal.Type.EXIT_PROCESS));
- }
- return new ResultFuture(proc);
- }
-}
\ No newline at end of file
Modified: 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 2008-07-13 13:23:02 UTC (rev 1599)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/client/ProcessManagerImpl.java 2008-07-13 13:27:59 UTC (rev 1600)
@@ -60,9 +60,8 @@
{
throw new InvalidProcessException(ex);
}
- Process pdef = ProcessAdapter.buildProcess(oldPD);
- addProcess(pdef);
- return pdef;
+ Process proc = ProcessAdapter.buildProcess(oldPD);
+ return proc;
}
@Override
@@ -77,8 +76,7 @@
{
throw new InvalidProcessException(ex);
}
- Process pdef = ProcessAdapter.buildProcess(oldPD);
- addProcess(pdef);
- return pdef;
+ Process proc = ProcessAdapter.buildProcess(oldPD);
+ return proc;
}
}
Modified: 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 2008-07-13 13:23:02 UTC (rev 1599)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/EndEventImpl.java 2008-07-13 13:27:59 UTC (rev 1600)
@@ -23,10 +23,8 @@
//$Id$
-import org.jboss.bpm.client.SignalManager;
import org.jboss.bpm.model.EndEvent;
import org.jboss.bpm.model.Process;
-import org.jboss.bpm.runtime.Token;
import org.jbpm.graph.def.Node;
/**
@@ -53,19 +51,4 @@
{
oldNode.setName(name);
}
-
- @Override
- public void execute(Token token)
- {
- SignalManager sm = SignalManager.locateSignalManager();
- sm.throwSignal(getEnterSignal());
- try
- {
- super.execute(token);
- }
- finally
- {
- sm.throwSignal(getExitSignal());
- }
- }
}
Modified: 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 2008-07-13 13:23:02 UTC (rev 1599)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/ProcessAdapter.java 2008-07-13 13:27:59 UTC (rev 1600)
@@ -27,6 +27,7 @@
import java.util.List;
import org.jboss.bpm.InvalidProcessException;
+import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.MultipleOutFlowSupport;
import org.jboss.bpm.model.Process;
@@ -79,7 +80,7 @@
}
else if (oldNode instanceof State)
{
- Task delegate = null;
+ ExecutionHandler delegate = null;
Event event = oldNode.getEvent(Event.EVENTTYPE_NODE_ENTER);
if (event != null)
{
@@ -91,10 +92,10 @@
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");
+ if (obj instanceof ExecutionHandler == false)
+ throw new InvalidProcessException("Node action is not of type ExecutionHandler");
- delegate = (Task)obj;
+ delegate = (ExecutionHandler)obj;
}
flowObject = new TaskImpl(apiProc, oldNode, delegate);
initTranstions(flowObject, oldNode);
Modified: 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 2008-07-13 13:23:02 UTC (rev 1599)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/StartEventImpl.java 2008-07-13 13:27:59 UTC (rev 1600)
@@ -23,14 +23,9 @@
//$Id$
-import org.jboss.bpm.client.SignalManager;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.StartEvent;
-import org.jboss.bpm.runtime.Token;
-import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.def.Node;
-import org.jbpm.graph.exe.Execution;
-import org.jbpm.integration.runtime.ExecutionContextImpl;
/**
* TODO
@@ -41,32 +36,9 @@
public class StartEventImpl extends StartEvent
{
private Node oldNode;
- private Execution oldEx;
StartEventImpl(Process proc, Node oldNode)
{
this.oldNode = oldNode;
}
-
- public Execution getExecution()
- {
- return oldEx;
- }
-
- public void execute(Token token)
- {
- SignalManager sm = SignalManager.locateSignalManager();
- sm.throwSignal(getEnterSignal());
- try
- {
- this.oldEx = new Execution(oldNode.getProcessDefinition());
- ContextInstance ctxInst = oldEx.getContextInstance();
- new ExecutionContextImpl(ctxInst).copyAttachments(token.getExecutionContext());
- ctxInst.setTransientVariable(Process.class.getName(), getProcess());
- }
- finally
- {
- sm.throwSignal(getExitSignal());
- }
- }
}
Modified: 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 2008-07-13 13:23:02 UTC (rev 1599)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/model/TaskImpl.java 2008-07-13 13:27:59 UTC (rev 1600)
@@ -23,10 +23,9 @@
//$Id$
-import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Task;
-import org.jboss.bpm.runtime.Token;
import org.jbpm.graph.def.Node;
/**
@@ -38,24 +37,13 @@
public class TaskImpl extends Task
{
private Node oldNode;
- private Task delegate;
-
- TaskImpl(Process proc, Node oldNode, Task task)
+
+ TaskImpl(Process proc, Node oldNode, ExecutionHandler handler)
{
this.oldNode = oldNode;
- this.delegate = task;
+ setExecutionHandler(handler);
}
- protected void initialize(Process proc)
- {
- super.initialize(proc);
- if (delegate != null)
- {
- delegate.setProcess(proc);
- delegate.setName(getName());
- }
- }
-
public String getName()
{
return oldNode.getName();
@@ -65,21 +53,4 @@
{
oldNode.setName(name);
}
-
- public void execute(Token token)
- {
- SignalManager sm = SignalManager.locateSignalManager();
- sm.throwSignal(getEnterSignal());
- try
- {
- if (delegate != null)
- {
- delegate.execute(token);
- }
- }
- finally
- {
- sm.throwSignal(getExitSignal());
- }
- }
}
Deleted: 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 2008-07-13 13:23:02 UTC (rev 1599)
+++ jbpm3/trunk/modules/jpdl/core/src/main/java/org/jbpm/integration/runtime/TokenImpl.java 2008-07-13 13:27:59 UTC (rev 1600)
@@ -1,57 +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.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);
- }
-}
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-13 13:23:02 UTC (rev 1599)
+++ jbpm3/trunk/modules/jpdl/core/src/main/resources/jbpm-beans.xml 2008-07-13 13:27:59 UTC (rev 1600)
@@ -17,7 +17,7 @@
</bean>
<!-- The execution manager -->
- <bean name="jBPMExecutionManager" class="org.jbpm.integration.client.ExecutionManagerImpl">
+ <bean name="jBPMExecutionManager" class="org.jboss.bpm.client.internal.ExecutionManagerImpl">
<property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
</bean>
17 years, 9 months
JBoss JBPM SVN: r1599 - in api/branches/tdiesler: docs/VioletUML and 16 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-13 09:23:02 -0400 (Sun, 13 Jul 2008)
New Revision: 1599
Added:
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Handler.java
api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/MockEngineTestCase.java
api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/pattern/
api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/
api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java
Removed:
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/InitialToken.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractToken.java
api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/AbstractMockEngineTestCase.java
api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/client/MockProcessEngine.java
Modified:
api/branches/tdiesler/.classpath
api/branches/tdiesler/docs/VioletUML/APIExecution.png
api/branches/tdiesler/docs/VioletUML/APIExecution.seq.violet
api/branches/tdiesler/docs/VioletUML/APIModel.class.violet
api/branches/tdiesler/docs/VioletUML/APIModel.png
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Event.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Executable.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Process.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Task.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java
api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/client/ProcessEngineLocatorTest.java
api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
api/branches/tdiesler/modules/api/src/test/resources/jbpm-mock-beans.xml
api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java
api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java
api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java
api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
Log:
wip
Modified: api/branches/tdiesler/.classpath
===================================================================
--- api/branches/tdiesler/.classpath 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/.classpath 2008-07-13 13:23:02 UTC (rev 1599)
@@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="src" output="modules/api/target/classes" path="modules/api/src/main/java"/>
<classpathentry kind="src" output="modules/api/target/test-classes" path="modules/api/src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="modules/api/target/classes" path="modules/api/src/main/resources"/>
<classpathentry excluding="**" kind="src" output="modules/api/target/test-classes" path="modules/api/src/test/resources"/>
<classpathentry kind="src" output="modules/testsuite/target/test-classes" path="modules/testsuite/src/test/java"/>
<classpathentry excluding="**" kind="src" output="modules/testsuite/target/test-classes" path="modules/testsuite/src/test/resources"/>
Modified: api/branches/tdiesler/docs/VioletUML/APIExecution.png
===================================================================
(Binary files differ)
Modified: api/branches/tdiesler/docs/VioletUML/APIExecution.seq.violet
===================================================================
--- api/branches/tdiesler/docs/VioletUML/APIExecution.seq.violet 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/docs/VioletUML/APIExecution.seq.violet 2008-07-13 13:23:02 UTC (rev 1599)
@@ -20,26 +20,26 @@
<object id="ActivationBarNode0" class="com.horstmann.violet.CallNode">
<void method="addChild">
<object id="ActivationBarNode1" class="com.horstmann.violet.CallNode">
- <void property="implicitParameter">
- <object id="LifelineNode1" class="com.horstmann.violet.ImplicitParameterNode">
- <void property="name">
- <void property="text">
- <string>Token</string>
- </void>
+ <void method="addChild">
+ <object id="ActivationBarNode2" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object id="LifelineNode1" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>Token</string>
+ </void>
+ </void>
+ </object>
</void>
</object>
</void>
- </object>
- </void>
- <void method="addChild">
- <object id="ActivationBarNode2" class="com.horstmann.violet.CallNode">
- <void property="implicitParameter">
- <object idref="LifelineNode1"/>
+ <void method="addChild">
+ <object id="ActivationBarNode3" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode1"/>
+ </void>
+ </object>
</void>
- </object>
- </void>
- <void method="addChild">
- <object id="ActivationBarNode3" class="com.horstmann.violet.CallNode">
<void method="addChild">
<object id="ActivationBarNode4" class="com.horstmann.violet.CallNode">
<void property="implicitParameter">
@@ -77,21 +77,35 @@
<void method="addChild">
<object id="ActivationBarNode7" class="com.horstmann.violet.CallNode">
<void property="implicitParameter">
+ <object id="LifelineNode4" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>Execution
+Handler</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode8" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
<object idref="LifelineNode3"/>
</void>
</object>
</void>
<void method="addChild">
- <object id="ActivationBarNode8" class="com.horstmann.violet.CallNode">
+ <object id="ActivationBarNode9" class="com.horstmann.violet.CallNode">
<void method="addChild">
- <object id="ActivationBarNode9" class="com.horstmann.violet.CallNode">
+ <object id="ActivationBarNode10" class="com.horstmann.violet.CallNode">
<void property="implicitParameter">
<object idref="LifelineNode1"/>
</void>
</object>
</void>
<void property="implicitParameter">
- <object id="LifelineNode4" class="com.horstmann.violet.ImplicitParameterNode">
+ <object id="LifelineNode5" class="com.horstmann.violet.ImplicitParameterNode">
<void property="name">
<void property="text">
<string>FlowHandler</string>
@@ -102,7 +116,7 @@
</object>
</void>
<void method="addChild">
- <object id="ActivationBarNode10" class="com.horstmann.violet.CallNode">
+ <object id="ActivationBarNode11" class="com.horstmann.violet.CallNode">
<void property="implicitParameter">
<object idref="LifelineNode1"/>
</void>
@@ -112,7 +126,7 @@
</object>
</void>
<void property="implicitParameter">
- <object id="LifelineNode5" class="com.horstmann.violet.ImplicitParameterNode">
+ <object id="LifelineNode6" class="com.horstmann.violet.ImplicitParameterNode">
<void property="name">
<void property="text">
<string>Execution
@@ -138,10 +152,10 @@
</object>
</void>
<void method="addNode">
- <object idref="LifelineNode5"/>
+ <object idref="LifelineNode6"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>199.0</double>
+ <double>230.0</double>
<double>0.0</double>
</void>
</object>
@@ -150,16 +164,16 @@
<object idref="LifelineNode3"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>562.0</double>
+ <double>561.0</double>
<double>0.0</double>
</void>
</object>
</void>
<void method="addNode">
- <object idref="LifelineNode4"/>
+ <object idref="LifelineNode5"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>690.0</double>
+ <double>782.0</double>
<double>0.0</double>
</void>
</object>
@@ -168,7 +182,7 @@
<object idref="LifelineNode1"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>315.0</double>
+ <double>343.0</double>
<double>0.0</double>
</void>
</object>
@@ -177,34 +191,16 @@
<object idref="ActivationBarNode1"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>347.0</double>
+ <double>262.0</double>
<double>103.0</double>
</void>
</object>
</void>
<void method="addNode">
- <object idref="ActivationBarNode2"/>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>347.0</double>
- <double>156.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
- <object idref="ActivationBarNode3"/>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>231.0</double>
- <double>209.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
<object idref="ActivationBarNode4"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>347.0</double>
+ <double>375.0</double>
<double>232.0</double>
</void>
</object>
@@ -213,7 +209,7 @@
<object idref="LifelineNode2"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>435.0</double>
+ <double>455.0</double>
<double>0.0</double>
</void>
</object>
@@ -222,70 +218,61 @@
<object idref="ActivationBarNode5"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>467.0</double>
+ <double>487.0</double>
<double>285.0</double>
</void>
</object>
</void>
<void method="addNode">
- <object idref="ActivationBarNode6"/>
+ <object idref="ActivationBarNode8"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>594.0</double>
- <double>338.0</double>
+ <double>593.0</double>
+ <double>444.0</double>
</void>
</object>
</void>
<void method="addNode">
- <object idref="ActivationBarNode7"/>
+ <object idref="ActivationBarNode9"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>594.0</double>
- <double>391.0</double>
+ <double>814.0</double>
+ <double>497.0</double>
</void>
</object>
</void>
<void method="addNode">
- <object idref="ActivationBarNode8"/>
+ <object idref="ActivationBarNode10"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>722.0</double>
- <double>444.0</double>
+ <double>375.0</double>
+ <double>520.0</double>
</void>
</object>
</void>
<void method="addNode">
- <object idref="ActivationBarNode9"/>
+ <object idref="ActivationBarNode11"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>347.0</double>
- <double>467.0</double>
+ <double>375.0</double>
+ <double>593.0</double>
</void>
</object>
</void>
<void method="addNode">
- <object idref="ActivationBarNode10"/>
- <object class="java.awt.geom.Point2D$Double">
- <void method="setLocation">
- <double>347.0</double>
- <double>540.0</double>
- </void>
- </object>
- </void>
- <void method="addNode">
<object id="NoteNode0" class="com.horstmann.violet.NoteNode">
<void property="text">
<void property="text">
- <string>The FlowHandler adds all active
-outgoing Flows to the FlowQueue
-in the Token</string>
+ <string>The FlowHandler adds all
+active outgoing Flows to the
+FlowQueue in the Token</string>
</void>
</void>
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>758.0</double>
- <double>154.0</double>
+ <double>831.0</double>
+ <double>352.0</double>
</void>
</object>
</void>
@@ -293,8 +280,8 @@
<object id="PointNode0" class="com.horstmann.violet.PointNode">
<void id="Rectangle2D$Double0" property="bounds">
<void method="setRect">
- <double>758.0</double>
- <double>59.0</double>
+ <double>822.0</double>
+ <double>521.0</double>
<double>0.0</double>
<double>0.0</double>
</void>
@@ -305,12 +292,33 @@
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>758.0</double>
- <double>59.0</double>
+ <double>822.0</double>
+ <double>521.0</double>
</void>
</object>
</void>
<void method="addNode">
+ <object id="PointNode1" class="com.horstmann.violet.PointNode">
+ <void id="Rectangle2D$Double1" property="bounds">
+ <void method="setRect">
+ <double>270.0</double>
+ <double>593.0</double>
+ <double>0.0</double>
+ <double>0.0</double>
+ </void>
+ </void>
+ <void property="bounds">
+ <object idref="Rectangle2D$Double1"/>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>270.0</double>
+ <double>593.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
<object id="NoteNode1" class="com.horstmann.violet.NoteNode">
<void property="text">
<void property="text">
@@ -323,66 +331,85 @@
</object>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>762.0</double>
- <double>354.0</double>
+ <double>96.0</double>
+ <double>429.0</double>
</void>
</object>
</void>
<void method="addNode">
- <object id="PointNode1" class="com.horstmann.violet.PointNode">
- <void id="Rectangle2D$Double1" property="bounds">
- <void method="setRect">
- <double>738.0</double>
- <double>466.0</double>
- <double>0.0</double>
- <double>0.0</double>
- </void>
+ <object idref="LifelineNode4"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>670.0</double>
+ <double>0.0</double>
</void>
- <void property="bounds">
- <object idref="Rectangle2D$Double1"/>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode6"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>593.0</double>
+ <double>338.0</double>
</void>
</object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode7"/>
<object class="java.awt.geom.Point2D$Double">
<void method="setLocation">
- <double>738.0</double>
- <double>466.0</double>
+ <double>702.0</double>
+ <double>391.0</double>
</void>
</object>
</void>
- <void method="connect">
- <object class="com.horstmann.violet.CallEdge">
- <void property="middleLabel">
- <string>create</string>
+ <void method="addNode">
+ <object idref="ActivationBarNode2"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>375.0</double>
+ <double>126.0</double>
</void>
</object>
- <object idref="ActivationBarNode0"/>
- <object idref="ActivationBarNode1"/>
</void>
- <void method="connect">
- <object class="com.horstmann.violet.CallEdge">
- <void property="middleLabel">
- <string>queueFlow</string>
+ <void method="addNode">
+ <object class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode0"/>
</void>
</object>
- <object idref="ActivationBarNode0"/>
- <object idref="ActivationBarNode2"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>69.0</double>
+ <double>753.0</double>
+ </void>
+ </object>
</void>
+ <void method="addNode">
+ <object idref="ActivationBarNode3"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>375.0</double>
+ <double>179.0</double>
+ </void>
+ </object>
+ </void>
<void method="connect">
<object class="com.horstmann.violet.CallEdge">
<void property="middleLabel">
- <string>execute(tok)</string>
+ <string>startProcess</string>
</void>
</object>
<object idref="ActivationBarNode0"/>
- <object idref="ActivationBarNode3"/>
+ <object idref="ActivationBarNode1"/>
</void>
<void method="connect">
<object class="com.horstmann.violet.CallEdge">
<void property="middleLabel">
- <string>getFlow</string>
+ <string>getHeadFlow</string>
</void>
</object>
- <object idref="ActivationBarNode3"/>
+ <object idref="ActivationBarNode1"/>
<object idref="ActivationBarNode4"/>
</void>
<void method="connect">
@@ -391,26 +418,17 @@
<string>getTarget</string>
</void>
</object>
- <object idref="ActivationBarNode3"/>
+ <object idref="ActivationBarNode1"/>
<object idref="ActivationBarNode5"/>
</void>
<void method="connect">
<object class="com.horstmann.violet.CallEdge">
<void property="middleLabel">
- <string>execute(tok)</string>
- </void>
- </object>
- <object idref="ActivationBarNode3"/>
- <object idref="ActivationBarNode6"/>
- </void>
- <void method="connect">
- <object class="com.horstmann.violet.CallEdge">
- <void property="middleLabel">
<string>getFlowHandler</string>
</void>
</object>
- <object idref="ActivationBarNode3"/>
- <object idref="ActivationBarNode7"/>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode8"/>
</void>
<void method="connect">
<object class="com.horstmann.violet.CallEdge">
@@ -418,26 +436,26 @@
<string>transfer(tok)</string>
</void>
</object>
- <object idref="ActivationBarNode3"/>
- <object idref="ActivationBarNode8"/>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode9"/>
</void>
<void method="connect">
<object class="com.horstmann.violet.CallEdge">
<void property="middleLabel">
- <string>queueFlows</string>
+ <string>addTailFlows</string>
</void>
</object>
- <object idref="ActivationBarNode8"/>
<object idref="ActivationBarNode9"/>
+ <object idref="ActivationBarNode10"/>
</void>
<void method="connect">
<object class="com.horstmann.violet.CallEdge">
<void property="middleLabel">
- <string>getFlow</string>
+ <string>getHeadFlow</string>
</void>
</object>
- <object idref="ActivationBarNode3"/>
- <object idref="ActivationBarNode10"/>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode11"/>
</void>
<void method="connect">
<object class="com.horstmann.violet.NoteEdge"/>
@@ -449,5 +467,41 @@
<object idref="NoteNode1"/>
<object idref="PointNode1"/>
</void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>getExecutionHandler</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode6"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>execute(tok)</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode7"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>createToken</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode2"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>addTailFlow</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode1"/>
+ <object idref="ActivationBarNode3"/>
+ </void>
</object>
</java>
Modified: api/branches/tdiesler/docs/VioletUML/APIModel.class.violet
===================================================================
--- api/branches/tdiesler/docs/VioletUML/APIModel.class.violet 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/docs/VioletUML/APIModel.class.violet 2008-07-13 13:23:02 UTC (rev 1599)
@@ -74,6 +74,11 @@
</void>
<void method="addNode">
<object id="ClassNode4" class="com.horstmann.violet.ClassNode">
+ <void property="methods">
+ <void property="text">
+ <string>execute</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>Event</string>
@@ -179,6 +184,11 @@
outFlows</string>
</void>
</void>
+ <void property="methods">
+ <void property="text">
+ <string>execute</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>Gateway
@@ -202,6 +212,11 @@
outFlow</string>
</void>
</void>
+ <void property="methods">
+ <void property="text">
+ <string>execute</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>SubProcess
@@ -224,6 +239,11 @@
outFlow</string>
</void>
</void>
+ <void property="methods">
+ <void property="text">
+ <string>execute</string>
+ </void>
+ </void>
<void property="name">
<void property="text">
<string>Task</string>
Modified: api/branches/tdiesler/docs/VioletUML/APIModel.png
===================================================================
(Binary files differ)
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -23,35 +23,26 @@
// $Id$
-import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.NotImplementedException;
-import org.jboss.bpm.client.internal.InitialToken;
-import org.jboss.bpm.model.EndEvent;
+import org.jboss.bpm.model.Executable;
import org.jboss.bpm.model.ExecutionHandler;
+import org.jboss.bpm.model.FlowHandler;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.model.SignalHandler;
import org.jboss.bpm.runtime.Attachments;
-import org.jboss.bpm.runtime.Token;
/**
- * The process manager is the entry point to create, find and otherwise manage processes.
+ * The ExecutionManager executes processes
*
* @author thomas.diesler(a)jboss.com
* @since 18-Jun-2008
*/
public abstract class ExecutionManager
{
- // provide logging
- private static final Log log = LogFactory.getLog(ExecutionManager.class);
-
// Injected through the MC
protected ProcessEngine engine;
@@ -61,6 +52,14 @@
}
/**
+ * Start the Process and return a Future
+ * @param proc The Process to start
+ * @param att The Attachments in the ExecutionContext
+ * @return The Future from which to obtain the process result
+ */
+ public abstract Future<Result> startProcess(Process proc, Attachments att);
+
+ /**
* Locate the signal manager
*/
public static ExecutionManager locateExecutionManager()
@@ -68,101 +67,38 @@
ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
return engine.getExecutionManager();
}
-
- public Future<Result> startProcess(Process proc, Attachments att)
+
+ protected ExecutionHandler getExecutionHandler(FlowObject target)
{
- throwSignal(new Signal(proc, Signal.Type.ENTER_PROCESS));
- try
- {
- FlowObject fo = proc.getStartEvent();
- ExecutionHandler exfo = getExecutable(fo);
- Token token = new InitialToken(proc, att);
-
- boolean hasEnded = false;
- while(hasEnded == false)
- {
- try
- {
- throwSignal(exfo.getEnterSignal());
- exfo.execute(token);
- }
- finally
- {
- throwSignal(exfo.getExitSignal());
- }
- }
- }
- finally
- {
- throwSignal(new Signal(proc, Signal.Type.EXIT_PROCESS));
- }
- return new ResultFuture(proc);
+ Executable exfo = getExecutable(target);
+ ExecutionHandler handler = exfo.getExecutionHandler();
+ return handler != null ? handler : exfo.getDefaultExecutionHandler();
}
- protected ExecutionHandler getExecutable(FlowObject fo)
+ protected SignalHandler getSignalHandler(FlowObject target)
{
- if (fo instanceof ExecutionHandler == false)
- throw new IllegalStateException("Flow object is not executable: " + fo);
-
- return (ExecutionHandler)fo;
+ Executable exfo = getExecutable(target);
+ SignalHandler handler = exfo.getSignalHandler();
+ return handler != null ? handler : exfo.getDefaultSignalHandler();
}
+ protected FlowHandler getFlowHandler(FlowObject target)
+ {
+ Executable exfo = getExecutable(target);
+ FlowHandler handler = exfo.getFlowHandler();
+ return handler != null ? handler : exfo.getDefaultFlowHandler();
+ }
+
protected void throwSignal(Signal signal)
{
SignalManager sm = SignalManager.locateSignalManager();
sm.throwSignal(signal);
}
-
- public class ResultFuture implements Future<Result>
- {
- private Result result;
- private Process proc;
- public ResultFuture(Process proc)
- {
- this.proc = proc;
- }
-
- 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()
- {
- boolean isDone = getResult() != null;
- return isDone;
- }
-
- private Result getResult()
- {
- if (result == null)
- {
- for (EndEvent aux : proc.getEndEvents())
- {
- result = aux.getResult();
- if (result != null)
- {
- break;
- }
- }
- }
- return result;
- }
+ private Executable getExecutable(FlowObject fo)
+ {
+ if (fo instanceof Executable == false)
+ throw new IllegalStateException("Flow object is not executable: " + fo);
+ return (Executable)fo;
}
}
\ No newline at end of file
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -47,7 +47,7 @@
{
// provide logging
private static final Log log = LogFactory.getLog(ProcessManager.class);
-
+
// Injected through the MC
protected ProcessEngine engine;
// The set of process definitions
@@ -58,7 +58,9 @@
{
}
- /* Get the associated process engine */
+ /**
+ * Get the associated process engine
+ */
public ProcessEngine getProcessEngine()
{
if (engine == null)
@@ -67,15 +69,17 @@
return engine;
}
- /* Locate the process definition manager */
+ /**
+ * Locate the process definition manager
+ */
public static ProcessManager locateProcessManager()
{
ProcessEngine engine = ProcessEngineLocator.locateProcessEngine();
return engine.getProcessManager();
}
- /*
- * Create a process defintion from a XML string in one of the supported formats
+ /**
+ * Create a Process from a XML string in one of the supported formats
*/
public final Process createProcess(String procDescriptor)
{
@@ -84,15 +88,12 @@
throw new EngineShutdownException("Cannot create new Process while engine is shutting down");
Process proc = createProcessOverride(procDescriptor);
- proc.initialize();
-
- marshallProcess(proc);
-
+ registerProcess(proc);
return proc;
}
- /*
- * Create a process defintion from an URL to a XML descritor in one of the supported formats
+ /**
+ * Create a Process from an URL to a XML descritor in one of the supported formats
*/
public final Process createProcess(URL procURL) throws IOException
{
@@ -101,48 +102,30 @@
throw new EngineShutdownException("Cannot create new Process while engine is shutting down");
Process proc = createProcessOverride(procURL);
- proc.initialize();
-
- marshallProcess(proc);
-
+ registerProcess(proc);
return proc;
}
/**
- * Override to implement process definition creation
+ * Override to implement Process creation
*/
- protected abstract Process createProcessOverride(String procDescriptor);
+ protected abstract Process createProcessOverride(String pXML);
- private void marshallProcess(Process proc)
- {
- try
- {
- File file = new File("target/" + proc.getName() + ".xml").getCanonicalFile();
- ProcessMarshaller marshaller = new ProcessMarshaller();
- marshaller.marshallProcess(proc, new FileWriter(file));
- log.info("Generated: " + file);
- }
- catch (Exception ex)
- {
- log.error("Cannot marshall: " + proc);
- }
- }
-
- /*
- * Override to implement process definition creation
+ /**
+ * Override to implement Process creation
*/
- protected abstract Process createProcessOverride(URL pdURL) throws IOException;
+ protected abstract Process createProcessOverride(URL pURL) throws IOException;
- /*
- * Get the set of registered process definitions
+ /**
+ * Get the set of registered Processes
*/
public Set<Process> getProcesses()
{
return Collections.unmodifiableSet(procs);
}
- /*
- * Find a process definition for a given name
+ /**
+ * Find a Process for a given name
*
* @return null if the process definition is not defined
*/
@@ -160,18 +143,39 @@
return proc;
}
- /*
- * Remove a process definition and all its associated process instances
+ /**
+ * Register a Process
*/
+ public final boolean registerProcess(Process proc)
+ {
+ // Only initialize if this has not already been done
+ if (proc.getProcessState() == Process.ProcessState.CREATED)
+ proc.initialize();
+
+ marshallProcess(proc);
+ return procs.add(proc);
+ }
+
+ /**
+ * Remove a Process
+ */
public void removeProcess(Process proc)
{
- // Remove the preocess definition
procs.remove(proc.getName());
}
- // Add a process definition
- protected void addProcess(Process proc)
+ private void marshallProcess(Process proc)
{
- procs.add(proc);
+ try
+ {
+ File file = new File("target/" + proc.getName() + ".xml").getCanonicalFile();
+ ProcessMarshaller marshaller = new ProcessMarshaller();
+ marshaller.marshallProcess(proc, new FileWriter(file));
+ log.info("Generated: " + file);
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot marshall: " + proc);
+ }
}
}
\ No newline at end of file
Added: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -0,0 +1,178 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * 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.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.NotImplementedException;
+import org.jboss.bpm.client.ExecutionManager;
+import org.jboss.bpm.client.ProcessEngine;
+import org.jboss.bpm.model.EndEvent;
+import org.jboss.bpm.model.ExecutionHandler;
+import org.jboss.bpm.model.Flow;
+import org.jboss.bpm.model.FlowHandler;
+import org.jboss.bpm.model.FlowObject;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.Result;
+import org.jboss.bpm.model.SequenceFlow;
+import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.model.SignalHandler;
+import org.jboss.bpm.model.StartEvent;
+import org.jboss.bpm.runtime.Attachments;
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * The process manager is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ExecutionManagerImpl extends ExecutionManager
+{
+ // provide logging
+ private static final Log log = LogFactory.getLog(ExecutionManager.class);
+
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ this.engine = engine;
+ }
+
+ @Override
+ public Future<Result> startProcess(Process proc, Attachments att)
+ {
+ throwSignal(new Signal(proc, Signal.Type.ENTER_PROCESS));
+ try
+ {
+ Token token = new Token(proc, att);
+ StartEvent start = proc.getStartEvent();
+ token.addTailFlow(new InitialFlow(start));
+
+ while (token.peekHeadFlow() != null)
+ {
+ // Peek the head flow
+ Flow flow = token.peekHeadFlow();
+
+ // Get the target and its handlers
+ FlowObject target = flow.getTarget();
+ ExecutionHandler exHandler = getExecutionHandler(target);
+ SignalHandler sigHandler = getSignalHandler(target);
+ FlowHandler flowHandler = getFlowHandler(target);
+
+ // Execute the FlowObject's ExecutionHandler
+ try
+ {
+ throwSignal(sigHandler.getEnterSignal());
+ exHandler.execute(token);
+ }
+ finally
+ {
+ throwSignal(sigHandler.getExitSignal());
+ }
+
+ // Remove the head flow
+ token.removeHeadFlow();
+
+ // Transfer the token to the FlowHandler
+ flowHandler.transfer(token);
+ }
+ }
+ finally
+ {
+ throwSignal(new Signal(proc, Signal.Type.EXIT_PROCESS));
+ }
+ return new ResultFuture(proc);
+ }
+
+ /**
+ * The initial flow 'to' the StartEvent
+ */
+ class InitialFlow extends SequenceFlow
+ {
+ InitialFlow(StartEvent start)
+ {
+ setTarget(start);
+ }
+ }
+
+ /**
+ * A basic implementation of a Future
+ */
+ class ResultFuture implements Future<Result>
+ {
+ private Result result;
+ private Process proc;
+
+ public ResultFuture(Process proc)
+ {
+ this.proc = proc;
+ }
+
+ 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()
+ {
+ boolean isDone = getResult() != null;
+ return isDone;
+ }
+
+ private Result getResult()
+ {
+ if (result == null)
+ {
+ for (EndEvent aux : proc.getEndEvents())
+ {
+ result = aux.getResult();
+ if (result != null)
+ {
+ break;
+ }
+ }
+ }
+ return result;
+ }
+ }
+}
\ No newline at end of file
Property changes on: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ExecutionManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/InitialToken.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/InitialToken.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/InitialToken.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -1,66 +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.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;
-
-/**
- * An initial token
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public 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;
- }
-
- static class InitialContext extends BasicAttachments implements ExecutionContext
- {
- InitialContext(Attachments att)
- {
- super(att);
- }
- }
-}
\ No newline at end of file
Added: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * 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.io.IOException;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.net.URL;
+
+import javax.xml.bind.JAXBException;
+
+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.jboss.bpm.util.ProcessUnmarshaller;
+
+/**
+ * The process manager is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessManagerImpl extends ProcessManager
+{
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ this.engine = engine;
+ }
+
+ /**
+ * Override to implement process definition creation
+ */
+ public Process createProcessOverride(String pXML)
+ {
+ try
+ {
+ ProcessUnmarshaller unmarschaller = new ProcessUnmarshaller();
+ Process proc = unmarschaller.unmarshallProcess(new StringReader(pXML));
+ return proc;
+ }
+ catch (JAXBException ex)
+ {
+ throw new InvalidProcessException("Cannot unmarschall: " + pXML, ex);
+ }
+ }
+
+ /**
+ * Override to implement process definition creation
+ */
+ public Process createProcessOverride(URL pURL) throws IOException
+ {
+ try
+ {
+ ProcessUnmarshaller unmarschaller = new ProcessUnmarshaller();
+ Process proc = unmarschaller.unmarshallProcess(new InputStreamReader(pURL.openStream()));
+ return proc;
+ }
+ catch (JAXBException ex)
+ {
+ throw new InvalidProcessException("Cannot unmarschall: " + pURL, ex);
+ }
+ }
+}
\ No newline at end of file
Property changes on: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/internal/ProcessManagerImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractEvent.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -21,6 +21,7 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
@@ -37,4 +38,58 @@
@XmlType(name="AbstractEvent")
abstract class AbstractEvent extends FlowObject
{
+ protected ExecutionHandler executionHandler;
+ protected FlowHandler flowHandler;
+ protected SignalHandler signalHandler;
+
+ /**
+ * Get the ExecutionHandler for this Event
+ */
+ public ExecutionHandler getExecutionHandler()
+ {
+ return executionHandler;
+ }
+
+ /**
+ * Set the ExecutionHandler for this Event
+ */
+ @XmlElement(name = "execution-handler", required = false)
+ protected void setExecutionHandler(ExecutionHandler executionHandler)
+ {
+ this.executionHandler = executionHandler;
+ }
+
+ /**
+ * Get the FlowHandler for this Event
+ */
+ public FlowHandler getFlowHandler()
+ {
+ return flowHandler;
+ }
+
+ /**
+ * Set the FlowHandler for this Event
+ */
+ @XmlElement(name = "flow-handler", required = false)
+ protected void setFlowHandler(FlowHandler flowHandler)
+ {
+ this.flowHandler = flowHandler;
+ }
+
+ /**
+ * Get the SignalHandler for this Event
+ */
+ public SignalHandler getSignalHandler()
+ {
+ return signalHandler;
+ }
+
+ /**
+ * Set the SignalHandler for this Event
+ */
+ @XmlElement(name = "signal-handler", required = false)
+ protected void setSignalHandler(SignalHandler signalHandler)
+ {
+ this.signalHandler = signalHandler;
+ }
}
\ No newline at end of file
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractGateway.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -42,6 +42,9 @@
abstract class AbstractGateway extends FlowObject implements NamedFlowObject, MultipleOutFlowSupport, MultipleInFlowSupport
{
private String name;
+ protected ExecutionHandler executionHandler;
+ protected FlowHandler flowHandler;
+ protected SignalHandler signalHandler;
@XmlElements( {
@XmlElement(name = "sequence", type = SequenceFlow.class),
@@ -94,4 +97,55 @@
{
this.outFlows = outFlow;
}
+
+ /**
+ * Get the ExecutionHandler for this Event
+ */
+ public ExecutionHandler getExecutionHandler()
+ {
+ return executionHandler;
+ }
+
+ /**
+ * Set the ExecutionHandler for this Event
+ */
+ @XmlElement(name = "execution-handler")
+ protected void setExecutionHandler(ExecutionHandler executionHandler)
+ {
+ this.executionHandler = executionHandler;
+ }
+
+ /**
+ * Get the FlowHandler for this Event
+ */
+ public FlowHandler getFlowHandler()
+ {
+ return flowHandler;
+ }
+
+ /**
+ * Set the FlowHandler for this Event
+ */
+ @XmlElement(name = "flow-handler")
+ protected void setFlowHandler(FlowHandler flowHandler)
+ {
+ this.flowHandler = flowHandler;
+ }
+
+ /**
+ * Get the SignalHandler for this Event
+ */
+ public SignalHandler getSignalHandler()
+ {
+ return signalHandler;
+ }
+
+ /**
+ * Set the SignalHandler for this Event
+ */
+ @XmlElement(name = "signal-handler")
+ protected void setSignalHandler(SignalHandler signalHandler)
+ {
+ this.signalHandler = signalHandler;
+ }
}
\ No newline at end of file
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractSubProcess.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -37,6 +37,10 @@
@XmlType(name="AbstractSubProcess")
abstract class AbstractSubProcess extends Process implements SingleOutFlowSupport
{
+ protected ExecutionHandler executionHandler;
+ protected FlowHandler flowHandler;
+ protected SignalHandler signalHandler;
+
@XmlElements( {
@XmlElement(name = "sequence", type = SequenceFlow.class),
@XmlElement(name = "message", type = MessageFlow.class)
@@ -76,4 +80,55 @@
{
this.outFlow = outFlow;
}
+
+ /**
+ * Get the ExecutionHandler for this Event
+ */
+ public ExecutionHandler getExecutionHandler()
+ {
+ return executionHandler;
+ }
+
+ /**
+ * Set the ExecutionHandler for this Event
+ */
+ @XmlElement(name = "execution-handler")
+ protected void setExecutionHandler(ExecutionHandler executionHandler)
+ {
+ this.executionHandler = executionHandler;
+ }
+
+ /**
+ * Get the FlowHandler for this Event
+ */
+ public FlowHandler getFlowHandler()
+ {
+ return flowHandler;
+ }
+
+ /**
+ * Set the FlowHandler for this Event
+ */
+ @XmlElement(name = "flow-handler")
+ protected void setFlowHandler(FlowHandler flowHandler)
+ {
+ this.flowHandler = flowHandler;
+ }
+
+ /**
+ * Get the SignalHandler for this Event
+ */
+ public SignalHandler getSignalHandler()
+ {
+ return signalHandler;
+ }
+
+ /**
+ * Set the SignalHandler for this Event
+ */
+ @XmlElement(name = "signal-handler")
+ protected void setSignalHandler(SignalHandler signalHandler)
+ {
+ this.signalHandler = signalHandler;
+ }
}
\ No newline at end of file
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/AbstractTask.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -40,6 +40,10 @@
@XmlType(name = "AbstractTask")
abstract class AbstractTask extends Activity implements SingleOutFlowSupport
{
+ protected ExecutionHandler executionHandler;
+ protected FlowHandler flowHandler;
+ protected SignalHandler signalHandler;
+
@XmlElements( {
@XmlElement(name = "sequence", type = SequenceFlow.class),
@XmlElement(name = "message", type = MessageFlow.class)
@@ -77,4 +81,55 @@
{
this.outFlow = outFlow;
}
+
+ /**
+ * Get the ExecutionHandler for this Event
+ */
+ public ExecutionHandler getExecutionHandler()
+ {
+ return executionHandler;
+ }
+
+ /**
+ * Set the ExecutionHandler for this Event
+ */
+ @XmlElement(name = "execution-handler")
+ protected void setExecutionHandler(ExecutionHandler executionHandler)
+ {
+ this.executionHandler = executionHandler;
+ }
+
+ /**
+ * Get the FlowHandler for this Event
+ */
+ public FlowHandler getFlowHandler()
+ {
+ return flowHandler;
+ }
+
+ /**
+ * Set the FlowHandler for this Event
+ */
+ @XmlElement(name = "flow-handler")
+ protected void setFlowHandler(FlowHandler flowHandler)
+ {
+ this.flowHandler = flowHandler;
+ }
+
+ /**
+ * Get the SignalHandler for this Event
+ */
+ public SignalHandler getSignalHandler()
+ {
+ return signalHandler;
+ }
+
+ /**
+ * Set the SignalHandler for this Event
+ */
+ @XmlElement(name = "signal-handler")
+ protected void setSignalHandler(SignalHandler signalHandler)
+ {
+ this.signalHandler = signalHandler;
+ }
}
\ No newline at end of file
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/EndEvent.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -26,6 +26,8 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.runtime.Attachments;
import org.jboss.bpm.runtime.Token;
@@ -42,6 +44,9 @@
@XmlType(name="EndEvent")
public class EndEvent extends AbstractEndEvent implements SingleInFlowSupport
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(EndEvent.class);
+
private Result result;
private Flow inFlow;
@@ -88,26 +93,51 @@
return result;
}
- /** Get signal for enter */
- public Signal getEnterSignal()
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
{
- return new Signal(getProcess(), Signal.Type.ENTER_END_EVENT);
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ log.debug("End reached in: " + getName());
+ }
+ };
}
-
- /** Get signal for exit */
- public Signal getExitSignal()
+
+ public SignalHandler getDefaultSignalHandler()
{
- return new Signal(getProcess(), Signal.Type.EXIT_END_EVENT);
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_END_EVENT);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_END_EVENT);
+ }
+ };
}
- public void execute(final Token token)
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
{
- // Provide the result
- result = new Result()
+ return new ExecutionHandler()
{
- public Attachments getAttachments()
+ @Override
+ public void execute(final Token token)
{
- return token.getExecutionContext();
+ // Provide the result
+ result = new Result()
+ {
+ public Attachments getAttachments()
+ {
+ return token.getExecutionContext();
+ }
+ };
}
};
}
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Event.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -21,12 +21,10 @@
*/
package org.jboss.bpm.model;
+//$Id$
+
import javax.xml.bind.annotation.XmlType;
-
-
-// $Id$
-
/**
* An Event is something that “happens” during the course of a business process.
* These Events affect the flow of the Process and usually have a cause or an impact.
@@ -44,20 +42,4 @@
protected Event()
{
}
-
- /**
- * Get signal for enter
- */
- public Signal getEnterSignal()
- {
- return new Signal(getProcess(), Signal.Type.ENTER_EVENT);
- }
-
- /**
- * Get signal for exit
- */
- public Signal getExitSignal()
- {
- return new Signal(getProcess(), Signal.Type.EXIT_EVENT);
- }
}
\ No newline at end of file
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Executable.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Executable.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Executable.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -34,9 +34,18 @@
/** Get the associated ExecutionHandler */
ExecutionHandler getExecutionHandler();
+ /** Get the default ExecutionHandler */
+ ExecutionHandler getDefaultExecutionHandler();
+
/** Get the associated SignalHandler */
SignalHandler getSignalHandler();
+ /** Get the default SignalHandler */
+ SignalHandler getDefaultSignalHandler();
+
/** Get the associated FlowHandler */
FlowHandler getFlowHandler();
+
+ /** Get the default FlowHandler */
+ FlowHandler getDefaultFlowHandler();
}
\ No newline at end of file
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -23,6 +23,9 @@
//$Id$
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
import org.jboss.bpm.runtime.Token;
/**
@@ -31,10 +34,21 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface ExecutionHandler
+@XmlType(name = "ExecutionHandler")
+public abstract class ExecutionHandler extends Handler
{
- /**
+ @XmlTransient
+ private ExecutionHandler delegate;
+
+ /**
* Execute this flow object
*/
- void execute(Token token);
+ public void execute(Token token)
+ {
+ if (delegate == null)
+ {
+ delegate = newInstance(ExecutionHandler.class);
+ }
+ delegate.execute(token);
+ }
}
\ No newline at end of file
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -23,54 +23,33 @@
//$Id$
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.jboss.bpm.runtime.Token;
+
/**
- * Implement to return the
+ * Implement to handle the outgoing Flows for an FlowObject
*
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
@XmlType(name = "FlowHandler")
-public class FlowHandler
+public abstract class FlowHandler extends Handler
{
- @XmlElement(name = "class")
- private String className;
- @XmlElement(name = "bean")
- private String beanRef;
- @XmlTransient
private FlowHandler delegate;
-
+
/**
- * Get signal for enter
+ * Transfer the token to the FlowHandler.
+ * <p/>
+ * The FlowHandler will add the active outgoing @{link Flow}s to
+ * @{link Token}'s flow queue.
*/
- @XmlTransient
- public List<Flow> getExecutableFlows()
+ public void transfer(Token token)
{
- return getDelegate().getExecutableFlows();
- }
-
- private FlowHandler getDelegate()
- {
if (delegate == null)
{
- try
- {
- if (className != null)
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- FlowHandler delegate = (FlowHandler)ctxLoader.loadClass(className).newInstance();
- }
- }
- catch (Exception ex)
- {
- // TODO: handle exception
- }
+ delegate = newInstance(FlowHandler.class);
}
- return delegate;
+ delegate.transfer(token);
}
}
\ No newline at end of file
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -30,6 +30,10 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.runtime.Token;
+
/**
* Gateways are modelling elements that are used to control how Sequence Flow interact as they converge and diverge within a Process.
* If the flow does not need to be controlled, then a Gateway is not needed.
@@ -40,9 +44,11 @@
@XmlType(name="Gateway")
public abstract class Gateway extends AbstractGateway implements NamedFlowObject, Executable
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(Gateway.class);
+
@XmlTransient
protected List<Flow> inFlows = new ArrayList<Flow>();
- protected
/**
* Construct an anonymous Gateway
@@ -60,19 +66,7 @@
{
super(name);
}
-
- @Override
- public Signal getEnterSignal()
- {
- return new Signal(getProcess(), Signal.Type.ENTER_GATEWAY);
- }
- @Override
- public Signal getExitSignal()
- {
- return new Signal(getProcess(), Signal.Type.EXIT_GATEWAY);
- }
-
public void addOutFlow(Flow flow)
{
outFlows.add(flow);
@@ -87,4 +81,48 @@
{
this.inFlows.add(inFlow);
}
-}
\ No newline at end of file
+
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
+ {
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ List<Flow> outFlows = getOutFlows();
+ if (outFlows.size() == 1)
+ token.addTailFlow(outFlows.get(0));
+ }
+ };
+ }
+
+ public SignalHandler getDefaultSignalHandler()
+ {
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_GATEWAY);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_GATEWAY);
+ }
+ };
+ }
+
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
+ {
+ return new ExecutionHandler()
+ {
+ @Override
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in gateway: " + getName());
+ }
+ };
+ }
+ }
\ No newline at end of file
Added: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Handler.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Handler.java (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Handler.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -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;
+
+//$Id$
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.bpm.NotImplementedException;
+
+/**
+ * Implement to handle the outgoing Flows for an FlowObject
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+@XmlType(name = "Handler")
+public abstract class Handler
+{
+ @XmlElement(name = "class")
+ private String className;
+ @XmlElement(name = "bean")
+ private String beanRef;
+
+ @SuppressWarnings("unchecked")
+ protected <T> T newInstance(Class<T> clazz)
+ {
+ try
+ {
+ if (className != null)
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ return (T)ctxLoader.loadClass(className).newInstance();
+ }
+ else if (beanRef != null)
+ {
+ throw new NotImplementedException();
+ }
+ else
+ {
+ throw new IllegalStateException("There is no 'class' nor 'bean' attribute set for this handler");
+ }
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot instanciate the handler", ex);
+ }
+ }
+}
\ No newline at end of file
Property changes on: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Handler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ItermediateEvent.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -28,7 +28,11 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.runtime.Token;
+
// $Id$
/**
@@ -44,6 +48,9 @@
@XmlType(name="ItermediateEvent")
public class ItermediateEvent extends AbstractItermediateEvent
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(ItermediateEvent.class);
+
@XmlTransient
protected List<Flow> inFlows = new ArrayList<Flow>();
@@ -79,6 +86,50 @@
this.inFlows.add(inFlow);
}
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
+ {
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ List<Flow> outFlows = getOutFlows();
+ if (outFlows.size() == 1)
+ token.addTailFlow(outFlows.get(0));
+ }
+ };
+ }
+
+ public SignalHandler getDefaultSignalHandler()
+ {
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_EVENT);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_EVENT);
+ }
+ };
+ }
+
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
+ {
+ return new ExecutionHandler()
+ {
+ @Override
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in start-event");
+ }
+ };
+ }
+
public String toString()
{
return "ItermediateEvent[" + getName() + "]";
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Process.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Process.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -35,7 +35,6 @@
import org.jboss.bpm.NameNotUniqueException;
import org.jboss.bpm.client.ExecutionManager;
import org.jboss.bpm.runtime.Attachments;
-import org.jboss.bpm.runtime.Token;
/**
* A Process is any Activity performed within a company or organization.
@@ -181,12 +180,6 @@
return processState;
}
- // Overwrite to prevent execution
- public void execute(Token token)
- {
- throw new IllegalStateException("A Process cannot get executed. Go through startProcess");
- }
-
/**
* Set the process state
*/
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -21,7 +21,9 @@
*/
package org.jboss.bpm.model;
+import javax.xml.bind.annotation.XmlType;
+
//$Id$
/**
@@ -30,15 +32,32 @@
* @author thomas.diesler(a)jboss.com
* @since 08-Jul-2008
*/
-public interface SignalHandler
+@XmlType(name = "SignalHandler")
+public abstract class SignalHandler extends Handler
{
+ private SignalHandler delegate;
+
/**
* Get signal for enter
*/
- Signal getEnterSignal();
+ public Signal getEnterSignal()
+ {
+ if (delegate == null)
+ {
+ delegate = newInstance(SignalHandler.class);
+ }
+ return delegate.getEnterSignal();
+ }
/**
* Get signal for exit
*/
- Signal getExitSignal();
-}
\ No newline at end of file
+ public Signal getExitSignal()
+ {
+ if (delegate == null)
+ {
+ delegate = newInstance(SignalHandler.class);
+ }
+ return delegate.getExitSignal();
+ }
+}
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/StartEvent.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -23,8 +23,13 @@
//$Id$
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.bpm.runtime.Token;
+
/**
* A Start Event indicates where a particular Process will start.
*
@@ -37,6 +42,9 @@
@XmlType(name = "StartEvent")
public class StartEvent extends AbstractStartEvent
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(StartEvent.class);
+
/**
* Construct a StartEvent with a constant name: 'start'
* Note, this MUST NOT leak into the public API.
@@ -45,22 +53,48 @@
{
}
- /**
- * Get signal for enter
- */
- public Signal getEnterSignal()
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
{
- return new Signal(getProcess(), Signal.Type.ENTER_START_EVENT);
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ token.addTailFlow(getOutFlow());
+ }
+ };
}
- /**
- * Get signal for exit
- */
- public Signal getExitSignal()
+ public SignalHandler getDefaultSignalHandler()
{
- return new Signal(getProcess(), Signal.Type.EXIT_START_EVENT);
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_START_EVENT);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_START_EVENT);
+ }
+ };
}
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
+ {
+ return new ExecutionHandler()
+ {
+ @Override
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in start-event");
+ }
+ };
+ }
+
public String toString()
{
return "StartEvent[]";
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -73,23 +73,47 @@
this.inFlow = inFlow;
}
- /** Get signal for enter */
- public Signal getEnterSignal()
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
{
- return new Signal(getProcess(), Signal.Type.ENTER_SUB_PROCESS, getName());
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ token.addTailFlow(getOutFlow());
+ }
+ };
}
- /** Get signal for exit */
- public Signal getExitSignal()
+ public SignalHandler getDefaultSignalHandler()
{
- return new Signal(getProcess(), Signal.Type.EXIT_SUB_PROCESS, getName());
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_SUB_PROCESS);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_SUB_PROCESS);
+ }
+ };
}
- public void execute(Token token)
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
{
- startProcess(token.getExecutionContext());
+ return new ExecutionHandler()
+ {
+ @Override
+ public void execute(Token token)
+ {
+ startProcess(token.getExecutionContext());
+ }
+ };
}
-
public String toString()
{
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Task.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -24,6 +24,8 @@
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.runtime.Token;
//$Id$
@@ -40,6 +42,9 @@
@XmlType(name = "Task")
public class Task extends AbstractTask implements SingleInFlowSupport, Executable
{
+ // provide logging
+ private static final Log log = LogFactory.getLog(Task.class);
+
private Flow inFlow;
/**
@@ -76,25 +81,52 @@
this.inFlow = inFlow;
}
- /** Get signal for enter */
- public Signal getEnterSignal()
+ @XmlTransient
+ public FlowHandler getDefaultFlowHandler()
{
- return new Signal(getProcess(), Signal.Type.ENTER_TASK, getName());
+ return new FlowHandler()
+ {
+ @Override
+ public void transfer(Token token)
+ {
+ token.addTailFlow(getOutFlow());
+ }
+ };
}
- /** Get signal for exit */
- public Signal getExitSignal()
+ @XmlTransient
+ public SignalHandler getDefaultSignalHandler()
{
- return new Signal(getProcess(), Signal.Type.EXIT_TASK, getName());
+ return new SignalHandler()
+ {
+ public Signal getEnterSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.ENTER_TASK);
+ }
+
+ public Signal getExitSignal()
+ {
+ return new Signal(getProcess(), Signal.Type.EXIT_TASK);
+ }
+ };
}
- public void execute(Token token)
+ @XmlTransient
+ public ExecutionHandler getDefaultExecutionHandler()
{
- throw new IllegalStateException("Overwrite to impolement the task");
+ return new ExecutionHandler()
+ {
+ @Override
+ public void execute(Token token)
+ {
+ log.debug("Nothing to do in task: " + getName());
+ }
+ };
}
public String toString()
{
return "Task[" + getName() + "]";
}
+
}
\ No newline at end of file
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/runtime/Token.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -23,6 +23,10 @@
//$Id$
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import org.jboss.bpm.model.Flow;
import org.jboss.bpm.model.Process;
/**
@@ -37,11 +41,48 @@
* @author Thomas.Diesler(a)jboss.com
* @since 20-Apr-2007
*/
-public interface Token
+public class Token
{
- /** Get the associated execution context */
- ExecutionContext getExecutionContext();
+ private Process proc;
+ private ExecutionContext context;
+ private Queue<Flow> flowQueue = new ConcurrentLinkedQueue<Flow>();
- /** Get the current process */
- Process getProcess();
+ public Token(Process proc, Attachments att)
+ {
+ this.proc = proc;
+ this.context = new InitialContext(att);
+ }
+
+ public Process getProcess()
+ {
+ return proc;
+ }
+
+ public ExecutionContext getExecutionContext()
+ {
+ return context;
+ }
+
+ public Flow peekHeadFlow()
+ {
+ return flowQueue.peek();
+ }
+
+ public Flow removeHeadFlow()
+ {
+ return flowQueue.remove();
+ }
+
+ public void addTailFlow(Flow flow)
+ {
+ flowQueue.add(flow);
+ }
+
+ static class InitialContext extends BasicAttachments implements ExecutionContext
+ {
+ InitialContext(Attachments att)
+ {
+ super(att);
+ }
+ }
}
\ No newline at end of file
Deleted: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractToken.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractToken.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/runtime/internal/AbstractToken.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.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
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -24,6 +24,9 @@
// $Id$
import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
import junit.framework.TestCase;
@@ -31,14 +34,18 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.JBPMException;
import org.jboss.bpm.client.internal.EmbeddedBeansDeployer;
+import org.jboss.bpm.model.Signal;
+import org.jboss.bpm.runtime.SignalListener;
-public abstract class AbstractAPITestCase extends TestCase
+public abstract class AbstractAPITestCase extends TestCase implements SignalListener
{
// provide logging
private static final Log log = LogFactory.getLog(AbstractAPITestCase.class);
// Every test case has a deployer
private EmbeddedBeansDeployer deployer;
+ // The signals caught by this test case
+ private List<Signal> signals = new ArrayList<Signal>();
/** Overwrite to provide beans config */
protected abstract String getBeansConfig();
@@ -50,6 +57,7 @@
log.debug("setUp: " + getName());
deployer = new EmbeddedBeansDeployer();
deployTestBeans(getBeansConfig());
+ signals.clear();
}
@Override
@@ -94,4 +102,14 @@
return url;
}
+ public void catchSignal(Signal signal)
+ {
+ signals.add(signal);
+ log.debug("catchSignal: " + signal);
+ }
+
+ public List<Signal> getCaughtSignals()
+ {
+ return Collections.unmodifiableList(signals);
+ }
}
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -23,44 +23,13 @@
// $Id$
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.jboss.bpm.client.ProcessEngine;
-import org.jboss.bpm.model.Signal;
-import org.jboss.bpm.runtime.SignalListener;
-public abstract class DefaultEngineTestCase extends AbstractAPITestCase implements SignalListener
+public abstract class DefaultEngineTestCase extends AbstractAPITestCase
{
- // provide logging
- private static final Log log = LogFactory.getLog(DefaultEngineTestCase.class);
-
- private List<Signal> signals = new ArrayList<Signal>();
-
@Override
protected String getBeansConfig()
{
return ProcessEngine.JBPM_ENGINE_CONFIG;
}
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- signals.clear();
- }
-
- public void catchSignal(Signal signal)
- {
- signals.add(signal);
- log.debug("catchSignal: " + signal);
- }
-
- public List<Signal> getCaughtSignals()
- {
- return Collections.unmodifiableList(signals);
- }
}
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/util/ProcessUnmarshaller.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -26,6 +26,7 @@
import java.io.Reader;
import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.jboss.bpm.model.ObjectFactory;
@@ -39,7 +40,7 @@
*/
public class ProcessUnmarshaller
{
- public Process unmarshallProcess(Reader xml) throws Exception
+ public Process unmarshallProcess(Reader xml) throws JAXBException
{
JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
Deleted: api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/AbstractMockEngineTestCase.java
===================================================================
--- api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/AbstractMockEngineTestCase.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/AbstractMockEngineTestCase.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm;
-
-//$Id$
-
-import org.jboss.bpm.test.AbstractAPITestCase;
-
-public abstract class AbstractMockEngineTestCase extends AbstractAPITestCase
-{
-
- @Override
- protected String getBeansConfig()
- {
- return "jbpm-mock-beans.xml";
- }
-
-}
Copied: api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/MockEngineTestCase.java (from rev 1598, api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/AbstractMockEngineTestCase.java)
===================================================================
--- api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/MockEngineTestCase.java (rev 0)
+++ api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/MockEngineTestCase.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -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;
+
+//$Id$
+
+import org.jboss.bpm.test.AbstractAPITestCase;
+
+public abstract class MockEngineTestCase extends AbstractAPITestCase
+{
+
+ @Override
+ protected String getBeansConfig()
+ {
+ return "jbpm-mock-beans.xml";
+ }
+
+}
Deleted: api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/client/MockProcessEngine.java
===================================================================
--- api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/client/MockProcessEngine.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/client/MockProcessEngine.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.client;
-
-//$Id$
-
-/**
- * A process engine with public access
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class MockProcessEngine extends ProcessEngine
-{
-
-}
\ No newline at end of file
Modified: api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/client/ProcessEngineLocatorTest.java
===================================================================
--- api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/client/ProcessEngineLocatorTest.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/client/ProcessEngineLocatorTest.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -23,9 +23,9 @@
// $Id$
-import org.jboss.bpm.AbstractMockEngineTestCase;
+import org.jboss.bpm.MockEngineTestCase;
-public class ProcessEngineLocatorTest extends AbstractMockEngineTestCase
+public class ProcessEngineLocatorTest extends MockEngineTestCase
{
public void testLocateProcessEngine() throws Exception
Modified: api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java
===================================================================
--- api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/model/ProcessMarshallerTest.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -51,7 +51,7 @@
marshaller.marshallProcess(inProc, strwr);
String xml = strwr.toString();
- //System.out.println(xml);
+ System.out.println(xml);
ProcessUnmarshaller unmarshaller = new ProcessUnmarshaller();
Process outProc = unmarshaller.unmarshallProcess(new StringReader(xml));
Added: api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java
===================================================================
--- api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java (rev 0)
+++ api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -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.pattern.sequence;
+
+// $Id$
+
+import java.util.List;
+import java.util.concurrent.Future;
+
+import org.jboss.bpm.MockEngineTestCase;
+import org.jboss.bpm.client.ProcessManager;
+import org.jboss.bpm.client.SignalManager;
+import org.jboss.bpm.model.Process;
+import org.jboss.bpm.model.ProcessBuilder;
+import org.jboss.bpm.model.Result;
+import org.jboss.bpm.model.Signal;
+
+/**
+ * Test the basic execution sequence
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 03-Jul-2008
+ */
+public class SequenceTest extends MockEngineTestCase
+{
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ SignalManager em = SignalManager.locateSignalManager();
+ em.addListener(getName(), this);
+ }
+
+ /**
+ * Test a basic sequence
+ */
+ public void testBasicSequence() throws Exception
+ {
+ Process proc = new ProcessBuilder(getName()).addStartEvent().addSequenceFlow("task").addTask("task").
+ addSequenceFlow("end").addEndEvent("end").getProcess();
+
+ // Create a Process through the ProcessManager
+ ProcessManager pm = ProcessManager.locateProcessManager();
+ pm.registerProcess(proc);
+
+ // 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(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
+ assertEquals(Signal.Type.ENTER_START_EVENT, signals.get(1).getType());
+ assertEquals(Signal.Type.EXIT_START_EVENT, signals.get(2).getType());
+ assertEquals(Signal.Type.ENTER_TASK, signals.get(3).getType());
+ assertEquals(Signal.Type.EXIT_TASK, signals.get(4).getType());
+ assertEquals(Signal.Type.ENTER_END_EVENT, signals.get(5).getType());
+ assertEquals(Signal.Type.EXIT_END_EVENT, signals.get(6).getType());
+ assertEquals(Signal.Type.EXIT_PROCESS, signals.get(7).getType());
+ }
+}
Property changes on: api/branches/tdiesler/modules/api/src/test/java/org/jboss/bpm/pattern/sequence/SequenceTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/branches/tdiesler/modules/api/src/test/resources/jbpm-mock-beans.xml
===================================================================
--- api/branches/tdiesler/modules/api/src/test/resources/jbpm-mock-beans.xml 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/api/src/test/resources/jbpm-mock-beans.xml 2008-07-13 13:23:02 UTC (rev 1599)
@@ -3,8 +3,26 @@
<!-- The Kernel Locator -->
<bean name="KernelLocator" class="org.jboss.kernel.plugins.util.KernelLocator"/>
- <!-- The BPM Process Engine -->
- <bean name="jBPMProcessEngine" class="org.jboss.bpm.client.MockProcessEngine">
+ <!-- The process engine -->
+ <bean name="jBPMProcessEngine" class="org.jboss.bpm.client.internal.ProcessEngineImpl">
+ <property name="processManager"><inject bean="jBPMProcessManager"/></property>
+ <property name="executionManager"><inject bean="jBPMExecutionManager"/></property>
+ <property name="signalManager"><inject bean="jBPMSignalManager"/></property>
</bean>
+
+ <!-- The process manager -->
+ <bean name="jBPMProcessManager" class="org.jboss.bpm.client.internal.ProcessManagerImpl">
+ <property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
+ </bean>
+
+ <!-- The execution manager -->
+ <bean name="jBPMExecutionManager" class="org.jboss.bpm.client.internal.ExecutionManagerImpl">
+ <property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
+ </bean>
+
+ <!-- The execution manager -->
+ <bean name="jBPMSignalManager" class="org.jboss.bpm.client.internal.SignalManagerImpl">
+ <property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
+ </bean>
</deployment>
\ No newline at end of file
Modified: api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java
===================================================================
--- api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/ExecutionContextTest.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -72,7 +72,7 @@
// Verify context variables
Attachments att = result.getAttachments();
String msg = att.getAttachment(String.class, "TaskMessage");
- assertEquals("stateA has: [[org.jboss.bpm.samples.context.ContextValue,null]]", msg);
+ assertEquals("TaskA has: [[org.jboss.bpm.samples.context.ContextValue,null]]", msg);
// Validate original attachement
ContextValue att1 = att.getAttachment(ContextValue.class);
Modified: api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java
===================================================================
--- api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/context/TaskA.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -23,7 +23,7 @@
// $Id$
-import org.jboss.bpm.model.Task;
+import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.runtime.ExecutionContext;
import org.jboss.bpm.runtime.Token;
@@ -33,13 +33,13 @@
* @author Thomas.Diesler(a)jboss.com
* @since 04-Jul-2008
*/
-public class TaskA extends Task
+public class TaskA extends ExecutionHandler
{
@Override
public void execute(Token token)
{
ExecutionContext ctx = token.getExecutionContext();
- ctx.addAttachment(String.class, "TaskMessage", getName() + " has: " + ctx.getAttachmentKeys());
+ ctx.addAttachment(String.class, "TaskMessage", "TaskA has: " + ctx.getAttachmentKeys());
ctx.addAttachment(ContextValue.class, "TaskAttachment", new ContextValue("bar"));
}
}
Modified: api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java
===================================================================
--- api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/sequence/BasicSequenceTest.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -72,13 +72,13 @@
// 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());
+ assertEquals(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
+ assertEquals(Signal.Type.ENTER_START_EVENT, signals.get(1).getType());
+ assertEquals(Signal.Type.EXIT_START_EVENT, signals.get(2).getType());
+ assertEquals(Signal.Type.ENTER_TASK, signals.get(3).getType());
+ assertEquals(Signal.Type.EXIT_TASK, signals.get(4).getType());
+ assertEquals(Signal.Type.ENTER_END_EVENT, signals.get(5).getType());
+ assertEquals(Signal.Type.EXIT_END_EVENT, signals.get(6).getType());
+ assertEquals(Signal.Type.EXIT_PROCESS, signals.get(7).getType());
}
}
Modified: api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java
===================================================================
--- api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/BasicTaskTest.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -72,17 +72,17 @@
assertNotNull("Result expected", result);
Attachments att = result.getAttachments();
assertEquals("Attachments expected", 1, att.getAttachmentKeys().size());
- assertEquals("Task: stateA", att.getAttachment(String.class));
+ assertEquals("Task: TaskA", 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());
+ assertEquals(Signal.Type.ENTER_PROCESS, signals.get(0).getType());
+ assertEquals(Signal.Type.ENTER_START_EVENT, signals.get(1).getType());
+ assertEquals(Signal.Type.EXIT_START_EVENT, signals.get(2).getType());
+ assertEquals(Signal.Type.ENTER_TASK, signals.get(3).getType());
+ assertEquals(Signal.Type.EXIT_TASK, signals.get(4).getType());
+ assertEquals(Signal.Type.ENTER_END_EVENT, signals.get(5).getType());
+ assertEquals(Signal.Type.EXIT_END_EVENT, signals.get(6).getType());
+ assertEquals(Signal.Type.EXIT_PROCESS, signals.get(7).getType());
}
}
Modified: api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java
===================================================================
--- api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java 2008-07-12 12:45:25 UTC (rev 1598)
+++ api/branches/tdiesler/modules/testsuite/src/test/java/org/jboss/bpm/samples/task/TaskA.java 2008-07-13 13:23:02 UTC (rev 1599)
@@ -23,7 +23,7 @@
// $Id$
-import org.jboss.bpm.model.Task;
+import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.runtime.ExecutionContext;
import org.jboss.bpm.runtime.Token;
@@ -33,12 +33,12 @@
* @author Thomas.Diesler(a)jboss.com
* @since 04-Jul-2008
*/
-public class TaskA extends Task
+public class TaskA extends ExecutionHandler
{
@Override
public void execute(Token token)
{
ExecutionContext ctx = token.getExecutionContext();
- ctx.addAttachment(String.class, "Task: " + getName());
+ ctx.addAttachment(String.class, "Task: TaskA");
}
}
17 years, 9 months
JBoss JBPM SVN: r1598 - in api/branches/tdiesler: modules/api/src/main/java/org/jboss/bpm/client and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-12 08:45:25 -0400 (Sat, 12 Jul 2008)
New Revision: 1598
Added:
api/branches/tdiesler/docs/VioletUML/APIExecution.png
api/branches/tdiesler/docs/VioletUML/APIExecution.seq.violet
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Executable.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java
Removed:
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutableFlowObject.java
Modified:
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Event.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Task.java
Log:
wip
Added: api/branches/tdiesler/docs/VioletUML/APIExecution.png
===================================================================
(Binary files differ)
Property changes on: api/branches/tdiesler/docs/VioletUML/APIExecution.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: api/branches/tdiesler/docs/VioletUML/APIExecution.seq.violet
===================================================================
--- api/branches/tdiesler/docs/VioletUML/APIExecution.seq.violet (rev 0)
+++ api/branches/tdiesler/docs/VioletUML/APIExecution.seq.violet 2008-07-12 12:45:25 UTC (rev 1598)
@@ -0,0 +1,453 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<java version="1.6.0_06" class="java.beans.XMLDecoder">
+ <object class="com.horstmann.violet.SequenceDiagramGraph">
+ <void method="addNode">
+ <object id="LifelineNode0" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>Process</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>37.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="ActivationBarNode0" class="com.horstmann.violet.CallNode">
+ <void method="addChild">
+ <object id="ActivationBarNode1" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object id="LifelineNode1" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>Token</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode2" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode1"/>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode3" class="com.horstmann.violet.CallNode">
+ <void method="addChild">
+ <object id="ActivationBarNode4" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode1"/>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode5" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object id="LifelineNode2" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>Flow
+</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode6" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object id="LifelineNode3" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>FlowObject</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode7" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode3"/>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode8" class="com.horstmann.violet.CallNode">
+ <void method="addChild">
+ <object id="ActivationBarNode9" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode1"/>
+ </void>
+ </object>
+ </void>
+ <void property="implicitParameter">
+ <object id="LifelineNode4" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>FlowHandler</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ </object>
+ </void>
+ <void method="addChild">
+ <object id="ActivationBarNode10" class="com.horstmann.violet.CallNode">
+ <void property="implicitParameter">
+ <object idref="LifelineNode1"/>
+ </void>
+ <void property="openBottom">
+ <boolean>true</boolean>
+ </void>
+ </object>
+ </void>
+ <void property="implicitParameter">
+ <object id="LifelineNode5" class="com.horstmann.violet.ImplicitParameterNode">
+ <void property="name">
+ <void property="text">
+ <string>Execution
+Manager</string>
+ </void>
+ </void>
+ </object>
+ </void>
+ <void property="openBottom">
+ <boolean>true</boolean>
+ </void>
+ </object>
+ </void>
+ <void property="implicitParameter">
+ <object idref="LifelineNode0"/>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>69.0</double>
+ <double>80.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="LifelineNode5"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>199.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="LifelineNode3"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>562.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="LifelineNode4"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>690.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="LifelineNode1"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>315.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode1"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>347.0</double>
+ <double>103.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode2"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>347.0</double>
+ <double>156.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode3"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>231.0</double>
+ <double>209.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode4"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>347.0</double>
+ <double>232.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="LifelineNode2"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>435.0</double>
+ <double>0.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode5"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>467.0</double>
+ <double>285.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode6"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>594.0</double>
+ <double>338.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode7"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>594.0</double>
+ <double>391.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode8"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>722.0</double>
+ <double>444.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode9"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>347.0</double>
+ <double>467.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object idref="ActivationBarNode10"/>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>347.0</double>
+ <double>540.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="NoteNode0" class="com.horstmann.violet.NoteNode">
+ <void property="text">
+ <void property="text">
+ <string>The FlowHandler adds all active
+outgoing Flows to the FlowQueue
+in the Token</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>758.0</double>
+ <double>154.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="PointNode0" class="com.horstmann.violet.PointNode">
+ <void id="Rectangle2D$Double0" property="bounds">
+ <void method="setRect">
+ <double>758.0</double>
+ <double>59.0</double>
+ <double>0.0</double>
+ <double>0.0</double>
+ </void>
+ </void>
+ <void property="bounds">
+ <object idref="Rectangle2D$Double0"/>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>758.0</double>
+ <double>59.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="NoteNode1" class="com.horstmann.violet.NoteNode">
+ <void property="text">
+ <void property="text">
+ <string>The ExecutionManager
+executes Flows while
+there are any in the
+FlowQueue.</string>
+ </void>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>762.0</double>
+ <double>354.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="addNode">
+ <object id="PointNode1" class="com.horstmann.violet.PointNode">
+ <void id="Rectangle2D$Double1" property="bounds">
+ <void method="setRect">
+ <double>738.0</double>
+ <double>466.0</double>
+ <double>0.0</double>
+ <double>0.0</double>
+ </void>
+ </void>
+ <void property="bounds">
+ <object idref="Rectangle2D$Double1"/>
+ </void>
+ </object>
+ <object class="java.awt.geom.Point2D$Double">
+ <void method="setLocation">
+ <double>738.0</double>
+ <double>466.0</double>
+ </void>
+ </object>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>create</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode0"/>
+ <object idref="ActivationBarNode1"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>queueFlow</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode0"/>
+ <object idref="ActivationBarNode2"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>execute(tok)</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode0"/>
+ <object idref="ActivationBarNode3"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>getFlow</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode3"/>
+ <object idref="ActivationBarNode4"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>getTarget</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode3"/>
+ <object idref="ActivationBarNode5"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>execute(tok)</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode3"/>
+ <object idref="ActivationBarNode6"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>getFlowHandler</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode3"/>
+ <object idref="ActivationBarNode7"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>transfer(tok)</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode3"/>
+ <object idref="ActivationBarNode8"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>queueFlows</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode8"/>
+ <object idref="ActivationBarNode9"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.CallEdge">
+ <void property="middleLabel">
+ <string>getFlow</string>
+ </void>
+ </object>
+ <object idref="ActivationBarNode3"/>
+ <object idref="ActivationBarNode10"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.NoteEdge"/>
+ <object idref="NoteNode0"/>
+ <object idref="PointNode0"/>
+ </void>
+ <void method="connect">
+ <object class="com.horstmann.violet.NoteEdge"/>
+ <object idref="NoteNode1"/>
+ <object idref="PointNode1"/>
+ </void>
+ </object>
+</java>
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-12 12:44:06 UTC (rev 1597)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-07-12 12:45:25 UTC (rev 1598)
@@ -33,7 +33,7 @@
import org.jboss.bpm.NotImplementedException;
import org.jboss.bpm.client.internal.InitialToken;
import org.jboss.bpm.model.EndEvent;
-import org.jboss.bpm.model.ExecutableFlowObject;
+import org.jboss.bpm.model.ExecutionHandler;
import org.jboss.bpm.model.FlowObject;
import org.jboss.bpm.model.Process;
import org.jboss.bpm.model.Result;
@@ -75,7 +75,7 @@
try
{
FlowObject fo = proc.getStartEvent();
- ExecutableFlowObject exfo = getExecutable(fo);
+ ExecutionHandler exfo = getExecutable(fo);
Token token = new InitialToken(proc, att);
boolean hasEnded = false;
@@ -99,12 +99,12 @@
return new ResultFuture(proc);
}
- protected ExecutableFlowObject getExecutable(FlowObject fo)
+ protected ExecutionHandler getExecutable(FlowObject fo)
{
- if (fo instanceof ExecutableFlowObject == false)
+ if (fo instanceof ExecutionHandler == false)
throw new IllegalStateException("Flow object is not executable: " + fo);
- return (ExecutableFlowObject)fo;
+ return (ExecutionHandler)fo;
}
protected void throwSignal(Signal signal)
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Event.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-12 12:44:06 UTC (rev 1597)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Event.java 2008-07-12 12:45:25 UTC (rev 1598)
@@ -35,7 +35,7 @@
* @since 08-Jul-2008
*/
@XmlType(name="Event")
-public abstract class Event extends AbstractEvent implements ExecutableFlowObject
+public abstract class Event extends AbstractEvent implements Executable
{
/**
* Construct an anonymous StartEvent.
Added: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Executable.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Executable.java (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Executable.java 2008-07-12 12:45:25 UTC (rev 1598)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model;
+
+//$Id$
+
+/**
+ * A combined interface for execution aspects
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Executable
+{
+ /** Get the associated ExecutionHandler */
+ ExecutionHandler getExecutionHandler();
+
+ /** Get the associated SignalHandler */
+ SignalHandler getSignalHandler();
+
+ /** Get the associated FlowHandler */
+ FlowHandler getFlowHandler();
+}
\ No newline at end of file
Property changes on: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Executable.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutableFlowObject.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutableFlowObject.java 2008-07-12 12:44:06 UTC (rev 1597)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutableFlowObject.java 2008-07-12 12:45:25 UTC (rev 1598)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.bpm.model;
-
-import org.jboss.bpm.runtime.Token;
-
-//$Id$
-
-/**
- * Implement to make the FlowObject executable
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface ExecutableFlowObject
-{
- /**
- * 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
Copied: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java (from rev 1591, api/trunk/modules/api/src/main/java/org/jboss/bpm/model/ExecutableFlowObject.java)
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/ExecutionHandler.java 2008-07-12 12:45:25 UTC (rev 1598)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.bpm.model;
+
+//$Id$
+
+import org.jboss.bpm.runtime.Token;
+
+/**
+ * Implement to make the FlowObject executable
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ExecutionHandler
+{
+ /**
+ * Execute this flow object
+ */
+ void execute(Token token);
+}
\ No newline at end of file
Added: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java 2008-07-12 12:45:25 UTC (rev 1598)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * 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.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Implement to return the
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+@XmlType(name = "FlowHandler")
+public class FlowHandler
+{
+ @XmlElement(name = "class")
+ private String className;
+ @XmlElement(name = "bean")
+ private String beanRef;
+ @XmlTransient
+ private FlowHandler delegate;
+
+ /**
+ * Get signal for enter
+ */
+ @XmlTransient
+ public List<Flow> getExecutableFlows()
+ {
+ return getDelegate().getExecutableFlows();
+ }
+
+ private FlowHandler getDelegate()
+ {
+ if (delegate == null)
+ {
+ try
+ {
+ if (className != null)
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ FlowHandler delegate = (FlowHandler)ctxLoader.loadClass(className).newInstance();
+ }
+ }
+ catch (Exception ex)
+ {
+ // TODO: handle exception
+ }
+ }
+ return delegate;
+ }
+}
\ No newline at end of file
Property changes on: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/FlowHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-12 12:44:06 UTC (rev 1597)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Gateway.java 2008-07-12 12:45:25 UTC (rev 1598)
@@ -38,10 +38,11 @@
* @since 08-Jul-2008
*/
@XmlType(name="Gateway")
-public abstract class Gateway extends AbstractGateway implements NamedFlowObject, ExecutableFlowObject
+public abstract class Gateway extends AbstractGateway implements NamedFlowObject, Executable
{
@XmlTransient
protected List<Flow> inFlows = new ArrayList<Flow>();
+ protected
/**
* Construct an anonymous Gateway
Added: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java (rev 0)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java 2008-07-12 12:45:25 UTC (rev 1598)
@@ -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.model;
+
+
+//$Id$
+
+/**
+ * Implement to get signals on enter and exit.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalHandler
+{
+ /**
+ * Get signal for enter
+ */
+ Signal getEnterSignal();
+
+ /**
+ * Get signal for exit
+ */
+ Signal getExitSignal();
+}
\ No newline at end of file
Property changes on: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SignalHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-12 12:44:06 UTC (rev 1597)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/SubProcess.java 2008-07-12 12:45:25 UTC (rev 1598)
@@ -35,7 +35,7 @@
* @since 08-Jul-2008
*/
@XmlType(name="SubProcess")
-public class SubProcess extends AbstractSubProcess implements SingleInFlowSupport, ExecutableFlowObject
+public class SubProcess extends AbstractSubProcess implements SingleInFlowSupport, Executable
{
private Flow inFlow;
Modified: api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Task.java
===================================================================
--- api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-12 12:44:06 UTC (rev 1597)
+++ api/branches/tdiesler/modules/api/src/main/java/org/jboss/bpm/model/Task.java 2008-07-12 12:45:25 UTC (rev 1598)
@@ -38,7 +38,7 @@
* @since 08-Jul-2008
*/
@XmlType(name = "Task")
-public class Task extends AbstractTask implements SingleInFlowSupport, ExecutableFlowObject
+public class Task extends AbstractTask implements SingleInFlowSupport, Executable
{
private Flow inFlow;
17 years, 9 months
JBoss JBPM SVN: r1597 - api/branches.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-12 08:44:06 -0400 (Sat, 12 Jul 2008)
New Revision: 1597
Added:
api/branches/tdiesler/
Log:
recreate userbranch
Copied: api/branches/tdiesler (from rev 1596, api/trunk)
17 years, 9 months
JBoss JBPM SVN: r1596 - jbpm3/trunk/modules/jpdl/core/src/main/resources/org/jbpm/db.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-07-11 13:25:28 -0400 (Fri, 11 Jul 2008)
New Revision: 1596
Modified:
jbpm3/trunk/modules/jpdl/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
Log:
removed redundant, unused query GraphSession.findAllTokensOfProcessInstance
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-11 17:24:48 UTC (rev 1595)
+++ jbpm3/trunk/modules/jpdl/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-07-11 17:25:28 UTC (rev 1596)
@@ -429,14 +429,6 @@
and ti.end IS NULL
]]>
</query>
-
- <query name="GraphSession.findAllTokensOfProcessInstance">
- <![CDATA[
- select token
- from org.jbpm.graph.exe.Token token
- where token.processInstance = :instance
- ]]>
- </query>
<query name="TaskMgmtSession.findTaskForNode">
<![CDATA[
17 years, 9 months