Global Variables
Introduction
Global Variables, as opposed to Flow Variables, are accessible by all Flows in a solution and have an unlimited validity, meaning that Global Variables can hold data that is persistent during the session and only expires when the session ends or times out. Variables get their values from Listeners, and hence the Variables and Listeners are closely connected: a Variable with an empty value must be declared so that a Listener can access it in its operation, and therefore when a Listener's TLML Syntax is fulfilled (usually when a certain user input is found), the script of the Listener is able to assign a certain value to the Variable.
View of Global Variables
Basics
Create
Edit
Save
Close
Delete
Filter
Details
Naming conventions
Variables are placeholders for changeable values and can be used to store text strings, Booleans, Lists, Maps (key/value pairs) and numbers. There exist various naming conventions related to computer programming and variable names, for example, snake_case or camelCase, and common to most of these is a need for a project team to use a similar convention which makes the names easy to read and understand for everyone.
Within the Teneo Platform, the scripting language is Groovy and, although not explicitly mentioned in documentation, Groovy makes use of camel case in examples of variable names throughout their documentation (see an example); furthermore, Java describes the use of camel case in their Java Language Basics (see last bullet point).
For Teneo solutions, the following recommendation are available:
- variable names must be unique within the solution
- use lower camelCase
- use a short, yet meaningful name which easily shows the purpose of its use to the reader.
Examples: user
, userName
, userFirstName
, companyName
, month
, hour