Tutorial - Launching a Task Every Monday Except Holidays

Introduction

In this exercise, we will define a trigger that runs the stonebranch-timertask-01 task (created in the Creating and Manually Launching a Simple Task tutorial) automatically every Monday at 1 p.m., except holidays.

For cases where Monday falls on a holiday, we will define a special restriction in the trigger that instructs the Controller to run the task on the next business day.

We will define the business days and holidays in a calendar.

Create Calendar and Custom Days

Before building the trigger, we will create the calendar:

Step 1

From the Automation Center navigation pane, Others > Calendars to display the Calendars list.

Step 2

Click New to display an empty Calendar Details.

Step 3

Enter stonebranch-calendar-01 in the Name field.

Step 4

In the Description field, enter Defines our company business days and holidays.

Step 5

Do not change the default selections for Business Days (Monday through Friday). Click Save.
 

Step 6

Open stonebranch-calendar-01 and click the Custom Days tab.

Step 7

On the Custom Days list, click the New button. A Custom Day Details for a new Custom Day displays.

Step 8

In the Name field, enter stonebranch-customday-01.

Step 9

In the Description field, enter Labor Day.

Step 9

In the Category field, select Holiday.

Step 10

In the Type field, select Relative Repeating Date. In the three additional fields that appear, make the following selections:

 

Step 11

Click Save to add this Custom Day to the Calendar.

Step 12

On the Custom Days list, click the New button. A Custom Day Details for a new Custom Day displays.

Step 13

In the Name field, enter stonebranch-customday-02.

Step 14

In the Description field, enter The founder's birthday.

Step 15

In the Category field, select Holiday.

Step 16

In the Type field, select Relative Repeating Date. In the three additional fields that appear, make the following selections:

 

Step 17

Click Save to add this Custom Day to the Calendar.

Create a Time Trigger

Step 1

From the Automation Center navigation pane, select Triggers > Time Trigger to display the Time Triggers list.

Step 2

Click New to display an empty Time Trigger Details.

Step 3

In the Name field, enter stonebranch-timetrigger-01.

Step 4

In the Description field, enter Run every Monday at 1 p.m., roll to Tuesday if Monday is a holiday.

Step 5

In the Calendar field, select stonebranch-calendar-01.

Step 6

In the Task(s) field, select stonebranch-timertask-01.

Step 7

In the Time Style field, keep the default, Time.

Step 8

In the Time field, enter 13:00 (1 p.m. in 24-hour time).

Step 9

In the Day Style field, keep the default, Simple.

Step 10

Enable Specific Day(s) field and select Monday.

Step 11

Enable Special Restriction and select:

  • On Holiday in the Situation field.
  • Next Business Day in the Action field.

Step 12

Click Save.
 

Step 13

Click the List Qualifying Times button to display the *List Qualifying Times Input pop-up dialog.

Step 14

In the Number of Dates/Times field, enter 15.

Step 15

In the Start Date fields, Select July 25 2014.

Step 16

Click Submit to display a list of Qualifying Times when the trigger will launch the task.
 

 
As shown in the list, the task will not run on the two Mondays that you have defined as holidays in the calendar, but instead will run the the following Tuesday.

Adding a Complex Restriction

The following steps show you how to add a complex restriction to the stonebranch-timetrigger-01 trigger. In this case, you will add a restriction that skips the last Monday of the year and instead triggers the task on the following Tuesday, just as it does for Mondays that are holidays.
 

Step 1

Enable Complex Restriction.

Step 2

In the Restriction Mode field, select Or.

Step 3

In the Restriction Adjective field, select Last.

Step 4

In the Restriction Noun field, select Monday.

Step 5

In the Restriction Qualifier field, select Year.

Step 6

Click Update.

Step 7

Re-open the trigger, click the List Qualifying Times button, enter 25 in the Number of Dates/Times field, and click Submit. The Qualifying Times list now shows an additional Monday (the last Monday of the year) on which the task will not be run.
 

For additional information, see: