Redwood Documentation

Product Documentation

 

›Calendaring

RunMyJobsMonitoring Processes

Processes

  • Monitoring and Managing Processes
  • Advanced Process Search
  • Filtering Processes
  • Processes Monitor Diagrams
  • Redwood Server Process Processing
  • Process States
  • Available Columns in the Processes Monitor
  • Chains Monitor Filter Columns
  • Process Forecasting
  • Integrating Redwood Server into Third-Party Applications with PermaLink

Operator Messages

  • Operator Messages Monitor
  • Creating Operator Messages
  • Interacting with Operator Messages
  • Creating Advanced Operator Message Reply Expressions
  • Receiving Operator Messages on your Desktop

Events

  • Monitoring Events
  • Filtering Events
  • Event Filter Columns

Environment

  • Monitoring System Performance
  • Monitoring Dashboard
  • Housekeeping Dashboard
  • Monitoring SAP Systems
  • Creating Custom Monitor Checks

Submitting Processes

  • Submitting Processes and Chains
  • Submitting a Process or Chain
  • Scheduling with Times and Dates
  • Rescheduling Processes Automatically
  • Using Recurrences

Calendaring

  • Using Time Windows
  • Shifting Times and Days with Time Windows
  • Configuration Data for Time Windows
  • Using Time Windows in Processes
  • Defining Advanced Execution Times with Period Functions
  • Managing Recurrences
  • Creating Submit Frames
  • Frequently Asked Questions About Submit Frames
  • Using Submit Frames in Processes
  • Time Zones
← Using Time Windows in ProcessesManaging Recurrences →

Defining Advanced Execution Times with Period Functions

Redwood Server features rich calendaring possibilities; time windows offer great flexibility while remaining easy to define. However, sometimes complex calculations are required to determine if certain conditions are met for a time window to be open, Easter for example. For this matter it is possible to create period functions. Period functions are boolean functions used in time windows that calculate when a time window is supposed to be open or closed. Period functions are complex functions written in RedwoodScript, stored in the Repository, that are used in time windows to calculate the dates and times that a time interval is open.

When you import SAP Calendars (like the Factory and Holiday calendars), these become available as period functions.

You can also define your own period functions, however, since all time windows using a period function share the same instance of a period function, parameter values can be cached for performance reasons. You must be very careful and check your parameters.

The following period functions are built-in:

Period FunctionDescription
SAP_FactoryCalendarUse the SAP calendar from an SAP instance to schedule SAP jobs; the calendaring data needs to be imported from the instance
SAP_HolidayCalendarUse the SAP calendar from an SAP instance to schedule SAP jobs; the calendaring data needs to be imported from the instance
System_InDayRecurrenceRecurrence within a day
System_EasterCalculates Easter or Easter-based holidays
System_FiscalPeriodsCalculates open days based on periods in a fiscal year.
note

You need the scripting module, which requires the Module.Scripting license key, to be able to create period functions.

Caching Objects in Period Functions

You should not cache SchedulerEntities, such as Time Windows, in period functions as these might have a long life-time or the dispatcher may refresh the session, causing JCS-122017: Trying to use non-attached object TimeWindow errors, for a time window in this example.

Easter Period Function

The easter period function accepts one dayNumber parameter, which is the offset to easter Sunday.

No parameter or dayNumber=0 means easter Sunday.

SAP Calendars

SAP calendars are imported and converted to period functions to be used in time windows. Period functions of SAP calendars take arguments, as the factory calendar, for example, can include several different calendars, which all must have a unique calendar ID.

SAP Calendar period functions accept the following arguments:

  • calendar=<SAP Instance> <Calendar ID>
ParameterDescription
<SAP Instance>The SAP Instance Name
<Calendar ID>The Calendar ID, usually two characters, can be found in the output file of the SAP_ImportCalendar process.

You should only specify instances for which you have imported the calendar with the SAP_ImportCalendar process definition and the specific calendar ID must exist in that SAP instance. Use the Opens at tab of the time window edit screen to ensure you are using the correct values.

Fiscal Period Function

The fiscal period function is used to calculate open days based on the fiscal year, both US and ISO-8601 fiscal years are supported. Fiscal years divide quarters in 1 five- and 2 four-week periods.

US style fiscal years start on January 1st. ISO-8601 fiscal years always start on Monday. The 4-5-4 fiscal period starts on the 2nd workday to the 6th workday of each period.

