A user-defined property (UDP) is a user-defined constant whose initial value can be modified, at design time, by the Message Flow editor, or overridden, at deployment time, by the Broker Archive editor. You can use UDPs in your ESQL or Java programs. In ESQL, you use the DECLARE statement to define a UDP to your program. You can give the UDP an initial value on the DECLARE statement, but your code cannot modify the value at run-time.
When a UDP is given an initial value on the DECLARE statement this becomes its default. However, any value specified by the Message Flow editor at design time, or by the BAR editor at deployment time (even a zero length string) overrides any initial value coded on the DECLARE statement.
All UDPs in a message flow must have a value, given either on the DECLARE statement or by the Message Flow or BAR editor; otherwise a deployment-time error occurs. At run time, after the UDP has been declared its value can be queried by subsequent ESQL statements but not modified.
The advantage of UDPs is that their values can be changed by operational staff at deployment time. If, for example, you use the UDPs to hold configuration data, it means that you can configure a message flow for a particular machine, task, or environment at deployment time, without having to change the code at the node level. Configuration data does not have to be accessed by, for example, plug-ins from data sources such as databases, or copied into environment trees.
Using UDPs, configuration data can be set easily and used just like normal constants. Because no external calls to user-written plug-ins or parsing of environment trees are involved, 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 user-defined property is stamped into the variable at deployment time, which makes it quick to access.
To add a UDP to your programs, use the DECLARE statement. You can declare UDPs only in modules or schemas.
If you use the Message Flow editor to change the value of a user-defined property, the value of the UDP is set at the flow level and is the same for all eligible nodes contained in the flow. (An "eligible node" is a node that supports UDPs and is within the scope of the DECLARE statement that declares the UDP to your application.) For example, if you use the Message Flow editor to change the value of a user property called "timezone", that is declared in a schema called "mySchema", in a message flow called "myFlow", the UDP is available at runtime to all the nodes in myFlow that support UDPs and fall within mySchema.
For information about defining user-defined properties to your programs, see DECLARE statement.