Calendar Conditions
Aim:
- Creating a calendar
- Creating a calendar keyword
- Assigning this calendar keyword to a file transfer
Lesson 8
It is very easy and helpful to schedule tasks through Schedule objects. Calendar objects can additionally be included as business processes often dependent on particular days.
In this lesson, we adjust the execution of the existing file transfer. It should be started Mondays to Fridays, but not on weekends.
- Open the folder in your Explorer in which all existing sample objects are stored.
- Click the button in the toolbar.
- Select the object type CALE (Calendar).
- Assign an appropriate name.
- Double-click the Calendar object to open it.
The weeks are graphically displayed in the Calendar tab.
Now the calendar must be linked to the FileTransfer object. This is done with calendar keywords.
- Open the Calendar tab.
- All calendar keywords are listed on the right side. As this Calendar object has been newly created, there is only the default keyword STATIC.
Different types of calendar keywords are available, each having its own Form Assistant for the quick and easy assignment of days.
- Right-click with the mouse button somewhere in the list area and select the command New Keyword -> Weekly.
- A dialog window opens in which this keyword can be renamed to WEEKDAYS.
- Remove the default keyword STATIC via the Del button or the command "Delete keyword" in the context menu (right mouse button).
- Now select the command Calendar Definition... (context menu) for the keyword WEEKDAYS. A Form Assistant opens.
- Highlight Mo, Tu, We, Th, Fr and click OK.
- Store the modifications using the button in the toolbar. All Mondays through to Fridays are now highlighted in the calendar.
If several calendar keywords are created, the days of the currently selected calendar keyword are highlighted.
- The calendar keyword WEEKDAYS now contains the dates of all weekdays.
- Close the Calendar object.
The Calendar object is now ready for use. In the next step, we assign the calendar keyword to the file transfer in the schedule.
- Open the Schedule object.
- Change to the Schedule tab and highlight the file transfer.
- Right-click the popup-menu command Properties.
- Change to the Calendar tab and activate the checkbox of the same name.
- Select "Execute if one condition matches".
- Select your Calendar object and the keyword WEEKDAYS, then click OK.
- The Schedule tab now contains the letter "C" in the Conditions column which indicates that the calendar condition has been set.
- Store your modifications using the button in the toolbar.
- Close the Schedule object.
In accordance with the definitions made, the FileTransfer object will run from Mondays to Fridays.
Note that this only applies when the file transfer was activated by the Schedule.
Exercise
Create a second calendar keyword in the Calendar object which includes all Saturdays and Sundays. Now select the WEEKEND keyword in the FileTransfer object instead of the WEEKDAYS keyword. Hence, the FileTransfer object does not run on days between Monday and Friday.
End the Schedule object and re-assign the WEEKDAYS keyword to the FileTransfer object.