Nested Scopes, Outer Fault Handler Has Catch
Nested Scopes, Outer Fault Handler Has Catch
Suppose you have the following BPL (partially shown):

The rest of this BPL is as follows:

This BPL business process does the following:
-
The first <trace> element generates the message before outer scope.
-
The first <scope> element starts the outer scope.
-
The next <trace> element generates the message in outer scope, before inner scope.
-
The second <scope> element starts the inner scope.
-
The next <trace> element generates the message in inner scope, before throw.
-
The <throw> element throws a specific, named fault ("MyFault").
-
Control now goes to the <faulthandlers> defined within the inner <scope>. A <catch> exists, but its fault value is "MismatchedFault". There is no <catchall> in the inner scope.
-
Control goes to the <faulthandlers> block in the outer <scope>. It contains a <catch> whose fault value is "MyFault".
-
The next <trace> element generates the message in outer scope catch faulthandler for 'MyFault'.
-
The second <scope> ends.
-
The last <trace> element generates the message after outer scope.
Event Log Entries
The corresponding Event Log entries look like this:

XData for This BPL
This BPL is defined by the following XData block:
XData BPL
{
<process language='objectscript'
request='Test.Scope.Request'
response='Test.Scope.Response' >
<sequence>
<trace value='"before outer scope"'/>
<scope>
<trace value='"in outer scope, before inner scope"'/>
<scope>
<trace value='"in inner scope, before throw"'/>
<throw fault='"MyFault"'/>
<trace value='"in inner scope, after throw"'/>
<faulthandlers>
<catch fault='"MismatchedFault"'>
<trace value=
'"In inner scope catch faulthandler for 'MismatchedFault'"'/>
</catch>
</faulthandlers>
</scope>
<trace value='"in outer scope, after inner scope"'/>
<faulthandlers>
<catch fault='"MyFault"'>
<trace value=
'"In outer scope catch faulthandler for 'MyFault'"'/>
</catch>
</faulthandlers>
</scope>
<trace value='"after outer scope"'/>
</sequence>
</process>
}