Out-of-the-box Schedules

Friday, October 26, 2007

DemiCode Scheduler 1.1 have a set of out-of-the-box schedules. These cover the most common scheduling scenarios. If you have special requirements don't hesitate contacting us with suggestions or extend Scheduler yourself.

  • OneShotSchedule
  • IntervalSchedule
  • IntervalCountedSchedule
  • WeeklySchedule
Here we will provide some sample configurations for these schedules.

OneShotSchedule

As its name indicates, this schedule fires, once and only once, on a specific date and time. The following configuration fires 10th October 2007 at 03:20 pm.

<OneShotSchedule name="MyOneShot">
    <time>2007-10-01 15:20:00</time>
</OneShotSchedule>

IntervalSchedule

The IntervalSchedule is useful for repeating tasks. You provide a start date and time and the time span between intervals.

This sample configures a 5-second interval starting on 30th November 2006 at 03:50pm.

<IntervalSchedule name="FiveSecInterval">
        <start>2006-11-30 15:50:00</start>
        <interval>00:00:05</interval>
</IntervalSchedule>

IntervalCountedSchedule

The IntervalCountedSchedule is equal to its more generic sibling IntervalSchedule but limits the amount of intervals. After the schedule have reached the specified amount of intervals the schedule stops.

This sample configures a maximum of 31 intervals.

<IntervalSchedule name="FiveSecInterval">
        <start>2006-11-30 15:50:00</start>
        <interval>00:00:05</interval>
	<occurrences>31</occurrences>
</IntervalSchedule>

WeeklySchedule

The WeeklySchedule is even more flexible in that you can configure specific days during the week on which the schedule should fire.

This sample configures the schedule to start on January 1st 2007 and end on three years later. During that time the schedule will fire at 10:00pm Monday, Tuesday and Wednesday every week.

<WeeklySchedule name="WeeklyMondayToWednesday">
    <fromDate>2007-01-01</fromDate>
    <toDate>2010-01-01</toDate>
    <timeOfDay>22:00:00</timeOfDay>
    <days>
        <day>monday</day>
        <day>tuesday</day>
        <day>wednesday</day>
    </days>
</WeeklySchedule>

The days element must have one or more day elements with the following values:

<day>monday</day>
<day>tuesday</day>
<day>wednesday</day>
<day>thursday</day>
<day>friday</day>
<day>saturday</day>
<day>sunday</day>

Note:the toDate element is optional.