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.

To Define a STATIC VARA Object

  1. On theVariables page define the values of the STATIC VARA object.

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

  2. On the Attributes page do the following:

    1. In the Data & Formatting section you specify the data format of the value that is rendered by the VARA object. Do the following:

      • For Text

        Enter an alphanumeric string. The system removes blanks at the end of the string, leading blanks are kept. Also define the following parameters:

        • Limit Text Length sets a limit to the length of the character string. The content length is unlimited. If you activate this option, this restriction affects the first value column only.

        • Max. text length

          Possible values: 1 to 1024

        • Force upper case converts the text of the first value column to upper case

        • Result format (BACKEND, MULTI, SQL, SQLI, SEC_SQL and SEC_SQLI VARA objects) defines the format of the content in the RESULT column, which is the first column that is displayed in the preview. The result column can show a combination of value columns and any other characters.

          Column numbers that are specified in curly brackets { } in the Result Format field are replaced by the value of the relevant column.

          Example:

          • Value column 1: JOB1
          • Value column 2: WIN01
          • Result format: {1}_{2}
          • Result column: JOB01_WIN01

          If you do not specify a result format, the value in the Result or in the Key column is used.

          Important!

          • The result must be within the defined limits and it must match the data type. Otherwise, the result column does not show a value.
          • The limitations (min. value, max. value, limit text to) do not affect the result column but the first returned column. If the values of this column exceed the maximum range, this line is skipped. The line is not available through the VARA object.
        • Sort by Column specifies the column that is used to sort the entries

          Possible values: Key, Value 1, Value 2, Value 3, Value 4, or Value 5.

        • Sort Order provides two options: Descending or Ascending. The underlying type of sorting, such as binary or alphabetic, depends on what is defined in your database.

      • For Number, Time, Date and Timestamp

        • Output format

          • Number is a singed integer, possible values: any number from 0 to 2147483647

            Default format: 16 digits

          • For Time the following formats are possible:

            • HHMMSS
            • HH:MM:SS
            • HHMM
            • HH:MM
            • MMSS
            • MM:SS

            Default format: HHMMSS

            The value for this data type must be a four or a six digit number. Decimal places are removed. Four-digit numbers are converted to hours and minutes.

            Example:

            Output Format: HH:MM:SS

            Value of the user or the data source: 1234, 1234.5, 123400, 12:34, 12:34:00

            Resulting variable value: 12:34:00

          • For Date the following formats are possible:

            • DD-MON-YYYY
            • DD-MON-RR
            • MM-DD-YYYY
            • YYYYMMDD
            • MMDDRR
            • DDMMRR
            • MM-DD-RR
            • MM/DD/RR
            • YYMMDD
            • YY.MM.DD
            • YY-MM-DD
            • YYYYMMDD
            • YYYY.MM.DD
            • YYYY-MM-DD
            • DDMMYY
            • DD.MM.YY
            • DD-MM-YY
            • DDMMYYYY
            • DD.MM.YYYY
            • DD-MM-YYYY
            • MMDDYY
            • MMDDYYYY
            • MM/DD/YY
            • MM/DD/YYYY

            Default format: YYMMDD

            Note: Some date formats include RR as a placeholder for the abbreviated year. Having both YY and RR accommodates different century-counting conventions, which are based on the two digits of the abbreviated year value.

            • YY - The current century applies for numbers from 00 to 80. The previous century applies for 81 - 99. 
            • RR - The current century applies for numbers from 00 to 49. The previous century applies for 50 - 99.

            Examples:

            • Date format DDMMYY and the resulting complete dates:

              010305 - corresponds to 01 March 2005
              010365 - corresponds to 01 March 2065
              010380 - corresponds to 01 March 2080
              010385 - corresponds to 01 March 1985

            • Date format DDMMRR and the resulting complete dates:

              010305 - corresponds to 01 March 2005
              010365 - corresponds to 01 March 1965
              010380 - corresponds to 01 March 1980
              010385 - corresponds to 01 March 1985

          • For Timestamp the following formats are possible:

            • YYYYMMDDHH24MISS
            • YYYY-MM-DD HH:MM:SS

            Default format: YYYY-MM-DD HH:MM:SS

            The value for this data type must be a four or a six digit number. Decimal places are removed. Four-digit numbers are converted to hours and minutes.

            Example:

            Output Format: YYYY-MM-DD HH:MM:SS
            Value of the user or the data source: 20110325 2201, 20110325 2201.5, 20110325 220100
            Resulting variable value: 2011-03-25 22:01:00

          Notes:

          • The first column is Value 1
          • The output format can be changed at any time. The values are converted to the new format. However, they are not converted if the values do not match the old format.
          • The format that you use to enter values is irrelevant unless it is an AE-supported format of the data type in question. The values are then converted to the relevant output format.
        • Set Min. value / Min. value and Set max. value / Max. value enforce a minimum/maximum value.

          Possible values for Number: max. 16 digits before and 16 digits after the decimal point

        • Sort by column specifies the column that is used to sort the entries

          Possible values: Key, Value 1, Value 2, Value 3, Value 4, or Value 5

        • Sort by order

          Possible options: Descending or Ascending

          The underlying type of sorting, such as binary or alphabetic, depends on what is defined in your database.

    2. In Variable Setting select the Scope of the variable.

      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.

    3. All VARA objects have a Script Access section on their definition pages that determines the error handling when scripts read the VARA object. In this section you decide what happens if scripts access the VARA object and the key to which they refer is not available.

      You have the following options:

      • Return error

        The script ends abnormally and a runtime error message is displayed in the Messages console

      • Return initial values (Default)

        The script continues executing although the key is not available. No runtime error is displayed. The report contains an empty string indicating that no key has been found.

        Tip: Ensure that the keys of VARA objects always return a value if you want to use this option.

    4. Save the object

Script Elements for STATIC VARA Objects

You can use the following script elements to store values in the 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!

  • 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

  1. In the source object, select as many rows as you need.

  2. Click Copy.

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

  4. 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: