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