Automation Engine Script Guide > Ordered by Function > Date and Time > CALE_LOOK_AHEAD

CALE_LOOK_AHEAD

Script Function: Returns the next date based on calendar conditions.

Syntax

CALE_LOOK_AHEAD([Date], JOBP\JSCH, Task Number)
CALE_LOOK_AHEAD
([Date], Condition, Calendar, Calendar Keyword, [[Calendar], [Calendar Keyword]]...)

Syntax

Description/Format

Date

Indication of a date in the format "YYMMDD" or "YYYYMMDD".

Format: script literal or script variable

It is also possible to specify a different date format. Do so by entering the required date format, then enter a separator (: or ;) and afterwards the date. Indicating a date format is optional.

JOBP\JSCH

Name of a workflowAn object of the Automation Engine that can include several executable objects and which runs them in a specified order. [Formerly called "ProcessFlow" and "JobPlan."] or schedule
Format: script literal or script variable

Task Number

Task number in the workflow or the schedule
Format: scriptA particular Automation Engine object type. literal or script variableA placeholder for a value within a script.

Condition

Condition that must apply for the definition of date
Format: script literal or script variable

Allowed values: "ONE", "ALL", "NO"

"ONE" - One of the given calendar conditions must apply
"ALL" - All the given calendar conditions must apply
"NO" - None of the given calendar conditions must apply

If no calendar conditionThe criteria for running a task is based on calendar keywords. applies for a taskAn executable object that is running. Tasks are also referred to as activities., a SPACE is returned. In this case, CALE_LOOK_AHEAD_MAX is displayed in the Schedule monitor.

Calendar

Name of a calendarAn Automation Engine object type that defines a set of days based on calendar keywords.
Format: script literal or script variable

Calendar Keyword

Calendar keyword in this calendar
Format: script literal or script variable


Return codes

Date in the specified format
" " - No calendar condition applies

Comments

The script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… may be used in two different ways.

On the one hand, it is possible to determine a respective objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task's next date of execution according to given calendar conditions. The object can be identified by its task number, which is displayed in the graphical picture of the workflow in the order in which the objects were added to the workflow. The schedule shows the objects, which are numbered according to their order in the listShows entities in a grid view of the Schedule tab.

On the other hand, the script function supports the calculation of the next date on which one, all, or no calendar conditions apply. Up to five calendarsShows a calendar overview of activities, releases or reservations. may be specified, including calendar keywords. The maximum number of days that are to be considered when checking for the next valid date may be specified for each clientA closed environment within an Automation Engine system where you can create and run objects. A client name consists of a 4-digit number that must be indicated when a user logs on to the Automation Engine system. Users and their rights are also defined in clients. A particular Automation Engine object type. by the administrator in the variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. UC_CLIENT_SETTINGS with the key "CALE_LOOK_AHEAD_MAX".

It is possible to specify the date from which on calendar conditions should be checked. Optionally, you may specify a particular Date Format. The default Date Formats to be used are "YYMMDD" or "YYYYMMDD". A colon or semicolon may be used as a separator between Date Format and Date. If no date is specified, the particular current date is used for calculation.

This script function supplies the date either in the default format or in the format that has been defined in its first parameter.

Please note that the parameters Calendar and Calendar Keyword must always be used together (see example below).

Examples

The following example shows how to identify the next date on which the object with task number "3" will run in the workflow "MM.DAY".

:SET  &DATE# = CALE_LOOK_AHEAD('YYYYMMDD:20041010','MM.DAY','3')

The second example identifies the next date on which all assigned calendar conditions apply.

:SET  &DATE# = CALE_LOOK_AHEAD(,'ALL','FIRM.CALENDAR','WORKDAYS','FIRM.CALENDAR','READINESS01')

 

See also:

Script Elements - Date and Time

Date, Time and Period Formats

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH