GET_PARENT_NAME

Use the GET_PARENT_NAME script function to retrieve the processor or activator of a task, 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 SYS_ACT_PARENT_NAME to retrieve the object name of the processor or activator of the current task (the task that contains the script function). For more information, see SYS_ACT_PARENT_NAME.

Syntax

GET_PARENT_NAME (RunID [, ACT|PRC])

GET_PARENT_NAME ([ACT|PRC])

Parameters

Parameter Description Format Allowed Values Default Value
RunID

(Optional) Defines the RunID of the task activated by the parent task.

Note: If you do not specify a RunID, the script function returns the parent of the task that contains the script.

Script literal or script variable n.a. n.a.
ACT|PRC

(Optional) Specifies the type of activation.

Note: If you do not specify an activation type, the script function retrieves the processor (default).

Script literal ACT
Activator. Parent task that activates the specified child task, or user who manually activates the task.
PRC
Processor (default). Other means of activating the task.
PRC

Return Codes

The GET_PARENT_NAME 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

Examples

The following script retrieves and uses the RunID of a task called MAWI.END.PROCESSING to return information about the activator of the task.

:SET &RunID# = GET_UC_OBJECT_NR(MAWI.END.PROCESSING)

:SET &RET# = GET_PARENT_NAME(&RunID#, ACT)

:PRINT "The task was activated by &RET#"

If the task was activated by a parent Workflow called JOBP.MM.PROCESSING, the output in the activation report would look as follows:

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

If a user called Smith from the DEV department manually executed the task, the output would show the user name:

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