Вы находитесь на странице: 1из 15

1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

Community

Ask a Question Write a Blog Post Login

Sujit Hemachandran
January 12, 2015 2 minute read

Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration)


Follow RSS feed Like

12 Likes 10,769 Views 14 Comments

Hello Integrators!

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

What is Exception Handling?

 
https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 1/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

On a technical de nition, 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 speci c 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 prede ned place and switching the execution to a speci c 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 ows. To add an exception sub-process to the integration ow, 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 ow.

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 2/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

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

How does the Exception sub-process work?

Consider the integration ow that we just saw: A SOAP sender sends messages to the integration ow (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.

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 3/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

Observe the following:

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

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

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 4/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

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.

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 5/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

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

Example – the sample integration ow we just saw has been modi ed to to send the exceptions to an SFTP location –

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

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 6/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

Best Regards,

Sujit

Alert Moderator

Assigned tags

SAP Cloud Platform Integration for process services | cloud integration | exception handling | exception subprocess | hci |

View more...

Related Blog Posts

Dev 10 Blog: Ten Developer Blogs on SAP Cloud Platform Integration (f.k.a HCI)
By Sujit Hemachandran , Nov 28, 2014
Landscape components of SAP Cloud Platform Integration
By Sujit Hemachandran , Jan 13, 2015
What's New in SAP Cloud Platform Integration Webinar Series
By Anette Asmus , May 08, 2017

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 7/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

Related Questions

S/4 HANA-Ariba Integration


By Prakashbabu Jaganathan , Mar 06, 2018

SAP ERP with Ariba on-demand Integration


By Anna Janas , Mar 06, 2019
SAP Hana SDI Vs SAP CPI
By Aravind Pasupuleti , Jan 02, 2019

14 Comments

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

Che Eky

January 12, 2015 at 4:28 pm

Very good to know. Thanks for sharing

Like (0)

Sujit Hemachandran | Post author

January 13, 2015 at 4:34 pm

Hi Che,

Thanks for the nice comment.

 
https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 8/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

Best Regards,

Sujit

Like (1)

Former Member

January 14, 2015 at 2:26 am

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 ow ?

Thanks Again

Rajesh

Like (0)

Former Member

January 28, 2015 at 11:58 am

Hello Rajesh,

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

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 9/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

Also I do not think it is possible to continue alternate processing ow 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

Like (0)

Former Member

January 20, 2015 at 6:35 pm

Thank you Sujit for the detailed information.

Like (0)

debasis mohapatra

September 14, 2016 at 9:10 am

Really really helpful as i am starting with HCI.

Regards,

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 10/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

Debasis

Like (0)

Devaraj R

June 10, 2017 at 7:47 pm

Hello Sujit and Everyone,

We have requirement as below.

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

Any other ways to con gure this Exception sub process in common place/integration in HCI tenant and accessing this in all these integrations, instead of
con guring 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

Like (0)

Former Member

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 11/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

November 2, 2017 at 3:30 pm

Hi Devaraj,

Did you get any solution for the above requirement. I have same requirement.

Thanks & Regards

Like (0)

Former Member

September 7, 2017 at 9:59 am

What about handling an error and continuing the process?

We process multiple records in one i ow 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 ?

Like (3)

Daniel Weinberg (DUSER)

March 8, 2018 at 11:58 am

Did you solve this? I am facing the exact same issue and do not ne a solution to it. Especially, because a gather step does raise an exception as well (some
XML Parsing error).
https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 12/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

Like (0)

Former Member

March 12, 2018 at 3:37 pm

We used below solution to handle this issue:

So we have main ow (MF) which calls Target system (TS) multiple times (using general splitter). We’ve created additional ow (AF) in HCI which is used only
for calling TS. So E2E it looks like:

MF -> AF -> TS

Now, whenever TS returns an error, AF catches this error in Exception Subprocess and prepare nice response for MF. Something like:

<AFresponse>
<status>ERROR</status>
<description>${exception.message}</description>
</AFresponse>

MF checks status node and in case of ERROR we have router to send an email. If status is SUCCESS we’re continuing processing other records.

Hope that helps!

Like (3)

Daniel Weinberg (DUSER)

March 14, 2018 at 8:30 am

Thank your for your feedback I will give this a try.

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 13/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

Like (0)

Former Member

May 17, 2018 at 6:00 pm

Hi Daniel,

Did you solve this? I still didn’t get the last part of Pawel’s explanation.

Like (0)

J. Evertse

January 3, 2019 at 9:32 am

Anyone had a situation where the exception.detail is not available? And tried to add a router condition to check for this, like ${exception.detail} = null ?

Like (0)

Find us on

Privacy Terms of Use

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 14/15
1/28/2020 Blog 4: Modelling Exceptions in Integration Flows (SAP Cloud Platform Integration) | SAP Blogs

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

https://blogs.sap.com/2015/01/12/blog-4-modelling-exceptions-in-integration-flows-hci-pi/ 15/15

Вам также может понравиться