Automation Center Documentation

Launching a Task Every Monday Except Holidays

From OpsWise Documentation Wiki

image:pdficon_small.gif Open as PDF

In this tutorial, we will define a trigger for our Demo Sleep task that runs the task automatically every Monday at one o'clock in the afternoon, except holidays. If a Monday falls on a holiday, we will instruct the system to run the task on the next business day. We will use calendars to define the holidays and special restrictions.

Contents

Create Calendar and Custom Days

Before building the trigger, we will create the calendar we will be using:

  1. From the navigation pane, select Calendars.
  2. Click the New button.
  3. In the Name field, type My Holiday Calendar.
  4. In the Comments field, type Defines our company business days and holidays.
  5. Leave the default selections for business days (Monday through Friday).
  6. We will define each of the holidays using the Calendar Custom Days tab. Before we can access the tab, we must first save the Calendar record to the database. To save a record without returning to the previous screen, click the small down-arrow and select Save.
  7. image:tut right click and save.jpg

  8. Click the Calendar Custom Days tab.
  9. A number of Custom Days definitions are included in the default database. First we will select several of those for our calendar:
    1. Click Edit. The Edit Members screen is available in many areas of OpsWise Automation Center. It allows you to select records and associate them with the current record. In this case, we will select a number of holidays and associate them with our holiday calendar.
    2. Press the CTRL key and click every holiday in the list except Flag Day and President's Day.
    3. Click the Add button. The days you selected are added to the Custom Days list.
    4. image:tut edit members.jpg

    5. Click Save. The Calendar Days you selected are now shown in the Calendar Custom Days tab.
  10. Now we will add two more custom days to our holiday calendar. For our first custom holiday, let's say our company holds an inventory day on the third Monday of each January, during which the company closes. To create this Custom Day:
    1. From the Calendar Custom Days list, click New.
    2. In the Name field, type Inventory Day.
    3. Click to enable the Holiday field. We are going to include instructions in the trigger to roll the date to the following Tuesday if a Monday falls on a holiday. In order for those instructions to apply to this Custom Day, we must flag the day as a holiday.
    4. In the Comments field, type Inventory performed on the third Monday of January. This comment will display on the Custom Days list.
    5. In the Type field, select Relative Repeating Date. Three additional fields appear: When, Day of Week, and Month.
    6. Make the following selections:
      • When = 3rd
      • Day of Week = Monday
      • Month = January
    7. image:tut new custom day.jpg

    8. Click Submit to add this custom day to the calendar.
    9. Now we will add another holiday. Let's say our company celebrates the birthday of its founder, which is April 1. Click the New button and fill in the fields as follows:
      • Name = Founder's birthday
      • Holiday = enabled
      • Comments = The founder's birthday
      • Type = Absolute Repeating Date
      • Month = April
      • Day = 1
    10. Click Submit to add this day to the calendar.
  11. You have already saved the calendar record and each custom day record, so you do not need to return to the main screen and save the calendar again. Note that the new custom days definitions can later be used in other calendars.

Now we are ready to build our trigger.

Create Time Trigger

  1. From the navigation pane, select Time Trigger.
  2. Select New.
  3. In the Trigger Name field, type Every Monday at One, Tuesday on Holidays.
  4. In the tasks field, select the Demo Sleep task. Hint: To skip to tasks beginning with "D" without opening the browse window, type "D" into field and select from the list that displays.
  5. image:tut skip to Ds.jpg

  6. In the Calendar field, select My Holiday Calendar.
  7. In the Description field, type Run every Monday at one, roll to Tuesday if Monday is a holiday.
  8. In the Time Style field, leave the default, Time and in the Time field, enter 13:00, which is 1 o'clock p.m. in 24-hour time.
  9. First we will define a simple restriction. In the Day Style field, leave the default, Simple.
  10. Enable the Specific Day field and select Monday.
  11. Enable the Special Restriction field. Several additional fields appear, which allow you to specify special processing. We will use these fields to instruct the system to roll the job to Tuesday if a Monday falls on any of the holidays defined in the calendar -- in our case, My Holiday Calendar. Fill in the fields as follows:
    • Situation = On Holiday
    • Action = Next Business Day
  12. image:tut every monday but holiday trigger.jpg

  13. For the purposes of the next exercise (below), we are going to change our simple restriction to a more complex restriction. We not only want to roll to Tuesdays on holidays, but our company has a extra processing load on the last Monday of the year so we want to roll this task to the next day. To provide such instructions in the trigger, select Complex Restriction and make the following selections:
    • Situation = On Holiday
    • Restriction Mode = Or
    • Restriction Adjective = Last
    • Restriction Noun = Monday
    • Restriction Qualifier = Year
  14. Click Submit.
  15. To enable this trigger, right-click on the trigger name in the list and select Enable Trigger.

List Qualifying Times

Now we will test our Time trigger and its date selection parameters using the List Qualifying Times function.

  1. Display the Time Trigger you just created called Every Monday at One, Tuesday on Holidays.
  2. Click List Qualifying Times. The system calculates the next twenty dates that this trigger will be satisfied and lists them in a new browser tab. In the sample shown below, three Tuesdays were selected in place of the following Mondays:
    • Labor Day, 1st Monday of September, specified in the calendar
    • Columbus Day, 2nd Monday of October, specified in the calendar
    • The last Monday of the year, specified in the trigger
    image:tut list qualifying times.jpg

image:sb15-1.gif


Return to First Look menu.

For additional information, see:

Personal tools