Completing a to-do task for converting a function selector

Configure a JavaCompute node named SelectFunction.

Before you begin

Run the WebSphere® ESB conversion tool to convert a mediation that contains a function selector.

About this task

In WebSphere Enterprise Service Bus, the export binding function selector is used to determine which interface operation should be invoked when a message is received by the export binding.

To achieve the same result in IBM® Integration Bus, the conversion tool creates a JavaCompute node named SelectFunction. Configure this node as follows:

Procedure

  1. In IBM Integration Toolkit, open the subflow that contains the JavaCompute node function selector.
  2. If necessary, reorder the nodes. Right-click the canvas, select Layout, and choose a layout.
  3. Double-click the JavaCompute node ( called SelectFunction) to edit it.
    The node contains code similar to the following snippet:
    
         // TODO: The Export_MQ Export selects from the available interface operations 
         // using the following function selector:
         // com.ibm.websphere.sca.mq.selector.impl.Constant
         // 
         // Manually convert the function selector here to select one of the 
         // available operations:
         // callHello, callGoodbye, callAuRevoir 			
         String selectedFunction = "callHello";
         
         // Finally, set the selected operation into the labelName element 
         DestinationData.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "labelName", selectedFunction);
    
    The available functions are taken from the mediation module, and your code might differ from this example. The string selectedFunction is hard-coded to the first function in the list of functions from the mediation flow.
  4. Write code that replicates the actions of the function selector in the mediation module, to select one of the available operations.
    For example, you might look in the message for a particular transport header.

Results

When this node is correctly configured, the next node in the main message flow, RouteToLabel, looks up the value that has been set, and sends the message to the appropriate Label node.