Handling Exceptions in Logic Apps using Atomic Scope | Blogs

Handling Exceptions in Logic Apps using Atomic Scope

Nikhil Tayal

Author

Category: Atomic Scope

Posted: March 14, 2018

We recently launched Atomic Scope, our latest product in the Integration space, that provides complete solution for end-to-end business functional monitoring and tracking. One of the cool features we have in Atomic Scope is the handling exceptions during run-time and show them in an integrated manner within the portal.

In this article, I’ll talk about how a business can leverage Atomic Scope to capture the exceptions in Azure Logic Apps and view the same in the context of message flow.

Overview

A business workflow may have one or more business rules that need to be executed to validate the message content as per business policies. In case of Azure Logic Apps, these business rules might be implemented either in custom components like Azure Functions, by calling an external library, or by simple use of conditions in the Logic App. Regardless of where the business rules are executed, there is a need to raise an exception when one or more rules fail.

With Atomic Scope, logging such business exceptions is easy with the Log Exception custom connector that is shipped with the product.

Scenario

Consider a scenario where we are processing purchase orders. A simple business rule is to check if the quantity in the purchase order is a positive integer and within permissible range. The message is generated by an application and posted to Logic App where this business rule is evaluated. Only if the quantity in the message is within the given range, the message should be processed further. Else the message processing should be terminated after logging an appropriate exception.

atomic-scope-webinar-cta

How it works

For illustration, I’m simply checking if the quantity provided in the purchase order is greater than zero or not. If the rule passes, the message is posted to blob for further processing, else an exception is logged. Below snapshot shows how this can easily be achieved with Atomic Scope.

Atomic Scope Logic App Connector

Above is a sample Logic App that receives the message from an application. The Logic App calls the Start Activity and Update Activity using Atomic Scope custom connectors. This will ensure that configured properties are tracked. Next, we check for the condition and create a blob entry if the condition evaluates to true; otherwise log an exception using the Log Exception Activity connector.

Now if there is a message with negative value for the quantity field, an exception would be logged and shown in the Atomic Scope portal as shown below.

Atomic Scope Business Activity Tracking

Conclusion

With the Atomic Scope Log Exception custom connector, it is very easy to log exceptions for business rules violation and view them in the context of message flow within Atomic Scope. I have shown a simple scenario for business rule violation, and the same process can be used for logging system exceptions.

The product is shipped with SDK which includes above scenario. You can try it out yourself by requesting a 30-day free trial of the product.

Get Started Atomic Scope 30-day Free Trial
Author: Nikhil Tayal

Nikhil Tayal has been working with product companies for last 18+ years, including Microsoft, creating software and services around Enterprise Integration leveraging BizTalk Server and Azure Logic Apps. Currently he is Senior Director at BizTalk360.