: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. You must always use an ampersand symbol (&) that precedes the script variable's name, and it is recommended that you use a hash (#) symbol to signal the end of the variable's name. The length of a script variable's name is limited to 32 characters. All characters of the alphabet, the numbers 0-9, and the following special characters can be used:"$", "_", "@", "ยง" and "#". German Umlauts are not allowed. The first character after the leading "&", which is not part of the 32-character limit, must neither be a number nor a "$" symbol. 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 In arrays, do not specify the empty index brackets [] at the end of the variable name. |
Scope |
This determines the validity range of the variable, you can specify the tasks in which the object variable should be used. Allowed values: TASK, WORKFLOW or TOP |
Comments
The script statement :PUBLISH converts a script variable or a script array to an object variable and passes it on to the superordinate task, if required.
Important!
- 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 elements and the last element that includes content is the element number 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. For performance reasons, nothing is published if the array is completely empty (null strings).
- Using script arrays that includes numerous elements (10000 or more) can result in performance losses.
Examples
The following example stores the object name in a script variable and passes it on to the superordinate workflow by 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 is then 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 |
---|---|
Stores several values to a script array. |
|
GET_PUBLISHED_VALUE | Retrieves the value or PromptSet variable of a certain task. |
:PSET | Assigns a value to an object variable. |
Script Elements - Activation Data
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Functions