DEACTIVATE_UC_OBJECT
Script Function: Deactivates a completed task.
Syntax
DEACTIVATE_UC_OBJECT (RunID [,FORCED])
Syntax |
Description/Format |
---|---|
RunID |
The RunID of the task that should be deactivated. |
FORCED |
Performs deactivation regardless of the status of the high-level tasks. The system will not check whether the task runs within a workflow. Also, the options for the automatic deactivation of all subordinate tasks are ignored and deactivated in any case. You can use FORCED only in combination with workflows. Note that FORCED does not check whether tasks in sub-workflows are active. Format: AE name, script literal, or variable |
Return Codes |
---|
12204 - The task (RunID) cannot be deactivated. You cannot deactivate objects of a workflow. |
Comments
You can only deactivate tasks that have already ended (either they have been successfully completed or were canceled). When tasks are deactivated, they are also removed from the Process Monitoring perspective. Note that you must indicate the task's RunID for this purpose.
The following rules apply for the deactivation process:
- Workflows that include active tasks cannot be deactivated. The same rule applies for the tasks of all sub-workflows.
- Tasks that have been started by a workflow can only be deactivated by deactivating the top workflow (for which the above rule applies).
In executable objects, you can also define settings for their automatic deactivation. These settings will also be checked by the system.
Examples
The following example activates an object and waits until it has ended. A message will be sent to the responsible user if an error occurs. When the object ends without an error, it will be deactivated.
:SET &ACTOBJ# = ACTIVATE_UC_OBJECT(&OBJ#,WAIT)
:IF &ACTOBJ# = "0"
: SET &ERRNR# = SYS_LAST_ERR_NR()
: SET &ERRINS# = SYS_LAST_ERR_INS()
: SET &MESSAGE# = GET_MSG_TXT(&ERRNR#,&ERRINS#)
: SET &RET# = SEND_MAIL("John.Smith@automic.com",,&MESSAGE#, "Please check. Thanks!")
:ELSE
: SET &DEACTJOB# = DEACTIVATE_UC_OBJECT(&ACTJOB#)
:ENDIF
See also:
Script Elements | Description |
---|---|
ACTIVATE_UC_OBJECT | Activates an object. |
RESTART_UC_OBJECT | Repeats the execution of a task. |
Script Elements - Activating Objects
Sample Collection:
Database Maintenance with Options
Notification with Variable Message Text
Retrieving Error Message and Number
Reaction to External Events
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function