Define the error handling mechanisms for a sequence of activities.
|Attribute or Element
|name, disabled, xpos, ypos, xend, yend attributes
||See Common Attributes and Elements.
||Optional. <scope> may contain zero or more of the following elements in any combination: <alert>, <assign>, <branch>, <break>, <call>, <code>, <continue>, <delay>, <empty>, <flow>, <foreach>, <if>, <label>, <milestone>, <reply>, <rule>, <scope>, <sequence>, <sql>, <switch>, <sync>, <throw>, <trace>, <transform>, <until>, <while>, <xpath>, or <xslt>.
To enable error handling, BPL defines an element called <scope>. A scope is a wrapper for a set of activities. This scope may contain one or more activities, one or more fault handlers, and zero or more compensation handlers. The fault handlers and are intended to catch any errors that activities within the <scope> produce. The fault handlers may invoke compensation handlers to compensate for those errors.
The following example provides a <scope> with a <faulthandlers> block that includes a <catchall>:
<trace value='"before scope"'/>
<trace value='"before assign"'/>
<assign property="SomeProperty" value="1/0"/>
<trace value='"after assign"'/>
<trace value='"in catchall faulthandler"'/>
" : "_
<trace value='"after scope"'/>
When a <scope> provides no <faulthandlers> block, Ensemble automatically outputs the system error to the Event Log
. When a <scope> does
contain a <faulthandlers> block, the BPL business process must output <trace> messages to the Event Log for system error messages to appear there. System error messages do appear on the Terminal console, in either case.
It is possible to nest <scope> elements. An error or fault that occurs within the inner scope may be caught within the inner scope, or the inner scope may ignore the error and allow it to be caught by the <faulthandlers> block in the outer scope.