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).
|
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.
|