Skip to Content

Hello Integrators!

 

In this blog, I shall explain how to model exceptions in Integration Flows.

 

What is Exception Handling?

 

On a technical definition, exception handling is the process of responding to the occurrence, during message processing, of exceptions. There exists scenarios where you want to control the exception process. For example, during a message processing you want to log all the exceptions in a specific location or server; or you want to modify the exception message sent back to the receiver; and so on.

 

An exception is handled by saving the current state of execution in a predefined place and switching the execution to a specific subroutine known as an exception sub-process. Exceptions can occur during any of the message processing step – Mapping execution error, Content Routing error, and so on.

 

How To Model Exception Handling in SAP Cloud Platform Integration?

 

You model exceptions as a sub-process in the integration flows. To add an exception sub-process to the integration flow, choose Exception Subprocess from the palette. And drop the sub-process into the integration process. Note: The sub-process should not be connected to any of the elements of the integration flow.

 

Exception_Palette.JPG IntegrationFlow_Exception_eg.JPG

 

In the Integration flow above, when any exception occurs in the message processing – the sub-process is executed.

 

How does the Exception sub-process work?

 

Consider the integration flow that we just saw: A SOAP sender sends messages to the integration flow (It is designed to fail at the mapping!) . When an exception occurs in the message processing – the sub-process is called. In the sub-process, we modify the details of the fault message.

 

Content_Modifier_Message.png

Observe the following:

  1. We have included the following tag ${exception.message} in the Content Modifier step.
  2. We have used Message End in the exception sub-process.

Message_End_event.JPG.png

So – when we send a SOAP message, we get the following response:

Message_end_payload.png

Again, observe the following:

  • The response comes in the SOAP Body
  • You can get more details on exception using ${exception.message} or ${exception.stacktrace} elements.

 

If I change the End Message to an Error End, the response structure shall change. The exception shall go as part of the SOAP fault message.

 

Error_end_payload.png

Optionally, you can choose to send the exception message to another endpoint.

Example – the sample integration flow we just saw has been modified to to send the exceptions to an SFTP location –

Exception_Folder.JPG

That is all for the exception sub-process! Try it out, and let us know if you have any questions.

 

Best Regards,

Sujit

To report this post you need to login first.

8 Comments

You must be Logged on to comment or reply to a post.

  1. Rajesh pasupula

    Hi Sujit – If I want to have multiple exception blogs on particular pipeline step is that possible if so how to invoke the appropriate exception block in that case ?

     

    Also is it possible to catch the exception and continue the remaining process/pipeline steps in the process flow ?

     

    Thanks Again

    Rajesh

    (0) 
    1. diptee s

      Hello Rajesh,

       

      You can try using the gateway step to check the exception details and handle it differently in one single exception handler, as it is not possible to add more than one exception handler to an iFlow.

       

      Also I do not think it is possible to continue alternate processing flow in case of an exception, you may try adding the required processing steps inside the exception handler itself and see if it works for you.

       

       

      Regards,

      Diptee

      (0) 
  2. Devaraj R

    Hello Sujit and Everyone,

    We have requirement as below.

    we have around 60+ integrations in our tenant and mail notification should be triggered immediately to our support mail box when each message failure occurring in HCI for all these integrations.

    Any other ways to configure this Exception sub process in common place/integration in HCI tenant and accessing this in all these integrations, instead of configuring this Exception sub process explicitly in all these 60+ integrations.?

    Plz let me know if any other solutions as well if it will work out here.

     

    Regards,

    Deva

     

    (0) 
  3. Bogumil Laska

    What about handling an error and continuing the process?

    We process multiple records in one iflow using a general splitter – however some of them may fail in the target system.

    If I catch an exception returned by the target system (soapfault) in my exception subprocess I have to end it with either End Message or Error End – which in both cases will stop further processing! And I do not want that – I want to send an email from within the exception subprocess and move on to the next item in my splitter – is that not possible in HCI ?

    (1) 

Leave a Reply