ParameterDescriptionValuesDefault
week{1|2|3}Specifies the number of weeks for the first, second and third period of the quarter4 (period is 4 weeks long) 5 (period is 5 weeks long)week1=4 week2=4 week3=5
weekday{From|To}Specifies the day(s) of the week.1 (Sunday), 2 (Monday), 3 (Tuesday), 4 (Wednesday), 5 (Thursday), 6 (Friday), 7 (Saturday), 8 (Workday), 9 (Weekends), 10 (Workweek), 0 (Anyday)weekdayFrom=8 (Workday) weekdayTo=8 (Workday)
weekOrDay{From|To}Specifies the number of the day in the period; if the number is larger than the number of days in the period, it specifies the last weekday.integers >=1 (1, 2, 3 ...)weekOrDayFrom=1 (first day of the period) weekOrDayTo=1 (first day of the period)
weekStartsAtWeekdaySpecifies the first day of a week (requires isoPeriod to be set to true)1 (Sunday), 2 (Monday), 3 (Tuesday), 4 (Wednesday), 5 (Thursday), 6 (Friday), 7 (Saturday)weekStartsAtWeekday=2
weekDayDefiningFirstWeekSpecifies the day to use to calculate first week of the year1 (Sunday), 2 (Monday), 3 (Tuesday), 4 (Wednesday), 5 (Thursday), 6 (Friday), 7 (Saturday)weekDayDefiningFirstWeek=5
isISOPeriodSpecifies the start of the year.true (Monday) false (January 1st)false (Year starts on January 1st).
note

The period function parameters are case-sensitive.

note

All parameters must be filled or you will not get the desired result.

Using Fiscal Period Functions

When you create a fiscal period function, you first specify the number weeks of your three periods, for example week1=4 week2=4 week3=5.

Next, you specify an open time frame which can be a day or a number of days using the weekdayFrom and weekdayTo parameters, for example weekdayFrom=2 and weekdayTo=6 is equivalent to weekdayFrom=8 and weekdayTo=8; your workweek is from Monday to Friday. The difference between weekdayFrom=8 and weekdayFrom=10 is that the latter is a week, not individual days - this is important when we start counting below.

Finally, you specify when the time frame occurs in your 3 periods using the weekOrDayFrom and weekOrDayTo parameters, for example weekOrDayFrom=5 and weekOrDayTo=5, meaning the last workweek of each period ( 5 is greater than 4 ).

If you only want to have the process run on the 5th week of a period, that is skip it on two of the three periods (those that are 4 weeks in length), you need to create a second time window which is open on the 4th week of a period; this time window must then be specified in the Disabled During Time Window field of the time window element where you specified the period function.

To illustrate the difference between weekdayFrom=8 and weekdayFrom=10, the following table lists equivalent combinations:

Time frame in WorkdaysTime frame in Workweeks
weekdayFrom=8weekdayTo=8weekOrDayFrom=1weekOrDayTo=5weekdayFrom=10weekdayTo=10weekOrDayFrom=1weekOrDayTo=1
weekdayFrom=8weekdayTo=8weekOrDayFrom=1weekOrDayTo=10weekdayFrom=10weekdayTo=10weekOrDayFrom=1weekOrDayTo=2

When isISOPeriod is true, then the Monday of the first week of the year is calculated as follows:

  • the week with the year's first Thursday in it.
  • the week with 4 January in it.

You can customize this behavior with the following parameter:

  • weekDayDefiningFirstWeek

Recurrence within a day

This period function is used to create recurrences in a day.

ParameterDescriptionValuesDefault
startHourThe hour the recurrence starts0-230
startMinuteThe minute the recurrence starts0-590
startSecondThe second the recurrence starts0-590
endHourThe hour the recurrence ends0-2323
endMinuteThe minute the recurrence ends0-5959
endSecondThe second the recurrence ends0-5959
intervalHourThe interval hour of the recurrence0-230
intervalMinuteThe interval minute of the recurrence0-5915
intervalSecondThe interval second of the recurrence0-590
durationHourThe duration of the opening (hours)0-230
durationMinuteThe duration of the opening (minutes)0-591
durationSecondThe duration of the opening (seconds)0-590
  • startHour, startMinute, and startSecond specify the start of the recurrence in the day, default 0:00:00.
  • endHour, endMinute, and endSecond specify the end of the recurrence in the day, default 23:59:59.
  • intervalHour, intervalMinute, and intervalSecond specify interval at which the function should open, default is 0:15:00.
  • durationHour, durationMinute, and durationSecond specify how long the recurrence period should open, default is 0:01:00.

Note the following:

  • if duration >= interval, the period function is always open.
  • endTime = 0 is evaluated as the start of the following day.
note

When the duration >= interval, the period function is always open. When EndTime=0, the EndTime will be the start of the next day.

Context-Menu

Period functions support the following context-menu actions:

ActionDescription
Edit SecurityEdit the security of the period function
DuplicateMake a copy of the period function to create a similar one
DeleteDelete the period function
Export > ExportExport the period function into a CAR file
Export > Export with related objectsExport the period function into a CAR file including referenced objects
Promote > Promote to systemPromote the object to a remote system
Promote > Edit further then promoteEdit the export rule set prior to promoting
PromotePromote the period function to another Redwood Server instance
EditEdit the period function
Show permalinksShow links that can be used from third party applications to link to the object
Add to navigation barAdd the current object to the navigation bar
New period functionCreate a new period function
Filter > New FilterCreate a new period function filter
Filter > Edit FilterEdit current period function filter
Filter > DeleteDelete current period function filter
Filter > Duplicate FilterCreate a copy of the filter
Filter > Export FilterExport the filter into a CAR file
Filter > Add to navigation barAdd the filter to a navigation bar
Filter > Create filter from searchCreate a filter from the current IntelliSearch query

