[Index]

state:cascade


A job which triggers the next job after the previous one completes. This job differs from a sequential task in that the latter follows the thread of execution, and only checks state to ensure it can continue. This job's thread of execution passes onwards after the cascade has been set up. This job will complete asynchronously once all it's children have completed.

State Operator

This job doesn't currently expose a State Operator property as sequential does. The state behaviour is equivalent to the WORST state operator, which is what is desired in most situations. A stateOperator property may be added in future versions if needed.

Property Summary

jobs  
name A name, can be any text.
stop Read only view of the internal stop flag.

Example Summary

Example 1 A cascade of two jobs.
Example 2 Showing cascade being used with parallel.

Property Detail

jobs

Configured ByELEMENT
AccessWRITE_ONLY

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

A name, can be any text.

stop

AccessREAD_ONLY
RequiredRead only.

Read only view of the internal stop flag. This flag is cleared with a reset.


Examples

Example 1

A cascade of two jobs.

<oddjob>
    <job>
        <state:cascade xmlns:state="http://rgordon.co.uk/oddjob/state">
            <jobs>
                <echo>This runs first.</echo>
                <echo>Then this.</echo>
            </jobs>
        </state:cascade>
    </job>
</oddjob>

Example 2

Showing cascade being used with parallel. The cascade will wait for the parallel job to finish before running the third job.

<oddjob>
    <job>
        <state:cascade xmlns:state="http://rgordon.co.uk/oddjob/state">
            <jobs>
                <parallel>
                    <jobs>
                        <echo>Oranges could be first or second.</echo>
                        <echo>Pears could be first or second.</echo>
                    </jobs>
                </parallel>
                <echo>Apples are guaranteed to be third.</echo>
            </jobs>
        </state:cascade>
    </job>
</oddjob>


(c) Rob Gordon 2005 - 2013