SYS_ACT_PARENT_NAME

Use the SYS_ACT_PARENT_NAME script function to retrieve the processor or activator of the current task (the task that contains the script function), including if the task was activated via a CallAPI. The task can be any type of executable object. For more information about processors and activators, see Superordinate Tasks (Parents).

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

Syntax

SYS_ACT_PARENT_NAME ([Activation type])

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_NAME on the Post Process page to retrieve information about groups. For more information, see Generating at Activation or at Runtime.

Example

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

:SET &NAME# = SYS_ACT_PARENT_NAME()
:
IF &NAME# NE " "
:   
PRINT "Name of parent: &NAME#."
:
ELSE
:  
 PRINT "No parent"
:
ENDIF

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

:SET &NAME# = SYS_ACT_PARENT_NAME(ACT)
:
PRINT "Task was activated by &NAME#."

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.MM.PROCESSING.

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 *SCRIPT.

If the task was activated manually by a user called Smith in the DEV department, the message in the activation report would look as follows:

2018-11-06 15:26:01 - U00020408 The task was activated by SMITH/DEV.

See also:

seealso

Script Elements for Workflows and Tasks in Workflows