Using Constants

Define constants in the EventFlow Editor's Definitions tab, in the Constants, Named Schemas, and Table Schemas section.

Defined constants have module scope, and can be referenced in any expression in any component or adapter in the containing module. Designate the value of a constant with an expression, which is calculated once when the module is initialized — that is, when the module is first loaded into a running StreamBase Server. If you stop and restart the container that holds the containing module, the constant's expression is re-evaluated when restarted.

A constant defined as above in the EventFlow Editor's Definitions tab is not used the same way as an operator parameter constant defined in the Parameters tab. A Definitions tab constant is specific to the containing module as described above, and its value is not passed to other modules. By contrast, the value of a constant defined in the Parameters tab can be passed to modules called by the containing module.

You can use any simple expression to set the constant's value. Do not use aggregate expressions. Do not use expression functions that can change the constant's value each time the module's container is restarted. For example, do not use random() or now().

Back to Top ^