[jbpm-commits] JBoss JBPM SVN: r4599 - 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 Apr 22 04:41:14 EDT 2009
Author: tom.baeyens at jboss.com
Date: 2009-04-22 04:41:14 -0400 (Wed, 22 Apr 2009)
New Revision: 4599
Added:
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.subprocess.variables.review.png
Removed:
jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.subprocess.review.png
Modified:
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml
Log:
JBPM-2025 sub-process example and docs
Deleted: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.subprocess.review.png
===================================================================
(Binary files differ)
Copied: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.subprocess.variables.review.png (from rev 4597, jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.subprocess.review.png)
===================================================================
(Binary files differ)
Property changes on: jbpm4/trunk/modules/userguide/src/main/docbook/en/images/process.subprocess.variables.review.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml 2009-04-22 08:00:50 UTC (rev 4598)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch05-Jpdl.xml 2009-04-22 08:41:14 UTC (rev 4599)
@@ -1198,6 +1198,7 @@
when it is created.
</entry>
</row>
+ <!--
<row>
<entry><literal>swimlane-mapping</literal></entry>
<entry>0..*</entry>
@@ -1205,6 +1206,7 @@
instance when the sub process is created.
</entry>
</row>
+ -->
<row>
<entry><literal>out-variable</literal></entry>
<entry>0..*</entry>
@@ -1239,7 +1241,6 @@
</table>
<!-- ~~~ SUB PROCESS VARIABLES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-
<section id="subprocessvariables">
<title><literal>sub-process</literal> variables</title>
<para>The SubProcessVariables example scenario will show the basic workings of the
@@ -1247,9 +1248,9 @@
and how to extract information out of the subprocess when it ends.
</para>
<para>The parent process involves a document that needs to be reviewed.</para>
- <figure id="process.subprocess.document">
+ <figure id="process.subprocess.variables.document">
<title>The subprocess document example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.subprocess.document.png"/></imageobject></mediaobject>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.subprocess.variables.document.png"/></imageobject></mediaobject>
</figure>
<programlisting><process name="SubProcessDocument" xmlns="http://jbpm.org/4/jpdl">
@@ -1270,9 +1271,9 @@
</process></programlisting>
<para>The review process is a reusable process for all kinds of reviews.</para>
- <figure id="process.subprocess.review">
+ <figure id="process.subprocess.variables.review">
<title>The subprocess review example process</title>
- <mediaobject><imageobject><imagedata align="center" fileref="images/process.subprocess.review.png"/></imageobject></mediaobject>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.subprocess.variables.review.png"/></imageobject></mediaobject>
</figure>
<programlisting><process name="SubProcessReview" xmlns="http://jbpm.org/4/jpdl">
@@ -1322,6 +1323,153 @@
and leave the <link>review</link> activity.
</para>
</section>
+
+ <!-- ~~~ SUB PROCESS OUTCOME VALUE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <section id="subprocessoutcomevalue">
+ <title><literal>sub-process</literal> outcome value</title>
+ <para>In the <literal>SubProcessOutcomeValueTest</literal> example, the value
+ of a sub process variable is used to select the outgoing transition
+ of the <literal>sub-process</literal> activity.
+ </para>
+ <figure id="process.subprocess.outcomevalue.document">
+ <title>The subprocess document example process</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.subprocess.outcomevalue.document.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="SubProcessDocument">
+
+ <start>
+ <transition to="review" />
+ </start>
+
+ <sub-process name="review"
+ sub-process-key="SubProcessReview"
+ <emphasis role="bold">outcome="#{result}"</emphasis>>
+
+ <transition <emphasis role="bold">name="ok"</emphasis> to="next step" />
+ <transition <emphasis role="bold">name="nok"</emphasis> to="update" />
+ <transition <emphasis role="bold">name="reject"</emphasis> to="close" />
+ </sub-process>
+
+ <state name="next step" />
+ <state name="update" />
+ <state name="close" />
+
+</process></programlisting>
+ <para>The <literal>SubProcessReview</literal> is the same as above in the
+ <link linkend="subprocessvariables">subprocess variables example</link>:</para>
+ <figure id="process.subprocess.outcomevalue.review">
+ <title>The subprocess review example process for outcome value</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.subprocess.variables.review.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="SubProcessReview" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <transition to="get approval"/>
+ </start>
+
+ <task name="get approval"
+ assignee="johndoe">
+
+ <transition to="end"/>
+ </task>
+
+ <end name="end" />
+
+</process></programlisting>
+ <para>A new document process instance is started like usual:
+ </para>
+ <programlisting>ProcessInstance processInstance = executionService
+ .startProcessInstanceByKey("SubProcessDocument");</programlisting>
+ <para>Then task is fetched from <literal>johndoe</literal>'s task list</para>
+ <programlisting>List<Task> taskList = taskService.findAssignedTasks("johndoe");
+Task task = taskList.get(0);
+ </programlisting>
+ <para>Then the <literal>result</literal> variable is set and
+ the task is completed.
+ </para>
+ <programlisting>taskService.setVariable(task.getDbid(), "result", "ok");
+taskService.completeTask(task.getDbid());
+ </programlisting>
+ <para>In this scenario, the <literal>ok</literal> transition is taken in
+ the parent process out of the sub-process review activity. The example
+ test case also shows other scenarios.
+ </para>
+ </section>
+
+ <!-- ~~~ SUB PROCESS OUTCOME ACTIVITY ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+ <section id="subprocessoutcomeactivity">
+ <title><literal>sub-process</literal> outcome activity</title>
+ <para>A process can have many end activities. In the <literal>SubProcessOutcomeActivityTest</literal>
+ example, the resulting end activity is used to select the outgoing transition of the <literal>sub-process</literal>
+ activity.
+ </para>
+ <figure id="process.subprocess.outcomeactivity.document">
+ <title>The subprocess document example process for outcome activity</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.subprocess.outcomevalue.document.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="SubProcessDocument">
+
+ <start>
+ <transition to="review" />
+ </start>
+
+ <sub-process name="review"
+ sub-process-key="SubProcessReview">
+
+ <transition <emphasis role="bold">name="ok"</emphasis> to="next step" />
+ <transition <emphasis role="bold">name="nok"</emphasis> to="update" />
+ <transition <emphasis role="bold">name="reject"</emphasis> to="close" />
+ </sub-process>
+
+ <state name="next step" />
+ <state name="update" />
+ <state name="close" />
+
+</process></programlisting>
+ <para>The <literal>SubProcessReview</literal> now has multiple end activities:</para>
+ <figure id="process.subprocess.outcomeactivity.review">
+ <title>The subprocess review example process for outcome activity</title>
+ <mediaobject><imageobject><imagedata align="center" fileref="images/process.subprocess.outcomeactivity.review.png"/></imageobject></mediaobject>
+ </figure>
+ <programlisting><process name="SubProcessReview" xmlns="http://jbpm.org/4/jpdl">
+
+ <start>
+ <transition to="get approval"/>
+ </start>
+
+ <task name="get approval"
+ assignee="johndoe">
+
+ <transition name="ok" to="ok"/>
+ <transition name="nok" to="nok"/>
+ <transition name="reject" to="reject"/>
+ </task>
+
+ <emphasis role="bold"><end name="ok" />
+ <end name="nok" />
+ <end name="reject" /></emphasis>
+
+</process></programlisting>
+ <para>A new document process instance is started like usual:
+ </para>
+ <programlisting>ProcessInstance processInstance = executionService
+ .startProcessInstanceByKey("SubProcessDocument");</programlisting>
+ <para>Then task is fetched from <literal>johndoe</literal>'s task list</para>
+ <programlisting>List<Task> taskList = taskService.findAssignedTasks("johndoe");
+Task task = taskList.get(0);
+ </programlisting>
+ <para>Then the task is completed with outcome <literal>ok</literal>.
+ </para>
+ <programlisting>taskService.completeTask(task.getDbid(), "ok");
+ </programlisting>
+ <para>This will cause the sub process to end in end activity <literal>ok</literal>.
+ The super process execution will then take outgoing transition <literal>ok</literal>
+ to <literal>next step</literal>.
+ </para>
+ <para>The example test case also shows the other scenarios.
+ </para>
+ </section>
+
</section>
</section>
More information about the jbpm-commits
mailing list