[Index]

events:trigger


Trigger on an event. This is a work in progress replacement for scheduling:trigger. The intention being that it has the ability to fire off any event, not just a state change.

The job has two children; the first being the source of the event that causes the trigger, and the second is the job that is run as the result of the trigger firing.


Property Summary

jobs The child jobs.
name A name, can be any text.
ran  
stop Read only view of the internal stop flag.
trigger The trigger event.

Example Summary

Example 1 A trigger expression based on the state of some jobs.

Property Detail

jobs

Configured ByELEMENT
AccessWRITE_ONLY
RequiredNo, but pointless if missing.

The child jobs.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

A name, can be any text.

ran

AccessREAD_ONLY

stop

AccessREAD_ONLY

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

trigger

AccessREAD_ONLY
RequiredRead only.

The trigger event.


Examples

Example 1

A trigger expression based on the state of some jobs.

<oddjob>
    <job>
        <sequential name="Trigger on Two Things">
            <jobs>
                <bean class="org.oddjob.events.Trigger" id="trigger">
                    <jobs>
                        <bean class="org.oddjob.state.expr.StateExpressionNode">
thing1 is success and thing2 is success and not (thing3 is success or thing4 is success)
                        </bean>
                        <echo id="notify" name="Triggered Job">You ran two things!</echo>
                    </jobs>
                </bean>
                <folder name="A Folder of Jobs">
                    <jobs>
                        <echo id="thing1" name="Run me!">Thank you</echo>
                        <echo id="thing2" name="Run me!">Thank you</echo>
                        <echo id="thing3" name="Don't Run me!">Uh oh!</echo>
                        <echo id="thing4" name="Don't Run me!">Uh oh!</echo>
                    </jobs>
                </folder>
            </jobs>
        </sequential>
    </job>
</oddjob>


(c) R Gordon Ltd 2005 - Present