[jbpm-commits] JBoss JBPM SVN: r3547 - in jbpm4/trunk/modules/userguide/src/main/docbook/en: modules and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Dec 24 14:58:14 EST 2008
Author: koen.aers at jboss.com
Date: 2008-12-24 14:58:13 -0500 (Wed, 24 Dec 2008)
New Revision: 3547
Added:
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.state.png
Removed:
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.state.png
Modified:
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
Log:
completed docs for state sequence, state choice and end events
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.state.png
===================================================================
(Binary files differ)
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.state.png (from rev 3546, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.state.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/end.state.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:mergeinfo
+
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml 2008-12-24 17:35:28 UTC (rev 3546)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch04-Jpdl.xml 2008-12-24 19:58:13 UTC (rev 3547)
@@ -211,6 +211,10 @@
<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>
@@ -294,6 +298,10 @@
</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>
@@ -359,6 +367,8 @@
</table>
<para>Example:
</para>
+ <para>Same picture as <link linkend="exclusive">above</link>.
+ </para>
<programlisting><process name="Poolcar">
<start>
<flow to="How far?" />
@@ -412,6 +422,8 @@
</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>
@@ -466,6 +478,10 @@
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>
@@ -511,15 +527,49 @@
</section>
<section id="endmultiple">
<title><literal>end</literal> multiple</title>
- <para>A process can have multiple end states. This can be handy to indicate
+ <para>A process can have multiple end events. This can be handy to indicate
different outcomes of a process instance. For example
</para>
- <programlisting></programlisting>
+ <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>TODO
+ <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>
@@ -543,6 +593,41 @@
</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>
More information about the jbpm-commits
mailing list