Chapter 7. Integration scenarios with WebSphere Message Broker 265
7.6.2 Define the filters
To do this:
1. Right-click the first Filter node (Skypass) and select Open ESQL. Change
the ESQL code as shown in Figure 7-2.
Example 7-2 ESQL code for Skypass filter
CREATE FILTER MODULE Filter1
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
If Root.XML.CustomerOrder.FlightInfo.Membership = 'Skypass'
Then Return TRUE;
Else Return FALSE;
End If;
END;
END MODULE;
2. Open the ESQL for the second Filter node (Morning Calm). Note that the
ESQL for both Filter nodes is kept in one file. Change the ESQL code as
shown in Figure 7-3.
Example 7-3 ESQL code for Morning Calm filter
CREATE FILTER MODULE Filter2
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
If Root.XML.CustomerOrder.FlightInfo.Membership = 'Morning Calm'
Then Return TRUE;
Else Return FALSE;
End If;
END;
END MODULE;
The resulting definitions should look like Figure 7-49 on page 266.

Get Enabling SOA Using WebSphere Messaging now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.