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, then 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, then the message follows the AllReservations path and the output message contains information about all the flights on which the passenger has reservations. This 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, and without having to create a chain of filter nodes, which would require a true/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 figure 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, read about the nodes in the XML_PassengerQuery message flow 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 XML domain. The message flow must, therefore, parse the message using the XML 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 thrown 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 should take through the message flow. The path that the message takes depends on the type of information provided in the message. The node updates the LocalEnvironment with the destination information:
- If the message contains only a reservation number, the node puts Single Passenger in the LocalEnvironment. This means 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 LocalEnvironment. This means that the RouteToLabel node passes second XML_PassengerQuery input message (passengerquery2.mbtest) to the AllReservations node.
- The DecideOnQuery node passes the message and the LocalEnvironment, 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 LocalEnvironment; the AllReservations node if the DecideOnQuery node put All Reservations in the LocalEnvironment.
- 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 GetReservationsInformation. 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