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

Return Codes

The script function has the following return codes:

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:

seealso

Script Elements for Workflows and Tasks in Workflows