Use BAM in a Logic Apps
  • 06 Nov 2020
  • 4 Minutes To Read
  • Contributors
  • Print
  • Share
  • Dark
    Light

Use BAM in a Logic Apps

  • Print
  • Share
  • Dark
    Light

If you are familiar with Azure Logic Apps you must've used the designer view to create your own Orchestrations. To create it you will be using an Action. An action or otherwise known as connector, eg : Facebook, Outlook, Twitter etc.. To enable users to track data from their Business Logic into Serverless360 BAM we provide this connector, download the BAM connector here.

Getting the BAM Connectors in your Azure subscription

Important points to note

  • If you are deploying the connector to Subscription "Test", the connector will be available inside the Subscription "Test" only.
  • If you have deployed the connector in Region "Central US", the Logic Apps which needs the connector to be used should also be in the same region.

Authenticating BAM Connectors

Once you have created a Business Process in the Serverless360 portal, navigate to Settings -> Access Keys you can switch to the BAM Connector APIKEY tab and obtain the API KEY from there.

Copy that key and navigate to Azure portal and when you first add an action you will need to create and Authenticate the API connection using the API KEY.

bamconnectorkey

You can enter a friendly name for the connection name and enter the API key obtained in the API key section.

Instrumenting the Logic App

BAM connectors in Serverless360 can be used to instrument the Business process in Azure Logic Apps.
Search and find the Serverless360 BAM connector from the Standard category as below.

BAM in search

Start Transaction Connector

The Start Transaction connector initiates the transaction in a Business Process. This Connector also acts as a starting stage of the Transaction. It is also possible to log the exception, archieve the message and complete the transaction using this connector.

Start Transaction

The Start Transaction connector returns three fields in its response. TransactionInstanceId, StageInstanceId and Result. The TransactionInstanceId is a correlation id for the complete transaction. It will be used for the stages further in the flow. StageInstanceId will be used to update the stage in a Transaction . As a result the Message will denote whether Transaction is completed

Checkpoint Connector

The Checkpoint connector is responsible for updating the status of the stages and transactions. This Connector can also archive the message flowing through the Stage. Apart from this it also collects all the configured Global and tracked properties based on stage configuration. Below are the required parameters that are mandatory to provide:

SL360-TransactionInstanceId: Correlation ID for the complete Transaction
SL360-Stage: Name of the Stage
SL360-StageStatus: Status of the Stage (Success, InProgress, Failure)

It is also possible to complete the transaction and archive the message with the parameters,
SL360-IsTransactionComplete and SL360-ArchiveMessage

Checkpoint Transaction

This connector will also return the TransactionInstanceId, StageInstanceId and Result as Start Transaction Connector.

Logging Exception

This Checkpoint connector can also be used to log the exception in a stage. There are two parameters in this connector that can be used to log an Exception

Exception Message: The Actual reason or message for the Exeception in the Stage
Exception Code: Error code of the Exception

Checkpoint Transaction with Exception

Correlation between the Logic Apps

In some business cases we do have ASYNC flows that are going outside the organisation. Typically we do want to correlate a functional response to our initial outbound request. When we do have the case where this response is async with the request we often do not have the chance to retrieve the TransactionInstanceId anymore. To be able to handle this, we do have a way where you can have the correlation based on functional properties. For example: correlate the incoming order response to the outgoing order based on the order reference. This is possible using the Checkpoint with Correlation connector.
To be able to use this, user needs to make sure that the functional parameter is tracked as a property in the first flow by using the normal checkpoint connectors. When the order response is received (without the TransactionInstanceId off course) we can make use of the Checkpoint with Correlation connector.
Here the user need to provide the functional correlation property, for example the order number.
Below are the parameters that needs to be provided:

Property Name: Name of the Correlation property
Property Value: Value of the Correlation property - Unique value

When the runtime will process this event, it will first do a lookup. "Search for TransactionInstanceId where property with the specified propertyname has a value equal to the specified property value"
3 possible outcomes for this query:
0 results found -> runtime will create a new Transaction Instance.
1 result found -> runtime will update this transaction with the new stage as configured
multiple results found -> runtime will take the most recent one and update that one with a new stage

SL360-IgnoreNotFound - By Enabling this parameter, checkpoint will check for the flag of previous stage. If it does not find previous stage with the flag, It will automatically Ignore the transaction after several retries.
Checkpoint with Correlation(1)

We'd love to hear your thoughts
Please visit our feedback system to suggest new Features or Enhancements. You can also take a look at our Roadmap
Was This Article Helpful?