GET_PARENT_NR

Use the GET_PARENT_NR script function to retrieve the RunID of the processor or activator of a task. The script function returns the session ID if the task is activated manually by a user. 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_NR to retrieve the RunID of the processor or activator of the current task (the task that contains the script function). For more information, see SYS_ACT_PARENT_NR.

Syntax

GET_PARENT_NR(RunID[, ACT|PRC])

GET_PARENT_NR([ACT|PRC])

Parameters

Return Codes

The script function has the following return codes:

Example

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

:SET &RunID# = GET_UC_OBJECT_NR(MAWI.END.PROCESSING)
:
SET &RET# = GET_PARENT_NR(&RunID#, ACT)
:
PRINT "The task was activated by &RET#"

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

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

If a user manually executed the task, the output would show the session ID of the user:

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

See also:

Script element Description

GET_PARENT_NAME

Returns the name of the superordinate task (Parent)
GET_PARENT_TYPE Returns the object type of the superordinate task (Parent)

Script Elements - Activation Data

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by function