A search for flights and hotels is a well-known integration problem in the context of travel agency business systems. The goal is to devise an EAI solution that makes it easier searching for the most inexpensive combination of flights and hotels for a desired travel with a limited budget, so that the customer can decide which one he/she will book.
The EAI solution involves two applications, namely: Flights Façade (FF) and Hotels Façade (HF). Both applications represent interfaces that allow for querying several flight and hotel companies, without restricting results by price. Requests to FF get a response with all of the application can find for a specific date, departing and destination cities. Likewise, HF responds with all of the available in a destination city for a specific date.
The EAI solution should publish a unique interface by means of which travel searches, containing all of the necessary information about the travel, can be requested and returns all the possible flights and hotels combination within the customer’s budget.
:: Guaraná solution
Below you can have one possible design for this solution using Guaraná DSL and download its implementation on Guaraná SDK. Note that to run this example in your computer you have to setup the rurring environment. Instructions can be found here.
The EAI solution we have devised using Guaraná DSL is composed of one orchestration process and two wrapping processes. The orchestration process uses a responder port to publish an interface for searching combinations of flights and hotels. FF and HF applications were provided with wrapping processes that allow for querying them and removing entries that exceed the maximum affordable price for flight and hotel, respectively. We have decided to implement this functionally outside of the orchestration processes, so that it can be reused in other EAI solutions.
The integration ﬂow begins at responder port (1). This port receives request messages and adds them to slot (2) inside the orchestration process, from which replicator task (3) gets them. The replicator creates two copies from a message; the first copy is used to search for the flights and hotels, whilst the second is used to remove combinations of flights and hotels that exceed the total budget from the response. Task (4) promotes the request id from the body of the message to the header of the message, so that it can be used for correlation purposes in tasks (6) and (7). Prior to the correlation, the first copy is chopped by task (5) into different messages, so that tasks (8) and (9) can assemble the outbound messages used to request all possible flights and hotels, respectively. The wrapping process for FF receives request messages from exit port (10), queries the FF application by means of solicitor port (11), slims the responses in task (12), and, then, by means of exit port (13) writes the responses to files. Symmetrically, the wrapping process for HF queries its corresponding application with messages received from exit port (14). Back to the orchestration process, task (15) builds every possible combinations of flights and hotels returned by the wrapping processes, and, finally, before making the response available at responder port (1), task (16) slims the response to ensure none of the combinations exceeds the maximum budget.
:: Download files