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

Conditions


To make choices based on conditions in BPEL 2.0, we use the <if> activity to define the conditional branches, which replaced the <switch> activity in BPEL 1.1. The <if> activity can have several <elseif> branches and one <else> branch. The following example shows the structure of the <if> activity:

<if>
  <condition>boolean-expression</condition>
  <!--activities -->

  <elseif>
    <condition>boolean-expression</condition>
    <!--activities -->
  </elseif>

  <elseif>
    <condition>boolean-expression</condition>
    <!--activities -->
  </elseif>
  ...
  <else>
    <!--activities -->
  </else>
</if>

The Boolean expressions for the <condition> elements are expressed in the XPath. We can use any valid XPath expression that returns a Boolean value. To use variables in conditions, we can use the $ operator, the same way as in assignments...