How to use BAM connectors
  • Updated on 24 Jun 2019
  • 3 minutes to read
  • Contributors
  • Print
  • Share
  • Dark
    Light

How to use BAM connectors

  • 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

Getting the BAM Connectors in your Azure subscription

This repository will deploy the Serverless360 custom connector to your Azure Subscription.

This is just a temporary way of deploying the connectors until we get it published in Azure Marketplace.

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.

image.png

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.

image.png

You can enter a friendly name for the connection along with paste the copied key in the API key section.

Instrumenting in OrderValidation Logic App

The first stage in the transaction processing is OrderValidation. We will have to use Serverless360 BAM connectors to log the activitis.
Search and find the BAM connector from the Custom category as below.
find_BAM

The start activity and update activity connectors will be used at the begining and end of the validation logic inside the logic app as shown below.
image.png

We have predefined the Business Process and Transaction by declaring a variable, since it makes configuration easier.
image.png

Start Activity

The start activity connector initiates a stage and logs the time at which the stage is started. Hence the stage will be in the beginning of a logic . In the start activity connector, configure following properties. These properties are the same as the ones which were defined in business process configuration.

image.png

The start activity connector returns two fields in its response. MainActivityId and the StageActivityId. The MainActivityId is a correlation id for the complete transaction. It will be used for the stages further in the flow. StageActivityId is specific to stage and will be used in Update Activity Connector.

Update Activity

The update Activity connector is responsible for updating the status of the transaction. Apart from this it also collects all the configured Global and tracked proeprties based on stage configuration.

image.png

The MiainActivityId and StageActivityId will be the values returned from the StartActivity connector. Once the update activity is executed, it indicates the completion of the stage and the Status flag decides if it was successful or not. In this scenario the flow is successful.

Log Exception Activity

This connector creates an exception object correlating the stage using StageActivityId from the StartActivity connector and creates an event in the Event Hub with the object data. This connector can be invoked for any business or system exception that you would want to capture.

  • StageActivityId - StageActivityId from the previous action output
  • ExceptionMessage - Message that you want to log
  • ExceptionCode -Some unique identifier or code that you want to associate with the exception type

image.png

Archive Activity

To archive a message pass the message in the similar format to StartActivity with the below mandatory headers.

image.png

  • SL360-BusinessProcess: Name of the Business Process
  • SL360-StageActivityId - StageActivityId from the response of StartActivity.
  • SL360-BusinessTransaction: Name of the Business Transaction
  • SL360-CurrentStage: Current Stage under execution

You can also Archive the message within the Start / Update Activities setting the AS-ArchiveMessage to True in the headers for those activities.

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?