Using Time Windows
A time window defines a time interval in which something can occur: for example the time a specific process definition is allowed to run, the opening time of a queue. A time window is made up of time window elements. Each of these elements defines a period of time. These elements can used fixed dates and times, rules such as "the first working day of the month", or a combination of both (dates and times and rules). A set of time window elements does not need be continuous.
The "enabled during" time window restricts the open period of time window to the open period of the "enabled during" time window. The "disabled during" time window restricts the open period of time window to the period where the "disabled during" time window is closed. This holds for both time window and time window element.
Time windows are part of the 'Environment' section in the navigation bar. A number of standard time windows are provided with Redwood Server representing common holiday calendars and time periods. The prefixes used for these are:
- System_BE - Belgium specific holidays and fiscal periods.
- System_CA - Canada specific holidays and fiscal periods.
- System_DE - Germany (and German state) specific holidays and fiscal periods.
- System_US - United States of America specific holidays and fiscal periods.
- System_GB - Great Britain specific holidays and fiscal periods.
- System_NL - Netherlands specific holidays and fiscal periods.
- System_Christian - Christian holidays used in some countries.
- System_World - World holidays used in some countries.
- System_ - other system time windows.
note
Nesting of time windows should be kept to a minimum. When deep nesting is used, the processing time for the process can increase significantly.
note
If the specified "day from" is after the last day of the month, it defaults to the last day of the month. This can have consequences for months with only 30 days and especially for February.
note
When you define a time window that is valid in a single time zone, it is recommended to set that time zone in the time window.
Tabs & Fields
The following table illustrates the fields of each tab of Time Windows editor dialogs.
Tab | Field | Description |
---|---|---|
Time Window | Partition | The Partition where you wish to store the time window. |
Time Window | Name | The name of the time window can contain any combination of US ASCII letters, digits, and underscores; limited to 80 characters. |
Time Window | Application | The Application of the time window. |
Time Window | Description | The description of the time window can contain any combination of printable UTF-8 characters, limited to 255 characters. |
Time Window | Time Zone | An optional time zone for the time window. |
Time Window | Enabled During Time Window | Another time window that defines open times for this time window. |
Time Window | Disabled During Time Window | Another time window that defines closed times for this time window. The current time window is closed when the Disabled During Time Window is open. |
Time Window | Is Calendar | The current time window is a calendar open entire days; a calendar time window cannot have times set, only dates. |
Time Window | If an open day is closed during | Specify a time window that is closed at the dates you want to shift the open dates forward or backward. The specified time window must be a calendar time window. |
Time Window | then shift this day | Direction in which you want to shift the open dates. |
Time Window | to the | Amount of open periods you would like to shift. |
Time Window | open day in | definition of open periods. |
Documentation | Documentation | A comment about the object, can be used for documentation purposes. |
Elements | Description | An optional description of the time window element. |
Elements | from/until-<time zone> | The times in specified time zone at which this element is open. Not to be used with calendar time windows. |
Elements | and from | Period of months this time window element is open. |
Elements | and from the/and until the | Days/weeks of the month. |
Elements | and from/and until | The times (without time zone) at which this element is open. Not to be used with calendar time windows. |
Elements | and period function | This time window element is [partly] defined by the following period function. |
Elements | with parameters | Parameters for the period function; all parameters of the period function must be specified. |
Elements | Time Zone | Time zone of the time window element, if different from the Time Zone field of the Time Window tab. |
Elements | Enabled During Time Window | Another time window that defines open times for this time window element. |
Elements | Disabled During Time Window | Another time window that defines closed times for this time window element. The current time window element is closed when the Disabled During Time Window is open. |
Elements | and shift open periods | Specifies how many days forward or backward should be shifted - it is an unconditional shift that is always performed. |
Elements | day rollover at | A time offset for day rollover. |
Opens At | Overview of when the time window is open (dates, times) and when the next opening and closure is. | |
Security | * | This is where you can specify who can access/change/remove the time window. |
Context-Menu
Time windows support the following context-menu actions:
Action | Description |
---|---|
Edit Security | Edit the security of the time window |
Duplicate | Make a copy of the time window to create a similar one |
Delete | Delete the time window |
Export > Export | Export the time window into a CAR file |
Export > Export with related objects | Export the time window into a CAR file including referenced objects |
Promote > Promote to system | Promote the object to a remote system |
Promote > Edit further then promote | Edit the export rule set prior to promoting |
Promote | Promote the time window to another Redwood Server instance |
Edit | Edit the time window |
Show permalinks | Show links that can be used from third party applications to link to the object |
Add to navigation bar | Add the current object to the navigation bar |
New time window | Create a new time window |
Filter > New Filter | Create a new time window filter |
Filter > Edit Filter | Edit current time window filter |
Filter > Delete | Delete current time window filter |
Filter > Duplicate Filter | Create a copy of the filter |
Filter > Export Filter | Export the filter into a CAR file |
Filter > Add to navigation bar | Add the filter to a navigation bar |
Filter > Create filter from search | Create a filter from the current IntelliSearch query |
Restricting Time Windows
A time window is closed all day every day, by default. Time window elements are open all day, every day; so once you add one you use restrictions, for example from Monday to Tuesday or 9:00:00 AM to 5:00:00 PM, to customize it to your liking. These settings are set on time window elements and are cumulative; a time window with two elements, one of which is open on Tuesdays and the other on Wednesdays, is open on both days. All settings that are set on an individual time window element must intersect at some point, or that time window element will always be closed. A time window element has no effect on other time window elements. See the above table Tabs & Fields for a description of the fields on the Time Window Elements tab.
On a time window element the "workday" ignores public holidays; you combine two or more time windows to take workdays that fall on public holidays into account.
Daylight Saving Time (DST)
In the developed world, DST has been introduced to attempt to save energy. For computer systems this means an hour of the day occurs twice or is skipped. Redwood Server has no issues with time switches. If systems in your data-center run Redwood Server processes and need to be shut-down over the switch period (usually SAP systems), ensure you have held all the affected queues before shutting down the SAP systems, as you do not want new processes to start. Please wait until all processes have reached a final state before shutting SAP systems down. Avoid releasing all queues simultaneously, or the SAP systems might get overloaded as soon as they become available. You can also use time windows to achieve the above without human intervention at the time of the date-change.
Wrapping
When you use restrictions, for example from Monday to Tuesday, and the from value comes after the to value, Redwood Server will automatically wrap. The following list illustrates the behavior:
- A range of months wraps around a year, for example, from November to February will be interpreted as from November (this year) to February (next year)
- A range of days of the month (with an offset) wraps around a month, for example from 26 (this month) to 5 (next month)
- A range of weekdays (with an offset) wraps until the following week.
- A range of times of day (with an offset allowing to cross midnight) from 23:00 (today) to 2:00 (tomorrow)
note
Offsets are specified in hours and wrap at 24.
Day Rollover
The day rollover is an offset in hours of midnight. When set on a time window, it affects any enabled during time window and any period function if they are open from midnight to midnight. Example: in 2016, Easter Sunday falls on 27th March. You want the time window to be open Easter Sunday 9:00 PM to Easter Monday 9:00 PM. You create a time window open all day, set the enabled during time window to System_Christian_Easter and a day rollover of 21:00:00
.
This works with any time window that is open from midnight to midnight; all calendar time windows fall into this category.
note
When multiple related time windows have different day rollovers, the latest (as in maximum) day rollover is used for the entire calculation.
Time Window Preview
In the preview pane of a time window, a calendar displays the current month and the days and time the currently selected time window is open. It shows the time of the current day by default but different days, months, and years can be selected. It shows a blue bar when a time window is open, a light blue bar when a time window opens and a white bar when the time window is closed. This can help fine tune a time window and can help you make sure you have made no mistakes when you created the time window.
The time scale below the calendar shows the time of the currently selected day the time window is open,
An overview table is displayed on the right-hand side and gives you an overview over all the times and dates of the current month the time window opens and closes as well as the previous open period and next open period, before and after current month, respectively.
Time Windows and Process Scheduling
Time windows can be set on queues, queue providers, and processes. A submitted process will start at the next intersection of all time windows involved. If all involved time windows are not all open at a specific point in time in their respective time zones over the coming two years, Redwood Server sets the process to status Never. Note that a shutdown process server can also cause the process to be put into status Never as Redwood Server cannot determine when the process server will be running again.
note
Not all regions observe DST changes, so a setup that appears to be working as designed at any given time should be thoroughly tested for time changes.
You prevent processes from starting too close to the closure of a time window by specifying a duration in milliseconds Min open time window duration to fit process ( MinimumOpenDurationExpression
) field of a process definition or process. The field accepts positive integers or REL expressions; JobDefinitionRuntimeLimit
REL substitution parameters are available.
REL Substitution Parameters
Name | Class | Description |
---|---|---|
averageRuntime | Number | The average runtime of the current process |
jobId | Number | The process ID of the current process |
parameters | InParametersScriptObject | The values of input parameters of current process |
parameters.<name> | [String]((https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html), Number, Date, DateTimeZone | Value of parameter named <name> of current process |
requestedStartTime | DateTimeZone | The requested starttime of the current process |
scheduledStartTime | DateTimeZone | The scheduled starttime of the current process |
standardDeviationRuntime | Number | The standard deviation of the runtimes of the process definition of the current process |
topLevelAgerageRuntime | Number | The estimated runtime of the top level process in the chain |
topLevelJobId | Number | The process ID of the top level process in the chain |
topLevelRequestedStartTime | DateTimeZone | The requested starttime of the top level process in the chain |
topLevelScheduledStartTime | DateTimeZone | The scheduled starttime of the top level process in the chain |
topLevelStandardDeviationRuntime | Number | The standard deviation of the runtimes of the process definition of the top level process in the chain |
note
REL expressions begin with an equals (=
).
To make sure that a job completely finishes within the time window, you can set Min open time window duration to fit process field to averageRuntime
(plus a safety margin).
Example
=averageRuntime
- the average job runtime=averageRuntime * 2
- twice the average job runtime=averageRuntime * 3
- three times the average job runtime=averageRuntime + standardDeviationRuntime
- the average job runtime plus the standard deviation=averageRuntime + standardDeviationRuntime * 2
- the average job runtime plus twice the standard deviation=averageRuntime + standardDeviationRuntime * 3
- the average job runtime plus three times the standard deviation.
Pre-submitted Processes
The submit frame time window and the process time window are intersected. The returned start times must match the result of the intersection.
Skip when time window is closed
istrue
- return only the calculated start times for which the intersection is open, skip if the intersection is closed.Skip when time window is closed
isfalse
- slide the result to the next opening to the intersection. If the submit frame element has an anchor time, try this time on the day of the result. Is the time window open, the anchor time is returned, otherwise the calculated opening of the intersection is used.
If the queue has a time window, it is applied after the start time calculations. This implies that if the queue time window is closed on the calculated start time, the start time slides to the next opening of the queue time window. In this case, the anchor time is tried first as well.
note
The Skip when time window is closed setting has an effect on both the time window of the submit frame and the time window of the process.
Finding Time Windows
You can search for time windows using filters and the Search Time Windows box on the Time Windows tab. This box is known as the IntelliSearch box located under your username on the top right-hand side of the user interface. Filters allow you to specify a list of objects with static criteria. IntelliSearch allows you to specify complex queries in a simple way using prefixes. Prefixes are used to specify which property you are searching in and have short as well as long syntaxes. For example, if you want to display all time windows with the term import in the comment, you would use the search criteria as follows:
c:import
You can search more than one property, as follows:
c:import n:Bi
note
No spaces should be entered before or after the colon (: ).
See the Advanced Object Search for more information.
The following table illustrates the available prefixes for time windows:
Prefixes | Description |
---|---|
n, name | searches the name property |
c, comm, comment | searches the documentation property |
d, desc, description | searches the description property |
a, application | searches the application property |
cb, changedbefore | (internal) search for time windows that changed before a certain ISO-8601 period |
Deleting Time Windows
You can only delete time windows when no other objects relate to them. For example, if there are processes that have run with the time window, the time window cannot be deleted until all processes that ran with it have been deleted. You can see all processes that relate to the time window in Related Objects in the lower detail pane and on the show page.
The table in related objects contains three columns:
- Type - the type of object with a link to it
- Related Object - the name of the object with a link to it
- Used As - objects can sometimes be used in different roles
Security
Privilege | Description |
---|---|
TimeWindow.Create | Create time windows |
TimeWindow.Delete | Delete time windows |
TimeWindow.Edit | Edit time windows |
TimeWindow.View | Access time windows |
You can grant privileges on two levels, Access and Admin; a privilege granted on Admin level allows the grantee to grant the privilege to other users. These privileges can be granted per partition or system-wide.
The Security tab allows you to specify which users can access, edit, and delete the time window.
Procedure
- Choose "Environment > Time Windows".
- Choose Refresh to see all existing time windows.
- Choose New Time Window to create a time window.
- Fill in the details, refer to the section below.
- Choose Save and Close to save the time window.
Values
The configuration details for time windows can be found in the Configuration Data for Time Windows section of the documentation.
Example
Upgrade Maintenance Window
The BRLN_AIXS4
system is going to be upgraded and a time window needs to be created.
- Choose "Environment > Time Windows" in the Navigation bar.
- Choose the New Time Window button and fill in the values for the Time Window tab.
- Optionally choose the Documentation tab and fill in the details in the Doucumentation field.
- Choose the Elements tab, choose Add and fill in the values for the Elements tab.
- Choose Save and Close.
note
You can choose Calendar to choose a from and until day.
Values to fill in on the respective tabs as follows:
Name: DataWareHouseUpgrade
Description: Data Warehouse Upgrade
Documentation: BRLN_AIXS4 will be upgraded and unavailable the 15th of march
from: 15-03-2022 17:30
until: 15-03-2022 20:30
tip
Redwood Server contains many predefined time windows that can be used to create new time windows. However, never remove built-in time windows.
You want to have a process run on every third workday of the month according to an SAP Factory Calendar
- Choose "Environment > Time Windows".
- Choose Refresh to see all existing time windows.
- Choose New Time Window from the context-menu to create a time window, fill
PR1_Never
into the Name field and check the field Is Calendar. - Choose Save & Close and choose New Time Window from the context-menu.
- Fill
PR1_FR
into the name field and check the field Is Calendar. - On the Elements tab, fill
SAP_FactoryCalendar
into the and period function field, fillcalendar = PR5 FR
into the with parameters field. - You must ensure the factory calendar is imported from the SAP System named PR5; you submit the SAP_ImportCalendars process definition on the PR5 SAP System to import the calendar.
- Choose Save & Close and choose New Time Window from the context-menu.
- Fill
PR1_3RD_Workday
into the Name field, check the Is Calendar field. - Fill PR1_Never into the If an open time window is closed during field.
- Choose Forward in the then shift this day field, fill
3
andPR1_FR
into the to the and open day in fields. - On the Elements tab, choose Add, and select last in the and from the
day
of the month (6th field from the top). - Choose Save, inspect the open times on the Opens at tab to make sure they are ok.
- Choose Save & Close.
DST Changes
You have a data process that needs to feed data from a data center in Paris to a data center in Karachi, Pakistan. Due to the current offset (April), you want the data to be processed at 3:00AM in Europe/Paris, which is 6:00AM in Asia/Karachi. A process sends the data to a file server in Karachi where it is picked up by another process that dumps it into your BI system. You create a time window that is open Sundays between 3:00AM and 3:59AM in Europe/Paris and set it on the process definition that retrieves the data from the Paris data center. The technicians in Karachi create a time window that is open from 6:00AM to 6:59AM and set it onto the process definition that is supposed to load the data into the BI system.
After the DST change in Paris in late October, the file event in Karachi that was supposed to start the second process fires too late. The process cannot be run anymore since the time windows no longer overlap. Besides, the first employees have started work already and are using the target system which now contains outdated data.
See Also
- Creating a time window - video
- Configuration Data for Time Windows
- Shifting Times and Days with Time Windows
- Using Time Windows in Processes
- Defining Advanced Execution Times with Period Functions
timewindow time window