STATIC VARA Objects
STATIC VARA objects allow you t 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:
Defining STATIC VARA Objects
A STATIC VARA object definition is made up of the following pages:
- General Page
-
Variables, see Variables Page below.
-
Attributes
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 Attributes Page below
- Script Access
- Client 0 VARA Objects in Other Clients
- Version Management Page
- Documentation Page
There are various ways to set the values of the STATIC VARA object:
-
Entering them manually
Notes:
-
The key must not start with a & character. Otherwise, you can save the VARA object but an error occurs when an attempt is made to access these lines through a script.
-
Maximum length of the keys: 200 characters
-
Case-sensitive keys are supported.
Example: Add the keys "test" and "TEST". If your database is case sensitive, it will save both keys, otherwise, the second entry replaces the first one.
-
The following value ranges are allowed depending on the your selection in the Data Type field (Data & Formatting section):
-
String
Content length: Unlimited
If the Limit text length checkbox in the Data & Formatting section is selected , this restriction only affects the first value column.
-
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
-
The values are sorted according to the settings on the Attributes page. By default, the Key column is sorted in an ascending order.
-
-
Using the Cell Editor window
The editor provides simple and user-friendly content editing. It is helpful for changing long values. To open it, click the editor icon on a cell.
-
Defining a SET VARIABLE or CLEAR VARIABLE condition action for a Workflow task. However, you cannot define a new VARA object with a condition action.
The following script elements are available for STATIC and XML variables:
- :PUT_VAR - Stores values in static variables.
- :PUT_VAR_COL - Stores a value in a specific column of a static Variable object.
- :DELETE_VAR - Deletes one or all values of a static variable.
-
Type
Read-only, always STATIC.
-
Scope
This setting can be used to simplify the script that writes values to the VARA object or reads them.
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. By specifying a particular scope, you can simplify design of scripts that write to or read from the VARA object.
For all values of scope except Freely selected, the key is optional. 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.
Default key if none is specified: N/A. Because specifying a key is mandatory, Runtime error U00003712 occurs if the key is missing.
If the VARA object has the scope Freely selected, you must specify the key when writing to or reading from the VARA object.
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.
If the VARA object has the scope User - each user name, you can omit the key when accessing the VARA object.
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.
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.
-
See also: