This chapter explains the concept of exception handling and how to configure various methods of handling errors.
Exception handling is the identification of failed components or systems. In eXchange Integrator, exception handling allows one or more components to throw an exception that is caught by eXchange Integrator within a scope. Using the scope element, you can configure eXchange Integrator to catch all exceptions or certain exceptions that you specify. The elements that you use to configure exception handling in your model are:
Catch Named Exceptions
Catch All Exceptions
Exception handling in B2B protocols relies heavily on the concept of compensation. Compensation is an application-specific activity that reverse the effects of a previous activity that was carried out as part of a larger unit of work that is being abandoned.
B2B protocols are often of long duration and use asynchronous messages for communication. They also manipulate sensitive business data in back-end databases and line-of-business applications. As a result, the overall business transaction may fail or be cancelled after many transactions have been committed during its progress. In these cases, the partial work may need to be reversed.
Exception handlers are configured to catch errors that are thrown by eGate components and/or Web Services. These systems can be configured to publish one or more exceptions.
Manual Exception Handling: The model can contain B2B protocol logic designed to handle the exception.
Automatic Exception Handling: Pre-packaged functionality guides the user to create multiple types of catches for thrown exceptions.
Each exception can be handled differently. The following represents one example:
Build the exception handling logic as a B2B protocol.
Select the exception handler to configure which exception triggers the exception handling process.
Drag the Scope element onto the eXchange Protocol Designer canvas.
Drag the Exception modeling element into the scope for which it should take effect.
Define a B2B protocol that appropriately handles each exception.
Model manual exceptions in a B2B protocol.
Configure the exception handler to take place when one of the components within the Scope throws the appropriate exception.
Exception management allows users to quickly identify and correct problems with components or systems.
Users can filter the list of displayed instances to quickly identify exceptions.
Users can easily navigate to particular versions of a B2B protocol to monitor the progress of instances.
A Web-based interface allows users to securely access the monitoring environment over the Internet.
Identification of troubled instances, such as time-outs or bad messages.
Failed components/systems create visual alerts via the B2B protocol monitoring interface. The integrated monitoring environment allows you to identify the problem, assign a resource to fix the problem, and if necessary, restart the affected instances.
Users can quickly identify troubled instances from a large number of instances, repair and restart that instance for continued processing.
Scope allows you to define a range
For handling of exceptions
For creating compensation logic
The range of the scope can span one or more activities in the B2B protocol or even the entire B2B protocol.
Either Catch Named Exception or Catch All Exceptions can be used at the B2B protocol level.
Drag the Catch Named Exception element into the scope for which the exception handler applies.
In the Exception Handler properties, configure the following:
Fault Container — The output Attribute that contains the run-time name of the thrown fault.
The fault name is auto-populated with values based on the components dragged to the editor.
Select the configuration control for the Exception Handler– the properties pane appears to select the Fault name and container.
Fault Name — The run-time value for the exception that is passed from the component to the engine at run time.
No configuration of the Catch All Exceptions element is required; any thrown exception not previously caught is caught with the Catch All Exceptions element.
Compensation allows the modeler to create the process flow for executing complex compensations. Exception Handlers for parent scopes invoke the correct Compensation Handlers in the appropriate order.
Compensation Activity — In an exception handler, initiates the compensation process. It models the compensation as a B2B protocol, and indicates the Compensation for “DB Insert” should be initiated.
Compensation Handler — This is dropped within a scope to create the compensation logic for a given scope.
After generating the business process code (BPEL), you can click the Validation button on the toolbar to identify any issues with the model. The validation results now appear in a wizard, listing any issues one by one with clear and understandable descriptions for the issues. You can fix each issue, regenerate the business process code, and again view the validation results until each of the issues has been fixed, and the model validates as correct.