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