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.
You can use any simple expression to set the
constant's value. Do not use aggregate expressions or 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()
.
In StreamSQL, use the CREATE CONSTANT statement to define module-scoped constants.