STATIC VARA Objects
STATIC VARA objects allow you to store as many keys as you need with a maximum of 5 values each. You can set the values manually, with a script element, or with a condition action. You define and enter the values for STATIC VARA objects on two pages. On the Variables main page you set its values. On the Attributes page you define the specific VARA object parameters.
This page includes the following:
Overview
A STATIC VARA object definition is made up of the following pages:
-
Common to all object types, here you define basic object information and apply custom values to it
-
Here you define the object-specific settings. Some sections on this page are common to all VARA objects and are described for all of them in dedicated topics:
- Data Types and Formatting
- Variable Settings, see below
- Script Access
- Client 0 VARA Objects in Other Clients
-
Common to all object types, here you find a list of all versions of the object
-
Common to all object types, here you enter information that you consider important to understand the configuration and behavior of the object
Defining a STATIC VARA Object
On this page you define the values of the STATIC VARA object.
- Click in a field to activate it.
-
Type the value or click the icon to open the Cell Editor window. The cell editor provides simple and user-friendly content editing. It is helpful for changing long values.
Maximum key length: 200 characters
The key must not start with &. If a key starts with &, you can save the VARA object. However, an error occurs when a script tries to access it.
This field is case-sensitive. If your database is case-sensitive too and you type two identical keys, where one is uppercase and the other lowercase (for example, "test" and "TEST"), both keys are saved when you save the object. If your database is not case-sensitive, the last entry that you enter replaces the first one.
The following value ranges are allowed depending on the your selection in the Data Type field (Data & Formatting section):
-
Number
Content length: 0 - 2147483647
-
Timestamp
Content length: Date and time value depending on the output format
-
Time
Content length: Time value depending on the output format
-
Date
Content length: Date value depending on the output format
-
- Define the Data Types and Formatting
Note: Only the entry of the Value 1 column is checked against the data type for plausibility. You can enter any value in the remaining Value columns. -
In the Variable Settings section, specify the following:
-
Type (read-only field)
-
Scope
Usually, the key must be specified as a parameter in the script element :PUT_VAR or GET_VAR. However, this makes it difficult to ensure that values are stored with unique keys. Specify a scope to simplify the design of scripts that write to or read from the VARA object.
The key is optional for all values of scope except Freely selected. The default key used to access the VARA object if no key is specified depends on the characteristics of the task that is accessing the object.
The following options are available:
-
No Scope
Specifying a key is optional.
Default key if none is specified: *
-
Freely selected
Specifying a key is mandatory. Runtime error U00003712 occurs if the key is missing.
Default key if none is specified: N/A.
Example:
:SET &VARA_NAME# = "UC0.MAL.TEST#1_1.VARA_STATIC_USERNAME"
:PUT_VAR &VARA_NAME#, &$USER#, "Mercury", "Venus", "Earth", "Mars", "Jupiter"
:SET &VALUE# = GET_VAR(&VARA_NAME#, &$USER# ,1)
:PRINT "Value: &Value#"
-
Host - each host name
Specifying a key is optional.
Default key if none is specified: The name of the Agent where the task is running.
-
Task - each task name
Specifying a key is optional.
Default key if none is specified: The name of the running executable object.
-
Workflow name - each workflow name
Specifying a key is optional.
Default key if none is specified: The name of the parent Workflow in which the task is running.
-
Workflow session - each workflow session
Specifying a key is optional.
Default key if none is specified: The RunID of the parent Workflow in which the task is running.
-
User - each user name
Specifying a key is optional.
Default key if none is specified: The name of the executing user.
Example:
:SET &VARA_NAME# = "UC0.MAL.TEST#1_1.VARA_STATIC_USERNAME"
:PUT_VAR &VARA_NAME#, , "Mercury", "Venus", "Earth", "Mars", "Jupiter"
:SET &VALUE# = GET_VAR(&VARA_NAME#, &$USER# ,1)
:PRINT "Value: &Value#"
-
User session - each user session
Specifying a key is optional
Default key if none is specified: The RunID of the user session. The entry (row) corresponding to the user session will be deleted when the user session ends.
Tip:
The two scopes that are more useful are User session - each user session and Workflow session - each workflow session. With these two scopes, the default key that is used if none is specified is user session ID or the workflow run ID, respectively. And importantly, with these two scopes, the rows are deleted when the corresponding run ID is deactivated.
Example:
You want to store some information in a VARA object as long as a user is logged in, but remove the information when the user logs out. You can set the scope of the VARA object to User session - each user session, and put values into the VARA object without specifying a key as shown here:
:SET &VARA_NAME# = "UC0.MAL.TEST#1_1.VARA_STATIC_USERSESSION"
:PUT_VAR &VARA_NAME#, , "Mercury", "Venus", "Earth", "Mars", "Jupiter"
:SET &VALUE# = GET_VAR(&VARA_NAME#, &$USER# ,1)
:PRINT "Value: &Value#"
The key used to write the values will be the session ID of the user who runs the script. In this example, running the script caused the following row to be added to the VARA object:
- Key 1168010
- Value 1 Mercury
- Value 2 Venus
- Value 3 Earth
- Value 4 Mars
- Value 5 Jupiter
1168010 is the ID of the user session. These IDs are visible under Users in the Administration perspective. When the user logs out, this row is removed from the VARA object.
The scope Workflow session - each workflow session works in a similar way. Any row written to such a VARA object (without a key specified) will be automatically removed as soon as the executing workflow is deactivated.
-
-
- Define the Script Access.
-
Save your changes.
Script Elements for STATIC VARA Objects
You can use the following script elements to store values in the VARA object:
- :PUT_VAR stores values
- :PUT_VAR_COL stores a value in a specific column
- :DELETE_VAR deletes one or all values
Filtering Entries
In large installations, STATIC VARA objects can contain hundreds of entries. Use the filter function to find entries more quickly.
To Filter the Contents of the STATIC VARA Object
-
Click the Filter button on the toolbar.
The Filter pane opens up. Key Name, Value 1 and Value 2 are always displayed. You cannot hide them.
-
Click Add Filter Criteria to add more values to your filter.
-
Enter the name or values and click the Filter button at the bottom of the pane.
Important!
-
The filter uses implicit wildcard characters at the beginning and at the end of the string you enter in any of the fields. Entering ABC triggers the search for *ABC*. The following results are also suggested in the dropdown list:
- MS_ABC
- ABC_MS
- MS_ABC_MS
- The search is not case-sensitive
Exporting Entries
The export button on the toolbar lets you export the list of entries in the STATIC VARA object to a CSV file. If the list is filtered, only the visible entries are exported. If the list is not filtered, the entire list is exported.
The list can always be exported, regardless of the number of entries that it contains.
Copying Entries
You can copy the content of a STATIC VARA object to another object on the same Client, on a different Client or in a different Automation Engine system, provided you have the necessary rights. You can also copy it to a third party tool, such as Google Sheets or Excel.
Note: Copying and pasting to a third-party application only works if https is used on the Automic Web Interface.
To Copy the Content of a STATIC VARA Object
-
In the source object, select as many rows as you need.
-
Click Copy.
-
Do one of the following:
-
Open or create another STATIC VARA object and select Paste.
-
Open the third party tool (for example Google Sheets or Excel) and press Ctrl+V or right-click and select Paste.
-
-
In the target object, select Paste.
Usage
Watch this video to learn how to use STATIC and XML VARA objects to configure Workflows: Watch the Video: Configuring Workflows with VARA objects
See also: