User-defined properties

A user-defined property (UDP) is a property that is defined when you construct a message flow using the Message Flow editor. This property can be used by the ESQL program inside message flow nodes such as a Compute node. It can also be used as a Java property inside the Java generated by a JavaCompute node.

The advantage of UDPs is that their values can be changed by operational staff at deployment time. You do not need to change your application programs. For example, if you use the UDPs to hold data about your computer center, you can configure a message flow for a particular machine, task, or environment at deployment time, without having to change the code at the message node level.

When you launch the Message flow editor to either create a message flow or modify an existing message flow, as well as deciding which nodes are required in the message flow, you also have the option (provided by the tab ) of defining and giving initial values to some user-defined properties. Use the User Defined Properties tab at the bottom of the edit window. See Message Flow editor for more information about how you do this.

As well as being defined using the Message flow editor, a UDP must also be defined using either a DECLARE statement with the EXTERNAL keyword in any ESQL program that uses it, or the getUserDefinedAttribute method in any JavaCompute node that uses it.

See the DECLARE statement for details of the DECLARE statement, and see Accessing user-defined properties from a JavaCompute node for more information about how to use a UDP in a JavaCompute node.

Any value that you give to a UDP when you define it in a message flow, overrides the value of that variable in your ESQL or Java program.

The value of a UDP can also be modified at deployment time by using the Broker Archive editor to edit the bar file. This value overrides any value that was given when you defined the message flow.

Every UDP in a message flow must have a value, given either when the UDP is declared or by the Message Flow or Broker Archive editor; otherwise a deployment-time error occurs. At run time, after the UDP has been declared its value can be queried by subsequent program statements but it cannot be modified.

The value of the UDP is set at the flow level and is the same for all eligible nodes that are contained in the flow. An "eligible node" is a node that supports UDPs and is within the scope of the declaration 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 run time to all the nodes in myFlow that support UDPs and that fall within mySchema.

Similarly, if you use the Message Flow editor to change the value of a user-defined property in a subflow, the newly edited property is available to all the nodes in the subflow that support UDPs and that are within the scope of the declaration. It is not available, for example, to nodes in the parent flow.

Related concepts
Message flows overview
ESQL variables
User-defined properties in ESQL
Related tasks
Developing message flows
Configuring a message flow at deployment time using UDPs
Accessing user-defined properties from a JavaCompute node
Related reference
ESQL variables
DECLARE statement
Message Flow editor