Skip to main content


Define the error handling mechanisms for a sequence of activities.


   <throw fault='"MyFault"'/>
     <catch fault='"MyFault"'>

Attributes and Elements

name, disabled, xpos, ypos, xend, yend attributes
Other 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>:

<process language='objectscript'
         response='Test.Scope.Response' >
    <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=
            '"%LastError "_
            " : "_
    <trace value='"after scope"'/>

When a <scope> provides no <faulthandlers> block, InterSystems IRIS 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 in the ObjectScript shell, 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.

For details, see Handling Errors in BPL.

See Also

FeedbackOpens in a new tab