Scopes
Scopes provide a way to divide a complex business process into hierarchically organized parts—scopes. Scopes provide behavioral contexts for activities. In other words scopes address the problem that we identified in the previous section and allow us to define different fault handlers for different activities (or sets of activities gathered under a common structured activity, such as <sequence>
or <flow>
). In addition to fault handlers, scopes also provide a way to declare variables that are visible only within the scope. Scopes also allow us to define local correlation sets, compensation handlers, and event handlers. We will discuss these topics laterin this chapter.
The code excerpt below shows how scopes are defined in BPEL. We can specify <variables>
, <correlationSets>
, <faultHandlers>
, <compensationHandlers>
, and <eventHandlers>
locally for the scope:
<scope> <variables> <!-- Variables definitions local to scope...