XML VARA Objects
XML VARA objects store one value for one or more keys. Their data must have a well-formed XML structure. They can be used to temporarily store complex data as XML structures in the CA Automic Workload Automation system. This data can be referenced and used in PromptSet objects, in Script objects, and other script contexts system-wide.
XML VARA object allow you to retrieve a list of Variable object values. Use the PREP_PROCESS_VAR and PREP_PROCESS_VAR_XML script function to access all or several particular entries of a variable. This prepares the processing of a data sequence.
You can include PromptSet variables here when using the Dynamic Reload (Combobox Prompts) feature for Combobox prompts. When you use PromptSet variables in a dynamic VARA object, the Preview feature returns an error. This is because the PromptSet variables do not exist in the dynamic VARA object. However, the PromptSet variables will be resolved when objects including the PromptSet are executed.
This page includes the following:
Important Database Considerations
The use of XPath expressions with the XML VARA object is possible, as described also in the individual sections of the relevant script functions. Depending on the database with which the CA Automic Workload Automation system is used, individual XPath expressions may work differently. In such cases, check with the database vendor.
If you use the CA Automic Workload Automation with an Oracle database, the attribute values of XML data used in this VARA object should not contain more than 4000 characters.
XML data can use only character encoding which is compatible with the character encoding in the database connection.
-
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: