Custom Connectors
  • 31 Mar 2022
  • 7 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Custom Connectors

  • Dark
    Light
  • PDF

Introduction

A Custom Connector allows users to easily plug in their Connector to Azure Logic Apps or Power Automate.

Users can make use of dynamic content by using Open API, which allows them to populate input attributes/parameters as well as leverage outbound attributes in downstream activities.

Deploy a Custom Connector

In Serverless360 Business Activity Monitoring (BAM), a Custom Connector can be deployed in two ways:

  • Users can provide Subscription information and deploy a pre-configured Connector in the specified Resource Group by selecting the Deploy Custom Connector option from the Actions dropdown on the Business Process homepage.

Deploy custom connector blade.png

  • Users can also manually configure the Custom Connector by creating it and importing the Swagger file (download it from Actions dropdown -> BAM Connection details -> download swagger).

Download swagger.png

Custom Connector and Logic Apps

  • Users who are familiar with Azure Logic Apps will have created Orchestration flow using the Designer View.

  • It will be created by the user using an Action.

  • Facebook, Outlook, Twitter, and other social media sites are examples of connectors.

  • This connector allows customers to track data from their business logic into Serverless360 Business Activity Monitoring (BAM).

  • When users deploy the connection to a subscription, for example, Test, the connector will be available exclusively within the subscription Test.

  • If users have deployed the connector in a specific region, such as Central America, the Logic Apps that use the connector should be in the same region as well.

Accessing Connectors

  • Once users have created a Business Process in the Serverless360 portal, navigate to Actions-> BAM Connection Details to obtain the Host API KEY, Host URL from there.

BAM Connection details.png

Instrumenting Logic App

Business Activity Monitoring (BAM) connectors in Serverless360 can be used to instrument the business process in Azure Logic Apps.

The steps to be followed are:

Step 1: Navigate to the Azure portal and create a Logic app custom connector.

Step 2: Import the downloaded JSON file

The Host URL will be filled in during the import process.

Host Section.png

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, archive the message, and complete the transaction using this connector.

Start Transaction.png

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 the 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.

SL360-IsTransactionComplete and SL360-ArchiveMessage

IsTransactionComplete and SL360-ArchiveMessage.png

  • 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 Exception in the Stage

  • Exception Code: Error code of the Exception
    Logging Exception.png

Correlation between Logic Apps

In some business cases, there might be ASYNC flows that are going outside the organization. Typically users would like to correlate a functional response to their initial outbound request. When the response is async with the request, users frequently lose the opportunity to retrieve the TransactionInstanceId. To handle this, users are provided with a method to 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 use this, the user must first ensure that the function parameter is tracked as a property in the first flow using standard checkpoint connectors. When the order response is received (without the TransactionInstanceId off course) users can make use of the Checkpoint with Correlation connector.

Here, the user needs to provide the functional correlation property, for example, the order number.

Below are the parameters that need to be provided:

  • Property Name: Name of the Correlation property.

  • Property Value: Value of the Correlation property - Unique value.

The runtime will perform a lookup before processing this event:
"Look for TransactionInstanceId where the specified property name has a value equal to the specified property value."

There are 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

  • Enabling this parameter causes a checkpoint to look for the previous stage's flag. If it cannot locate the previous stage with the flag, it will ignore the transaction after several retries.

Ignore Not Found.png

Custom Connector and Power Automate

  • Users who are familiar with Power Automate will have created Orchestration flow using the Designer View.

  • It will be created by the user using an Action.

  • Facebook, Outlook, Twitter, and other social media sites are examples of connectors.

  • This connector allows customers to track data from their business logic into Serverless360 Business Activity Monitoring (BAM).

Instrumenting Power Automate

Business Activity Monitoring (BAM) connectors in Serverless360 can be used to instrument the business process in Azure Power Automate.

The steps to be followed are as below:

Step 1: Navigate to the Microsoft Flow portal.

Step 2: Create a Custom Connector under the Data section.

Step 3: Import the downloaded JSON file.
The Host URL will be filled in during the import process.

Host Section.png

Custom connector API Key.png

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, archive the message and complete the transaction using this connector.

Start transaction.png

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 the 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

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 Exception in the stage.

  • Exception Code: Error code of the Exception.

Correlation between Power Automate

In some business cases, there might be ASYNC flows that are going outside the organization. Typically users would like to correlate a functional response to their initial outbound request. When the response is async with the request, users frequently lose the opportunity to retrieve the TransactionInstanceId. To handle this, users are provided with a method to 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 use this, the user must first ensure that the function parameter is tracked as a property in the first flow using standard checkpoint connectors. When the order response is received (without the TransactionInstanceId off course) users can make use of the Checkpoint with Correlation connector.

Here the user needs to provide the functional correlation property, for example, the order number.

Below are the parameters that need to be provided:

  • Property Name: Name of the Correlation property.

  • Property Value: Value of the Correlation property - Unique value.

The runtime will perform a lookup before processing this event:
"Look for TransactionInstanceId where the specified property name has a value equal to the specified property value."

There are 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

  • Enabling this parameter causes a checkpoint to look for the previous stage's flag. If it cannot locate the previous stage with the flag, it will ignore the transaction after several retries.

Checkpoint with correlation power automate.png


Was this article helpful?

What's Next