User-defined properties in ESQL
Access user-defined properties (UDPs) as variables in your
ESQL program by specifying the EXTERNAL keyword on a DECLARE statement.
For example, the ESQL statement DECLARE today EXTERNAL CHARACTER
'monday'
defines a user-defined property called today with an initial value monday.
Before you can use a user-defined property, you must define the property in the Message Flow editor when you construct a message flow that uses it. When you define a UDP in the Message Flow editor, you must define a value and the property type. The value can be a default value, which varies according to the type of the UDP. The value that is assigned to the UDP in the Message Flow editor takes precedence over a value that you have assigned to the UDP in your ESQL program.
You can also define a UDP for a subflow. A UDP has global scope and is not specific to a particular subflow. If you reuse a subflow in a message flow, and those subflows have identical UDPs, you cannot set the UDPs to different values.
Before you deploy the message flow that uses the UDP, you can change the value of the UDP in the BAR editor. If you try to deploy a message flow that contains a UDP that has had no value assigned to it, a deployment failure occurs. For more information, see Configuring a message flow at deployment time with user-defined properties.
You can also modify the value of a UDP at run time, by using the administration REST API. For more information, see Setting message flow user-defined properties at run time by using the administration REST API.
You can use UDPs to set configuration data, and use them like typical properties. No external calls to user-written plug-ins or parsing of environment trees are involved, and parsing costs of reading data out of trees are removed. The value of the UDP is finalized in the variable at deployment time.
You can declare UDPs only in modules or schemas. You can query, discover, and set UDPs at run time, to dynamically change the behavior of a message flow. For more information, see User-defined properties.
- Compute
- Database
- DatabaseInput
- Filter
For a description of how to access a UDP from a JavaCompute node, see Accessing message flow user-defined properties from a JavaCompute node.