SYS_ACT_TOP_NAME

Use the SYS_ACT_TOP_NAME script function to retrieve the name of the topmost Workflow. The task that contains the script function can be a child of the top Workflow, or can be nested at any level within the Workflow.

Note: If an object starts from the Postconditions tab, the Workflow is not a direct parent but only the activator of the script. In this case, this script function returns the properties of the activator.

Syntax

SYS_ACT_TOP_NAME()

Return Codes

The script function has the following return codes:

Example

The following script in a task retrieves the name of the parent task, and of the top Workflow. The script compares the retrieved names to determine whether the parent task is the top Workflow. A conditional block in the script sends the user a message with the appropriate information.

:SET &TNAME# = SYS_ACT_TOP_NAME()
:
SET &PNAME# = SYS_ACT_PARENT_NAME()

:
IF &TNAME# = &PNAME#
:   
IF &TNAME# = " "
:      
SEND_MSG ADMIN,AE,"Task does not run in a workflow."
:  
 ELSE
:      
SEND_MSG ADMIN,AE,"Task runs in a workflow &TNAME#. No superordinate workflows."
:   
ENDIF
:
ELSE
:   
SEND_MSG ADMIN,AE,"Name of the top workflow: &TNAME#."
:
ENDIF

See also:

seealso

Script Elements for Workflows and Tasks in Workflows