Sun B2B Suite eXchange Integrator User's Guide

Creating a Nondefault Error Handler

Within each of the standard BPs that provides for error handling, at the lower right margin of the main scope is a Catch Named Exception activity, connecting it to a scope containing an instance of a B2B protocol process: ErrorHandlerSelector. See Figure 3–4.

Figure 3–4 Template B2B Protocol Process “ErrorHandlerSelector“

Template B2B Protocol Process “ErrorHandlerSelector“

If you open the ErrorHandlerSelector BP, you find that by default, it uses JMS for handling errors, mapping fields under the ErrorHandlerSelectorRequest’s errorEvent container to the handleError.Input’s ErrorHandler container. See Figure 3–5.

Figure 3–5 Mapping from ErrorHandlerSelector to ErrorHandler

Mapping from ErrorHandlerSelector to ErrorHandler

The purpose of the JMSErrorHandler B2B protocol process is to send error messages to JMS, using the ErrorEvent_ErrorEventType OTD. However, in place of JMS, you could substitute SMTP to e-mail the text of the error message or FTP to write it to a file on a remote server. To create an SMTP-based error handler, for example, you would follow these steps:

ProcedureTo create an SMTP-based error handler

  1. Export the sbyn-exchange-error.wsdl file.

  2. In the Error Management folder, create a new B2B protocol process and name it; for example, SMTPErrorHandler.

  3. Open the properties of SMTPErrorHandler and do the following:

    1. Use the WSDL tab to load the .wsdl file you exported.

    2. Use the Partners tab to add a new partner named ErrorSelector.

    3. Use the Business Process Attributes tab to create a new attribute named ErrorEvent (namespace urn:sbyn-exchange-err).

  4. Drag activities onto the Protocol Designer canvas for SMTPErrorHandler and connect them.

  5. Configure business rules in the same way as for JMSErrorHandler.

    After you have created a new error handler, you can go back to ErrorHandlerSelector and replace JMSErrorHandler with the new error handler, for example, if you wanted AS2OutboundChannelManager to deliver error messages via SMTP instead of JMS.

    In the same way, you can add or modify other components in the B2B Templates folder, making them part of the toolset used by eeXchange Integrator projects in this Repository.