Apama 10.15.0 | Developing Apama Applications | EPL Reference | Variables | Specifying named constant values
 
Specifying named constant values
A constant is a named literal and its value cannot be changed during runtime. It resembles a variable declaration with constant before it.
You can declare an identifier for a constant value in an event type definition or in a monitor. A constant appears in memory once. Spawning a monitor that contains a constant does not make copies of the constant.
The type of a constant must be boolean, decimal, float, integer, or string.
The name you assign to a constant must be unique within the event type or monitor that contains the constant definition.
The literal that you assign to the constant must be the specified type.
When you define a constant event field, you can refer to that constant from outside the event. Qualify the name of the constant with the event name, for example, MyEvent.myConstant.
You cannot declare a constant in an action, directly in a package, or in a custom aggregate function.
See also Specifying named constant values.