[jbpm-commits] JBoss JBPM SVN: r5992 - in jbpm4/trunk/modules: devguide/src/main/docbook/en/images and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Dec 18 08:32:24 EST 2009


Author: jbarrez
Date: 2009-12-18 08:32:23 -0500 (Fri, 18 Dec 2009)
New Revision: 5992

Added:
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.default.sequence.flow.png
   jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.sequence.flow.png
Modified:
   jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java
   jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
Log:
JBPM-2676, JBPM-2671, JBPM-2670: documented sequence flow, default sequence flow and conditional sequence flow

Modified: jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java
===================================================================
--- jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java	2009-12-18 13:16:19 UTC (rev 5991)
+++ jbpm4/trunk/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/BpmnParser.java	2009-12-18 13:32:23 UTC (rev 5992)
@@ -259,15 +259,13 @@
         }
       }
 
-      // 8.2.5 of the spec document
       if (conditionElement != null) {
         String type = conditionElement.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "type");
         if ("bpmn:tFormalExpression".equals(type) || "tFormalExpression".equals(type)) {
 
           String expr = conditionElement.getTextContent();
           String lang = XmlUtil.attribute(conditionElement, "language");
-          // TODO: add looking up the default language in the document if lang
-          // is null.
+          // TODO: add looking up the default language in the document under definitions if lang  is null.
           
           ExpressionCondition expressionCondition = new ExpressionCondition();
           expressionCondition.setExpression(expr);

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.default.sequence.flow.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.default.sequence.flow.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.sequence.flow.png
===================================================================
(Binary files differ)


Property changes on: jbpm4/trunk/modules/devguide/src/main/docbook/en/images/bpmn2.sequence.flow.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml
===================================================================
--- jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml	2009-12-18 13:16:19 UTC (rev 5991)
+++ jbpm4/trunk/modules/devguide/src/main/docbook/en/modules/ch03-Bpmn2.xml	2009-12-18 13:32:23 UTC (rev 5992)
@@ -362,6 +362,66 @@
         
     </section>
     
+    <section id="sequenceFlow">
+    
+      <title>Sequence Flow</title>
+      
+      <para>
+        A sequence flow is the connection between events, activities and gateways shown as a
+        solid line with an arrow in a BPMN diagram (JPDL equivalent is the transition).
+        Each sequence flow has exactly one <emphasis role="bold">source</emphasis> and exactly one 
+        <emphasis role="bold">target</emphasis> reference, that contains the <emphasis role="bold">id</emphasis> 
+        of an activity, event or gateway.
+        <programlisting>
+&lt;sequenceFlow id=&quot;myFlow&quot; name=&quot;My Flow&quot; 
+        sourceRef=&quot;sourceId&quot; targetRef=&quot;targetId&quot; /&gt;
+        </programlisting>
+      </para>
+      
+      <para>
+        An important difference with JPDL is the behaviour of multiple outgoing sequence flows.
+        In JPDL, only one transition is selected as outgoing transition, unless the activity
+        is a fork (or a custom activity with fork behaviour). However, in BPMN, the standard behaviour
+        of multiple outgoing sequence flow is to split the incoming token ('execution' in jBPM
+        terminology) into a collection of tokens, one for each outgoing sequence flow. In the following
+        situation, after completing the first task, there will be three tasks activated instead of one.
+       <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.sequence.flow.png"/></imageobject></mediaobject>
+       To avoid that a certain sequence flow is taken, one has to add a condition to the sequence flow.
+       At runtime, only when the condition evaluates to true, that sequence flow will
+       be taken.
+      </para>
+      
+      <para>
+        To put a condition on a sequence flow, add a <emphasis role="bold">conditionExpression
+        </emphasis> element to the sequence flow. Conditions are to be put between <emphasis role="bold">
+        ${}</emphasis>.
+        <programlisting>
+&lt;sequenceFlow id=....&gt;
+  &lt;conditionExpression xsi:type=&quot;tFormalExpression&quot;>${amount &gt;= 500} /&gt;   
+&lt;/sequenceFlow&gt;    
+        </programlisting>
+        Note that is currently is necessary to add the <emphasis role="bold">
+        xsi:type=&quot;tFormalExpression&quot;</emphasis> to the <emphasis role="bold">
+        conditionExpression</emphasis>. This is not 100% BPMN specification compliant, but we'll
+        work this out in a next release.
+      </para>
+      
+      <para>
+        Activities (such as the user task) and gateways (such as  the exclusive gateway) can have a
+        default sequence flow. This default sequence flow is taken only when all the other outgoing
+        sequence flow from an activity or gateway have a condition that evaluate to false. A
+        default sequence flow is graphically visualized as a sequence flow with a 'slash marker".
+        <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.default.sequence.flow.png"/></imageobject></mediaobject>
+        The default sequence flow is specified by filling in the <emphasis role="bold">'default'
+        </emphasis> attribute of the activity or gateway.
+      </para>
+      
+      <para>
+         Also note that an expression on a default sequence flow is ignored.
+      </para>
+    
+    </section>
+    
     <section id="gateway">
     
       <title>Gateways</title>
@@ -386,7 +446,7 @@
       <para>
         An exclusive gateway represents an <emphasis role="bold">exclusive decision</emphasis>
         in the process. Exactly one outgoing sequence flow will be taken, depending on the conditions
-        defined on the sequence flows.
+        defined on the sequence flow.
       </para>
       
       <para>
@@ -400,11 +460,11 @@
       
       <para>
         The following diagram shows the usage of an exclusive gateway: depending on the value of the
-        amount variable, one of the three outgoing sequence flows out of the exclusive gateway
+        amount variable, one of the three outgoing sequence flow out of the exclusive gateway
         is chosen.
         <mediaobject><imageobject><imagedata align="center" fileref="images/bpmn2.exclusive.gateway.png"/></imageobject></mediaobject>
         The corresponding executable XML of this process looks as follows.
-        Note that the conditions are defined on the sequence flows. The exclusive gateway will select
+        Note that the conditions are defined on the sequence flow. The exclusive gateway will select
         the single sequence flow for which its condition evaluates to true. If multiple conditions
         evaluate to true, the first one encountered will be taken (a log message will indicate
         this situation).
@@ -451,12 +511,12 @@
       </para>
       
       <para>
-        The exclusive gateway requires that all outgoing sequence flows have conditions defined
+        The exclusive gateway requires that all outgoing sequence flow have conditions defined
         on them. An exception to this rule is the default sequence flow, as defined above.
         The exclusive gateway also has a shortcut attribute to define such a default sequence flow.
         Use the <emphasis role="bold">default attribute</emphasis> to reference an existing
         <emphasis role="bold">id of a sequence flow</emphasis>. This sequence flow will be taken
-        when the conditions on the other outgoing sequence flows all evaluate to false.
+        when the conditions on the other outgoing sequence flow all evaluate to false.
         <programlisting>
 &lt;exclusiveGateway id=&quot;decision&quot; name=&quot;decideBasedOnAmountAndBankType&quot; default=&quot;myFlow&quot;/&gt;
    



More information about the jbpm-commits mailing list