About the XML_PassengerQuery message flow
The XML_PassengerQuery message flow retrieves the reservation details of the passenger
specified in the input message.
The type of information in the output message depends on the information given in the input message:
- If the input message provides only a reservation number,
the message follows the SinglePassenger path and the output message contains information
about only the flight with which the reservation number is associated.
- If the input message provides only a passenger's name, the message follows the AllReservations path and the
output message contains information about all of the flights on which the passenger has reservations.
This sample assumes that the passenger's full name is unique, which is not realistic but simplifies the sample.
The message flow uses RouteToLabel and Label nodes to dynamically route a message based on information in the
message itself without having to create a chain of filter nodes, which requires a true or false Boolean
result to route messages along particular paths.
Two input messages are supplied for running the XML_PassengerQuery message flow to demonstrate the
retrieval of both types of information described.
The following diagram shows the XML_PassengerQuery message flow.

The following table lists the types of nodes that are used in the XML_PassengerQuery message flow.
Node type |
Node name |
MQInput |
XML_PASSENGERQUERY_IN |
Compute |
DecideOnQuery; GetPassengerInformation; GetReservationsInformation |
RouteToLabel |
RouteToLabel
|
Label |
SinglePassenger; AllReservations |
MQOutput |
XML_PASSENGERQUERY_FAIL_1; XML_PASSENGERQUERY_FAIL_2; XML_PASSENGERQUERY_OUT |
For more information about the nodes that are used in this sample, see
Built-in nodes in the WebSphere Message Broker documentation.
To see the ESQL that is used in this message flow,
see Creating the XML_PassengerQuery message flow.
The XML_PassengerQuery message flow performs the following actions:
- The XML_PASSENGERQUERY_IN node gets the input message from the XML_PASSENGERQUERY_IN queue and identifies
the input message as being in the XMLNSC domain. The message flow must, therefore, parse the message by using the
XMLNSC parser.
- The XML_PASSENGERQUERY_IN node passes the message to the DecideOnQuery node. Alternatively:
- If there is a problem identifying the input message, the node passes the message through the Failure
terminal to the XML_PASSENGERQUERY_FAIL_1 node, which puts the message on the XML_PASSENGERQUERY_FAIL queue.
- If an exception is produced downstream and the message is rolled back,
the XML_PASSENGERQUERY_IN node passes the message through the Catch terminal to the XML_PASSENGERQUERY_FAIL_2 node,
which puts the message on the XML_PASSENGERQUERY_FAIL queue.
- The DecideOnQuery node decides which path the message takes through the message flow.
The path that the message takes depends on the type of information provided in the message.
The node updates the local environment with the destination information:
- If the message contains only a reservation number, the node puts
Single Passenger in the local environment, so that
the RouteToLabel node passes the first XML_PassengerQuery input message
(passengerquery1.mbtest) to the SinglePassenger node.
- If the message contains a passenger's full name, the node puts
All Reservations in the local environment, so that
the RouteToLabel node passes the second XML_PassengerQuery input message
(passengerquery2.mbtest) to the AllReservations node.
- The DecideOnQuery node passes the message and the local environment through the Out terminal to the
RouteToLabel node.
- The RouteToLabel node passes the input message to the relevant Label node:
the SinglePassenger node if the DecideOnQuery node put Single Passenger in the
local environment; the AllReservations node if the DecideOnQuery node put All Reservations
in the local environment.
- If the RouteToLabel node passed the input message to the SinglePassenger node, the SinglePassenger node
passes the input message, which contains a reservation number, through the Out terminal to the
GetPassengerInformation node. The GetPassengerInformation node looks up the reservation number in the
XMLPASSENGERTB table in the RESERVDB database and builds an output message from the information found in
the XMLPASSENGERTB table, including the reservation number, the passenger's full name, the flight number,
the flight date, and the class of seat. The GetPassengerInformation node then passes the output message
through the Out terminal to the XML_PASSENGERQUERY_OUT node.
- If the RouteToLabel node passed the input message to the AllReservations node, the AllReservations node
passes the input message, which contains a passenger's name, through the Out terminal to
the GetReservationsInformation node. The GetReservationsInformation node looks up the passenger's name in the
XMLPASSENGERTB table of the RESERVDB database and builds an output message from the information found in the
XMLPASSENGERTB table, including the passenger's full name, and the flight number, flight date, and class of
seat for each reservation that the passenger has made. The GetReservationsInformation node then passes the
output message through the Out terminal to XML_PASSENGERQUERY_OUT.
- The XML_PASSENGERQUERY_OUT node puts the output message on the XML_PASSENGERQUERY_OUT queue.
Back to About the Airline Reservations sample