Pattern 8 (Multiple Merge)

Trying to follow the pattern as described at http://is.tm.tue.nl/research/patterns/download/swf/pat_8.swf :


<process-definition name="pattern8" revision="1.5.1pre2">

    <description>
Modelling the workflow pattern #8
    </description>

    <!-- body of the flow -->

    <sequence>
        <participant ref="a" />
        <concurrence>
           <if>
              <equals field-value="__subject__" other-value="credit approval" />
              <sequence>
                  <participant ref="b" />
                  <subprocess ref="d" />
              </sequence>
           </if>
           <if>
              <equals field-value="category" other-value="new plant" />
              <sequence>
                  <participant ref="c" />
                  <subprocess ref="d" />
              </sequence>
           </if>
        </concurrence>
    </sequence>


    <!-- subprocesses -->

    <process-definition name="d">
        <participant ref="d" />
    </process-definition>

</process-definition>

As the pattern requires it, the subprocess 'd' may get executed 1 or 2 times (even 0 times if none of the two conditions evals to true). A subprocess got used in order to have the same flow segment after 'b' and 'c'. This subprocess could be expanded like this :


    <process-definition name="d">
        <sequence>
            <participant ref="d" />
            <participant ref="e" />
            <participant ref="f" />
        </sequence>
    </process-definition>

Where 'd' ,'e' then 'f' might get executed each twice if branch 'b' and 'c' both get triggered.

The implementation of this pattern with OpenWFE reveals its difference with a graph based workflow system.