Performing Exception Handling

Objective

After completing this lesson, you will be able to perform exeption handling

Exception Handling

In this lesson, the following topics are discussed:

  • What is an Exception?
  • Define an Error Configuration for one integration flow to inform the Sender.
  • Define an Exception Subprocess.
  • Error Handler.
  • Error and Escalation events.

What is an Exception?

There are typically two types of exceptions: expected and unexpected. Expected exceptions can include different values in a message field or empty values, and can be handled through the integration flow design. Unexpected exceptions, on the other hand, are technical in nature, such as connection failures or errors in scripts, and can lead to program termination. To prevent this, unexpected errors must be intercepted and handled appropriately to allow the program to continue running.

The focus now shifts to unexpected exceptions and their handling, and for the remainder of this discussion, the terms "unexpected exceptions", "exceptions", and "errors" will be used interchangeably.

Define Error Configuration for One Integration Flow to Inform the Sender

You can specify the error handling mechanism for handling runtime failures during message processing. The primary objective of this approach is to communicate error details to the sender for better awareness. To achieve this, you can enable the Return Exception to Sender flag in the integration flow settings.

Screenshot of the Integration Flow with the Error Configuration tab and the Return Exception to Sender checked box highlighted in red.

Read More Here:

Define Error Configuration

Define an Exception Subprocess

An extra subprocess can be defined within an integration flow, which will be invoked whenever an unexpected error occurs.

Procedure

  • In an editable flow, you may want to retrieve an exception to ensure that the original process is completed without any errors.
  • Place an Exception Subprocess.
  • Define your error handler.
  • Save, deploy, and run your integration flow.

Sample

Your integration flow has encountered an error as the connection parameters are not functional.

Screenshot of a sample integration flow.

The error in the message monitor after deployment:

Screenshot of the Failed error message in the monitor.

Usage of an Exception Subprocess:

The starting event is an Error Start event. This component fetches the exception.

Screenshot of the Error Start 1 highlighted in red.

The monitor with the exception subprocess:

Screenshot of the Completed message in the monitor.

You can view the detailed error information inside the Message Processing Run.

Screenshot of the detailed error situation. Information about the error handler is provided in the next paragraph.

Error Handler

If the error is caught by an Error Start event, any further processing can be implemented as in a regular process. Scripts, like the one demonstrated in Handle Exceptions, are especially common.

Error and Escalation Events

The Error Start event always triggers the Exception Subprocess, which intercepts the error and starts its execution. If you want to terminate the Exception Subprocess without the status Failed, you must define an End Message, as shown in the previous example.

Manual Generation of Error and Escalation End Events

Setting an Error End event at the end of an integration flow will always cause it to enter the Fail status, which can be used as a design element. The Error End event serves as the endpoint of the main process, and in case of any errors, the Exception Subprocess always intercepts it.

Run to an Error End Event:

Screenshot of the Failed status result of the run.

If you get the Failed status, then the process worked correctly.

Screenshot of the result with the error at the end of the event.

The Escalation End event generates an error without interrupting the main process.

Run to an Escalation End Event:

Screenshot of the escalated run result.

If you get the Escalated status, then the process worked correctly.

Screenshot of the result at the escalation end.

Summary

A special error subprocess can intercept an unexpected error using an Exception Start Event. After interception, various processing steps can be implemented. For instance, it is appropriate to store process values or message content following an error. Also, informing the sender about the error can also be configured.

Create an Exception Process

Business Scenario

We will now add error handling to intercept unexpected errors, which is necessary for every OData call since the connection may not be established from time to time. To achieve this, we apply our own Exception Subprocess.

Task Flow

In this exercise, you will perform the following steps in one task:

  1. Log on to the integration flow DelayedDelivery_Process.
  2. Create and configure an Exception Subprocess.
  3. Learn more about the Exception Subprocess.

Prerequisites

A subprocess to handle exceptions should be added by you.

Outcome After This Exercise

You have implemented an Exception Subprocess that handles errors in your integration flow.

The graphic shows the integration flow process with the Exception Subprocess element highlighted in red.

What Do You Learn Within This Exercise?

Learn to create and use an Exception Subprocess.

Task 1: Create an Exception Process

Steps

  1. Log on to the integration flow DelayedDelivery_Process via Integration Suite.

    1. Navigate within the Integration Suite Welcome page toDesignIntegrationsDelayedDelivery_Process_Package_CLD900_Date_NumberDelayedDelivery_Process_Number.

    2. Following the status after the last exercise step.

      Screenshot of the last exercise.
    3. Imagine that the integration flow has been further edited.

  2. Create and configure an Exception Subprocess component.

    1. Choose ProcessException Subprocess.

      Choose Exception Subprocess.
    2. Ensure that there is enough space in the swim lane to accommodate the subprocess before placing it in a free area.

      Rename to Exception Subprocess.
    3. Rename it to Exception Subprocess.

    4. The subprocess is traversed in case of an error, but no actions are taken based on it.

  3. Learn more about the Exception Subprocess.

    1. Go back to the Design view of your iflow. Navigate to Exception Subprocess, open the configuration bar of the Exception Subprocess component, and choose the question mark symbol.

Log in to track your progress & complete quizzes