Book Image

WS-BPEL 2.0 Beginner's Guide

Book Image

WS-BPEL 2.0 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
WS-BPEL 2.0 Beginner's Guide
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – the <forEach> loop


Let us now implement the same scenario using the <forEach> loop:

  1. We don't want to overwrite the <while> loop example; therefore, we will add another BPEL process component to the composite diagram. We will call it BookOrderForEachBPEL:

  2. We will also wire it with BookWarehousingBPEL:

  3. We will use exactly the same schema as in the previous example. To implement the BPEL process, we will first add the <forEach> activity to the process flow by dragging-and-dropping For Each from the Components palette (you will find it under Structured Activities):

  4. We will double-click the ForEach1 activity and set Name as ManageOrders and name of the counter variable (Counter name) as OrderCounter:

  5. In the Counter Values tab, we will set the start and the end value for the counter. The start value is 1 and the end value is the count($inputVariable.payload/ns1:BookData) expression. With this expression, we will count the number of books in the array. This...