Automation Engine Script Guide > Ordered by Function > Activate Objects > FORECAST_TASK

FORECAST_TASK

Script Function: Creates a forecastEstimates a task's runtime on the basis of previous executions. for a specified active taskAn executable object that is running. Tasks are also referred to as activities..

Syntax

FORECAST_TASK(RunID,Title, [Registrations], [Group_ERT], [Days])

Syntax

Description/Format

RunIDShort for "run number". It is a number that provides unique information about a task's execution. The RunID can include 7 to 10 digits. It is assigned by the Automation Engine component .

Run number (RunID) of the activated objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task.
Format: script literal or script variable

Title

Name of the forecast.
Format: scriptA particular Automation Engine object type. literal or script variableA placeholder for a value within a script.

Registrations

Setting whether registrations (for groups) should be considered or not.
Format: script literal or script variable

Allowed values: "Y", "N" (default value)

Group_ERT

Expected runtimeThe duration of a task's execution. It refers to the period between a task's start and end. It does not include its activation period (see also: activation and start). (ERT) for Froups. It is used when Registrations is set to 'N'.

Allowed values:
"0" - The groupAn Automation Engine object type that integrates tasks so that they can be processed together.'s ERT is used (default value).
"1" to "7199" - Fixed value in seconds.

Days

Maximum number of days in the future that should be used for the calculation.
Format: Number without inverted commas, script literal or script variable

Default value: "1"


Return codes

"0" - Forecast was successfully created
"20463" - Runtime error in object '&01', line '&02'. Object RunID/Name '&04' was not found.

Comments

A forecast can be created that shows the expected runtime of any running task. You can create it manually in the UserInterfaceThis is the Automation Engine's graphical user interface. [Formerly called the "Rich Client", "RichGUI" and "Dialog Client."] by calling the command of the same name in the Activity Window's context menu. Define your criteria and a forecast will be created for the task you selected. Alternately, you can use the corresponding script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,….

The procedure for using the script function is similar to using it manually. Define a forecast name (use capital letters and no blanks). If required, the parameters Registrations and Group_ERT may be set for tasks that belong to a group. Note that the forecast name must not yet exist.

Use the script element FORECAST_OBJECT to create forecasts for objects.

This script statement has the effect that all open script transactions are written to the AE databaseA database is an organized collection of data including relevant data structures..

FORECAST_TASK only works for active tasks.

Examples

The following line creates a forecast for a file transferTransfers files from one computer to another. A particular Automation Engine object type (FileTransfer object)..

:SET &RUNNR# = GET_UC_OBJECT_NR ("C70.WINDOWS")
:
SET &RET# = FORECAST_TASK(&RUNNR#,"PROGNOSE_FT_C70.WINDOWS")

The second example creates a forecast for a jobAn Automation Engine object type for a process that runs on a target system. that runs in a group. Instead of using the group's ERT, a fixed value of 60 seconds should be applied.

:SET &RUNNR# = GET_UC_OBJECT_NR ("T91.SALDO.03")
:
SET &RET# = FORECAST_TASK(&RUNNR#,"PROGNOSE_T91.SALDO.03","N",60)

 

See also:

Script element Description

AUTOFORECAST

Calculates forecast data for future activitiesDeployment-related activities.

FORECAST_OBJECT

Generates a forecast for the specified object.

Script Elements - Activate Objects

Forecast
Runtime Evaluation

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