A booking is to be sent to, and a confirmation received from, each airline for every individual flight in the flight trip. You define a correlation so that the confirmation can be assigned to the booking. A correlation links messages by using one or more XML elements. In this lesson, you define a correlation based on the order number and the travel agency ID. This means that the assignment between the booking and the confirmation is uniquely defined.
You use the correlation editor to define a correlation. In the correlation editor, you define a container element for both the order number and the travel agency ID. You then specify which messages and which XML elements of the messages are to satisfy the correlation. The correlation can be activated by a send step and used by a receive step (more information: 7: Sending a Booking for Individual Flights (Send Step) and 9: Receiving a Confirmation (Receive Step)).
In the previous step, you defined a block with a ParForEach. A booking message is sent and a confirmation message received for each block instance. To assign the booking message and the confirmation message to each other, you must create a correlation instance for each block instance. A correlation instance is a value pair consisting of the order number and the travel agency ID. You achieve this by defining that the correlation is only valid for the particular block. To do so, specify the correlation as a local correlation in the block. If you do not do this, the correlation is valid for the entire integration process. In this example, only one correlation instance can be created.
1. In the title bar of the object area, choose with the quick info text Switch View → Correlation List.
2. In the Correlation Name field, enter BookingConfirmation.
3. Choose with the quick info text Details.
The editing area displays the correlation editor.
4. In the correlation container, define a container element for the order number by entering OrderNumber in the Name field and selecting xsd:string as the Type.
5. Following the same procedure, define a container element for the travel agency ID.
○ Name: AgencyID
○ Type: xsd:string
6. Following the same procedure, define a container element for the purchase order item.
7. Under Involved Messages, select the messages that are to be linked by the correlation at runtime.
8. Select the relevant service interfaces:
○ Booking message FlightBookingOrderRequest_Abstract
○ Confirmation message FlightBookingOrderConfirmation_Abstract
9. Under Properties, specify for the FlightBookingOrderRequest_Abstract message which field contains the travel agency ID:
a. Double-click the AgencyID field.
This displays the expression editor.
b. Select the container element and choose Interface.
In the XPath
screen area, navigate to the ID of the travel agency:
FlightBookingOrderRequest → AgencyData → AgencyID
The following is displayed in the XPath Expression field:
d. The Multiline field must not be selected.
10. Following the same procedure, specify which field contains the order number:
11. Following the same procedure, specify the fields for the FlightBookingOrderConfirmation_Abstract message:
12. To return to the graphical definition of the integration process, in the title bar of the editing area, choose with the quick info text Switch Editor and select Graphical Definition.
13. In the graphical definition of the integration process, click the SendParallel step.
14. In the Local Correlation field in the properties area of the block, select the BookingCorrelation correlation you just defined.