Configuring a message flow at deployment time using UDPs

User-defined properties (UDPs) give you the opportunity to configure message flows at deployment time, without modifying program code. Typical uses of UDPs are to specify configuration information or to maintain version information.

A UDP is a user-defined constant that you can use in your ESQL or Java programs. Optionally, you can give the UDP an initial value when you declare it to your program. This initial value can be modified at design time, by the Message Flow editor, or overridden, at deployment time, by the Broker Archive editor. At run time, after the UDP has been declared its value can be queried by subsequent program statements but not modified.

You can define UDPs within procedures and functions, or at the module or schema level.

For an overview of user-defined properties, see User-defined properties. For reference information about defining UDPs in ESQL programs, see DECLARE statement.

  1. Code your application to handle two or more values of a user-defined property, perhaps by executing different sub-routines or functions.
  2. Declare the user-defined property to your application. (In ESQL, you do this using the DECLARE statement with the EXTERNAL option specified. See DECLARE statement.)
  3. Optional: Give the UDP an initial value which, if specified, becomes the default value. Any value specified by the Message Flow editor at design time, or by the BAR editor at deployment time, overrides an initial value declared here.

    The UDP must be given a value, either when the UDP is declared or by the Message Flow or BAR editor; otherwise a deployment-time error occurs.

  4. Specify the data type of the UDP. Take care when when doing this, because the value is cast to the requested DataType.
  5. At design time, use the "User Defined properties" tab of the Message Flow editor to define the UDP to the broker, using the same name as that declared to your program. (Note that the Message Flow editor allows UDPs to be grouped in the UI; however, this grouping has no part in matching the declaration of the UDP.) You can also set or change the default value of the UDP. 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 declaration that declares the UDP to your application.)
  6. At deployment time, if the default value of the UDP is unsuitable for the current environment or task, use the BAR editor to change it. The BAR editor allows UDP values for a flow to be viewed and set. The value of the UDP is set at the flow level and is the same for all eligible nodes contained in the flow.
  7. If a sub flow includes a UDP that has the same name as a UDP in the main flow, the values of the main and sub flow UDPs are separate. In the BAR editor, set the main flow value at the node representing the main flow; setting it changes only the value seen by the eligible nodes in the main flow. Set the sub flow UDP value on the child node of the main flow that represents the sub flow.
  8. If you want to set different values for a UDP at different nodes in the same flow, each node or group of nodes that are to have the same value must be placed in a separate sub flow. You can then set the UDP value for each set of nodes, at design and deployment time, on the sub flow.
Related concepts
Message flows overview
ESQL overview
User-defined properties
Related tasks
Designing a message flow
Defining message flow content
Promoting a property
Related reference
Compute node
Database node
DECLARE statement
Message Flow editor
Configurable message flow properties