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

FORECAST_TASK

Script Function: Creates a forecast for a specified active task.

Syntax

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

Syntax

Description/Format

RunID

Run number (RunID) of the activated object.
Format: script literal or script variable

Title

Name of the forecast.
Format: script literal or script variable

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 runtime (ERT) for Froups. It is used when Registrations is set to 'N'.

Allowed values:
"0" - The group'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 UserInterface 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 function.

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 transfer.

: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 job 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 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