WebSphere Message Broker, Version 8.0.0.7
Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS
See information about the latest product version
See information about the latest product version
Updating filter tables on Route nodes
Use the Message Broker Java™ API to modify a pattern instance to update filter tables on Route nodes.
You can add and update rows on the filter table of a Route node.
- Adding a new row
- The following example shows you how to add a new row to a filter
table by using the createRow() method:
- The message flow and the Route node are loaded into memory.
- The filter table of the Route node is loaded into memory by using the getFilterTable() method of the RouteNode object.
- A new filter table row is created by using the createRow() method.
- The value of the filter pattern property on this new row is set to value="123" by using the setFilterPattern() method.
- The routing output terminal property is set to NEWOUT by using the setRoutingOutputTerminal() method.
- The new row is then added to the filter table by using the addRow() method.
MessageFlow mf1 = patternInstanceManager.getMessageFlow("MyFlowProject", "main.msgflow"); RouteNode routeNode = (RouteNode)mf1.getNodeByName("My Route Node"); RouteNode.FilterTable filterTable = (RouteNode.FilterTable)routeNode.getFilterTable(); RouteNode.FilterTableRow newRow = filterTable.createRow(); newRow.setFilterPattern("value=\"123\""); newRow.setRoutingOutputTerminal("NEWOUT"); filterTable.addRow(newRow);
- Updating a row
- The following example shows you how to update rows on the filter
table of a Route node.
- The message flow, Route node, and filter table of the Route node are loaded into memory.
- The rows of the filter table are loaded into memory by using the getRows() method.
- The filter pattern property of the first row of the filter table is set to value2="456".
- The routing output terminal property of the first row of the filter table is set to NEWOUT2.
MessageFlow mf1 = patternInstanceManager.getMessageFlow("MyFlowProject", "main.msgflow"); RouteNode routeNode = (RouteNode)mf1.getNodeByName("My Route Node"); RouteNode.FilterTable filterTable = (RouteNode.FilterTable)routeNode.getFilterTable(); Vector<RouteNode.FilterTableRow> filterTableRows = filterTable.getRows(); filterTableRows.get(0).setFilterPattern("value2=\"456\""); filterTableRows.get(0).setRoutingOutputTerminal("NEWOUT2");