[Index]

events:watch


Provides a component wrapper around a value type event source such as state:watch.

Property Summary

eventSource The event source being wrapped to be a component.
name A name, can be any text.
to The destination events will be sent to.

Example Summary

Example 1 Running a job when two other jobs complete.

Property Detail

eventSource

Configured ByELEMENT
AccessREAD_WRITE
RequiredYes.

The event source being wrapped to be a component.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

A name, can be any text.

to

Configured ByELEMENT
AccessWRITE_ONLY
RequiredMaybe. Set automatically by some parent components.

The destination events will be sent to.


Examples

Example 1

Running a job when two other jobs complete. Using components allows visibility on the individual event sources in a UI.

<oddjob>
    <job>
        <sequential>
            <jobs>
                <events:when id="when" xmlns:events="oddjob:events">
                    <jobs>
                        <events:list>
                            <of>
                                <events:watch name="Is Job 1 Complete">
                                    <eventSource>
                                        <state:watch xmlns:state="http://rgordon.co.uk/oddjob/state">
                                            job1 is COMPLETE
                                        </state:watch>
                                    </eventSource>
                                </events:watch>
                                <events:watch name="Is Job 2 Complete">
                                    <eventSource>
                                        <state:watch xmlns:state="http://rgordon.co.uk/oddjob/state">
                                            job2 is COMPLETE
                                        </state:watch>
                                    </eventSource>
                                </events:watch>
                            </of>
                        </events:list>
                        <echo id="job3" name="Job 3">
                            It's Done on ${when.trigger}
                        </echo>
                    </jobs>
                </events:when>
                <folder>
                    <jobs>
                        <echo id="job1" name="Job 1">
                            Hello
                        </echo>
                        <echo id="job2" name="Job 2">
                            World
                        </echo>
                    </jobs>
                </folder>
            </jobs>
        </sequential>
    </job>
</oddjob>


(c) R Gordon Ltd 2005 - Present