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.
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
-
SYS_ACT_PARENT_NAME
Retrieves the name of the activator or processor -
Activation type
(Optional) Specifies the type of activation
Allowed values:- ACT
Activator
Parent task that activates the 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).
- ACT
Return Codes
The script function has the following return codes:
- Name of the activator or processor
- Name of the user
Task was activated manually
Format: NAME/DEPARTMENT - *SCRIPT
Task was activated via a CallAPI - Empty value
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_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: