TOGGLE_OBJECT_STATUS

Use the TOGGLE_OBJECT_STATUS script function to stop or start the automatic processing of an activated task. The script function supports the following task types:

  • Agent Group (HOSTG)
  • Event (EVNT)
  • Job Group (JOBG)
  • Remote Task Manager (JOBQ)
  • Period (PERIOD)
  • Schedule (JSCH)
  • Workflow (JOBP)

Note: You need the Modify at runtime permission for this script function. For more information, see Granting Automation Engine Authorizations.

Syntax

TOGGLE_OBJECT_STATUS (RunID, Status[, ALL])

Parameters

Parameter Description Format Allowed Values
RunID RunID of the activated task to stop or start. AE name, script literal or script variable n.a.
Status Processing status to set. AE name, script literal or script variable
  • STOP — Stops the automatic processing of the task
  • GO — Starts the automatic processing of a task
ALL
(Optional)
For Workflows, Job Groups, Periods and Schedules only. Includes all tasks that are running within the task that you are stopping or starting. AE name, script literal or script variable n.a.

Return Codes

The script function has the following return codes:

Return Value Condition
0 Status was modified successfully.
20444 Invalid status was entered; you can only use STOP or GO.
20445 No object with the specified RunID was found.

Examples

The following script retrieves the RunID of an Event and stops the Event.

: SET &RUNNR# = GET_UC_OBJECT_NR (DUMP.CONTROL)

: SET &RET# = TOGGLE_OBJECT_STATUS (&RUNNR#"STOP")

The following script retrieves the RunID of a Workflow and starts the Workflow and all the child tasks in the Workflow.

: SET &RUNNR# = GET_UC_OBJECT_NR (MM.DAY)

: SET &RET# = TOGGLE_OBJECT_STATUS (&RUNNR#"GO", ALL)

See also: