[Index]

state:join


Waits for a COMPLETE state from it's child job before allowing the thread of execution to continue.


Property Summary

job The child job.
name A name, can be any text.
stop Read only view of the internal stop flag.
timeout  

Example Summary

Example 1 An join that waits for two triggers.

Property Detail

job

Configured ByELEMENT
AccessWRITE_ONLY
RequiredNo, but pointless if missing.

The child job.

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.

timeout

Configured ByATTRIBUTE
AccessREAD_WRITE


Examples

Example 1

An join that waits for two triggers. In this example another trigger to run the last job might be a better solution because it wouldn't hog a thread - but there are situations when join is just simpler.

<oddjob>
    <job>
        <sequential>
            <jobs>
                <folder>
                    <jobs>
                        <state:flag id="apples" xmlns:state="http://rgordon.co.uk/oddjob/state"/>
                        <state:flag id="oranges" xmlns:state="http://rgordon.co.uk/oddjob/state"/>
                    </jobs>
                </folder>
                <state:join id="our-join" xmlns:state="http://rgordon.co.uk/oddjob/state">
                    <job>
                        <sequential>
                            <jobs>
                                <scheduling:trigger newOnly="true" on="${apples}" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling">
                                    <job>
                                        <echo>Apples</echo>
                                    </job>
                                </scheduling:trigger>
                                <scheduling:trigger newOnly="true" on="${oranges}" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling">
                                    <job>
                                        <echo>Oranges</echo>
                                    </job>
                                </scheduling:trigger>
                            </jobs>
                        </sequential>
                    </job>
                </state:join>
                <echo id="last-job">And that's that!</echo>
            </jobs>
        </sequential>
    </job>
</oddjob>


(c) Rob Gordon 2005 - 2017