In addition to a regular schedule, an optional retry schedule can be specified. If the scheduled job doesn't complete or flags an exception the retry schedule will be used to schedule the next execution.
When the schedule specifies an interval, the regular schedule will be scheduled at the beginning of the schedule, the retry will be schedule at the end of the interval. In the example below the job will be scheduled at 10am, and if it fails 10:15, 10:30 etc.
This schedule takes advantage of schedules being defined as intervals by using the from/to time in the event that the scheduler wasn't running at exactly the due time and the scheduler isn't a type that saves state. The schedule could be specified using on="10:00", but if the scheduler doesn't use a persistant store and is started at 1pm the job will not be scheduled until 10am the next day. Setting the to="17:00" means that if the shceduler is started at 1pm the job will be scheduled immediately as if it started at 10am that same day.
If the scheduler saves state then this schdule will always run from the last completed time. If the job last completed on Monday at 10am but the scheduler isn't started until Wednesday at 1pm the schedule will run immediately as if scheduled at 10am Tuesday, then immedately again as if scheduled at 10am Wednesday.
| Name | Description | Required |
|---|---|---|
| job | The job who's execution to schedule. | Yes. |
| schedule | The regular schedule which is a schedule type. | Yes. |
| retry | The schedule used in the event that the child job doesn't complete or is in an exception state. This is a schedule type. | No. |
| timeZone | The time zone the schedule is to run in. This is the text id of the time zone, such as "Europe/London". More information can be found at TimeZone. | No. |
<ojschedule job="${ajob}" >
<schedule>
<dayofweek from="mon" to="fri" >
<time from="10:00" to="17:00" />
</dayofweek>
<schedule>
<retry>
<interval interval="00:15" />
</retry>
</ojschedule>
Also see the scheduling example.