JOnES project

Agility in Web-Services Orchestration using BPEL

by ObjectWeb@INRIA

 

 

 

Demonstration context: "booking" service sample

  The demonstration deals with a "booking" service. This service allows booking a given number of rooms and optionally a restaurant too.
  From a client's point of view, the booking service appears as a black box, taking a room number and a restaurant booking option as input, and returning a booking result with a price and a text-message.
  For the needs of this demonstration, we will have to look inside the "booking service" (see architecture below), and work at a finer service level ("HotelBooking/RestaurantBooking" web-services and BPEL process).


Architecture of the "booking" service

  The following schema shows what is behind the "Booking" web page that appears in the clients' browsers:
 
Click for full-size
  The client's browser calls a servlet, which calls a "Booking" Web-Service. This "Booking" Web-Service is deployed inside a BPEL engine. Only the WSDL file and the BPEL description have been provided, as the WS implementation is generated by the BPEL engine. The "Booking" Web-Service invokes itself two other WS, which are "HotelBooking" and "RestaurantBooking".


Services descriptions & WSDL

  To explain BPEL orchestration, we will need to understand a few concepts of WSDL files, such as available operations and theirs associated input and output. Any text or XML editor is enough for that purpose, but we can use more powerful tools to graphically view WS exposed operations (see Eclipse in the snapshot below).
 
Click for full-size
 
 
HotelBooking
This service offers the "bookHotel" operation, its input being the number of rooms to book (roomNumber). It returns:
  • a boolean indicating the booking operation success (bookingResult)
  • a integer giving the booking cost (bookingPrice)
  • a user-friendly message (returnedMessage)
  •  
    RestaurantBooking
    This service offers the "bookRestaurant" operation, its input being a promotion code (promoCode). It returns:
  • a boolean indicating the booking operation success (bookingResult)
  • a integer giving the booking cost (bookingPrice)
  • a user-friendly message (returnedMessage)
  •  
    Booking
    This service offers the "book" operation, its input being the number of rooms to book (roomNumber) and a boolean indicating if the client wants to book a restaurant too (isRestaurant). It returns:
  • a boolean indicating the whole booking operation success (bookingResult)
  • a integer giving the total booking cost (bookingPrice)
  • a user-friendly message (returnedMessage)


  • The BPEL process in details

      The "Booking" service is not hard-coded, but dynamically generated from its BPEL description when deployed in the BPEL engine. This mechanism offers agility to orchestrate existing services such as "HotelBooking" and "RestaurantBooking".
      Indeed, to create the global "Booking" service, we just have to write a few lines in BPEL. Editor such as Bull ZenFlow (see snapshot below) can make this job quite easy.
     
    Click for full-size
      In this schema, we define a process starting when receiving a booking ordrer, and ending when replying the result. Between these two steps, one calls the bookHotel operation and optionnally the bookRestaurant too, and tests/assigns variables. As you can see, the BPEL source of the "booking" service is very short and quite easily understandable.


    Running the "booking" service

      Before going further, here's a demo of the "booking" service in action. Just click on the picture below to start the animation.
     
    Click to run the demo
      In this animation, we can see in the upper left hand corner the client web-interface. For "HotelBooking" and "RestaurantBooking", they appear as black-boxes, and only some logs are available and displayed in the bottom left hand corner. As dynamically interpreted and generated by the BPEL engine, the "booking" process can be more easily monitored, according to the tools coming with the BPEL engine (in this example, we use the BPEL Monitoring Tool of the Bull Orchestra engine).


    How BPEL brings agility to orchestration

      The aim of this paragraph is to show the agility offered by BPEL orchestration. Thus, let's assume that we want to change the business logic, by adding the following rule: if the client successfully books 3 rooms or more, the restaurant is systematically booked too for free.
      To meet with this new rule, we will have to modify the BPEL file. The short animation below shows how to update the BPEL source code of the "booking" service.
     
    Click to run the demo
      NB: We implemented the new rule using a property of the "RestaurantBooking" service (the "promoCode" input parameter). If the service did not offer such a parameter, we would implement the new rule easily too, by not taking into account the cost of the restaurant (at the of the BPEL booking process, when we compute the total booking price).
      Finally, to update the service, we just have to deploy the new BPEL file in the BPEL engine. Then, when a client books a room, the new rule is applied.