Examples of Calendar Events
Basic Calendar
You create a basic calendar that you can reuse afterward for defining more complex ones. In our example, it is called Basic and it contains two weekly Calendar Events:
-
Weekends
It selects all Saturdays and Sundays in the year.
-
Weekdays
It selects Mondays to Fridays every week of the year.
To Define a Basic Calendar
-
In the Process Assembly perspective, click Add Object and select Calendar.
Define the general settings as described here: Adding Objects
In this example, the Calendar is called Basic. Its title reads "Weekdays and Weekends".
Click OK.
-
On the Calendar page, the days of the year that lie in the past are dimmed. The difference in color is a mere visual help. Any Calendar Event that you define here also affects past dates.
-
Create the first Calendar event, namely, one that selects all the weekends.
- Click the Add Event button.
- From the drop-down list, select the type of event you want to create. In this case, Weekly.
-
The Edit Weekly Event pane is displayed, where the following options are available:
-
Event Name
Name of the event, which must be unique
Use names that you can easily recognize later on to reuse the event in other Calendars.
For this example, the event is called WEEKENDS.
-
Weekdays
Select the days of the week that this event should select.
For this example, Saturday and Sunday.
-
Interval
Interval in which this weekly event is effective
For this example, as the goal is selecting all weekends in the year, we accept the default Every Week.
-
Set CW Limits
Calendar week limits for the event. This option is useful if, for example, your financial year does not start on January 1 and you want this event to consider it.
We ignore this setting for this example.
-
-
The Calendar view is now in the background and dimmed. Click the Save & View button in the middle of the page to save the settings and preview the results of the event.
- If you are satisfied with the results, click the Apply & Close button to return to the Calendar Events pane.
- Create the WEEKDAYS event (Monday to Friday).
Your Calendar is now ready. You can assign it to your executable objects or you can use it and its events as basis for defining more complex Calendars.
WORKDAYS Calendar
You want to ensure that the execution of some of your tasks is carried out on working days. They should not run on weekends or on national holidays.
For this purpose, you create a Calendar object containing the following Calendar Events:
-
WEEKDAYS
We can reuse the Calendar Event that we have already created.
-
NATIONAL_HOLIDAYS
Yearly Calendar Event that selects all national holidays in the year.
The system supplies standard Calendar Events for national holidays in most of the countries. You can use and edit them, or create your own ones.
For this example, the national holidays are January 1, March 30 and 31, May 1, August 7, October 31, December 31.
-
WORKING_DAYS
Group Calendar Event that combines the previous two Calendar Events, subtracting the national holidays from the weekdays.
To Define a WORKDAYS Calendar
- Create a Calendar object called WORKDAYS.
-
Create a yearly Event called NATIONAL_HOLIDAYS. On the Edit Yearly Event pane that is displayed, specify the following parameters:
-
Event Name, which must be unique and easy to recognize
-
Start Year
-
Interval
-
Happening on
Fort our example, the settings are:
-
Defined days
- Every x days
This option 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, activate the Set Yearly Limits checkbox and define the first and last days of the year in which the event is effective.
For example, for the event to select every five days beginning with December 31 and backwards until September 1, specify the following parameters:
The screenshot displays the results:
-
-
-
Create the WORKDAYS Group event:
-
In Group Existing Events, select WEEKDAYS. You want to combine this event with the NATIONAL_HOLIDAYS one.
Either open the drop-down list and select it or click the eye icon to open the Choose Calendar Event. The latter might be the best option if you have many Calendars and Events because it displays a preview of the selected Calendar Event.
- Click Add.
-
Expand the Advanced Options section.
Here you select the events 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:
Note: Intersect with Events means that the resulting Calendar selects the dates that are common to all the events applied to the Group event.
-
Click the Save & View button.
As a result, the indicated dates are extracted from the resulting calendar:
-
Last Working Day of Month Calendar
This example builds the situation that is described in Offset Calendar Events.
Several 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 is called LAST_DAY_OF_MONTH that selects all last days of the month. This Calendar Event is the existing one in the Offset event.
Other tasks must be executed on the last working day of the month. You have already defined a Calendar Event that is called WORKDAYS that selects all working days throughout the year. This Calendar Event is the target event in the Offset event.
To make it more complex, in this example you exclude all Fridays. If the resulting day is a Friday, the following day should be selected. You have already defined a Calendar Event that is called FRIDAYS that selects all Fridays of the year.
To Define the Calendar
- Create a Calendar or open an existing one to create the Offset event.
- The adjustment to the LAST_DAY_OF_MONTH event depends on another event, namely WORKDAYS. For this reason, you must define an offset event of type Matching.
-
Select LAST_DAY_OF_MONTH in Existing Event.
The result of this event is as follows:
-
Select WORKDAYS in Target Event.
The result of this event is as follows:
-
Define the relationship between both events. 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:
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.
-
Click Edit to open the Edit exception for event dialog and define the exception:
- Select the FRIDAYS event in If collision with.
- Select Advance by in Then.
-
Select 1 in Additional Offset.
This jumps one day back in the calendar if the result is Friday.
-
The result of applying the exception is as follows:
In January, April, July, September and December the selected day is now Thursday instead of Friday.
See also: