Skip to Content
Personal Insights
Author's profile photo Suresh Gunji

How to create Exception Sub Process for i-Flow in SAP CPI

Introduction:

In this blog post I will take you through how to create Exception Sub Process for developed i-Flow in SAP CPI. I am sharing my inputs which I had gone through while I was developing the i-Flow.

Exception Sub Process:

If any error occurs in developed i-flow this Exception Sub-Process will generate an email and will send it to the required stakeholders which we will configure in MAIL adapter. So, that Support/Monitoring team will get an alert mail then they will look into the issue and will rectify that error.

Let’s consider that you have the below i-Flow named Exception_SubProcess. In that we should create an Exception Sub process. So, that if any exception/error occurs in that flow it will send an alert mail to Support team.

Below is the Exception Sub Process. To create this in i-Flow go to Pallets ->> Process ->> Exception Sub Process. It will look like below.

Then, Delete End Pallet and add Error End Pallet in place of that. Because End pallet will end the message whereas Error End Pallet sends continuous alert mail to support team.

After this go to Pallets ->> Transformation ->> Content Modifier and add it to the Exception Sub Process.

In this Content Modifier we need to declare variables in the message header or exchange property and body which we will get in alert mail.

I’m declaring in Exchange Property as shown below

 

Then we need to write the below message in Message Body as shown below

Hello Team,

Message has been failed with below error:

Error detail: ${exception.message}

Correlation ID: ${header.SAP_MplCorrelationId}

Message ID: ${property.SAP_MessageProcessingLogID}

Iflow Name: ${camelId}

Date: ${date:now:dd-MM-yyyy HH:mm} / SAP CPI – Tenant Number: ${property.SystemName}

Thanks & Regards,

SAP CPI Team

 

 

After this again go to Pallets ->> Call ->> External Call ->> Send and add it to the flow. This Send request is used to configure a service call to the receiver system.

Again go to Pallets ->> Participant ->> Receiver add this Receiver to the flow and connect this with Send request by using MAIL adapter

 

Configure the Mail adapter as below

 

With this we have competed creating Exception Sub Process. After deploying this i-Flow if any error occurred it will send an alert mail like below.

Note: I wontedly kept some error in this i-Flow to show the alert mail as below.

Conclusion:

So, to conclude this blog post helps you in creating the Exception Sub Process for i-Flow in SAP CPI.

If you have any queries please feel free to ask your question in comments. I would request everyone to provide your feedback and like if this blog post finds helpful for you. Please do follow me for similar content to learn more about CPI

Also, please check out this link https://blogs.sap.com/tags/67837800100800006801/ to get more in depth knowledge on CPI.

Thanks & Regards,

Suresh

 

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Saravanan Subramanian
      Saravanan Subramanian

      Thanks for the detailed post Suresh Gunji.

      Author's profile photo Avinash Paul
      Avinash Paul

      Thank you Suresh for the insights I tried and it's working.

      Author's profile photo Antonio Maradiaga
      Antonio Maradiaga

      Hi Suresh Gunji ,

      Great blog post! I see that you mention CPI (SAP Cloud Integration) in your blog post. Would you mind updating this with their current name? This will greatly help other community members who might not be familiar with the old names of the current products.

      Thanks,

      .A