Accessing message flow user-defined properties from a JavaCompute node

Customize a JavaCompute node to access properties that you have associated with the message flow in which the node is included.

About this task

To access these properties from a JavaCompute node, use the getUserDefinedAttribute(name) method, where name is the name of the property that you are accessing. The type of the object that is returned depends on the type of the property that you are accessing. The object has one of a set of types:
  • MbDate
  • MbTime
  • MbTimestamp
  • Boolean
  • byte[]
  • String
  • Integer 32-bit values
  • Long 64-bit values
  • Double
  • BigDecimal
  • BitSet
You cannot access user-defined properties in the constructor. To access them at initialization time, implement the following method, and use it to access the user-defined properties.
public void onInitialize() throws MbException
{
   // access the user-defined properties here
}

You can use the IBM® Integration API to change the value of user-defined properties. The getUserDefinedAttribute() method is not supported for User-Defined Nodes (UDN). Use the getUserDefinedPropertyNames(), getUserDefinedProperty(), and setUserDefinedProperty() methods to query, discover, and set user-defined properties, as described in Setting message flow user-defined properties at run time by using a custom integration application.