[Index]

sequence


Provide a sequence number which is incremented each time the job is executed.

Property Summary

current The current sequence number.
from The sequence number to start from.
name The name of this job.
watch This can be any object which will be watched, and when it changes the sequence will be reset.

Example Summary

Example 1 Using a sequence in a file name.

Property Detail

current

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredSet automatically, but can be changed manually.

The current sequence number.

from

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo, defaults to 0.

The sequence number to start from.

name

Configured ByATTRIBUTE
AccessREAD_WRITE
RequiredNo.

The name of this job.

watch

Configured ByATTRIBUTE
AccessREAD_WRITE

This can be any object which will be watched, and when it changes the sequence will be reset. This will most likely be a date.


Examples

Example 1

Using a sequence in a file name.

<oddjob id="this" xmlns:scheduling="http://rgordon.co.uk/oddjob/scheduling" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules">
    <job>
        <scheduling:timer id="daily">
            <schedule>
                <schedules:daily/>
            </schedule>
            <job>
                <scheduling:timer>
                    <schedule>
                        <schedules:count count="10"/>
                    </schedule>
                    <job>
                        <sequential>
                            <jobs>
                                <sequence id="seqnum" watch="${daily.current}"/>
                                <variables id="vars">
                                    <seqnumFormatted>
                                        <format format="0000" number="${seqnum.current}"/>
                                    </seqnumFormatted>
                                </variables>
                                <copy name="Create file" to="${work.dir}/sequence${vars.seqnumFormatted}.txt">
                                    <input>
                                        <value value="This text will be in every file."/>
                                    </input>
                                </copy>
                            </jobs>
                        </sequential>
                    </job>
                </scheduling:timer>
            </job>
        </scheduling:timer>
    </job>
</oddjob>
The watch property is set to watch when the daily scheule move forward so the sequence is restarted.


(c) R Gordon Ltd 2005 - Present