DELETE_FORECAST

Script Function: Deletes any number of or given Forecasts stored in the Automation Engine database.

Syntax

DELETE_FORECAST (FC_TITLE [,DAYS] ,[FORCED])

Syntax

Description/Format

FC_TITLE

Title of the Forecast to be deleted. (mandatory) You may also use wildcards: "*"

Will be logically combined with the "DAYS" parameter by the operator AND.

Format: string

DAYS

Start time of the Forecast. (optional)

Will be logically combined with the "FC_TITLE" parameter by the operator AND.

Format: hh:mm:ss

If this parameter is set to "0", the value of the Logical start date of the Forecast is set to today's date (todays_date): 23:59:59

FORCED

Fixed value: "FORCED" (optional )

If this parameter is set, all Forecasts will be deleted without a check and running Forecasts would be stopped with undefined errors.

If this parameter is not set, a check will be performed on the running status of the Forecasts and only not running Forecasts will be deleted.


Return code

"0" - The forecast(s) was/were successfully deleted.

A number > than "0" - Not all forecasts with the given parameters were deleted.

In the executable object's report you will see a message (message number 20824) being displayed, which contains the exact number of deleted forecasts.

Comments

Forecasts can only be deleted by using their title. You may not use their name with this Script function.

In connection with the "DAYS" parameter please also keep the time zone rules of the Automation Engine system in mind.

Using this Script function any type of Forecast will be deleted, which may be objects, tasks or Auto Forecasts.

Examples

The following examples show the use of DELETE_FORECAST:

Delete all Forecasts, which are not running:

: SET &ret# = DELETE_FORECAST ("*", ,)

Delete all Forecasts with the status ENDED_OK:

: SET &ret# = DELETE_FORECAST ("*")

Delete all Forecasts with the title "MyFC", forced:

: SET &ret# = DELETE_FORECAST ("MyFC", , FORCED)

Delete all Forecasts, whose titles start with "FC_" AND which are older than two days AND have the status ENDED_OK:

: SET &ret# = DELETE_FORECAST ("FC_*", "2")

Delete all Forecasts, whose titles start with "FC_" AND which are older than two days:

: SET &ret# = DELETE_FORECAST ("FC_*", "2","FORCED")

Delete all Forecasts, whose titles start with "FC_" and logical start < (today's date):23:59:59 and whose status is ENDED_OK:

: SET &ret# = DELETE_FORECAST ("FC_*",0)

Delete all Forecasts, whose title start with "FC_" and whose logical start is < (today's date):23:59:59

: SET &ret# = DELETE_FORECAST ("FC_*",0, "FORCED") ->

See also:

Script element Description

AUTOFORECAST

Calculates forecast data for future activities

FORECAST_TASK

Creates a forecast for a specified task

Script Elements - Activate Objects

Forecast
Runtime Evaluation

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function