FORECAST_TASK

Use the FORECAST_TASK script function to create a forecast for an active task. FORECAST_TASK performs the same function as the task forecast that you can open in the context menu in the Process Monitoring perspective. The forecast shows the expected runtime of a particular running task.

More information:

Note: This script function writes all open transactions of the script to the AE database. For more information, see Script Processing.

Tip: FORECAST_TASK only creates forecasts for active tasks. Use FORECAST_OBJECT to create forecasts for other objects.

Syntax

FORECAST_TASK (RUN#, Title [,Registrations] [,Group_ERT] [,Days])

Parameters

  • FORECAST_TASK
    Creates a forecast for an active task

  • RUN#
    RunID of the activated object

  • Title
    Name of the forecast

  • Registrations
    (Optional) Determines whether registrations for groups are considered
    Allowed values: Y or N (default)

  • Group_ERT
    (When Registrations is set to N) Expected runtime for groups
    Allowed values:

    • 0
      The ERT of the group is used (default)
    • 1 - 7199
      Fixed value in seconds

  • Days
    Maximum number of future days to use for the calculation
    Format: number without quotation marks, script literal, or script variable
    Default: 1

Return Codes

  • 0
    The forecast was created successfully
  • 20463
    Object RunID or name was not found

Examples

The following line creates a forecast for a file transfer.

: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 ERT of the group, the function applies a fixed value of 60 seconds.

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

See also: