Cron Expression Fields

The Axeda® Connected Product Management Applications supports the Cron expression for Schedules configured for Rule Timers. The Cron expression is shown in the Schedule column for each rule timer in the View and manage rule timers page. In the Configure the rule timer page, the Schedule field displays the selections made for the fields in the dialog boxes; the field itself cannot be edited.

From left to right the expression has six fields, separated by a space, as follows:

Seconds Minutes Hours Days_of_Month Months Days_of_Week

These fields may contain numbers, letters, and special characters. The special characters and letters that may appear in the different schedule fields include:

o        The asterisk (*) indicates every value applies. For example, if used in the Month field, the rule timer will run every month. This character is allowed in every field of a Cron expression.

o        The forward slash (/) describes increments. For example, if 0/15 is displayed for Seconds in the Schedule field, the rule timer runs on the 0th second of the first minute and then every 15 seconds thereafter. This character is allowed in every field of a Cron expression.

o        The comma (,) separates elements of a list. For example, the string "MON,WED,FRI" in the Days of Week field means that the rule timer will run every Monday, Wednesday, and Friday. This character is allowed in every field of a Cron expression.

o        The hyphen (-) delimits the boundaries of a range. For example, "JAN-APRIL" in the Month field means that the rule timer will run every month between January and April inclusively. This character is allowed in every field of a Cron expression.

o        The letter "L" specifies the last day of the month for in the Month field or the last day of the week in the Days of Week field.

o        The letter "W" specifies the weekday nearest to the given day. If combined with "L", the result ("LW" translates to the last weekday of the month.

o        The pound sign "#*" specifies the "nth" xxx day of the month. For example, if you want to specify the third Friday of the month, use the Other field in the Days of Month Time Expression dialog box, and type 6#3, where Friday is day 6 and the #3 indicates the third one in the month.

o        The question mark "?" is valid only for the "Days of Month" or "Days of Week" fields. It can be used in only one of the fields at a time. For example, if you want the timer to fire every Friday, without regard to the day of the month, you would select Friday in the Days of Week Time Expression dialog box and the option, "Happens on an unspecified day based on Days of Week setting" in the Days of Month Time Expression dialog box. In the Cron expression, you would see the question mark (?) in the Days of Month field and the number 6 (representing Friday) in the Days of Week field.

You can specify a value for "Days of Month" OR for "Days of Week" but not for both within the same schedule.

The following table lists the fields in the Cron expression in the Schedule field of a Rule Timer configuration or in the Schedule column of the View and manage rule timers page. The table shows whether the field is required, the values allowed in the field, and the special characters allowed in the field.

 

Field

Required?

Valid Values

Special Characters

Seconds

yes

0 through 59

comma ,
hyphen -
asterisk *
forward slash /

Minutes

yes

0 through 59

comma ,
hyphen -
asterisk *
forward slash /

Hours

yes

0 through 23

comma ,
hyphen -
asterisk *
forward slash /

Days of Month

yes

1 through 31

comma ,
hyphen -
asterisk *
question mark ?
forward slash /
the letters L and W

Month

yes

JAN through DEC

comma ,
hyphen -
asterisk *
forward slash /

Days of Week

yes

SUN through SAT

comma ,
hyphen -
asterisk *
question mark ?
forward slash /
the letter L
pound sign #

 

For more information about Cron expressions, refer to http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html.

 

See Also