CANCEL_UC_OBJECT

Use the CANCEL_UC_OBJECT script function to terminate an active object.

Notes:

Syntax

CANCEL_UC_OBJECT (RunID [, Extension])

Parameters

Return Codes

The script function returns the following codes:

Tip: Use the :ON_ERROR script statement to define action to take if the cancellation fails. For more information, see Script Elements for Error Handling.

Examples

The following script activates a Notification object that is called ALARM3, and waits 60 seconds. If the Notification is still active after 60 seconds, the Notification is terminated.

:SET &RUNNR# = ACTIVATE_UC_OBJECT("ALARM3")

:WAIT 60

:SET &STATUS# = GET_STATISTIC_DETAIL(&RUNNR#,STATUS)

:IF &STATUS# < 1800

:SET &STATUS# = CANCEL_UC_OBJECT(&RUNNR#)

:ENDIF

The following example shows part of an event process script in an Event object. When the event occurs, the script retrieves the RunID of the parent (the main Event task), and terminates the event.

:SET &RUNNR# = SYS_ACT_PARENT_NR()

:SET &STATUS# = CANCEL_UC_OBJECT(&RUNNR#)

The following lines check if an Event (EVNT.NIGHT) is still active. If the Event is active, the script cancels the Event and sets the status of the task to ENDED_CANCEL.

:SET &RUNNR# = GET_UC_OBJECT_NR(EVNT.NIGHT)

:IF &RUNNR# <> "

:SET &STATUS# = CANCEL_UC_OBJECT(&RUNNR#, "ENDED_CANCEL")

:ENDIF

See also:

seealso

Script Elements for Handling Tasks