Scheduling
Redwood Server includes a rule-based scheduling engine that allows sophisticated schedules to be easily built and maintained. There are two primary mechanisms for scheduling in Redwood Server:
- Time windows & submit frames - Unlimited, rule-based scheduling.
- Recurrences - Time limited scheduling for irregular schedules.
Processes submitted using either mechanism are visible in the processes monitor.
Time Windows & Submit Frames
Time windows and submit frames are a rule-based scheduling method. This means that the times that a process runs at are defined by a set of rules. For example, a process can run at any of the following schedules:
- Once an hour between 8:00 am and 5:00pm (European Standard Time).
- On weekdays.
- Unless that day is a holiday in Germany or The Netherlands.
- Once a month, on the last working day of the month.
note
For any time-based object to be precise, you must specify a time zone.
A variety of rules are delivered by default, these include:
- Definitions for holidays that do not occur on the same date each year, like Easter.
- Holiday calendars for many European countries (and their states or provinces), the United States, and Canada.
- Rules for United States fiscal quarters (445 and 544 calendars).
These rules are implemented using two complementary concepts:
- Time windows - To specify when processes may and may not run.
- Submit frames - To specify how often processes run.
Time windows and submit frames may be used individually, or together.
When a process is submitted using submit frames and/or time windows, the following processes appear in the processes monitor:
- All previous runs of the process (until they are deleted).
- If the process is currently running - the running process.
- If the process is not currently running - a process scheduled to run the next time the process starts.
Time Windows
A time window specifies when processes may and may not run. A time window is open at a particular time if processes are allowed to run, otherwise it is closed. Time windows are made up of time window elements that specify restrictions on opening times. A time window is open if at least one of its elements is open, otherwise it is closed.
A time window that is open during business hours so not at lunch-time, for example, could look like the following:
- Open between 08:00 and 12:00.
- Open between 13:00 and 17:00.
This time window is open at the following times:
- 08:00, 12:00, 13:00, 14:45 and 17:00.
Note that time window elements include their opening time (08:00 and 17:00 in this case), but do not include their closing time (12:00 and 17:00 in this case). This is to ensure that inclusion and exclusion work correctly.
Time windows can refer to one another, using inclusion and exclusion. So, another way to define the time window above would be:
Time window Lunch:
- Open between 12:00 and 13:00.
Time window Business excluding Lunch
- Open between 08:00 and 17:00.
- Closed during Lunch.
This method has the advantage that it is much easier to change the hours associated with Lunch, and the Lunch time window can be shared with many other time windows. It also makes it possible to use the predefined rules that come with the product:
For example, a time window that is only open when business units in Germany, the US, and Canada are open is defined below:
Time window All Business Units Open:
- Open from Monday to Friday.
- Closed during System_DE_PublicHolidays.
- Closed during System_US_PublicHolidays.
- Closed during System_CA_PublicHolidays.
Submit Frames
Submit frames specify how often a process runs, for example, once an hour, twice a month, or on the last workday of every month.
Like time windows, submit frames are made up of elements. Submit frame elements may refer to time windows, allowing different frequencies to be specified, depending on the time.
For example, a process that deletes output files might need to run more often during peak periods:
- Every 5 minutes, during PEAK time window.
- Every 15 minutes, otherwise.
note
For any time-based object to be precise, you must specify a time zone.
Recurrences
Recurrences are another method of controlling when processes run, based on concepts similar to those you might use to schedule a business appointment. You use recurrences to schedule processes to run on specific schedules, such as daily, weekly, monthly, yearly, or by specifying specific dates.
Time Zones
Many large organizations have systems that are distributed geographically, often in different time zones. Operators are frequently not in the same location as the processes being managed. When working in such a situation, it is important to be able to work with processes in the time zone that they are likely to run in.
Consider a process that runs at 5:00 pm in New York, and an operator based in London talking to a user in New York. The operator needs to be able to see that the process's time zone is New York and that the process runs at 5:00 pm, even though it may be 10:00 pm local time for the operator. If that operator needs to move the process to run at a new time (to allow some missing data to be loaded into a database, for example), then doing it in the appropriate (process specific) time zone is far less error prone.
The time zone of a process is the time zone specified in the submit wizard. When the process was submitted from RedwoodScript, without specific time zone, the central Redwood Server time zone is used for the process time zone.