:PUBLISH

Script Statement: Defines script variables and arrays as object variables.

Syntax 

:PUB[LISH] Variable name [, [Object variable] [,Scope] ]

Syntax

Description/Format

Variable Name

The name of the script variable or script array (including a & character).

A script variable's name is limited to 32 alphanumeric characters, including the special characters "$", "_", "@", "ยง" and "#". German Umlauts are not allowed. The first character must not be a number. Variables within the script must always specified with a leading "&" following the variable name!

Format: script variable

In arrays, you must additionally use empty brackets [] at the end of the name.

Object Variable

The new name of the object variable (without a leading & character).
Format: AE name

For arrays, the empty index brackets [] at the end of the variable name must not be specified!

Scope

This determines the validity range of the variable.

Allowed values: TASK, WORKFLOW or TOP
TASK - The object variable is only available for its own task.
WORKFLOW - The object variable is passed on to the parent workflow.
TOP - The object variable is passed on to the top workflow.

Comments

The script statement :PUBLISH converts a script variable or a script array to an object variable and, if required, it passes it on to the superordinate task.

:PUBLISH is similar to the script element :PSET. The difference is that the specified scripting variable must exist and that you can also use arrays.

The specified script variable or the array must already exist. Otherwise, a runtime error will occur.

Arrays are published with their filled size. For example, if an array is defined with 5 entries and the last entry with content other than nullstring is entry # 3, then only the entries 1 to 3 are published to the subsequent tasks. As a result, the size of the array in the subsequent task is limited to 3. If the array is completely empty (all entries have nullstring assigned) then nothing is published. This is for performance reasons.

When you specify a script array, the empty elements at the end of the array will not be used in or removed from the object variable regardless if the script variable is converted or when a new object variable is created.

Performance losses can be the result of using a script array that includes numerous elements (10000 or more).

By using the parameter Scope, you can specify the tasks in which the object variable should be used. The variable can be passed on to the parent workflow, the top workflow or only be used within its own task.

Examples

The following example stores the object name in a script variable and passes it on to the superordinate workflow using :PUBLISH.

:SET &CHILD# = SYS_ACT_ME_NAME()
:PUBLISH &CHILD#,,"WORKFLOW"

The second example creates a script array and fills it with the values of a Variable object. The array and the passed on to the top workflow as the new object variable.

:DEFINE &ARRAY#, string, 5
:FILL &ARRAY#[] = GET_VAR(VARA.TEST, KEY1)

:PUBLISH &ARRAY#[], VARA_ARRAY#, "TOP"

 

See also:

Script element Description

:FILL

Stores several values to a script array.

GET_PUBLISHED_VALUE Retrieves the value or PromptSet variable of a certain task.