User-defined properties (UDPs) can be accessed 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 also define the property when you construct a message flow that uses it by using the Message Flow editor. When you define a UDP using the Message Flow editor, a value and property type are also defined. The value might be a default value, which varies according to the UDP's type. The value that is assigned to the UDP in the Message Flow editor takes precedence over any value that you have assigned to the UDP in your ESQL program.
Before you deploy the message flow that uses the UDP, you can change the value of the UDP by using the Broker Archive 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 use UDPs to set configuration data easily and use them like typical constants. No external calls to user-written plug-ins or parsing of environment trees are involved, therefore the ESQL code is easier to write and maintain, and performs better. Also, the parsing costs of reading data out of trees are removed. The value of the UDP is stamped into the variable at deployment time, which makes it quick to access.
You can declare UDPs only in modules or schemas.
For a description of how to access a UDP from a JavaCompute node, see Accessing user-defined properties from a JavaCompute node.