Skip to Content
Author's profile photo Shabarish Nair

Integration Centric Process – Advanced Exception Handling in BPM

The blog Integration Centric Process – Exception Handling in BPM would have helped set a context around handling exceptions within your Integration centric process. In this blog, we will take the Exception handling to the next level in an attempt to model a comprehensive solution and a Integration centric process that is highly supportable.

Note: To maintain continuity, we will extend the Process Model that was defined in the earlier blog.

Adding a Notification

We can introduce a simple notification step within our process. This will be helpful to trigger email notifications to the business process owner, Process Admin or the Application Maintenance team so that they can take the required follow up action.

On the introduction of the Notification step, the process will look as below;

notificationonly24nov.JPG

You can configure the properties of the notification step to create an email. There is a concept of ‘variable’ that you can define. These variables can then be referenced as part of the Mail Subject or/and Body.

In our case, I decided to use the fields from the input file (FName, LName and Age), the Process instance id along with the actual exception details, to be embedded into the Email.

In the below screenshot, you can find the Notification step (Notify by Email) properties. The variables once added can be assigned an Expression and I have chosen the corresponding context objects from the expression editor. These variables once defined, can be referenced in the email subject/body using the curly braces i.e {} as shown below;

notpropertiesfirstnov24.JPG.

Upon the execution of the process (with an erroneous file), you will find an ‘alert’ email in your inbox as below;

notemailfirst24nov.JPG

The highlighted (orange boxes) are values of the variables at runtime, populated during the execution of the process.

Implement Retries for a failed Step

Even though notifications help better the overall maintainability of the process, what would be much more optimum for some business processes, is the ability to retry some of its failed steps.

Take the example of an automated activity that makes a webservice call to an external application. It is quite possible that due to the network traffic during the time of the execution of the call, the webservice could timeout. Instead of ending the process then and there, if we could implement a retry logic, then it would help continue the process and give it a better chance of a successful completion.

Lets us try and extend the above process model and implement a retry step for our automated activity.

Note: The automated activity in the process we have is making a mapping call into PI. So this might not be an ideal use case for retry. But the idea here is to demonstrate this as a strategy so that you can implement it in other processes where it finds a use.

The process is extended further as below;

advBPMfull.JPG

If I can try to describe it, what we are trying to achieve is to implement a retry feature by checking the value of a data object (Retry_Num). The Data Object is initialized as 0 during the start of the process and when an exception occurs we increment it by 1. The exclusive choice will then check the value of Retry_Num. If it is less than 4, then we route the flow back to the automated activity. A notification is also triggered that informs that an exception has occurred and the step is being re-triggered.

So in short, in case of exceptions, the automated step PI_Mapping, instead of proceeding to end the process now attempts retries (a maximum of 3 times) in our particular process.

Properties of Intermediate Timer;

retrycheck.JPG

waiting24nov14.JPG

Properties of Exclusive choice step;

retrycheck.JPG

Mapping to increment the Data object;

outputmapincrement24nov14.JPG

Properties of Notification Step;

notretry24nov14.JPG

On testing with an erroneous file, you will find emails in the below order informing of the exception, the retry events and the final exception handling.

Mail for the first retry attempt;

exp1nov24.JPG

Mail for the second retry attempt;

exp2nov24.JPG

Mail for the third and final retry attempt;

exp3nov24.JPG

Exception handled and the notification is triggered;

exp4nov24.JPG

With this, hope you now have options to make your Integration Centric Processes much more supportable.

Reference:

INT361 : Error Handling in BPM-Based Processes Using SAP Process Orchestration

Assigned Tags

      5 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Eng Swee Yeoh
      Eng Swee Yeoh

      Hi Shabarish

      This is such an excellent blog covering the advanced technique of error handling in NW BPM.

      I implemented the loopback retry mechanism but hit the following error at first at the increment Retry counter step.

      bpm retry counter error.png

      I kinda guessed that maybe the retry counter was not initialized (I had assumed that it would have been automatically initialized by the process.)

      Your blog doesn't explicitly show if initialization of the counter is required, so I'm not sure if I have missed something or not.

      Anyway, since there is no direct way to assign a constant in NW BPM (you would have expected to be able to do that!), I added the following mapping on my starting step to initialize retry counter to 0.

      initRetry.png

      Also another observation during my development. One of my automated activity step involved sending a synchronous message out to PI. If there is a fault message defined for the service interface, it can also be added as the boundary event to capture the return fault message.

      /wp-content/uploads/2015/01/fault_629538.png

      Overall, thanks for your series on Integration Centric BPM. Your blogs and William Li's article have definitely helped me shorten the learning curve as I move from ccBPM in the dual stack environment into PO.

      Rgds

      Eng Swee

      Author's profile photo Dinesh Chandra
      Dinesh Chandra

      Hi Eng,

      You can initialize the RetryCount var of DataObject on double click to the varable and pop-up screen will open.Put 0 value and "Ok"

      Regards,

      Dinesh Chandra

      Author's profile photo Eng Swee Yeoh
      Eng Swee Yeoh

      I've been so used to PI's graphical mapping where I need to use a Constant function to assign a constant value so initially I couldn't find a similar function in NW BPM. Eventually I did figure that out 😳

      Thanks for giving that tip anyway, Dinesh. Hopefully it might help someone else from PI background starting up in NW BPM who stumbles upon this in the future 🙂

      Author's profile photo Rajesh PS
      Rajesh PS

       

       

      Kindly let me know your thoughts on the below thread?

       

      https://answers.sap.com/questions/13153025/index-out-of-bounds-exception-in-bpm.html

      Can this be handled at embedded sub process level instead ate very automated activity.?

       

      Thanks,

      Rajesh PS

      Author's profile photo Rajesh PS
      Rajesh PS

       

       

      Kindly let me know your thoughts on the below thread?

       

      https://answers.sap.com/questions/13153025/index-out-of-bounds-exception-in-bpm.html

       

      Thanks,

      Rajesh PS