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, optionally a restaurant too, and finally sends a recapitulation email with the total price to pay.
  From a client's point of view, the booking service appears as a black box, taking a room number, a restaurant booking option, and an email address as input, and returning a booking result with a price and a text-message which are body of the sent email.
  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).


Software architecture

 
PEtALS 1.3
Its architecture is based on the Fractal component framework.
PEtALS includes communication agents (jndi, joram and jmx) and communication services (jmxService, JndiService)
 
Orchestra 3.0
It needs JOnAS 4.8.x series and runs BPEL 2.0 process
 
Tomcat 4.1.34
 
resin 2.1.14


PEtALS

  What is PEtALS ?
  PEtALS is the highly distributed Open Source ESB hosted by OW2. PEtALS delivers OW2 JavaTM Business Integration (JBI) platform.
 
Click for full-size
  To promote such an architecture, Petals implements the Java(tm) Business Integration specification (JSR 208). J.B.I. describes a "Service Component" approach. Components are elements that offer services. Those Components are plugged on a JBI container. The services that they expose are accessible through Endpoints. Each consumer-component can request the JBI container to find a service. The JBI container give to the consumer the corresponding Endpoint. Then, the consumer send a message to the service-provider thanks to this Endpoint. The JBI specification is strongly based on WSDL. Thus, each Component has to provide a WSDL description of the services it exposes. That's why PetALS' services are BPEL compliant.


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 invokes a servlet, which invokes 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

 
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)
  •  
    SendMail
    This service offers the "sendMail" operation, its input being a email address (emailAddress). It returns:
  • a concatenation of bookRestaurant returned Message and bookHotel returned message at the specified email address (emailContent)
  •  
    Booking
    This service offers the "book" operation, its input being the number of rooms to book (roomNumber) , a boolean indicating if the client wants to book a restaurant too (isRestaurant), and an email address. 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", "RestaurantBooking", and "SendMail".
      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 invokes the bookHotel operation, optionnally the bookRestaurant, and optionnally the sendMail 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 left the client web-interface. For "HotelBooking" and "RestaurantBooking", they appear as black-boxes, and only some logs are available and displayed in the bottom right hand corner (tomcat server logs). And for "SendMail" , it appears as black-box too, and only some logs are available in the top right hand corner (petals console logs).