IBM Integration Bus, Version 10.0.0.1 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS


Creating or changing user-defined properties

Use the IBM® Integration API to create or change user-defined properties (UDPs).

You can create new UDPs and add them to the message flow, or you can discover existing UDPs and modify them.
The following example shows you how to create a UDP and add it to a message flow:
  1. A UDP called Property1 is created in parameter group Group1. The data type of the UDP is defined as a string, and the UDP is given the default value Hello World!
  2. The UDP is then added to the message flow by using the addFlowProperty() method.
File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
UserDefinedProperty udp = new UserDefinedProperty("Group1", "Property1", UserDefinedProperty.Usage.MANDATORY, UserDefinedProperty.Type.STRING, "Hello World!");
mf1.addFlowProperty(udp);
In the following example, the existing UDPs in a message flow are discovered by using the getFlowProperties() method on the message flow. The setName() method is then used to set the name of the first UDP to Property3:
File msgFlow = new File("main.msgflow");
MessageFlow mf1 = FlowRendererMSGFLOW.read(msgFlow);
Vector<FlowProperty> flowProperties = mf1.getFlowProperties();
flowProperties.get(0).setName("Property3");

Pattern authoring

The following examples are the same as the previous UDP examples, but for pattern authoring:

MessageFlow mf1 = patternInstanceManager.getMessageFlow("MyFlowProject", "main.msgflow");
UserDefinedProperty udp = new UserDefinedProperty("Group1", "Property1", UserDefinedProperty.Usage.MANDATORY, UserDefinedProperty.Type.STRING, "Hello World!");
mf1.addFlowProperty(udp);
MessageFlow mf1 = patternInstanceManager.getMessageFlow("MyFlowProject", "main.msgflow");
Vector<FlowProperty> flowProperties = mf1.getFlowProperties();
flowProperties.get(0).setName("Property3");

bc31630_.htm | Last updated 2015-05-28 20:52:21