SYS_ACT_PARENT_TYPE

Use the SYS_ACT_PARENT_TYPE script function to retrieve the object type of the activator (including users and CallAPI) or processor of the current task (the task that contains the script). The task can be any type of executable object.

More Information:

Tip: Use GET_PARENT_TYPE to retrieve the object type of the processor or activator of a different task by specifying a RunID. For more information, see GET_PARENT_TYPE.

Syntax

SYS_ACT_PARENT_TYP[E] ([ACT|PRC])

Parameters

  • SYS_ACT_PARENT_TYPE
    Retrieves the object type of the activator or processor

  • Activation type

    (Optional) Specifies the type of activation

    Allowed values:

    • ACT
      Activator
      Parent task that activates the current task, or user who manually activates the task
    • PRC
      Processor (default)
      Other means of activating the task
      Note: If you do not specify an activation type, the script function retrieves the processor (default).

Return Codes

The script function has the following return codes:

  • Object type of the activator or processor
  • USER
    (ACT only) Task was activated manually
  • API

    (ACT only) Task was activated via a CallAPI
  • Empty value

    (PRC only) No parent task exists

Note: To retrieve information about a group, the task that contains the script function must be generated at runtime. If the task is generated at activation time, you can only use SYS_ACT_PARENT_TYPE on the Post Process page to retrieve information about groups. For more information, see Generating at Activation or at Runtime.

Examples

A task contains the following script. If the task runs in a group, Workflow, or Schedule, the script prints the object type of the parent task in the activation report. If there is no parent task, the script writes No parent in the activation report.

:SET &TYPE# = SYS_ACT_PARENT_TYPE()
:
IF &TYPE#  = " "
:   
PRINT "No parent"
:
ELSE
:   
PRINT "Object type of parent is &TYPE#."
:
ENDIF

The following script retrieves and prints the object type of the activator of the task in the activation report.

:SET &TYPE# = SYS_ACT_PARENT_TYPE(ACT)
:
PRINT "The task was activated by &TYPE#."

If the task was activated  by a Workflow, the message in the activation report would look as follows:

2018-11-06 15:26:01 - U00020408 The task was activated by JOBP

If the task was activated through the CallAPI, the message in the activation report would look as follows:

2018-11-06 15:26:01 - U00020408 The task was activated by API

See also: