You can run the Airline Reservations sample to simulate the following tasks:
Reserving seats on a flight
Requesting information about a passenger
Requesting information about a specific flight and its passenger list
Cancelling a reservation
For each task, you put a message on a particular WebSphere MQ queue.
The appropriate message flow gets the message from the queue and processes the message.
The following instructions describe how to put the supplied self-defining XML messages
through the Airline Reservations sample message flows and what output you can expect to
receive from the message flows.
Because the message flows update databases,
you must run the message flows in the order that they are listed in the following instructions.
When you run the sample, you may see error messages similar to
Unresolvable database table reference T.CLASSTYPE
in the Problems view of the IBM Integration Toolkit.
This warning indicates that definitions for the database tables have not been imported into the project.
This warning does not affect the behavior of the sample at run time.
How you view the sample database contents depends on which database product is installed.
For DB2 databases use the tools provided by DB2; for example, the DB2 Control Center.
Note: Running multiple test messages through the flow might result in an apparent failure.
This apparent failure is caused because a threshold has been passed,
causing the message to pass through the flow differently.
To resolve this apparent failure, revert the database to the original content.
Running the XML_Reservation message flow
The XML_Reservation message flow reserves seats on the flight listed in the
input message and generates reply messages for the passengers to confirm their
reservations.
To run the XML_Reservation message flow:
In the "Application Development" view, expand the Airline XML Message Flows project,
under Flow Tests double-click the reservation1.mbtest file to open it in the Test Client.
In the Test Client, click Enqueue.
Click Send Message. The first input message is put on the XML_RESERVATION_IN queue.
In the Test Client, click Dequeue.
Click Get Message to read the first message from the queue, confirming the booking for Mary Smith.
The reply message confirms the reservation for one passenger and
contains the full name of the passenger, the class of seat they have reserved,
and their unique reservation number.
The following example shows the format of a reply message:
Repeat the previous step to get each of the remaining three messages,
confirming the bookings for Diane Rose, Debra Wiess, and Atila Wiess, from the XML_RESERVATION_OUT queue.
Check the XMLFLIGHTTB table in the RESERVDB database.
In all the rows, the value in the RESERVATIONSEQNO field has increased by four. In the
row for flight CA937 on May 25th 2003 the XML_Reservation message flow has
made the following changes:
Increased by two the value in ECONOMICCLASS
Increased by two the value in FIRSTCLASS
Decreased by two the value in TOTALECONOMIC
Decreased by two the value in TOTALFIRST
Check the XMLPASSENGERTB table in the RESERVDB database. The XML_Reservation
message flow has made the following changes:
Added four new rows to the XMLPASSENGERTB table, one for each person
listed in the input message
Allocated a unique reservation number to each reservation
Open reservation2.mbtest in the Test Client,
click Enqueue.
Click Send Message to put the second input
message on the XML_RESERVATION_IN queue.
In the Test Client, click Dequeue.
Click Get Message to get one reply message from the
XML_RESERVATION_OUT queue.
The reply message confirms the second reservation for Mary Smith, and
contains her full name, the class of seat she has reserved, and her
unique reservation number. The structure of the reply message is the
same as for the replies to the first input message.
Check the XMLFLIGHTTB table in the RESERVDB database.
In all the rows, the value in the RESERVATIONSEQNO has increased by one. In the
row for flight BA039 on May 25th 2003 the XML_Reservation message flow has
made the following changes:
Increased by one the value in FIRSTCLASS
Decreased by one the value in TOTALFIRST
Check the XMLPASSENGERTB table in the RESERVDB database.
The XML_RESERVATION message flow has made the following changes:
Added a new row to the XMLPASSENGERTB table for the person named in
the input message
Allocated a unique reservation number to the reservation
Running 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 that is given in the input message.
To run the XML_PassengerQuery message flow:
Open passengerquery1.mbtest in the Test Client,
click Enqueue.
Click Send Message. The first input message is put on the XML_PASSENGERQUERY_IN
queue.
In the Test Client, click Dequeue.
Click Get Message to get one output message from
the XML_PASSENGERQUERY_OUT queue. The output message contains the name
and reservation details of Debra Weiss, who was allocated the
reservation number that is specified in the input message. The
following example shows the format of the output message:
Open passengerquery2.mbtest in the Test Client,
click Enqueue.
Click Send Message to put the second input message on the XML_PASSENGERQUERY_IN
queue.
In the Test Client, click Dequeue.
Click Get Message to get one output message from the XML_PASSENGERQUERY_OUT queue.
The output message contains the name and reservation details of both reservations made
by Mary Smith, the passenger specified in the input message. The following example shows the format of the output message:
Check the RESERVDB database to see that the XML_PassengerQuery message
flow has not modified any of the data.
Running the XML_FlightQuery message flows
The XML_FlightQuery message flow is constructed from three small message flows.
All three message flows must be deployed to the integration node and started for XML_FlightQuery
to work:
XML_FlightQueryOut
XML_FlightQueryReply
XML_FlightQueryIn
The XML_FlightQuery message flow retrieves information about the flight that is specified
in the input message, and a list of passengers who have booked reservations
on that flight.
To run the XML_FlightQuery message flow:
Open flightdetailsquery.mbtest in the Test Client,
click Enqueue.
Click Send Message to put the input message on the XML_FLIGHTQUERY_IN
queue.
In the Test Client, click Dequeue.
Click Get Message to get one output message from the XML_FLIGHTQUERY_OUT queue.
The reply message
contains the details of how many seats there are in First Class and Economy Class,
the cost of the seats, and how many seats are available. The following example shows the format of the reply message:
Check the RESERVDB database to see that the XML_FlightQuery message
flow has not modified any of the data.
Running the XML_CancelReservation message flow
The XML_CancelReservation message flow cancels the reservations that are listed,
by their reservation number, in the input message.
To run the XML_CancelReservation message flow:
Open cancelreservation.mbtest in the Test Client,
click Enqueue.
Check the RESERVDB user database to ensure that the reservation numbers
in cancelreservation.mbtest exist in the XMLPASSENGERTB table.
If the reservation numbers do not exist in cancelreservation.mbtest,
edit the Message data field.
Click Send Message.
The input message is put on the XML_CANCELRESERVATION_IN queue.
In the Test Client, click Dequeue.
Click Get Message to get one output message from the
XML_CANCELRESERVATION_OUT queue. The output
message is a copy of the input message.
Check the XMLFLIGHTTB table in the RESERVDB database. In the row for flight
CA937 on May 25th 2003, the XML_CancelReservation message flow has made the
following changes:
Decreased by two the value in ECONOMICCLASS
Decreased by two the value in FIRSTCLASS
Increased by two the value in TOTALECONOMIC
Increased by two the value in TOTALFIRST
Check the XMLPASSENGERTB table in the RESERVDB database. The XML_CancelReservation
message flow has made the following changes:
Removed four rows from the XMLPASSENGERTB table, one for each person listed
in the input message.