Finding Period Functions

You can search for period functions using filters and the Search Period Functions box on the Period Functions tab. This box is known as the IntelliSearch box and 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 period functions 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 period functions:

PrefixesDescription
n, namesearches the name property
c, comm, commentsearches the documentation property
d, desc, descriptionsearches the description property
a, applicationsearches the application property
cb, changedbefore(internal) search for period functions that changed before a certain ISO-8601 period

Deleting Period Functions

You can only delete period functions when no other objects relate to them. For example, if there are time windows that use the period function, the period function cannot be deleted until all time windows that use it have been edited to not use it anymore. You can see all objects that relate to the period function 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

PrivilegeDescription
PeriodFunction.CreateCreate period functions
PeriodFunction.DeleteDelete period functions
PeriodFunction.EditEdit period functions
PeriodFunction.ViewAccess period functions

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.

  • Granting and Revoking System Privileges
  • Granting or Revoking Object Privileges

Example

In the following examples, tables illustrate the fields of the time window element that need to be filled, all other fields are left with their default values.

SAP Calendar Period Function Parameter

In this example, you want to have the time open on the fourth workday of the SAP Factory Calendar of every month. You need 3 time windows in this case. One that is always closed, one that uses the SAP Factory Calendar and one for the day shift.

note

We need the TW_AlwaysClosed and TW_GermanFactoryCalendar time windows below because we want to force Redwood Server to use the SAP Calendar for determining and counting workdays, this way it takes public holidays into account.

You need to create a time window that is always closed. Only the following fields need to be specified:

FieldValue
NameTW_AlwaysClosed
Is Calendartrue (checked)

You also need a time window to use the SAP Factory Calendar:

FieldValue
NameTW_GermanFactoryCalendar
Is Calendartrue (checked)

The German factory calendar of the PR1 instance is used in a time window element as follows:

FieldValue
Period FunctionSAP_FactoryCalendar
with parameterscalendar=PR1 FR

The time window with the day shift is the one you will use in Redwood Server. In this case, it should be open on the first workday of the month and shift 3 days forward when the open day falls on a day where TW_AlwaysClosed is closed.

TabFieldValue
Time WindowNameSAP_4th_Workday
Time WindowIs Calendartrue (checked)
Time WindowIf an open day is closed duringTW_AlwaysClosed
Time Windowthe shift this dayForward
Time Windowto the3
Time Windowopen day inTW_GermanFactoryCalendar
Elementsand from the1st workday of the month

Easter Period Function

The following time window element defines Good Friday (Friday preceding easter).

FieldValue
Period FunctionSystem_Easter
with parametersdayNumber=-2

Fiscal Period Function

You want a time window to open on the third Monday of each period

FieldValue
Period FunctionSystem_FiscalPeriods
with parametersweek1=4week2=5week3=4weekdayFrom=2weekdayTo=2weekOrDayFrom=3weekOrDayTo=3isISOPeriod=trueweekStartsAtWeekday=2weekDayDefiningFirstWeek=5

You want a time window open on the last weekend of each period

FieldValue
Period FunctionSystem_FiscalPeriods
with parametersweek1=4week2=4week3=5weekdayFrom=9weekdayTo=9weekOrDayFrom=5weekOrDayTo=5isISOPeriod=trueweekStartsAtWeekday=2weekDayDefiningFirstWeek=5

You want your time window to open on the second and third Thursday of each period

FieldValue
Period FunctionSystem_FiscalPeriods
with parametersweek1=4week2=4week3=5weekdayFrom=5weekdayTo=5weekOrDayFrom=2weekOrDayTo=3isISOPeriod=trueweekStartsAtWeekday=2weekDayDefiningFirstWeek=5

PeriodFunction

← Using Time Windows in ProcessesManaging Recurrences →
  • Caching Objects in Period Functions
  • Easter Period Function
  • SAP Calendars
  • Fiscal Period Function
    • Using Fiscal Period Functions
  • Recurrence within a day
  • Context-Menu
  • Finding Period Functions
  • Deleting Period Functions
    • Security
  • Example
    • SAP Calendar Period Function Parameter
    • Easter Period Function
    • Fiscal Period Function
Docs
Getting StartedInstallationFinance InstallationConcepts
TroubleshootingArchiving
Learn and Connect
Support Portal
BlogEventsResources
ISO/ IEC 27001 Information Security Management
Automate to be human

2023 All Rights Reserved |

Terms of Service | Policies | Cookies | Glossary | Third-party Software | Contact | Copyright | Impressum |