Adding loops to our example
Let us now extend our example to demonstrate how we can use loops. So far, our BookWarehousing
process has been able to handle one book title only. We will extend this example so that it can handle a list (array) of book titles. The process will iterate through the list and direct each book to the corresponding bookstore.
There are two possibilities to extend our example. The first would be to modify the BookWarehousingBPEL
process. We would need to modify the corresponding schema for the process to accept a list instead of a single book title. Then, we would need to modify the process flow so that it can handle more than one title.
The other approach that we will use is to add another BPEL process, which we will call BookOrderManagementBPEL
. The BookOrderManagementBPEL
process will receive a list of book titles. It will use a loop to iterate through the list. For each book title, it will invoke the BookWarehousingBPEL
process.