Bridging Variables

A Bridging variable is a named, typed dataset that stores values outside the flow of a single activity. Variables give a transaction somewhere to keep an intermediate result, such as a counter, a threshold, or a status message that must survive from one activity to the next—or from one transaction to another.

Variables are configured in Workbench under Bridging > Variables, and read and written to from a diagram by the Variable Reader Activity and Variable Writer Activity, or by addressing them directly in an expression.

Scope

Bridging distinguishes two scopes, configured under separate nodes.

Scope

Description

Local Variables

Private to the transaction instance that uses them. Each running transaction gets its own copy, so parallel instances of the same transaction cannot interfere with one another. Use local variables for counters, accumulators, and intermediate results.

Global Variables

Shared across the system. Every transaction sees the most recently assigned value, which is exposed as a data point that any GENESIS client can subscribe to. Use global variables for values that must be shared between transactions or shown in a display.

Because parallel transactions share a global variable, two instances writing the same global variable can overwrite each other. Use a local variable whenever the value belongs to one transaction instance.

Variable Types

Both scopes support Static Variables, and the global scope additionally supports Automatic Variables.

A Static Variable holds a dataset that you define and populate yourself. In the Variable Dataset section, you add columns—each with a name and a type of Boolean, Byte, Char, Double, DWord, Float, Integer, DateTime, Short, String, or Word—and then add rows of values. Right-clicking a column heading lets you add, copy, rename, remove, or reorder columns.

An Automatic Variable holds a single value that the system recalculates when the variable is read, which makes it useful for supplying report ranges, file names, and time boundaries without any configuration in the diagram. The available Automatic Type depends on the selected Data Type.

Data Type

Automatic Type

Boolean, Byte, Char, Double, DWord, Float, Integer, Short, Word

Auto Increment or Random Number, bounded by Minimum and Maximum and refreshed at the configured Update Rate.

DateTime

Timestamp, Today, Starting Shift, Ending Shift, and the first or last day of the current or previous week or month. Selecting Use UTC or Use Offset adjusts the result, and Direction and Offset shift it forward or backward.

String

Server Name

Addressing a Variable

You can address a variable as a GENESIS data point under the bwx: point manager, using the global@ or local@ prefix and the desired row and column:

bwx:global@<VariableName>.Row[<index>].Col[<indexOrName>] bwx:local@<VariableName>.Row[<index>].Col[<indexOrName>]

Rows and columns are zero-based. The same reference works in the following places:

  • As the tag of a Real Time Output Activity or Dynamic Tag Writer Activity, to write a value into the variable.

  • Inside an expression, wrapped in double braces, to read the current value—for example:

    x={{bwx:local@Counter.Row[0].Col[0]}} - 1

  • As a data point in a display or another GENESIS component, for global variables.

After you add or change a variable, click (Click to refresh the variables) in the Template Designer so that the diagram picks up the new schema.

Because a variable is a dataset that persists across activities, it is the standard mechanism for building a loop counter in a transaction diagram. Learn more