[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>&lt;process name=&quot;StateChoice&quot; xmlns=&quot;http://jbpm.org/4/jpdl&quot;&gt;
 
   &lt;start&gt;
@@ -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>&lt;process name=&quot;ExclusiveConditions&quot; &gt;
 
   &lt;start&gt;
@@ -359,6 +367,8 @@
         </table>
         <para>Example:
         </para>
+        <para>Same picture as <link linkend="exclusive">above</link>.
+        </para>
         <programlisting>&lt;process name=&quot;Poolcar&quot;&gt;
   &lt;start&gt;
     &lt;flow to=&quot;How far?&quot; /&gt;
@@ -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>&lt;process name=&quot;ExclusiveHandler&quot;&gt;
 
   &lt;start&gt;
@@ -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>&lt;process name=&quot;EndProcessInstance&quot; xmlns=&quot;http://jbpm.org/4/jpdl&quot;&gt;
 
   &lt;start&gt;
@@ -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>&lt;process name=&quot;EndMultiple&quot; xmlns=&quot;http://;jbpm.org/4/jpdl&quot;&gt;
+
+  &lt;start&gt;
+    &lt;flow to=&quot;get return code&quot; /&gt;
+  &lt;start&gt;
+  
+  &lt;state name=&quot;get return code&quot;&gt;
+    &lt;flow name=&quot;200&quot; to=&quot;ok&quot;/&gt;
+    &lt;flow name=&quot;400&quot; to=&quot;bad request&quot;/&gt;
+    &lt;flow name=&quot;500&quot; to=&quot;internal server error&quot;/&gt;
+  &lt;/state&gt;
+  
+  &lt;end name=&quot;ok&quot;/&gt;
+  &lt;end name=&quot;bad request&quot;/&gt;
+  &lt;end name=&quot;internal server error&quot;/&gt;
+  
+&lt;/process&gt;
+        </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(&quot;EndMultiple&quot;);
+String executionId = execution.getId();
+execution = executionService.signalExecutionById(executionId, &quot;400&quot;);
+        </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>&lt;process name=&quot;EndState&quot; xmlns=&quot;http://jbpm.org/4/jpdl&quot;&gt;
+
+  &lt;start&gt;
+     &lt;flow to=&quot;get return code&quot;/&gt;
+  &lt;/start&gt;
+
+  &lt;state name=&quot;get return code&quot;&gt;
+    &lt;flow name=&quot;200&quot; to=&quot;ok&quot;/&gt;
+    &lt;flow name=&quot;400&quot; to=&quot;bad request&quot; /&gt;
+    &lt;flow name=&quot;500&quot; to=&quot;internal server error&quot;/&gt;
+  &lt;/state&gt;
+
+  &lt;end name=&quot;ok&quot; state=&quot;completed&quot;/&gt;
+  &lt;end-cancel name=&quot;bad request&quot;/&gt;
+  &lt;end-error name=&quot;internal server error&quot;/&gt;
+
+&lt;/process&gt;
+        </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(&quot;EndState&quot;);
+String executionId = execution.getId();
+execution = executionService.signalExecutionById(executionId, &quot;400&quot;);
+        </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