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:

Defining STATIC VARA Objects

A STATIC VARA object definition is made up of the following pages:

Defining the Variables Page

On this page you define the values of the STATIC VARA object.

  1. Click in a field to activate it.
  2. Ttype 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.

    Important!

    • 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.

    • Maximum key length: 200 characters

    • Case-sensitive keys are supported

      Example: Add the keys "test" and "TEST". If your database is case sensitive, it saves 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):

      • 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

Defining the Attributes Page

  1. Define the Data Types and Formatting.
  2. In the Variable Settings section, specify the following:

    • Type

      Read-only

    • 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

        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.

      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.

  3. Define the Script Access.
  4. If you are logged in to Client 0, an additional section is available. For more information, see Client 0 VARA Objects in Other Clients.
  5. Save your changes.

Script Elements for STATIC VARA Objects

The following script elements are available to store values in a STATIC VARA object:

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

  1. 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.

  2. Click Add Filter Criteria to add more values to your filter.

  3. Enter the name or values and click the Filter button at the bottom of the pane.

Important!

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.

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: