CAPITULO V: CONCLUSIONES Y RECOMENDACIONES
5.1 CONCLUSIONES
5.1.1 Confort Térmico e Iluminación
Consider a travel agency that uses the workflow management technology to automate some of its business processes. For example, when a customer sends a flight request to the travel agency, a flight process is started, which interacts with the information systems of several airline companies to find flights that match the customer needs. A hotel process is used to search for available hotel rooms by interacting with the information systems of several hotels chains. A travel package process is used to compose flight offers and hotel accommodations into full vacation packages.
The workflow processes mentioned above take as input the necessary pa- rameters from the customer search request (e.g., departure city and destination city) and return one or more offers, so that each offer has a unique offer id. If the customer wants to book a given offer, she specifies the offer id and the payment information. This starts another workflow process for booking, which interacts with the airline companies, and/or hotels chains, and a credit card payment company to complete the booking.
In the following, the flight process and travel package process are modeled using a graph-based workflow language. Then, these processes are implemented in BPEL, with the assumption that the airline companies, the hotel chains, and the credit card company expose their services to partners as Web Services.
3.2.1
Workflow graphs for the travel agency scenario
The graph-based workflow language that was presented in Section 2.2.2 of Chap- ter 2 will be used to illustrate the issues of crosscutting concern modularity in workflow processes graphically and independently of any specific language. This graph-based language was chosen because it shows well the activity graph, which is the basis for the discussion on crosscutting concerns in Section 3.3. However, the observations that will be made apply also to the other kinds of workflow languages.
In Figure 3.1, the visual graph-based language is used to model the flight process and the travel package process. The flight process, on the left hand side of this figure, starts upon receiving a flight request from a customer. Once
such request arrives, two flight search activities interact with airline companies (Berlin Air and Tunis Air) to find flights matching the customer needs. The subsequent activity make offer is a composite activity that contains nested activities, e.g., for assigning an offer id to each available flight. The activity send flight offers sends the previously generated flight offers to the customer.
The travel package process, shown on the right hand side of Figure 3.1 is quite similar to the flight process. After receiving a client request for a vacation package, this process interacts with Berlin Air to find a flight, and then with the hotel portal MyHotels to find an accommodation. In addition to assigning an offer id, the composite activity make offer of this process incorporates logic for combining the available flights and the hotel accommodations into full vacation packages. The activity send package offers sends the vacation package offers to the customer. flight process receive flight request Flight search Berlin Air send flight offers Flight search Tunis Air Make Offer receive package request Flight search Berlin Air send package offers Hotel search MyHotels Make Offer package process
Figure 3.1: Two workflow processes in the travel agency scenario
3.2.2
The travel agency scenario in BPEL
Assuming that the partner companies of the travel agency provide their services using Web Services, the different workflow processes can be implemented with the BPEL language. This workflow-based Web Service composition language allows the travel agency to compose the Web Services of airline companies, hotel chains, and credit card companies. The composition in BPEL is recursive, i.e., the Web Service composition specified by a BPEL process is exposed as a Web Service. That is, the composition specified by the flight process is exposed as a Web Service operation getFlight, the composition specified by the travel package process is exposed as a Web Service operation getTravelPackage, and the composition specified by the hotel process is exposed as a Web Service operation getHotel, as shown in Figure 3.2.
In this figure, the workflow processes are represented by horizontal bars that contain ovals representing the activities. The dashed lines connecting the processes to the Web Services on the right hand side show the Web Services that are invoked from each process. The operations of the composite Web Service of
the travel agency are called from a Web application, which is part of the portal of the travel agency.
Travel Agency Berlin Air Tunis Air MyHotels getHotel getFlight getTravel Package findARoom searchFlight findAFlight BPEL Engine book bookAFlight book bookRoom MagicHotels book getRoom pay Visa checkCard Clients Web App Partners
Figure 3.2: The travel agency processes in BPEL
The operation getTravelPackage is implemented by the travel package pro- cess, which composes the Web Services of Berlin Air and MyHotels. The oper- ation getFlight is implemented by the flight process, which composes the Web Services of Berlin Air and Tunis Air. The operation getHotel is implemented by the hotel process, which composes the Web Services of the hotel chains My- Hotels and MagicHotels. These operations return one or more offers; each of them contains a description of the flight, the accommodation, or the vacation package in addition to a unique offer id that can be used later for booking.
To book a certain offer, the client calls the Web Service operation book, which is also implemented by a BPEL process that composes the hotel and air- line partner Web Services of the travel agency and the Visa card payment Web Service. The operation book takes two parameters: the offer id (that was previ- ously returned by one of the operations getFlight, getHotel, or getTravelPackage) and the credit card information.
Listing 3.1 shows the travel package process, which implements the operation getTravelPackage. This process declares three partner links that respectively connect the composition to the client, Berlin Air Web Service, and MyHotels Web Service (lines 3–5). It also declares six variables for holding the client request and response messages, as well as the request and response messages for the invocations of the operations findAFlight and findARoom on the Web Services of Berlin Air and MyHotels (lines 8–13).
The main activity in this process is the sequence activity packageSequence (lines 15–49), which contains a receive activity that matches the operation get- TravelPackage and an assign activity for copying data from the variable clien- trequest to the variables flightrequest and hotelrequest (lines 19–25).
In addition, the activity packageSequence contains two invoke activities for calling Berlin Air Web Service (lines 26–28) and MyHotels Web Service (lines 29–31). Moreover, another assign activity is used to copy the flight and hotel data from the variables flightresponse and hotelresponse into the variable clien-
1 <process name=”travelPackage”> 2 <partnerLinks>
3 <partnerLink name=”client” partnerLinkType=”clientPLT” .../> 4 <partnerLink name=”flight” partnerLinkType=”flightPLT” .../> 5 <partnerLink name=”hotel” partnerLinkType=”hotelPLT” .../> 6 </partnerLinks>
7 <variables>
8 <variable name=”clientrequest” messageType=”findPackageRequest”/> 9 <variable name=”clientresponse” messageType=”findPackageResponse”/> 10 <variable name=”flightrequest” messageType=”findAFlightRequest”/> 11 <variable name=”flightresponse” messageType=”findAFlightResponse”/> 12 <variable name=”hotelrequest” messageType=”findARoomRequest”/> 13 <variable name=”hotelresponse” messageType=”findARoomlResponse”/> 14 </variables>
15 <sequence name=”packageSequence”>
16 <receive name=”receiveClientRequest” partnerLink=”client”
17 portType=”travelServicePT” operation=”getTravelPackage” 18 variable =” clientrequest ” createInstance =”yes”/> 19 <assign>
20 <copy>
21 <from variable=” clientrequest ” part=”deptDate”> 22 <from variable=” flightrequest ” part=”DepartOn”> 23 </copy>
24 ...
25 </assign>
26 <invoke name=”invokeFlightServiceTP”
27 partnerLink =”flight” portType=”flightPT” operation=”findAFlight” 28 inputVariable =” flightrequest ” outputVariable =” flightresponse ”/> 29 <invoke name=”invokeHotelServiceTP”
30 partnerLink =”hotel” portType=”HotelPT” operation=”findARoom” 31 inputVariable =”hotelrequest” outputVariable =”hotelresponse”/> 32 <assign>
33 <copy>
34 <from variable=” flightresponse ” part=” flightDetails ”/> 35 <to variable =”clientresponse” part=” flightInfo ”/> 36 </copy>
37 <copy>
38 <from variable=”hotelresponse” part=”roomDetails”/> 39 <to variable =”clientresponse” part=”hotelInfo”/> 40 </copy>
41 <copy>
42 <from expression=”concat(getVariableData(’ flightresponse ’,’ flightnum ’),
43 getVariableData (’ hotelresponse ’,’ id’))”/>
44 <to variable =”clientresponse” part=”offerid”/> 45 </copy>
46 </assign>
47 <reply name=”replyToClient” partnerLink=”client” portType=”travelServicePT” 48 operation=”getTravelPackage” variable=”clientresponse” />
49 </sequence> 50 </process>
tresponse (lines 32–46). This assign activity also creates an offer id for the travel package by concatenating the flight number and the product number returned by the hotel Web Service (lines 41–45). The reply activity (lines 47–48) sends the travel package offer to the client.
The specifications of the flight process and the hotel process in BPEL are similar to the travel package process, whereby the flight process invokes the Web Services of Tunis Air and Berlin Air, and the hotel process invokes the Web Services of MyHotels and MagicHotels.