Script Statement: Defines script variables and arrays as object variablesPlaceholder for values that are stored in an object's "Variables & Prompts" tab/section..
:PUB[LISH] Variable Name, [Object Variable], [Scope]
Syntax |
Description/Format |
---|---|
Variable Name |
The name of the script variableA placeholder for a value within a script. or scriptA particular Automation Engine object type. 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 variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. 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 objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task variable (without a leading & character). 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 |
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 taskThere are various ways of activating objects. The originator of the activation is referred to as the superordinate task (parent)..
If you define the parameter Object Variable, the system creates a new object variable with this name and the value of the script variable. An existing object variable of the same name will be overwritten and the script variable remains unchanged in this case.
Note that the specified script variable or the array must already exist. Otherwise, a runtimeThe duration of a task's execution. It refers to the period between a task's start and end. It does not include its activation period (see also: activation and start). error will occur.
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).
This script statement is similar to the script element :PSET. The difference is that the specified scripting variable must exist and that you can also use arrays.
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.
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 |
---|---|
Stores several values to a script array. |
|
GET_PUBLISHED_VALUE | Retrieves the value or PromptSet variable of a certain task. |
Script Elements - Activation Data
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Functions
Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support |
Copyright © 2016 Automic Software GmbH |