The following sections examine the essential language constructs designers will need to understand to create a BPEL process: the basic process structure, variables and assignments, exception handling and compensation, split and join, loops, participant exchange, transactions, and extensions.
A developer’s first BPEL process is not easy to write. Two puzzles face the beginner:
A BPEL process has exactly one activity (which, of course, can consist of any number of subactivities to any level of hierarchy). Which activity should that be? Which are allowed? Which are disallowed? Which are recommended?
How is the initial inbound event handler set up? Where do
you place the
pick in the activity
described in the first problem?
The simplest approach, and the one recommended to most
developers, is to use a
whose first activity is a
createInstance="yes", as in
the following code example :
<sequence> <receive . . . createInstance="yes" . . .> . . . </receive> <!-- other activities --> </sequence>
This process starts when the
receive triggers, then executes the
remaining steps sequentially, and exits when the last activity has
completed. Error handling complicates the processing, of course; see
the section "Exception
Handling and Compensation" for a discussion.
Another approach is to use a
receive within a
receive should not have any inbound links.
<flow> <receive . ...