Defining a schedule specification

The <CronSchedule> element in file scheduler-config.xml describes when PolicyCenter is to run the process.

<CronSchedule schedule_attributes/>

Use this element to define a schedule_attributes value to specify the exact timing, such as once every hour or every night at a certain time. The schedule_attributes value is a combination of one or more of the following attributes:

Attribute

Standard Values

Default

Example

seconds

0-59

0

seconds="0"

minutes

0-59

0

minutes="15"

hours

0-23

*

hours="12"

dayofmonth

1-31

*

dayofmonth="1"

month

1-12 or JAN-DEC

*

month="2"

dayofweek

1-7 or SUN-SAT

?

dayofweek="1"

Important: If you do not provide a value for a defined schedule attribute, the scheduler uses its default value in determining the work queue schedule. For example, if you do not specify a value for the hours attribute, the scheduler assumes a value of * and PolicyCenter runs the work queue process every hour. Thus, Guidewire recommends that you provide a value for each scheduler attribute. If you do not provide a value for a specific attribute, carefully review that attribute's default value and determine if the default value meets your business needs.

Useful attribute characters

Along with the standard values listed, there are some special characters that give you more flexible options.

Character

Meaning

*

Indicates all values. For example, minutes="*" means run the process every minute.

?

Indicates no specific value. Used only for dayofmonth and dayofweek attributes. See the examples for clarification.

-

Specifies ranges. For example, hour="6-8" specifies the hours 6, 7 and 8.

,

Separates additional values. For example, dayofweek="MON,WED,FRI" means every Monday, Wednesday, and Friday.

/

Specifies increments. For example, minutes="0/15" means start at minute 0 and run every 15 minutes.

L

Specifies the last day. Used only for dayofmonth and dayofweek attributes. See the examples for clarification.

W

Specifies the nearest weekday, use only with dayofmonth. For example, if you specify 1W for dayofmonth, and that day is a Saturday, the trigger then fires on Monday the 3rd. You can combine this with L to schedule a process for the last weekday of the month by specifying dayofmonth="LW".

#

Specifies the nth day of the week within a month. For example, a dayofweek value of 4#2 means the second Wednesday of the month (day 4 = Wednesday and #2 = the second Wednesday in the month).

These represent only some of the values that you can use for setting schedule.

Scheduler examples

The following table lists a few examples of how to work with the <CronSchedule> element.

Example

Description

<CronSchedule hours="10" />

Run every day at 10 a.m.

<CronSchedule hours="0" />

Run every night at midnight.

<CronSchedule minutes="15,45" />

Run at 15 and 45 minutes after every hour.

<CronSchedule minutes="0/5" />

Run every five minutes.

<CronSchedule hours="0" dayofmonth="1" />

Run at midnight on the first day of the month.

<CronSchedule hours="12" dayofweek="MON-FRI" dayofmonth="?" />

Run at noon every weekday (without regard to the day of the month).

<CronSchedule hours="22" dayofmonth="L" />

Run at 10 p.m. on the last day of every month.

<CronSchedule hours="22" dayofmonth="L-2" />

Run at 10 p.m. on the second-to-last day of every month.

<CronSchedule minutes="3" hours="8-18/2" dayofweek="1-5" dayofmonth="?"/>

Run 3 minutes after every other hour, 8:03 a.m. to 6:03 p.m., Monday through Friday.

<CronSchedule minutes="*/15" hours="0-8,18-23"/>

Run every 15 minutes after the hour, 12:15 a.m. to 8:45 a.m. and 6:15 p.m. to 11:45 p.m.

<CronSchedule hours="0" dayofmonth="6L" />

Run at midnight on the last Friday of the month.

<CronSchedule hours="4" dayofmonth="4#2" />

Run at 4 a.m. on the second Wednesday of the month.

The Quartz Enterprise Job Scheduler

These characters represent only some of the values that you can use for setting a schedule. Guidewire bases the PolicyCenter scheduler on the open source Quartz Enterprise Job Scheduler. The scheduler therefore uses the same specification for schedule attributes that Quartz uses. To determine the exact Quartz version, check the file name of the Quartz JAR file in PolicyCenter/admin/lib.