Catching Activity Faults with Scope and Fault Handlers

A scope and fault handler is defined for activities within a process. The handler catches faults that have been triggered within the scope.

If accessing the sample from the Welcome page of TIBCO Business Studio™ for BusinessWorks™, go directly to Step 3.

Procedure

  1. In the samples directory, select core > fault > ScopeAndFaultHandler and double-click tibco.bw.sample.core.fault.ScopeAndFaultHandler.zip. For more information, see Accessing Samples.
  2. In the Project Explorer, expand the tibco.bw.sample.core.fault.ScopeAndFaultHandler project.
  3. Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
  4. Fully expand the Processes directory and double-click ScopeFault.bwp.
  5. Click Run > Debug Configurations.
  6. At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication
  7. Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the check box next to tibco.bw.sample.core.fault.ScopeAndFaultHandler.application.
  8. Click Debug.
    This runs the sample in Debug mode.
  9. Click the Terminate icon to stop the process.

Result

The console displays the messages based on the value specified in "INPUT_XML_FILE" Module Property.
  • If the correct location is specified for the MortgageRatesDB.xml file in "INPUT_XML_FILE" Module Property property, the message, The mortgage rate is 3.5 displays.
  • If an incorrect location is specified for the MortgageRatesDB.xml file in "INPUT_XML_FILE" Module Property, the following error message displays:

    Caught FNF: < User_Defined_File_Location >\MortgageRatesDB.xml was not found.

    The same message is written in a output.log file at C:\tmp\ScopeAndFaultHandler location.