GET_PARENT_TYPE
Use the GET_PARENT_TYPE script function to retrieve the object type of the activator (including users and CallAPI) or processor of a task. 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_TYPE to retrieve the object type of the processor or activator of the current task (the task that contains the script function). For more information, see SYS_ACT_PARENT_TYPE.
Syntax
GET_PARENT_TYP[E](RunID[, ACT|PRC])
GET_PARENT_TYP[E]([ACT|PRC])
Parameters
-
GET_PARENT_TYPE
Retrieves the object type of the activator or processor -
RunID
(Optional) RunID of the activated task
Format: script literal or script variable
Note: If you do not specify a RunID, the script function returns the parent of the task that contains the script. -
ACT or PRC
(Optional) Specifies the type of activation
Allowed values:- 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
- ACT
Return Codes
The script function has the following return codes:
- Object type of the activator or processor
- USER
(ACT only) Task was activated manually - API
(ACT only) Task was activated via a CallAPI - Empty value
No parent task exists
Example
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_TYPE(&RunID#, ACT)
:PRINT "The task was activated by type &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 type JOBP
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 type USER
See also:
Script element | Description |
---|---|
Returns the name of the superordinate task (Parent) | |
GET_PARENT_NR | Returns the run number (RunID) of the superordinate task (Parent) |
Script Elements - Activation Data
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by function