JBoss JBPM SVN: r3585 - jbpm4/trunk/modules/userguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-12-30 11:33:27 -0500 (Tue, 30 Dec 2008)
New Revision: 3585
Added:
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
Log:
add the script task documentation
Added: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml (rev 0)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml 2008-12-30 16:33:27 UTC (rev 3585)
@@ -0,0 +1,896 @@
+<chapter id="jpdl">
+ <title>jPDL</title>
+
+ <para>This chapter will explain the jPDL file format for describing
+ process definitions. The schemadocs can also serve as a quick reference for this
+ information.
+ </para>
+ <para>An example jPDL process file looks like this:
+ </para>
+ <programlisting><?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Purchase order" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="Verify supplier" />
+ </start>
+
+ <state name="Verify supplier">
+ <flow name="Supplier ok" to="Check supplier data" />
+ <flow name="Supplier not ok" to="Error" />
+ </state>
+
+ <exclusive name="Check supplier data">
+ <flow name="nok" to="Error" />
+ <flow name="ok" to="Completed" />
+ </exclusive>
+
+ <end name="Completed" />
+
+ <end name="Error" />
+
+</process></programlisting>
+
+ <section id="process">
+ <title><literal>process</literal></title>
+ <para>The top level element representing one process definition.
+ </para>
+ <table><title><literal>process</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>name</literal></entry>
+ <entry>any text</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>name or label of the process used to display to the process
+ name in user interactions.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>key</literal></entry>
+ <entry>alpha numeric characters and underscores</entry>
+ <entry>if omitted, the key will be generated based on the name by replacing
+ all non-alpha-numeric characters with underscores</entry>
+ <entry>optional</entry>
+ <entry>identification to distinct different process definitions.
+ Multiple versions of a process with the same key can be deployed.
+ The key:name combination must remain exactly the same for all
+ deployed versions.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>version</literal></entry>
+ <entry>integer</entry>
+ <entry>one higher then highest version number starting with 1 if no other process
+ is deployed with the same name/key.
+ </entry>
+ <entry>optional</entry>
+ <entry>version number of this process</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table><title><literal>process</literal> elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>description</literal></entry>
+ <entry>0..1</entry>
+ <entry>description text</entry>
+ </row>
+ <row>
+ <entry><link linkend="activities">activities</link></entry>
+ <entry>1..*</entry>
+ <entry>a list of any activity type can be placed here. At least
+ one <literal>start</literal> activity must be present.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section id="activities">
+ <title>Activities</title>
+ <para>(BPMN note: when we mention activities here, we are not only refering to BPMN
+ activities, but also to BPMN events and BPMN gateways.)
+ </para>
+
+ <section id="start">
+ <title><literal>start</literal></title>
+ <para>Indicates where an execution for this process starts. Typically there is
+ exactly one start activity in a process. A process has to have at least one start
+ activity. A start activity must have exactly one outgoing flow and that flow
+ is taken when a process execution starts.
+ </para>
+ <table><title><literal>start</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>name</literal></entry>
+ <entry>any text</entry>
+ <entry></entry>
+ <entry>optional</entry>
+ <entry>name of the activity. Since a start activity
+ cannot have incoming flows, the name is optional.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table><title><literal>start</literal> elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>flow</literal></entry>
+ <entry>1</entry>
+ <entry>the outgoing flow</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section id="state">
+ <title><literal>state</literal></title>
+ <para>A wait state. Process execution will wait until an external trigger is
+ provided through the API. Apart from the <link linkend="commonactivitycontent">
+ common activity content</link>, <literal>state</literal> doesn't have any extra
+ attributes or elements.
+ </para>
+ <section id="statesequence">
+ <title><literal>state</literal> sequence</title>
+ <para>Let's look at an example which shows states connected with flows
+ as a sequence</para>
+ <figure id="state.sequence">
+ <title>A sequence of states</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/state.sequence.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="StateSequence" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="a" />
+ </start>
+
+ <state name="a">
+ <flow to="b" />
+ </state>
+
+ <state name="b">
+ <flow to="c" />
+ </state>
+
+ <state name="c" />
+
+</process></programlisting>
+ <para>After you start an execution like this:</para>
+ <programlisting>Execution execution = executionService.startExecutionByKey("StateSequence");</programlisting>
+ <para>the created process instance will be positioned in
+ state <literal>a</literal>. Providing an external trigger can
+ be done with the <literal>signalExecution</literal> methods.</para>
+ <programlisting>String executionId = execution.getId();
+execution = executionService.signalExecutionById(executionId);</programlisting>
+ </section>
+ <section id="statechoice">
+ <title><literal>state</literal> choice</title>
+ <para>In this second example with states, we'll show how you can use a
+ <literal>state</literal> can be used to feed in an external choice of
+ the path to take.
+ </para>
+ <figure id="state.choice">
+ <title>A choice between state</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/state.choice.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="StateChoice" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="wait for response" />
+ </start>
+
+ <state name="wait for response">
+ <flow name="accept" to="submit document" />
+ <flow name="reject" to="try again" />
+ </state>
+
+ <state name="submit document" />
+
+ <state name="try again" />
+
+</process></programlisting>
+ <para>Let's start a new process instance for this process definition:</para>
+ <programlisting>Execution execution = executionService.startExecutionByKey("StateSequence");</programlisting>
+ <para>Now, the execution is arrived in the <literal>wait for response</literal>.
+ The execution will wait there until an external trigger is given. In case
+ a <literal>state</literal> has multiple outgoing flows, the signalName given
+ in the external trigger will be matched against the name of the outgoing flow
+ to take. So when we provide signalName <literal>accept</literal> like this:
+ </para>
+ <programlisting>executionService.signalExecutionById(executionId, "accept");</programlisting>
+ <para>Then the execution will continue over the outgoing flow named
+ <literal>accept</literal>. Analogue, when signalName <literal>reject</literal>
+ is given in the signalExecutionXxx methods, the execution will continue over
+ the outgoing flow named reject.
+ </para>
+ </section>
+ </section>
+
+ <section id="java">
+ <title><literal>java</literal></title>
+ <para>The Java task. A process execution will execute the method of the class that is configured
+ in this task.</para>
+ <table><title><literal>java</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>class</literal></entry>
+ <entry></entry>
+ <entry></entry>
+ <entry></entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry><literal>method</literal></entry>
+ <entry></entry>
+ <entry></entry>
+ <entry></entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry><literal>var</literal></entry>
+ <entry></entry>
+ <entry></entry>
+ <entry></entry>
+ <entry></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table><title><literal>java</literal> elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>field</literal></entry>
+ <entry></entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry><literal>arg</literal></entry>
+ <entry></entry>
+ <entry></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>Consider the following example.</para>
+ <figure id="java">
+ <title>A java task</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/java.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="Java" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="invoke java method" />
+ </start>
+
+ <java name="invoke java method"
+ class="org.jbpm.examples.java.JohnDoe"
+ method="hello"
+ var="answer">
+
+ <field name="state"><string value="fine"/></field>
+ <field name="session"><env type="org.hibernate.Session"/></field>
+
+ <arg><string value="Hi, how are you?"/></arg>
+
+ <flow to="wait" />
+ </java>
+
+ <state name="wait">
+
+</process>
+ </programlisting>
+ <para>The java task specifies that during its execution an instance of the class <literal>org.jbpm.examples.java.JohnDoe</literal>
+ will be instantiated and the method <literal>hello</literal> of this class will be invoked on the resulting object. The variable named
+ <literal>answer</literal> will contain the result of the invocation. Let's look at the class <literal>JohnDoe</literal> below.
+ </para>
+ <programlisting>package org.jbpm.examples.java;
+
+import org.hibernate.Session;
+
+public class JohnDoe {
+
+ String state;
+ Session session;
+
+ public String hello(String msg) {
+ if ( (msg.indexOf("how are you?")!=-1)
+ && (session.isOpen())
+ ) {
+ return "I'm "+state+", thank you.";
+ }
+ return null;
+ }
+}
+ </programlisting>
+ <para>The class above reveals that it contains two fields named <literal>state</literal> and <literal>session</literal>
+ and that the method <literal>hello</literal> accepts one argument. During the execution the values specified in the
+ <literal>field</literal> and <literal>arg</literal> configuration elements will be used. The expected result of creating
+ a process instance is that the process variable <literal>answer</literal> contains the string
+ <literal>I'm fine, thank you.</literal>.
+ </para>
+ </section>
+
+ <section id="script">
+ <title><literal>script</literal></title>
+ <para>The Script task. A process execution will execute a script that is specified by this task. The script can be
+ specified by either the <literal>expr</literal> attribute or by the inclusion of the <literal>text</literal> nested
+ element. The result of the evaluation
+ </para>
+ <table><title><literal>script</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>expr</literal></entry>
+ <entry></entry>
+ <entry></entry>
+ <entry></entry>
+ <entry></entry>
+ </row>
+ <row>
+ <entry><literal>var</literal></entry>
+ <entry></entry>
+ <entry></entry>
+ <entry></entry>
+ <entry></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table><title><literal>script</literal> elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>text</literal></entry>
+ <entry></entry>
+ <entry></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>Consider the following example.</para>
+ <figure id="script">
+ <title>A script task</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/script.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="ScriptExpression" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="invoke script" />
+ </start>
+
+ <script name="invoke script"
+ expr="Send packet to #{person.address}"
+ var="text">
+
+ <flow to="wait" />
+ </script>
+
+ <state name="wait"/>
+
+</process></programlisting>
+ </section>
+
+ <section id="esb">
+ <title><literal>esb</literal></title>
+ </section>
+
+ <section id="sql">
+ <title><literal>sql</literal></title>
+ </section>
+
+ <section id="hql">
+ <title><literal>hql</literal></title>
+ </section>
+
+ <section id="task">
+ <title><literal>task</literal></title>
+ </section>
+
+ <section id="exclusive">
+ <title><literal>exclusive</literal></title>
+ <para>Takes one path of many alternatives. Also known as a decision. An exclusive
+ activity has multiple outgoing flows and when an execution arrives in an exclusive
+ activity, an automatic evaluation will decide which outgoing flow is taken.
+ </para>
+ <para>An exclusive activity should be configured in one of the three following ways:
+ </para>
+
+ <section id="exclusiveconditions">
+ <title>Exclusive conditions</title>
+ <para>An exclusive with conditions on the flows evaluates the condition in each flow.
+ The first flow for which the nested condition expression resolves to true or which does
+ not have a condition is taken.
+ </para>
+ <table><title><literal>exclusive.flow.condition</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>expr</literal></entry>
+ <entry>expression</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>script that will be evaluated in the specified
+ expression language.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>lang</literal></entry>
+ <entry>expression language</entry>
+ <entry>the <literal>default-expression-language</literal> taken from the <link linkend="scripting"><literal>script-manager</literal> configuration</link></entry>
+ <entry>optional</entry>
+ <entry>the language in which <literal>expr</literal> is
+ to be evaluated.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>Example:
+ </para>
+ <figure id="exclusive">
+ <title>The exclusive gateway</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/exclusive.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="ExclusiveConditions" >
+
+ <start>
+ <flow to="evaluate document" />
+ </start>
+
+ <exclusive name="evaluate document">
+ <flow to="submit document">
+ <emphasis role="bold"><condition expr="#{content=="good"}" /></emphasis>
+ </flow>
+ <flow to="try again">
+ <emphasis role="bold"><condition expr="#{content=="not so good"}" /></emphasis>
+ </flow>
+ <flow to="give up" />
+ </exclusive>
+
+ <state name="submit document" />
+
+ <state name="try again" />
+
+ <state name="give up" />
+
+</process></programlisting>
+ </section>
+
+ <section id="exclusiveexpression">
+ <title>Exclusive expression</title>
+ <para>An exclusive expression evaluates to a String representing the name of
+ an outgoing flow.
+ </para>
+ <table><title><literal>exclusive</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>expr</literal></entry>
+ <entry>expression</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>script that will be evaluated in the specified
+ expression language.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>lang</literal></entry>
+ <entry>expression language</entry>
+ <entry>the <literal>default-expression-language</literal> taken from the <link linkend="scripting"><literal>script-manager</literal> configuration</link></entry>
+ <entry>optional</entry>
+ <entry>the language in which <literal>expr</literal> is
+ to be evaluated.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>Example:
+ </para>
+ <para>Same picture as <link linkend="exclusive">above</link>.
+ </para>
+ <programlisting><process name="Poolcar">
+ <start>
+ <flow to="How far?" />
+ </start>
+ <exclusive name="How far?" <emphasis role="bold">expr="#{distance}"</emphasis>>
+ <flow name="far" to="Big car" />
+ <flow name="nearby" to="Small car" />
+ </exclusive>
+ <state name="Big car" />
+ <state name="Small car" />
+</process></programlisting>
+ <para>When you start an new process instance like this
+ </para>
+ <programlisting>Map<String, Object> variables = new HashMap<String, Object>();
+variables.put("distance", "far");
+Execution execution = executionService.startExecutionByKey("Poolcar", variables);</programlisting>
+ <para>then the new execution will go to node <literal>Big car</literal>.</para>
+ </section>
+
+ <section id="exclusivehandler">
+ <title>Exclusive handler</title>
+ <para>An exclusive handler is a java class that implements the
+ <literal>ExclusiveHandler</literal> interface. The exclusive handler
+ will be responsible for selecting the name of the outgoing flow.
+ </para>
+ <programlisting>public interface ExclusiveHandler {
+ String select(OpenExecution execution);
+}</programlisting>
+ <para>The handler is specified as a sub element of the exclusive</para>
+ <table><title><literal>exclusive.handler</literal> attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>class</literal></entry>
+ <entry>classname</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>fully qualified classname of the handler implementation class.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>Here's an example process of an exclusive using an ExclusiveHandler:</para>
+ <para>Same picture as <link linkend="exclusive">above</link>.
+ </para>
+ <programlisting><process name="ExclusiveHandler">
+
+ <start>
+ <flow to="evaluate document" />
+ </start>
+
+ <exclusive name="evaluate document">
+ <handler class="org.jbpm.examples.exclusive.handler.ContentEvaluation" />
+ <flow name="good" to="submit document" />
+ <flow name="bad" to="try again" />
+ <flow name="ugly" to="give up" />
+ </exclusive>
+
+ <state name="submit document" />
+
+ <state name="try again" />
+
+ <state name="give up" />
+
+</process></programlisting>
+ <para>The ContentEvaluation class looks like this</para>
+ <programlisting>public class ContentEvaluation implements ExclusiveHandler {
+
+ public String select(OpenExecution execution) {
+ String content = (String) execution.getVariable("content");
+ if (content.equals("you're great")) {
+ return "good";
+ }
+ if (content.equals("you gotta improve")) {
+ return "bad";
+ }
+ return "ugly";
+ }
+}</programlisting>
+ <para>Now, when we start a process instance and supply value
+ <literal>you're great</literal> for variable content, then the
+ ContentEvaluation will return String <literal>good</literal> and
+ the process instance will arrive in node <literal>Submit document</literal>.
+ </para>
+ </section>
+
+ </section>
+
+ <section id="end">
+ <title><literal>end</literal></title>
+ <para>Ends the execution.
+ </para>
+ <section id="endprocessinstance">
+ <title><literal>end</literal> process instance</title>
+ <para>By default, an end activity will end the complete
+ process instance. In case multiple concurrent executions
+ are still active within the same process instance, all of
+ them will be ended.
+ </para>
+ <figure id="end.processinstance">
+ <title>The end event</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/end.processinstance.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="EndProcessInstance" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="end" />
+ </start>
+
+ <end name="end" />
+
+</process></programlisting>
+ <para>When a new process instance is created, it immediately ends.</para>
+ </section>
+ <section id="endexecution">
+ <title><literal>end</literal> execution</title>
+ <para>Only the execution that arrives in the
+ end activity will be ended and other concurrent executions
+ should be left active. To get this behaviour, set
+ attribute <literal>ends="execution"</literal>
+ </para>
+ <table><title><literal>end</literal> execution attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>ends</literal></entry>
+ <entry>{processinstance|execution}</entry>
+ <entry>processinstance</entry>
+ <entry>optional</entry>
+ <entry>specifies if the whole process instance should be ended or
+ just the path of execution that arrives in the end activity.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section id="endmultiple">
+ <title><literal>end</literal> multiple</title>
+ <para>A process can have multiple end events. This can be handy to indicate
+ different outcomes of a process instance. For example
+ </para>
+ <figure id="end.multiple">
+ <title>Multiple end events</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/end.multiple.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="EndMultiple" xmlns="http://;jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="get return code" />
+ <start>
+
+ <state name="get return code">
+ <flow name="200" to="ok"/>
+ <flow name="400" to="bad request"/>
+ <flow name="500" to="internal server error"/>
+ </state>
+
+ <end name="ok"/>
+ <end name="bad request"/>
+ <end name="internal server error"/>
+
+</process>
+ </programlisting>
+ <para>Now if we would start an execution and signal it to move out of the <literal>get return code</literal> wait state with the
+ following code, the execution would end with the <literal>bad request</literal> end event.</para>
+ <programlisting>Execution execution = executionService.startExecutionByKey("EndMultiple");
+String executionId = execution.getId();
+execution = executionService.signalExecutionById(executionId, "400");
+ </programlisting>
+ <para>Likewise, using the value <literal>200</literal> or <literal>500</literal> would cause the execution
+ to end with the <literal>ok</literal> or with the <literal>internal server error</literal> end events
+ respectively.</para>
+ </section>
+
+ <section id="endstate">
+ <title><literal>end</literal> state</title>
+ <para>An execution can also end with different states. It is another way to specify the outcome of a process.
+ It is indicated by the <literal>state</literal> attribute of the end event or by the <literal>end-cancel</literal>
+ and <literal>end-error</literal> shortcut notations.
+ </para>
+
+ <table><title><literal>end</literal> execution attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>state</literal></entry>
+ <entry>String</entry>
+ <entry></entry>
+ <entry>optional</entry>
+ <entry>the state assigned to the execution.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>Take for example the following process.
+ </para>
+ <figure id="end.state">
+ <title>Different end states</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/end.state.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="EndState" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <flow to="get return code"/>
+ </start>
+
+ <state name="get return code">
+ <flow name="200" to="ok"/>
+ <flow name="400" to="bad request" />
+ <flow name="500" to="internal server error"/>
+ </state>
+
+ <end name="ok" state="completed"/>
+ <end-cancel name="bad request"/>
+ <end-error name="internal server error"/>
+
+</process>
+ </programlisting>
+ <para>This time, if we would start an execution and signal it to move out of the <literal>get return code</literal> wait state with the
+ following code, the execution would end with the <literal>cancel</literal> state.</para>
+ <programlisting>Execution execution = executionService.startExecutionByKey("EndState");
+String executionId = execution.getId();
+execution = executionService.signalExecutionById(executionId, "400");
+ </programlisting>
+ <para>Similarly as above, using the value <literal>200</literal> or <literal>500</literal> would cause the execution
+ to end with the <literal>completed</literal> or with the <literal>error</literal> states
+ respectively.</para>
+
+ </section>
+ </section>
+
+ <section id="commonactivitycontents">
+ <title>Common activity contents</title>
+ <para>Unless specified otherwise above, all activities also include this
+ content model:
+ </para>
+ <table><title>Common activity attributes:</title>
+ <tgroup cols="5" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Attribute</entry>
+ <entry>Type</entry>
+ <entry>Default</entry>
+ <entry>Required?</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>name</literal></entry>
+ <entry>any text</entry>
+ <entry></entry>
+ <entry><emphasis role="bold">required</emphasis></entry>
+ <entry>name of the activity</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table><title>Common activity elements:</title>
+ <tgroup cols="3" rowsep="1" colsep="1">
+ <thead>
+ <row>
+ <entry>Element</entry>
+ <entry>Multiplicity</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>flow</literal></entry>
+ <entry>0..*</entry>
+ <entry>the outgoing flows</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ </section>
+
+</chapter>
15 years, 4 months
JBoss JBPM SVN: r3584 - in jbpm4/tags/jbpm-4.0.0.Alpha1: modules/api and 14 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-29 08:33:50 -0500 (Mon, 29 Dec 2008)
New Revision: 3584
Modified:
jbpm4/tags/jbpm-4.0.0.Alpha1/build.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/api/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/db/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/devguide/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/distro/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/enterprise/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/examples/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/jpdl/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/log/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/pvm/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/task/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-base/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-db/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-load/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-pojo/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/modules/userguide/pom.xml
jbpm4/tags/jbpm-4.0.0.Alpha1/pom.xml
Log:
changed version from 4.0.0-SNAPSHOT to 4.0.0-Alpha1
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/build.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/build.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/build.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -21,7 +21,7 @@
<property name="linux.browser" value="mozilla" />
<property name="distro.installation.dir" value="c:/software" />
- <property name="distro.version" value="4.0.0-SNAPSHOT" />
+ <property name="distro.version" value="4.0.0-Alpha1" />
<property name="distro.eclipse" value="c:/downloads/eclipse/eclipse-jee-ganymede-SR1-win32.zip" />
<property name="distro.gef" value="c:/downloads/eclipse/GEF-runtime-3.4.1.zip" />
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/api/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/api/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/api/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -22,7 +22,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/db/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/db/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/db/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/devguide/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/devguide/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/devguide/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/distro/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/distro/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/distro/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/enterprise/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/enterprise/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/enterprise/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/examples/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/examples/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/examples/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/jpdl/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/jpdl/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/jpdl/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/log/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/log/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/log/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/pvm/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/pvm/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/pvm/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/task/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/task/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/task/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -24,7 +24,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-base/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-base/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-base/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-db/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-db/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-db/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-load/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-load/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-load/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-pojo/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-pojo/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/test-pojo/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -21,7 +21,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/modules/userguide/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/modules/userguide/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/modules/userguide/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/tags/jbpm-4.0.0.Alpha1/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0.0.Alpha1/pom.xml 2008-12-29 13:14:35 UTC (rev 3583)
+++ jbpm4/tags/jbpm-4.0.0.Alpha1/pom.xml 2008-12-29 13:33:50 UTC (rev 3584)
@@ -22,7 +22,7 @@
<artifactId>jbpm</artifactId>
<packaging>pom</packaging>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.0-Alpha1</version>
<organization>
<name>JBoss, a division of Red Hat</name>
15 years, 4 months
JBoss JBPM SVN: r3583 - jbpm4/tags.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-29 08:14:35 -0500 (Mon, 29 Dec 2008)
New Revision: 3583
Added:
jbpm4/tags/jbpm-4.0.0.Alpha1/
Log:
copying tag jbpm-4.0.0.Alpha1 from trunk
Copied: jbpm4/tags/jbpm-4.0.0.Alpha1 (from rev 3582, jbpm4/trunk)
15 years, 4 months
JBoss JBPM SVN: r3582 - in jbpm4/trunk/modules: jpdl/src/test/java/org/jbpm/jpdl/parsing and 5 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-29 08:10:52 -0500 (Mon, 29 Dec 2008)
New Revision: 3582
Modified:
jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java
jbpm4/trunk/modules/pvm/pom.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java
jbpm4/trunk/modules/task/pom.xml
Log:
further cleanup
Modified: jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java 2008-12-29 12:27:04 UTC (rev 3581)
+++ jbpm4/trunk/modules/jpdl/src/main/java/org/jbpm/jpdl/xml/JpdlParser.java 2008-12-29 13:10:52 UTC (rev 3582)
@@ -163,7 +163,7 @@
if (startNodes.size()==0) {
- parse.addProblem("no start event in process");
+ parse.addProblem("no start activity in process");
} else if (startNodes.size()>1) {
parse.addProblem("multiple start events not yet supported");
// TODO verify that all start events have conditions
Modified: jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java
===================================================================
--- jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java 2008-12-29 12:27:04 UTC (rev 3581)
+++ jbpm4/trunk/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/JpdlSchemaTest.java 2008-12-29 13:10:52 UTC (rev 3582)
@@ -33,9 +33,9 @@
public void testSimplestValidProcess() {
List<Problem> problems = parseProblems(
- "<jpdl:process xmlns:jpdl='http://jbpm.org/jpdl4' " +
- " name='p' initial='n'>" +
- " <jpdl:state name='n' />" +
+ "<jpdl:process xmlns:jpdl='http://jbpm.org/4/jpdl' " +
+ " name='p' >" +
+ " <jpdl:start name='n' />" +
"</jpdl:process>"
);
assertEquals("", problems.toString());
Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml 2008-12-29 12:27:04 UTC (rev 3581)
+++ jbpm4/trunk/modules/pvm/pom.xml 2008-12-29 13:10:52 UTC (rev 3582)
@@ -105,16 +105,6 @@
<configuration>
<excludes>
<exclude>**/*TestCase.java</exclude>
- <exclude>**/ExecutionServiceTest.java</exclude>
- <exclude>**/AutomaticDecisionDbTest.java</exclude>
- <exclude>**/PersistentExecutionModeTest.java</exclude>
- <exclude>**/BasicProcessPersistenceTest.java</exclude>
- <exclude>**/ProcessServiceTest.java</exclude>
- <exclude>**/JobExecutorTest.java</exclude>
- <exclude>**/ContinuationTest.java</exclude>
- <exclude>**/LanguageExtensionsDbTest.java</exclude>
- <exclude>**/ObjectWireTest.java</exclude>
- <exclude>**/ClassWireTest.java</exclude>
</excludes>
</configuration>
</plugin>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java 2008-12-29 12:27:04 UTC (rev 3581)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java 2008-12-29 13:10:52 UTC (rev 3582)
@@ -58,7 +58,7 @@
} catch (ClassNotFoundException e) {
log.trace("couldn't load class "+className+" with pvm lib classloader "+classLoader);
}
- throw new JbpmException("couldn't find class "+className);
+ throw new JbpmException("couldn't load class "+className);
}
public static InputStream getResourceAsStream(ClassLoader classLoader, String resource) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.java 2008-12-29 12:27:04 UTC (rev 3581)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ClassDescriptor.java 2008-12-29 13:10:52 UTC (rev 3582)
@@ -26,7 +26,7 @@
try {
return ReflectUtil.loadClass(classLoader, text);
} catch (JbpmException e) {
- Throwable cause = e.getCause();
+ Throwable cause = (e.getCause()!=null ? e.getCause() : e);
throw new WireException("couldn't load class '"+text+"': "+cause.getMessage(), cause);
}
}
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java 2008-12-29 12:27:04 UTC (rev 3581)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectWireTest.java 2008-12-29 13:10:52 UTC (rev 3582)
@@ -994,6 +994,8 @@
assertTextPresent("attributes 'class' and 'method' indicate static method and also a 'constructor' element is specified for element 'object': ", problems.get(0).getMsg());
}
+ /* this error message has been removed because object binding is reused in
+ * the context of jpdl parsing, in which case other elements are allowed.
public void testBadOperation(){
List<Problem> problems = parseProblems(
"<objects>" +
@@ -1008,6 +1010,7 @@
assertTextPresent("element 'object' can only have 'factory', 'arg', 'constructor' elements or an operation element", problems.get(1).getMsg());
assertTextPresent("Invalid element 'bad-operation' in: ", problems.get(1).getMsg());
}
+ */
public void testConstructorAndFactoryAttribute(){
List<Problem> problems = parseProblems(
Modified: jbpm4/trunk/modules/task/pom.xml
===================================================================
--- jbpm4/trunk/modules/task/pom.xml 2008-12-29 12:27:04 UTC (rev 3581)
+++ jbpm4/trunk/modules/task/pom.xml 2008-12-29 13:10:52 UTC (rev 3582)
@@ -91,20 +91,4 @@
</plugins>
</build>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <quiet>true</quiet>
- <source>1.5</source>
- <verbose>false</verbose>
- <noqualifier>all</noqualifier>
- <excludePackageNames>*.internal:*.test</excludePackageNames>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
-
</project>
\ No newline at end of file
15 years, 4 months
JBoss JBPM SVN: r3581 - in jbpm4/trunk/modules/pvm/src/test: java/org/jbpm/pvm/eventlistener and 8 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-29 07:27:04 -0500 (Mon, 29 Dec 2008)
New Revision: 3581
Added:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/DisplaySource.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventListenerTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/PrintLn.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/AutomaticCreditRating.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/BasicProcessExecutionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/Decision.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/ExternalDecisionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/InternalDecisionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/VariablesTest.java
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/variables/
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/variables/custom.types.jbpm.cfg.xml
Removed:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example06/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example07/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example08/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/langext/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/type/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ExamplesConfiguration.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/activities/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex01/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex02/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex03/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex04/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex05/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex06/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex07/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex08/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex09/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex13/
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/db/langext/
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/db/type/
Modified:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
Log:
pvm test suite cleanup
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/DisplaySource.java (from rev 3579, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example08/DisplaySource.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/DisplaySource.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/DisplaySource.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.eventlistener;
+
+import org.jbpm.listener.EventListener;
+import org.jbpm.listener.EventListenerExecution;
+
+public class DisplaySource implements EventListener {
+
+ private static final long serialVersionUID = 1L;
+
+ public void notify(EventListenerExecution execution) {
+ System.out.println("leaving "+execution.getEventSource());
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/DisplaySource.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventListenerTest.java (from rev 3579, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example07/EventListenerTest.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventListenerTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventListenerTest.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.eventlistener;
+
+import javax.enterprise.deploy.spi.exceptions.ClientExecuteException;
+
+import org.jbpm.client.ClientExecution;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.model.Event;
+import org.jbpm.pvm.display.Display;
+import org.jbpm.pvm.display.TestConsole;
+import org.jbpm.pvm.executionmode.object.AutomaticActivity;
+import org.jbpm.pvm.executionmode.object.WaitState;
+import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
+
+
+public class EventListenerTest extends JbpmTestCase {
+
+ TestConsole testConsole;
+
+ public void setUp() {
+ testConsole = TestConsole.install();
+ }
+
+ public void tearDown() {
+ TestConsole.uninstall();
+ testConsole = null;
+ }
+
+ public void testEventListener() {
+ ClientProcessDefinition processDefinition = ProcessFactory.build()
+ .node("a").initial().behaviour(new AutomaticActivity())
+ .event(Event.NODE_END)
+ .listener(new PrintLn("leaving a"))
+ .listener(new PrintLn("second message while leaving a"))
+ .transition().to("b")
+ .listener(new PrintLn("taking transition"))
+ .node("b").behaviour(new WaitState())
+ .event(Event.NODE_BEGIN)
+ .listener(new PrintLn("entering b"))
+ .done();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+
+ assertEquals("leaving a", testConsole.getLine(0));
+ assertEquals("second message while leaving a", testConsole.getLine(1));
+ assertEquals("taking transition", testConsole.getLine(2));
+ assertEquals("entering b", testConsole.getLine(3));
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventListenerTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java (from rev 3579, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example08/EventPropagationTest.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.eventlistener;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.client.ClientExecution;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.model.Event;
+import org.jbpm.pvm.display.TestConsole;
+import org.jbpm.pvm.executionmode.object.WaitState;
+import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
+
+
+public class EventPropagationTest extends JbpmTestCase {
+
+ TestConsole testConsole;
+
+ public void setUp() {
+ testConsole = TestConsole.install();
+ }
+
+ public void tearDown() {
+ TestConsole.uninstall();
+ testConsole = null;
+ }
+
+ public void testEventPropagation() {
+ ClientProcessDefinition processDefinition = ProcessFactory.build("propagate")
+ .compositeNode("composite")
+ .event(Event.NODE_END)
+ .listener(new DisplaySource())
+ .node("a").initial().behaviour(new WaitState())
+ .transition().to("b")
+ .node("b").behaviour(new WaitState())
+ .transition().to("c")
+ .compositeEnd()
+ .node("c").behaviour(new WaitState())
+ .done();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+
+ List<String> expectedLines = new ArrayList<String>();
+ assertEquals(expectedLines, testConsole.lines);
+
+ execution.signal();
+
+ expectedLines.add("leaving node(a)");
+ assertEquals(expectedLines, testConsole.lines);
+
+ execution.signal();
+
+ expectedLines.add("leaving node(b)");
+ expectedLines.add("leaving node(composite)");
+ assertEquals(expectedLines, testConsole.lines);
+ }
+
+ public void testEventPropagationDisabled() {
+ ClientProcessDefinition processDefinition = ProcessFactory.build("propagate")
+ .compositeNode("composite")
+ .event(Event.NODE_END)
+ .listener(new DisplaySource())
+ .propagationDisabled()
+ .node("a").initial().behaviour(new WaitState())
+ .transition().to("b")
+ .node("b").behaviour(new WaitState())
+ .transition().to("c")
+ .compositeEnd()
+ .node("c").behaviour(new WaitState())
+ .done();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+
+ List<String> expectedLines = new ArrayList<String>();
+ assertEquals(expectedLines, testConsole.lines);
+
+ execution.signal();
+
+ assertEquals(expectedLines, testConsole.lines);
+
+ execution.signal();
+
+ expectedLines.add("leaving node(composite)");
+ assertEquals(expectedLines, testConsole.lines);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/EventPropagationTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/PrintLn.java (from rev 3579, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example07/PrintLn.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/PrintLn.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/PrintLn.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.eventlistener;
+
+import org.jbpm.listener.EventListener;
+import org.jbpm.listener.EventListenerExecution;
+
+
+public class PrintLn implements EventListener {
+
+ private static final long serialVersionUID = 1L;
+
+ String message;
+
+ public PrintLn(String message) {
+ this.message = message;
+ }
+
+ public void notify(EventListenerExecution execution) throws Exception {
+ System.out.println(message);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/eventlistener/PrintLn.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/AutomaticCreditRating.java (from rev 3579, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex05/AutomaticCreditRating.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/AutomaticCreditRating.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/AutomaticCreditRating.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.execution;
+
+import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityExecution;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class AutomaticCreditRating implements Activity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) {
+ int creditRate = (Integer) execution.getVariable("creditRate");
+
+ if (creditRate > 5) {
+ execution.take("good");
+
+ } else if (creditRate < -5) {
+ execution.take("bad");
+
+ } else {
+ execution.take("average");
+ }
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/AutomaticCreditRating.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/BasicProcessExecutionTest.java (from rev 3579, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example06/BasicProcessExecutionTest.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/BasicProcessExecutionTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/BasicProcessExecutionTest.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.execution;
+
+import org.jbpm.client.ClientExecution;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.pvm.display.Display;
+import org.jbpm.pvm.externalactivity.WaitState;
+import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
+
+
+public class BasicProcessExecutionTest extends JbpmTestCase {
+
+ public void testBasicProcessExecution() {
+ ClientProcessDefinition processDefinition = ProcessFactory.build("loan")
+ .node("submit loan request").initial().behaviour(new Display("loan request submitted"))
+ .transition().to("evaluate")
+ .node("evaluate").behaviour(new WaitState())
+ .transition("approve").to("wire money")
+ .transition("reject").to("end")
+ .node("wire money").behaviour(new Display("wire the money"))
+ .transition().to("archive")
+ .node("archive").behaviour(new WaitState())
+ .transition().to("end")
+ .node("end").behaviour(new WaitState())
+ .done();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+
+
+
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/BasicProcessExecutionTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/Decision.java (from rev 3579, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex04/Decision.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/Decision.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/Decision.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.execution;
+
+import java.util.Map;
+
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.activity.ExternalActivity;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Decision implements ExternalActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ execution.waitForSignal();
+ }
+
+ public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception {
+ execution.take(signalName);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/Decision.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/ExternalDecisionTest.java (from rev 3579, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex04/ExternalDecisionTest.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/ExternalDecisionTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/ExternalDecisionTest.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.execution;
+
+import junit.framework.TestCase;
+
+import org.jbpm.client.ClientExecution;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.pvm.executionmode.embedded.AutomaticActivity;
+import org.jbpm.pvm.externalactivity.WaitState;
+import org.jbpm.pvm.model.ProcessFactory;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ExternalDecisionTest extends TestCase {
+
+ public static ClientProcessDefinition createCreditProcess() {
+ return ProcessFactory.build()
+ .node("initial").initial().behaviour(new AutomaticActivity())
+ .transition().to("creditRate?")
+ .node("creditRate?").behaviour(new Decision())
+ .transition("good").to("priority delivery")
+ .transition("average").to("bulk delivery")
+ .transition("bad").to("payment upfront")
+ .node("priority delivery").behaviour(new WaitState())
+ .node("bulk delivery").behaviour(new WaitState())
+ .node("payment upfront").behaviour(new WaitState())
+ .done();
+ }
+
+ public void testGoodRating() {
+ ClientProcessDefinition processDefinition = createCreditProcess();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ execution.signal("good");
+
+ assertEquals("priority delivery", execution.getNode().getName());
+ }
+
+ public void testAverageRating() {
+ ClientProcessDefinition processDefinition = createCreditProcess();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ execution.signal("average");
+
+ assertEquals("bulk delivery", execution.getNode().getName());
+ }
+
+ public void testBadRating() {
+ ClientProcessDefinition processDefinition = createCreditProcess();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ execution.signal("bad");
+
+ assertEquals("payment upfront", execution.getNode().getName());
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/ExternalDecisionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/InternalDecisionTest.java (from rev 3579, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex05/InternalDecisionTest.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/InternalDecisionTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/InternalDecisionTest.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.execution;
+
+import junit.framework.TestCase;
+
+import org.jbpm.client.ClientExecution;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.pvm.externalactivity.WaitState;
+import org.jbpm.pvm.model.ProcessFactory;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class InternalDecisionTest extends TestCase {
+
+ public static ClientProcessDefinition createCreditProcess() {
+ return ProcessFactory.build()
+ .node("get credit rate").initial().behaviour(WaitState.class)
+ .transition().to("creditRate?")
+ .node("creditRate?").behaviour(AutomaticCreditRating.class)
+ .transition("good").to("priority delivery")
+ .transition("average").to("bulk delivery")
+ .transition("bad").to("payment upfront")
+ .node("priority delivery").behaviour(WaitState.class)
+ .node("bulk delivery").behaviour(WaitState.class)
+ .node("payment upfront").behaviour(WaitState.class)
+ .done();
+ }
+
+ public void testGoodRating() {
+ ClientProcessDefinition processDefinition = createCreditProcess();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ execution.setVariable("creditRate", 7);
+ execution.signal();
+
+ assertEquals("priority delivery", execution.getNode().getName());
+ }
+
+ public void testAverageRating() {
+ ClientProcessDefinition processDefinition = createCreditProcess();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ execution.setVariable("creditRate", 2);
+ execution.signal();
+
+ assertEquals("bulk delivery", execution.getNode().getName());
+ }
+
+ public void testBadRating() {
+ ClientProcessDefinition processDefinition = createCreditProcess();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+ execution.setVariable("creditRate", -9);
+ execution.signal();
+
+ assertEquals("payment upfront", execution.getNode().getName());
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/execution/InternalDecisionTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java 2008-12-29 12:00:36 UTC (rev 3580)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -25,9 +25,9 @@
import org.jbpm.client.ClientExecution;
import org.jbpm.env.Environment;
import org.jbpm.env.EnvironmentFactory;
+import org.jbpm.pvm.externalactivity.WaitState;
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.samples.activities.WaitState;
import org.jbpm.test.JbpmTestCase;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java 2008-12-29 12:00:36 UTC (rev 3580)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -25,9 +25,9 @@
import org.jbpm.client.ClientExecution;
import org.jbpm.env.Environment;
import org.jbpm.env.EnvironmentFactory;
+import org.jbpm.pvm.externalactivity.WaitState;
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.model.ProcessFactory;
-import org.jbpm.pvm.samples.activities.WaitState;
import org.jbpm.test.JbpmTestCase;
Deleted: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ExamplesConfiguration.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ExamplesConfiguration.java 2008-12-29 12:00:36 UTC (rev 3580)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ExamplesConfiguration.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.samples;
-
-import org.jbpm.Configuration;
-import org.jbpm.ExecutionService;
-import org.jbpm.ManagementService;
-import org.jbpm.ProcessService;
-import org.jbpm.cfg.JbpmConfiguration;
-import org.jbpm.env.EnvironmentFactory;
-
-
-/**
- * @author Tom Baeyens
- */
-public abstract class ExamplesConfiguration {
-
- static boolean isInitialized;
- static ProcessService processService;
- static ExecutionService executionService;
- static ManagementService managementService;
- static EnvironmentFactory environmentFactory;
-
- public static ProcessService getProcessService() {
- initialize();
- return processService;
- }
-
- public static ExecutionService getExecutionService() {
- initialize();
- return executionService;
- }
-
- public static ManagementService getManagementService() {
- initialize();
- return managementService;
- }
-
- public static EnvironmentFactory getEnvironmentFactory() {
- initialize();
- return environmentFactory;
- }
-
- private synchronized static void initialize() {
- if (!isInitialized) {
- isInitialized = true;
- environmentFactory = (EnvironmentFactory) new Configuration().setResource("environment.cfg.xml").buildProcessEngine();
- processService = environmentFactory.get(ProcessService.class);
- executionService = environmentFactory.get(ExecutionService.class);
- managementService = environmentFactory.get(ManagementService.class);
- }
- }
-
-}
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java (from rev 3579, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/db/type/VariableCustomTypeTest.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.variables;
+
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Map;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.activity.ExternalActivity;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.type.Variable;
+import org.jbpm.pvm.internal.type.variable.DateVariable;
+import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.EnvironmentDbTestCase;
+import org.jbpm.test.EnvironmentFactoryTestSetup;
+
+/**
+ * @author Guillaume Porcher
+ */
+public class CustomTypeVariableTest extends EnvironmentDbTestCase {
+
+ private static final String ENVIRONMENT_CFG_XML = "org/jbpm/pvm/variables/custom.types.jbpm.cfg.xml";
+
+ public CustomTypeVariableTest() {
+ super(ENVIRONMENT_CFG_XML);
+ }
+
+ public static class WaitState implements ExternalActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) {
+ execution.waitForSignal();
+ }
+
+ public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) {
+ execution.take(signalName);
+ }
+ }
+
+ public void testDateVariable() {
+ ClientProcessDefinition clientProcessDefinition = ProcessFactory.build().node().initial().behaviour(WaitState.class).done();
+
+ getDbSession().save(clientProcessDefinition);
+
+ ExecutionImpl execution = (ExecutionImpl) clientProcessDefinition.startProcessInstance();
+
+ execution = reload(execution, ExecutionImpl.class);
+
+ Calendar calendar = new GregorianCalendar();
+ calendar.set(Calendar.YEAR, 2007);
+ calendar.set(Calendar.MONTH, 10); // (10 == november)
+ calendar.set(Calendar.DAY_OF_MONTH, 22);
+ calendar.set(Calendar.HOUR_OF_DAY, 15);
+ calendar.set(Calendar.MINUTE, 28);
+ calendar.set(Calendar.SECOND, 57);
+ calendar.set(Calendar.MILLISECOND, 374);
+
+ execution.setVariable("v", calendar.getTime());
+
+ execution = reload(execution, ExecutionImpl.class);
+
+ Variable variable = execution.getVariableObject("v");
+ assertEquals(DateVariable.class, variable.getClass());
+
+ assertEquals(calendar.getTime(), execution.getVariable("v"));
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/CustomTypeVariableTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/VariablesTest.java (from rev 3579, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex03/VariablesTest.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/VariablesTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/VariablesTest.java 2008-12-29 12:27:04 UTC (rev 3581)
@@ -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.jbpm.pvm.variables;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.client.ClientProcessInstance;
+import org.jbpm.pvm.externalactivity.WaitState;
+import org.jbpm.pvm.model.ProcessFactory;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class VariablesTest extends TestCase {
+
+ public void testVariables() {
+ ClientProcessDefinition processDefinition = ProcessFactory.build("expenses")
+ .node("evaluate").initial().behaviour(WaitState.class)
+ .transition().to("pay back")
+ .node("pay back").behaviour(WaitState.class)
+ .done();
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("reason", "business trip");
+ variables.put("total amount", "$1500");
+
+ ClientProcessInstance execution = processDefinition.createProcessInstance();
+ execution.setVariables(variables);
+ execution.start();
+
+ assertEquals("business trip", execution.getVariable("reason"));
+ assertEquals("$1500", execution.getVariable("total amount"));
+
+ execution.setVariable("total amount", "$1400");
+ execution.setVariable("approver", "me");
+ execution.setVariable("cost center", 87364);
+
+ execution.signal();
+
+ assertEquals("business trip", execution.getVariable("reason"));
+ assertEquals("$1400", execution.getVariable("total amount"));
+ assertEquals("me", execution.getVariable("approver"));
+ assertEquals(new Integer(87364), execution.getVariable("cost center"));
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/variables/VariablesTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/variables/custom.types.jbpm.cfg.xml (from rev 3579, jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/internal/db/type/environmentCustomTypes.cfg.xml)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/variables/custom.types.jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/variables/custom.types.jbpm.cfg.xml 2008-12-29 12:27:04 UTC (rev 3581)
@@ -0,0 +1,31 @@
+<jbpm-configuration>
+
+ <process-engine>
+
+ <hibernate-configuration>
+ <properties resource="hibernate.properties" />
+ <mapping resource="jbpm.pvm.typedefs.hbm.xml" />
+ <mapping resource="jbpm.pvm.wire.hbm.xml" />
+ <mapping resource="jbpm.pvm.definition.hbm.xml" />
+ <mapping resource="jbpm.pvm.execution.hbm.xml" />
+ <mapping resource="jbpm.pvm.variable.hbm.xml" />
+ <mapping resource="jbpm.pvm.job.hbm.xml" />
+ <cache-configuration resource="jbpm.pvm.cache.xml"
+ usage="nonstrict-read-write" />
+ </hibernate-configuration>
+
+ <hibernate-session-factory />
+ <variable-types>
+ <type name="date" class="java.util.Date" variable-class="org.jbpm.pvm.internal.type.variable.DateVariable" />
+ </variable-types>
+ </process-engine>
+
+ <environment>
+
+ <transaction />
+ <hibernate-session />
+ <pvm-db-session />
+
+ </environment>
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/variables/custom.types.jbpm.cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:mergeinfo
+
15 years, 4 months
JBoss JBPM SVN: r3580 - jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-29 07:00:36 -0500 (Mon, 29 Dec 2008)
New Revision: 3580
Removed:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/
Log:
pvm test suite cleanup
15 years, 4 months
JBoss JBPM SVN: r3579 - in jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm: executionmode and 4 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-29 06:59:53 -0500 (Mon, 29 Dec 2008)
New Revision: 3579
Added:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/AutomaticActivity.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/EmbeddedExecutionModeTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/WaitState.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/AutomaticActivity.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/WaitState.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/externalactivity/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/externalactivity/ExternalActivityExampleTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/externalactivity/WaitState.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ContinuationTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/Recorder.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java
Log:
pvm test suite cleanup
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/AutomaticActivity.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/AutomaticActivity.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/AutomaticActivity.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/AutomaticActivity.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.executionmode.embedded;
+
+import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityExecution;
+
+/** a node behaviour implementation that records its execution and then
+ * just proceeds.
+ *
+ * @author Tom Baeyens
+ */
+public class AutomaticActivity implements Activity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/AutomaticActivity.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/EmbeddedExecutionModeTest.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/EmbeddedExecutionModeTest.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/EmbeddedExecutionModeTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/EmbeddedExecutionModeTest.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.executionmode.embedded;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.cfg.Configuration;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * @author Tom Baeyens
+ */
+public class EmbeddedExecutionModeTest extends JbpmTestCase {
+
+ SessionFactory sessionFactory;
+ Session session;
+ Transaction transaction;
+
+ public void testLoanApprove() {
+ Configuration configuration = new Configuration();
+ configuration.configure("org/jbpm/pvm/executionmode/embedded/hibernate.cfg.xml");
+ sessionFactory = configuration.buildSessionFactory();
+
+ startTransaction();
+
+ Loan loan = new Loan("john doe", 234.0);
+ session.save(loan);
+ assertEquals("evaluate", loan.getState());
+
+ newTransaction();
+
+ loan = (Loan) session.get(Loan.class, loan.getDbid());
+ assertEquals("evaluate", loan.getState());
+ loan.approve();
+ assertEquals("archive", loan.getState());
+
+ newTransaction();
+
+ loan = (Loan) session.get(Loan.class, loan.getDbid());
+ assertEquals("archive", loan.getState());
+ loan.archiveComplete();
+ assertEquals("end", loan.getState());
+
+ commitTransaction();
+ }
+
+ public void testLoanReject() {
+ Configuration configuration = new Configuration();
+ configuration.configure("org/jbpm/pvm/executionmode/embedded/hibernate.cfg.xml");
+ sessionFactory = configuration.buildSessionFactory();
+
+ startTransaction();
+
+ Loan loan = new Loan("john doe", 234.0);
+ session.save(loan);
+ assertEquals("evaluate", loan.getState());
+
+ newTransaction();
+
+ loan = (Loan) session.get(Loan.class, loan.getDbid());
+ assertEquals("evaluate", loan.getState());
+ loan.reject();
+ assertEquals("end", loan.getState());
+
+ newTransaction();
+
+ loan = (Loan) session.get(Loan.class, loan.getDbid());
+ assertEquals("end", loan.getState());
+ }
+
+
+ void newTransaction() {
+ commitTransaction();
+ startTransaction();
+ }
+
+ void startTransaction() {
+ session = sessionFactory.openSession();
+ transaction = session.beginTransaction();
+ }
+
+ void commitTransaction() {
+ transaction.commit();
+ session.close();
+ }
+}
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/Loan.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/Loan.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.executionmode.embedded;
+
+
+import org.jbpm.client.ClientExecution;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.pvm.model.ProcessFactory;
+
+/**
+ * @author Tom Baeyens
+ */
+public class Loan {
+
+ /** the loan process definition as a static resource */
+ private static final ClientProcessDefinition processDefinition = createLoanProcess();
+
+ private static ClientProcessDefinition createLoanProcess() {
+ ClientProcessDefinition processDefinition = ProcessFactory.build("loan")
+ .node("submit loan request").initial().behaviour(AutomaticActivity.class)
+ .transition().to("evaluate")
+ .node("evaluate").behaviour(WaitState.class)
+ .transition("approve").to("wire money")
+ .transition("reject").to("end")
+ .node("wire money").behaviour(AutomaticActivity.class)
+ .transition().to("archive")
+ .node("archive").behaviour(WaitState.class)
+ .transition().to("end")
+ .node("end").behaviour(WaitState.class)
+ .done();
+
+ return processDefinition;
+ }
+
+ /** exposes the process definition to the execution hibernate type */
+ private static ClientProcessDefinition getProcessDefinition() {
+ return processDefinition;
+ }
+
+ long dbid;
+ String customer;
+ double amount;
+ ClientExecution execution;
+
+ /** constructor for persistence */
+ protected Loan() {
+ }
+
+ public Loan(String customer, double amount) {
+ this.customer = customer;
+ this.amount = amount;
+ this.execution = processDefinition.startProcessInstance();
+ }
+
+ public void approve() {
+ execution.signal("approve");
+ }
+
+ public void reject() {
+ execution.signal("reject");
+ }
+
+ public void archiveComplete() {
+ execution.signal();
+ }
+
+ public String getState() {
+ return execution.getNodeName();
+ }
+
+ // getters //////////////////////////////////////////////////////////////////
+
+ public long getDbid() {
+ return dbid;
+ }
+ public String getCustomer() {
+ return customer;
+ }
+ public double getAmount() {
+ return amount;
+ }
+}
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/WaitState.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example03/WaitState.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/WaitState.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/WaitState.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.executionmode.embedded;
+
+import java.util.Map;
+
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.activity.ExternalActivity;
+
+/**
+ * @author Tom Baeyens
+ */
+public class WaitState implements ExternalActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ public WaitState() {
+ }
+
+ public void execute(ActivityExecution execution) throws Exception {
+ execution.waitForSignal();
+ }
+
+ public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) throws Exception {
+ execution.take(signalName);
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/embedded/WaitState.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/AutomaticActivity.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example01/AutomaticActivity.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/AutomaticActivity.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/AutomaticActivity.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -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.jbpm.pvm.executionmode.object;
+
+import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityExecution;
+
+/**
+ * @author Tom Baeyens
+ */
+public class AutomaticActivity implements Activity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) throws Exception {
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/AutomaticActivity.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example01/ObjectExecutionModeTest.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.executionmode.object;
+
+import junit.framework.TestCase;
+
+import org.jbpm.client.ClientExecution;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.pvm.model.ProcessFactory;
+
+
+public class ObjectExecutionModeTest extends TestCase {
+
+
+ public void testObjectExecutionMode(){
+ ClientProcessDefinition processDefinition = ProcessFactory.build("loan")
+ .node("submit loan request").initial().behaviour(AutomaticActivity.class)
+ .transition().to("evaluate")
+ .node("evaluate").behaviour(WaitState.class)
+ .transition("approve").to("wire money")
+ .transition("reject").to("end")
+ .node("wire money").behaviour(AutomaticActivity.class)
+ .transition().to("archive")
+ .node("archive").behaviour(WaitState.class)
+ .transition().to("end")
+ .node("end").behaviour(WaitState.class)
+ .done();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+
+ assertEquals("evaluate", execution.getNodeName());
+
+ execution.signal("approve");
+
+ execution.signal();
+ assertEquals("end", execution.getNodeName());
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/ObjectExecutionModeTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/WaitState.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example01/WaitState.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/WaitState.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/WaitState.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.executionmode.object;
+
+import java.util.Map;
+
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.activity.ExternalActivity;
+
+/**
+ * @author Tom Baeyens
+ */
+public class WaitState implements ExternalActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) {
+ execution.waitForSignal();
+ }
+
+ public void signal(ActivityExecution execution,
+ String signalName,
+ Map<String, Object> parameters) {
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/executionmode/object/WaitState.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/externalactivity/ExternalActivityExampleTest.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/ExternalActivityExampleTest.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/externalactivity/ExternalActivityExampleTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/externalactivity/ExternalActivityExampleTest.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.externalactivity;
+
+import org.jbpm.client.ClientExecution;
+import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.test.JbpmTestCase;
+
+
+public class ExternalActivityExampleTest extends JbpmTestCase {
+
+ public void testExternalActivityExample() {
+ ClientProcessDefinition processDefinition = ProcessFactory.build()
+ .node("a").initial().behaviour(new WaitState())
+ .transition().to("b")
+ .node("b").behaviour(new WaitState())
+ .done();
+
+ ClientExecution execution = processDefinition.startProcessInstance();
+
+ assertEquals("a", execution.getNodeName());
+
+ execution.signal();
+
+ assertEquals("b", execution.getNodeName());
+ }
+
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/externalactivity/ExternalActivityExampleTest.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/externalactivity/WaitState.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example05/WaitState.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/externalactivity/WaitState.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/externalactivity/WaitState.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.externalactivity;
+
+import java.util.Map;
+
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.activity.ExternalActivity;
+
+public class WaitState implements ExternalActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ public void execute(ActivityExecution execution) {
+ execution.waitForSignal();
+ }
+
+ public void signal(ActivityExecution execution,
+ String signalName,
+ Map<String, Object> parameters) {
+ execution.take(signalName);
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/externalactivity/WaitState.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/continuation/AutomaticActivity.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.jobexecutor;
+
+import org.jbpm.activity.Activity;
+import org.jbpm.activity.ActivityExecution;
+
+/** a node behaviour implementation that records its execution and then
+ * just proceeds.
+ *
+ * @author Tom Baeyens
+ */
+public class AutomaticActivity implements Activity {
+
+ private static final long serialVersionUID = 1L;
+
+ public AutomaticActivity() {
+ }
+
+ public void execute(ActivityExecution execution) throws Exception {
+ ContinuationTest.recorder.record(execution.getDbid(), "execute("+execution.getNode().getName()+")");
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/AutomaticActivity.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ContinuationTest.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/continuation/ContinuationTest.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ContinuationTest.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ContinuationTest.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.jobexecutor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.Session;
+import org.jbpm.cmd.Command;
+import org.jbpm.env.Environment;
+import org.jbpm.model.OpenProcessDefinition;
+import org.jbpm.pvm.model.ProcessFactory;
+
+/**
+ * @author Tom Baeyens
+ */
+public class ContinuationTest extends JobExecutorTestCase {
+
+ // private static final Log log = Log.getLog(ContinuationTest.class.getName());
+
+ static Recorder recorder = new Recorder();
+
+ int nbrOfExecutions = 1;
+
+ public void testContinuations() {
+
+ try {
+ deployProcess();
+ startExecutions();
+ jobExecutor.start();
+ waitTillNoMoreMessages();
+
+ } finally {
+ jobExecutor.stop(true);
+ }
+
+ List<String> expectedLogs = new ArrayList<String>();
+ expectedLogs.add("execute(start)");
+ expectedLogs.add("execute(a)");
+ expectedLogs.add("execute(b)");
+ expectedLogs.add("execute(c)");
+ expectedLogs.add("execute(end)");
+
+ assertEquals(nbrOfExecutions, recorder.executionEvents.size());
+ for (List<String> executionLogs : recorder.executionEvents.values()) {
+ assertEquals(expectedLogs, executionLogs);
+ }
+ }
+
+ public void deployProcess() {
+ commandService.execute(new Command<Object>() {
+ public Object execute(Environment environment) throws Exception {
+ OpenProcessDefinition processDefinition = ProcessFactory.build("continuations")
+ .key("continuations")
+ .node("start").initial().behaviour(AutomaticActivity.class)
+ .asyncExecute()
+ .transition().to("a")
+ .node("a").behaviour(AutomaticActivity.class)
+ .asyncExecute()
+ .transition().to("b")
+ .node("b").behaviour(AutomaticActivity.class)
+ .asyncExecute()
+ .transition().to("c")
+ .node("c").behaviour(AutomaticActivity.class)
+ .asyncExecute()
+ .transition().to("end")
+ .node("end").behaviour(WaitState.class)
+ .done();
+
+ Session session = environment.get(Session.class);
+ session.save(processDefinition);
+ return null;
+ }
+ });
+ }
+
+ public void startExecutions() {
+ for (int i = 0; i < nbrOfExecutions; i++) {
+ executionService.startExecutionByKey("continuations");
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/ContinuationTest.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/Recorder.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/continuation/Recorder.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/Recorder.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/Recorder.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.jobexecutor;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Tom Baeyens
+ */
+public class Recorder {
+
+ public Map<Object, List<String>> executionEvents = null;
+
+ public synchronized void record(long executionDbid, String event) {
+ if (executionEvents==null) {
+ executionEvents = new HashMap<Object, List<String>>();
+ }
+ List<String> events = executionEvents.get(executionDbid);
+ if (events == null) {
+ events = new ArrayList<String>();
+ executionEvents.put(executionDbid, events);
+ }
+ events.add(event);
+ }
+
+ public void reset() {
+ executionEvents = null;
+ }
+}
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/Recorder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/continuation/WaitState.java)
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java (rev 0)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java 2008-12-29 11:59:53 UTC (rev 3579)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.jobexecutor;
+
+import java.util.Map;
+
+import org.jbpm.activity.ActivityExecution;
+import org.jbpm.activity.ExternalActivity;
+
+/**
+ * @author Tom Baeyens
+ */
+public class WaitState implements ExternalActivity {
+
+ private static final long serialVersionUID = 1L;
+
+ public WaitState() {
+ }
+
+ public void execute(ActivityExecution execution) throws Exception {
+ ContinuationTest.recorder.record(execution.getDbid(), "execute("+execution.getNode().getName()+")");
+ }
+
+ public void signal(ActivityExecution execution, String signal, Map<String, Object> parameters) throws Exception {
+ throw new UnsupportedOperationException();
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/jobexecutor/WaitState.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
15 years, 4 months
JBoss JBPM SVN: r3578 - in jbpm4/trunk/modules: pvm/src/test/java/org/jbpm/pvm and 6 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-29 06:57:15 -0500 (Mon, 29 Dec 2008)
New Revision: 3578
Added:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/executionmode/
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/executionmode/embedded/
Removed:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/samples/ex10/
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/svc/
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/example03/
Modified:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/executionmode/embedded/Loan.hbm.xml
jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/executionmode/embedded/hibernate.cfg.xml
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
Log:
pvm test suite cleanup
Copied: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx (from rev 3570, jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/tx)
Property changes on: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/api/tx/BasicTransactionTest.java 2008-12-29 09:39:56 UTC (rev 3570)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java 2008-12-29 11:57:15 UTC (rev 3578)
@@ -19,14 +19,12 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jbpm.pvm.api.tx;
+package org.jbpm.pvm.tx;
import java.util.List;
import javax.transaction.Synchronization;
-import junit.framework.Test;
-
import org.hibernate.Session;
import org.jbpm.JbpmException;
import org.jbpm.cmd.Command;
@@ -34,13 +32,12 @@
import org.jbpm.env.Transaction;
import org.jbpm.pvm.internal.model.CommentImpl;
import org.jbpm.pvm.internal.type.variable.StringVariable;
-import org.jbpm.test.OldDbTestCase;
-import org.jbpm.test.EnvironmentFactoryTestSetup;
+import org.jbpm.test.DbTestCase;
/**
* @author Tom Baeyens
*/
-public class BasicTransactionTest extends OldDbTestCase {
+public class BasicTransactionTest extends DbTestCase {
public void testCommit() {
commandService.execute(new Command<Object>() {
Copied: jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/executionmode/embedded (from rev 3570, jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/example03)
Modified: jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/executionmode/embedded/Loan.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/example03/Loan.hbm.xml 2008-12-29 09:39:56 UTC (rev 3570)
+++ jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/executionmode/embedded/Loan.hbm.xml 2008-12-29 11:57:15 UTC (rev 3578)
@@ -4,7 +4,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-<hibernate-mapping package="org.jbpm.pvm.example03" default-access="field">
+<hibernate-mapping package="org.jbpm.pvm.executionmode.embedded" default-access="field">
<typedef name="execution" class="org.jbpm.pvm.internal.hibernate.ExecutionType" />
Modified: jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/executionmode/embedded/hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/example03/hibernate.cfg.xml 2008-12-29 09:39:56 UTC (rev 3570)
+++ jbpm4/trunk/modules/pvm/src/test/resources/org/jbpm/pvm/executionmode/embedded/hibernate.cfg.xml 2008-12-29 11:57:15 UTC (rev 3578)
@@ -17,7 +17,7 @@
<property name="hibernate.format_sql">true"</property>
<property name="hibernate.use_sql_comments">true"</property>
- <mapping resource="org/jbpm/pvm/example03/Loan.hbm.xml"/>
+ <mapping resource="org/jbpm/pvm/executionmode/embedded/Loan.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java 2008-12-29 11:56:58 UTC (rev 3577)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/DbTestCase.java 2008-12-29 11:57:15 UTC (rev 3578)
@@ -22,10 +22,8 @@
package org.jbpm.test;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
-import java.util.Map;
import org.jbpm.Configuration;
import org.jbpm.Execution;
@@ -35,7 +33,7 @@
import org.jbpm.ProcessEngine;
import org.jbpm.ProcessService;
import org.jbpm.TaskService;
-import org.jbpm.client.ClientProcessDefinition;
+import org.jbpm.cmd.CommandService;
import org.jbpm.task.Task;
/**
@@ -45,26 +43,22 @@
protected static ProcessEngine processEngine = null;
- protected ProcessService processService;
- protected ExecutionService executionService;
- protected ManagementService managementService;
- protected TaskService taskService;
-
+ protected static ProcessService processService;
+ protected static ExecutionService executionService;
+ protected static ManagementService managementService;
+ protected static TaskService taskService;
+
+ protected static CommandService commandService;
+
protected List<ProcessDefinition> processDefinitions;
protected List<String> taskIds;
protected void setUp() throws Exception {
super.setUp();
-
- initializeProcessEngine();
-
- processService = processEngine.getProcessService();
- executionService = processEngine.getExecutionService();
- managementService = processEngine.getManagementService();
- taskService = processEngine.getTaskService();
+ initialize();
}
- protected synchronized void initializeProcessEngine() {
+ protected synchronized void initialize() {
if (processEngine==null) {
String jbpmTestCfgType = System.getProperty("jbpm.test.cfg.type");
@@ -76,6 +70,12 @@
}
processEngine = configuration.buildProcessEngine();
+
+ processService = processEngine.getProcessService();
+ executionService = processEngine.getExecutionService();
+ managementService = processEngine.getManagementService();
+ taskService = processEngine.getTaskService();
+ commandService = processEngine.get(CommandService.class);
}
}
15 years, 4 months
JBoss JBPM SVN: r3576 - in jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm: example07 and 1 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2008-12-29 06:56:49 -0500 (Mon, 29 Dec 2008)
New Revision: 3576
Modified:
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example06/BasicProcessExecutionTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example07/EventListenerTest.java
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example08/EventPropagationTest.java
Log:
pvm test suite cleanup
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example06/BasicProcessExecutionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example06/BasicProcessExecutionTest.java 2008-12-29 11:56:26 UTC (rev 3575)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example06/BasicProcessExecutionTest.java 2008-12-29 11:56:49 UTC (rev 3576)
@@ -23,8 +23,8 @@
import org.jbpm.client.ClientExecution;
import org.jbpm.client.ClientProcessDefinition;
-import org.jbpm.pvm.example04.Display;
-import org.jbpm.pvm.example05.WaitState;
+import org.jbpm.pvm.display.Display;
+import org.jbpm.pvm.externalactivity.WaitState;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.test.JbpmTestCase;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example07/EventListenerTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example07/EventListenerTest.java 2008-12-29 11:56:26 UTC (rev 3575)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example07/EventListenerTest.java 2008-12-29 11:56:49 UTC (rev 3576)
@@ -26,10 +26,10 @@
import org.jbpm.client.ClientExecution;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.model.Event;
-import org.jbpm.pvm.example01.AutomaticActivity;
-import org.jbpm.pvm.example01.WaitState;
-import org.jbpm.pvm.example04.Display;
-import org.jbpm.pvm.example04.TestConsole;
+import org.jbpm.pvm.display.Display;
+import org.jbpm.pvm.display.TestConsole;
+import org.jbpm.pvm.executionmode.object.AutomaticActivity;
+import org.jbpm.pvm.executionmode.object.WaitState;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.test.JbpmTestCase;
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example08/EventPropagationTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example08/EventPropagationTest.java 2008-12-29 11:56:26 UTC (rev 3575)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/example08/EventPropagationTest.java 2008-12-29 11:56:49 UTC (rev 3576)
@@ -27,8 +27,8 @@
import org.jbpm.client.ClientExecution;
import org.jbpm.client.ClientProcessDefinition;
import org.jbpm.model.Event;
-import org.jbpm.pvm.example01.WaitState;
-import org.jbpm.pvm.example04.TestConsole;
+import org.jbpm.pvm.display.TestConsole;
+import org.jbpm.pvm.executionmode.object.WaitState;
import org.jbpm.pvm.model.ProcessFactory;
import org.jbpm.test.JbpmTestCase;
15 years, 4 months