In his comment regarding my first Blogpost, Thierry has aked me for an article on this subject. And since I spoke briefly on this subject at the Automic World in Berlin, I’ve received several emails. This tells me that the subject is of great interest to some of you.
It is about the Curly Brackets Notation, how it functions, and what can be done with it. As always, I will explain it to you by using a few useful examples.
How the Curly Brackets Notation Works
With the Curly Brackets Notation you can read values in VARA objects. The script uses the fuction GET_VAR
. More information about GET_VAR
can be found in the Automic Manual.
The script function GET_VAR
works really well, but VARA values are useful in many other places. For examples:
- As default values for Prompt Sets
- As values in other VARA objects, for instance, as value of bind parameters in SQL Secure VARAs
- As paths in file transfer objects
GET_VAR cannot be used for these scenarios. However, beginning with Version 9, precisely those functions have been made available with the Curly Brackets Notation.
In scripts you continue to use GET_VAR
, but Curly Brackets cannot be used. Only with the script statement :RESOLVE
(description in the manual) can you resolve Curly Brackets.
The syntax of Curly Brackets Notation is very easy:
{Variablen-Objekt [, Key [, Spaltennummer ]]}
In the following screenshot you can see the VARA Object VARA_LOCATIONS
with the keys AUSTRIA
, CHINA
and USA
. The object has two columns: Value 1
and Value 2
.
We are only interested in the key USA
and the second column Value 2
. The field is marked in red in the screenshot and has the value “North America
“. To access it, we would use GET_VAR
in a script:
:SET &CONTINENT# = GET_VAR( VARA_LOCATIONS, USA, 2)
And you reference the same value with Curly Brackets Notation:
{VARA_LOCATIONS, USA, 2}
It does not matter whether the VARA object is a static or a dynamic one (e.g. SQL VARAs). The application functions exactly the same way.
By the way, there is a section in the Automic Manual about Curly Brackets Notation – however pretty well-hidden. The description can be found in the section “Working with Objects / General Information“.
Application of Curly Brackets Notation: Configuration VARAs
As I mentioned in my presentation at AW in Berlin, I use static VARAs for storing configurations of automation solutions.
Almost all of my Jobs use Prompt Sets, so that they can be reused as simply as possible. By using the Curly Brackets Notation, I apply the configuration values of my configuration VARAs to my Jobs.
The following screenshots illustrate the principle:
SCRI_ECHO
returns the entered text.
The entry is made with
PRPT_ECHO
.
Both of the “Output”configuration values of the configuration VARA VARA_CONF_DUMMY
should appear in my DUMMY solution.
To do that, I use the above-mentioned SCRI_ECHO
twice in the workflow of the DUMMY solution. In case of a real solution, I would assign alias names to the tasks.
In the Properties of both workflow tasks, I would finally use the Curly Brackets Notation (marked in red), in order to read the configuration values.
Application of the Curly Brackets Notation: Use in VARA Objects
The second important application area for Curly Brackets Notation is its use in VARA Objects. You can reference another VARA entry in the value of a VARA entry. Regardless whether from the same VARA or another VARA.
The VARA VARA_SCR
contains the values for the example.
In the VARA VARA_EXAMPLE
the values are referenced with the Curly Bracket Notation.
Now we are using the values of VARA_EXAMPLE
in a script::
:RESOLVE &SENTENCE1# = "{VARA_EXAMPLE,Sentence1,1}" :RESOLVE &SENTENCE2# = "{VARA_EXAMPLE,Sentence2,1}"
This results in the following report:
What Else are You Interested in?
I always love being able to answer direct questions from my readers with my articles. That’s why I always try to implement them as quickly as my publication plan allows.
Also, if there are any questions regarding the Automation Engine that are urgently on your mind, don’t hesitate to let me know, either by leaving a comment, or by sending me an email.