Examples of Calendar Objects

Example 1 - Basic Calendar

You want to create a basic calendar that you can reuse afterwards for defining more complex ones. In our example, we'll call it Basic. It contains two weekly Calendar Events:

ClosedTo Define a Basic Calendar

  1. In the Process Assembly perspective, click Add Object and select Calendar.

    Define the general settings as described here: Defining Objects

    In this example, the Calendar is called Basic. Its title reads "Weekdays and Weekends".

    Click OK.

  2. The Calendar page is displayed. The days of the year that lie in the past are grayed out. This is a mere visual help; any Calendar event that you define here will also affect past dates:

    Click to Expand

  3. Create the first Calendar event, namely, one that selects all the weekends.

    1. Click the button.
    2. From the drop-down menu, select the type of event you want to create. In this case, Weekly.

      Click to Expand

    3. The Edit Weekly Event pane is displayed:

      Click to Expand

      The following options are available:

      Option Description
      Event Name

      Name of the event, which must be unique.

      Make sure that you use names that you can easily recognize, as you'll probably want to use them later on with other calendars.

      For this example, the event is called WEEKENDS.

      Weekdays

      Select the days of the week that this event will select.

      For this example, Saturday and Sunday.

      Interval

      You can define the interval in which this weekly event should be effective.

      For this example, as the goal is selecting all weekends in the year, we accept the default Every Week.

      Set CW Limits

      This allows you to set calendar week limits to the event. This can be useful if, for example, your financial year does not start on the 1st of January and you want this event to consider this.

      We ignore this setting for this example.

    4. The Calendar view is now in the background and grayed out:

      Click to Expand

      Click the button in the middle of the page to save the settings and preview the results of the event:

      Click to Expand

    5. If you are satisfied with the results, click the Apply & Close button at the bottom right corner of the page to return to the Calendar Events pane.
  4. Create now the WEEKDAYS event (Monday to Friday) following the steps described above.

Your calendar is now ready. You can assign it to your executable objects or use it and its events as basis for defining more complex calendars.

Example 2 - WORKDAYS Calendar

You want to make sure that the execution of some of your tasks is carried out on working days to be able to monitor them and react quickly if something goes wrong. This means that they should run neither on weekends nor on national holidays.

For this purpose you create a Calendar object containing the following Calendar events:

ClosedTo Define a WORKDAYS Calendar

  1. Create a Calendar object called WORKDAYS.
  2. Create a yearly event called NATIONAL_HOLIDAYS:

    The options in the Edit Yearly Event pane are as follows:

    Option Description
    Event Name

    Name of the event, which must be unique.

    Make sure that you use names that you can easily recognize, as you'll probably want to use them later on with other calendars.

    For this example, the event is called NATIONAL_HOLIDAYS.

    Start Year Specifies the year as of which the calendar event will be effective.
    Interval

    Specifies the interval in years in which the calendar event will be effective.

    Happening on

    Specifies the days of the year that will be selected by this event. The options are:

    • Defined days

      This is the case for this example:

      Click to Expand

    • Every x days

      This allows you to specify a recurrence throughout the year. You must specify whether it starts at the beginning or at the end of the year.

      Optionally you can activate the Set Yearly Limits checkbox and define the first and the last day of the year in which the event will be effective.

      For example, if you want the event to select every 5 days beginning with the 31st of December and backwards until the 1st of September, you would specify the following:

      Click to Expand

      And this would be the result:

      Click to Expand

  3. Create the WORKDAYS Group event:

    Click to Expand

    1. In Group Existing Events select WEEKDAYS; this is the event you want to combine with the NATIONAL_HOLIDAYS one.

      You can either open the dropdown list and select it or you can click the eye icon to open the Choose Calendar Event. The latter might be the best choice if you have many calendars and events and you want to display a preview of the one you choose to make sure that it is the correct one:

      Click to Expand

    2. Click Add.
    3. Expand the Advanced Options section.

      Here you select the event(s) to combine and define the nature of the relationship between the events.

      For our example this is Subtract Events. Select NATIONAL_HOLIDAYS here and click Add.:

      Click to Expand

      Intersect with Events means that the resulting calendar would select the dates that are common to all the events applied to the Group event.

    4. Click the button.

      As a result, the indicated dates are extracted from the resulting calendar:

      Click to Expand

       

Example 3 - Last Working Day of Month Calendar

This example builds the situation described on Offset Calendar Events.

A number of tasks in your company must be processed at the end of the month, no matter whether the last day is a working or a non-working day. You have already defined a calendar event that selects all last days of the month in your calendar; in this example, it is called LAST_DAY_OF_MONTH. This will be the existing event in the Offset event.

However, for other tasks you want to make sure that they are executed on a working day, that is, on the last working day of the month. You have already defined a calendar event that selects all working days throughout the year; in this example, it is called WORKDAYS. This will be the target event in the Offset event.

To make it a bit more complex, in this example you will exclude all Fridays. Should the resulting day be a Friday, you define to advance by one day. You have already defined a calendar event that selects all Fridays of the year; it is called FRIDAYS.

ClosedTo Define a Last Working Day of Month Calendar

  1. Create a new calendar or open an existing one to create the Offset event.
  2. Since the adjustment to the LAST_DAY_OF_MONTH event depends on another event, namely WORKDAYS, you must define an offset event of type Matching.
  3. Select LAST_DAY_OF_MONTH in Existing Event.

    The result of this event is as follows:

    Click to Expand

  4. Select WORKDAYS in Target Event.

    The result of this event is as follows:

    Click to Expand

  5. Define the relationship between both event. In this case, as you want the tasks that use this event to be processed within the month, select Match to nearest target date: before or on LAST_DAY_OF_MONTH.

    If you now have a look at the results, this is how it looks like:

    Click to Expand

    In January, April, July, September and December the last working day is a Friday. To avoid tasks to be processed on Fridays you define an exception.

  6. Click to open the Edit exception for event dialog and define the exception:

    1. Select the FRIDAYS event in If collision with.
    2. Select Advance by in Then.
    3. Select 1 in Additional Offset.

      This will jump one day back in the calendar if the result is Friday.

      Click to Expand

  7. The result of applying the exception is as follows:

    Click to Expand

    In January, April, July, September and December the selected day is now Thursday instead of Friday.

See also:

Calendar Object (CALE)