Pattern 10 (Arbitrary Cycles)

This pattern is graphically represented at http://is.tm.tue.nl/research/patterns/download/swf/pat_10.swf

This flow is an implementation of the pattern as drawn on the workflow pattern site :


<?xml version="1.0" encoding="UTF-8"?> 

<process-definition name="pattern10" revision="1.6.2pre0" >

    <!-- body -->

    <sequence>

        <participant ref="a" />

        <cursor>
            <participant ref="b" />
            <participant ref="c" />
            <participant ref="d" />
        </cursor>

        <participant ref="e" />

    </sequence>

</process-definition>

The implementation of this pattern uses the 'cursor' expression. This expression is described at the section called “cursor”.

The example process definition follows the diagram found on the workflow pattern site : the flow cannot 'rewind' until 'a' and at 'e', the 'cursor is over. Within the cursor, steps back are ordered to the engine by setting the value of the field '__cursor_command__' to 'back'.

To adhere more strictly to the pattern as described on the workflow pattern site, this could be written :


        <cursor disallow="break, rewind">
            <participant ref="b" />
            <participant ref="c" />
            <participant ref="d" />
        </cursor>

where the commands 'break' and 'rewind' are neutralized, preventing the participants from exiting ('break') and fully rewinding (to 'b' with the 'rewind' command).