FORECAST_TASK
Use the FORECAST_TASK script function to create a forecast for an active task. It performs the same function as the task forecast available from the context menu in the Process Monitoring perspective, showing the expected runtime of a running task.
More information:
Notes:
-
This script function writes all open transactions of the script to the AE database. For more information, see Script Processing.
-
FORECAST_TASK only creates forecasts for active tasks. Use FORECAST_OBJECT to create forecasts for other objects. For more information, see Forecasts and Working with Forecasts.
Syntax
FORECAST_TASK (RUN#, Title [,Registrations] [,Group_ERT] [,Days])
Parameters
| Parameter | Description | Format | Allowed Values | Default Value |
|---|---|---|---|---|
| RUN# | RunID of the active task | n.a. | n.a. | n.a. |
| Title | Name of the forecast | n.a. | n.a. | n.a. |
| Registrations
(Optional) |
Specifies whether registrations for groups are taken into account | n.a. |
|
N |
| Group_ERT
(Optional) |
Expected runtime for groups. Used when Registrations is set to N. | n.a. |
|
0 |
| Days
(Optional) |
Maximum number of future days to use for the calculation. For example, 1 means until tonight at midnight, 2 means until tomorrow at midnight. | Number without quotation marks, script literal, or script variable | n.a. | 1 |
Return Codes
| Return Value | Condition |
|---|---|
| 0 | The forecast was created successfully |
| 20463 | Object RunID or name was not found |
Examples
The following example creates a forecast for a file transfer task.
: SET &RUNNR# = GET_UC_OBJECT_NR ("C70.WINDOWS")
: SET &RET# = FORECAST_TASK (&RUNNR#, "ETA_FT_C70.WINDOWS")
The following 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 is applied.
: SET &RUNNR# = GET_UC_OBJECT_NR ("T91.SALDO.03")
: SET &RET# = FORECAST_TASK (&RUNNR#, "ETA_T91.SALDO.03", "N" ,60)
See also: