TOGGLE_OBJECT_STATUS

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

  • 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

  • TOGGLE_OBJECT_STATUS
    Stops or starts the automatic processing of an activated task

  • RunID
    RunID of the activated task to stop or start
    Format: AE name, script literal or script variable

  • Status
    Processing status to set
    Format: AE name, script literal or script variable
    Allowed values:

    • 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
    Format: AE name, script literal or script variable

Return Codes

The script function has the following return codes:

  • 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: