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

CANCEL_UC_OBJECT

Script Function: This is used to terminate an activated objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task

Syntax

CANCEL_UC_OBJECT(RunID, [Extension])

Syntax

Description/Format

RunIDShort for "run number". It is a number that provides unique information about a task's execution. The RunID can include 7 to 10 digits. It is assigned by the Automation Engine component .

Run number of the activated object
Format: scriptA particular Automation Engine object type. literal or script variableA placeholder for a value within a script.

Extension

This additional parameter is available for specific object types.
Format: AE name or script literal


Return codes

"0" - Task was canceled successfully
"11049" - Task with this RUN# was not found and therefore not canceled
"11050" - The taskAn executable object that is running. Tasks are also referred to as activities. has a status that cannot be canceled
"20347" - It is not possible to cancel a script with CANCEL_UC_OBJECT when it was started via a CallAPIA programming interface that processes a script in the Automation Engine system. It can be called directly from within the program itself or from a different program. 

Comments

The execution of activated objects can be canceled with  the statement CANCEL_UC_OBJECT. Activated objects can be accessed using the Short Label of the object typeAn individual object is provided for the individual activities: There are User, UserGroup, Notification, Cockpit, CodeTable, Documentation, Event, Agent, FileTransfer, Group, Include, Job, Workflow, Calendar, Login, Client, RemoteTaskManager, Schedule, Script, Server, Sync, Variable and TimeZone objects and the run number with which the object has been activated.

The script statement :ON_ERROR can be used to determine the reaction to this error which can then be analyzed with the Script Functions for Error Handling. Script processing is continued but can also be canceled if necessary.

Keep the following in mind for events: a new instance of the activated eventAction that is triggered if particular conditions apply. It can be an Automation Engine object type or an entry in a Policy Orchestrator EventBase. is created whenever an event occurs. This instance has also a run number. If the event should be terminated due to specified conditions that occurred, the RUN# can be retrieved with the functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… SYS_ACT_PARENT_NR.

The script statement causes all open transactions of the script to be written to the AE databaseA database is an organized collection of data including relevant data structures..

In previous releases, the CANCEL_UC_OBJECT script function could be used for ended tasks to triggered a deactivation. This is not possible any more. Now you need to use the DEACTIVATE_UC_OBJECTscript function instead.

Examples

In the example, the notificationAn Automation Engine object type used to send messages to users and user groups. [Formerly called "CallOperator."] "ALARM3" is activated. The statement :READ is used to wait until the notification is displayed. After retrieving the run number and the confirmation of the userIn the Automation Engine, a user is an instance of a User object, and generally the user is a specific person who works with Automic products. The User object is assigned a user ID and then a set of access rights to various parts of the Automation Engine system and product suite. These access rights come in the form of Automation Engine authorizations and privileges, Decision user roles and EventBase rights and ARA web application object rights. You can manage all these centrally in the ECC user management functions. See also, Unified user management., the notification is terminated.

:SET &JOBNR# = ACTIVATE_UC_OBJECT("ALARM3")
:
READ &JOBNR#,,,&JOBNR#
:
SET &STATUS# = CANCEL_UC_OBJECT(&JOBNR#)

The example shows part of the script of an event. When the event occurs, the run number is retrieved and the event is terminated.

:SET &JOBNR# = SYS_ACT_PARENT_NR()   
:
SET &STATUS# = CANCEL_UC_OBJECT(&JOBNR#)

The following lines cancel a running Event object with the status "ENDED_CANCEL".

:SET &RUNNR# = GET_UC_OBJECT_NR(EVNT.NACHT)
:
SET &STATUS# = CANCEL_UC_OBJECT(&RUNNR#, "ENDED_CANCEL")

 

See also:

Script element Description

ACTIVATE_UC_OBJECT

Activates an object.

RESTART_UC_OBJECT Repeats the execution of a task.
GET_UC_OBJECT_NR Returns the RUN# of an activated object.
:ON_ERROR Determines the reaction to certain errors and messages of script elements.

Script Elements - Activate Objects

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by function

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH