BPEL in a Nutshell
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.
Basic Process Structure: Start, End, Activities, Sequence
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
receive
orpick
in the activity described in the first problem?
The simplest approach, and the one recommended to most
developers, is to use a sequence
whose first activity is a receive
with 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 flow
. The receive
should not have any inbound links.
For example:
<flow> <receive . ...
Get Essential Business Process Modeling now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.