Checkpoint
  • 19 Nov 2024
  • 4 Minutes to read
  • Dark
    Light
  • PDF

Checkpoint

  • Dark
    Light
  • PDF

Article summary

Checkpoint events

  • Once users have defined Business Activity Monitoring (BAM) model for their transactions, the next step is instrumenting solution to tell Business Activity Monitoring (BAM) about the checkpoint events that indicate stages are being executed.

  • In modern cloud solutions, users will often be composing services together to achieve the desired solution. With Business Activity Monitoring, the user can tell us about the Checkpoint events and how they correlate from many different services as shown in the below diagram:

Check Point.png

  • The mapping of Checkpoint events to the Business Activity Monitoring (BAM) solution will then allow users to see what is happening about the business view of operations.

Checkpoints

  • A Checkpoint is where the technical view meets the business view. In the user's solution, they would implement a checkpoint to tell Business Activity Monitoring (BAM) that an event related to a stage has happened.

  • As an example, a user might execute a checkpoint that will update a shape in the transaction to show that a stage has been executed, a stage is in progress or a stage has failed.

  • Using the Turbo360 connectors or API, the user could tell Business Activity Monitoring that a checkpoint has occurred in a component such as a Logic App, a Flow in Power Automate, a Function, and many other choices. This would update the associated instance of a transaction to indicate that the transaction has executed a stage and can progress to the next stage.

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:

  • BAM-TransactionInstanceId: Correlation ID for the complete Transaction.

  • BAM-Stage: Name of the Stage.

  • BAM-StageStatus: Status of the Stage (Success, InProgress, Failure).

It is also possible to complete the transaction and archive the message with the parameters,

BAM-IsTransactionComplete and BAM-ArchiveMessage

Checkpoint-2.png

Checkpoint with Correlation

  • This API can be used to track and correlate a checkpoint stage in a business process transaction instance.

  • This endpoint should be used if the business process transaction is distributed across various environments.

  • If the properties are not identified, the checkpoint with correlation turns into a Start Transaction. When the IgnoreNotFound property is set to True and the properties do not match, the transaction instances will be ignored.

Endpoint Suffix

Suffix : /CheckPointWithCorrelation
Method : POST
Ex: https://< function-app-endpoint> /api/CheckPointWithCorrelation?code= < API Key >

Request body format

{
    "messageBody":{Actual message body},
    "messageHeader":{Additional custom headers},
    "property":[
        {
            Name:"< Name of the Tracked Correlation property >",
            Value :"< Unique value of the Tracked Correlation property >"
        },
    ]
}

Response body format

{
    "TransactionInstanceId":{Unique Id}, // will be used in the upcoming checkpoints
    "StageInstanceId":{Unique Id},
    "Result":"Success or Error message"
}

Request Headers

HeaderDescription
BAM-BusinessProcessRequired. Tracking Name of the Business Process
BAM-TransactionRequired. Tracking Name of the Business Process Transaction
BAM-TransactionInstanceIdTransaction instance Id of a Business Process transaction
BAM-StageRequired. Tracking Name of a Stage in a transaction
BAM-ArchiveMessageArchive the tracked message body
BAM-StageStatusRequired. Status of the stage (Success, Failure, InProgress)
BAM-BatchIdUnique Id to correlate batch of transactions
BAM-isBatchedRequired if a Transaction must take on the role of a Parent.
BAM-ExceptionRequired if BAM-ExceptionCode is given. Exception Message
BAM-ExceptionCodeRequired if BAM-Exception is given. Exception code
BAM-IsTransactionCompleteRequired if the checkpoint is tracking the last stage. Mark a Business Process transaction as complete.

Instrument Business Process

To instrument the business process, the user must make some changes in their existing business process. But to make the user feel the experience more easily, the user can run the scripts given below in their Azure Cloud Shell and deploy resources to the required subscription:

  1. Open the Azure portal.

  2. Create a new resource group if the user wants to deploy the resource in a new resource group. This step can be skipped if user want to deploy the resources in an existing resource group.

  3. Click on the Cloud Shell icon from the Azure portal.

Cloud Shell.png

  1. Run the following Powershell scripts.
$subscriptionId = Read-Host -Prompt "Enter the Subscription ID"
$resourceGroupName = Read-Host -Prompt "Enter the Resource Group name" 
$bamEndpoint = Read-Host -Prompt "Enter the BAM API Endpoint"
$apiKey = Read-Host -Prompt "Enter the BAM API Key"
$secureString = ConvertTo-SecureString $apiKey –asplaintext –force

New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName ` -SubscriptionID $subscriptionId ` -BAMEndpoint $bamEndpoint -TemplateUri https://raw.githubusercontent.com/Turbo360/turbo360-bam-lib/master/Kovai.Turbo360.Sample/BamCustomConnector.json

New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName ` -SubscriptionID $subscriptionId ` -APIKey $secureString -TemplateUri https://raw.githubusercontent.com/Turbo360/turbo360-bam-lib/master/Kovai.Turbo360.Sample/BamConnection.json

New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName ` -SubscriptionID $subscriptionId ` -TemplateUri https://raw.githubusercontent.com/Turbo360/turbo360-bam-lib/master/Kovai.Turbo360.Sample/BamLogicApp.json

  1. Business Activity Monitoring (BAM) API Endpoint and Key can be found in the Turbo360 portal by navigating to Configuration -> Connection details.

checkpoint.png

While executing the scripts, check the value of the ProvisioningState. The State of Provisioning state should be Succeeded.

ProvisioningState: Succeeded

  1. After provisioning the resources, go to the appropriate resource group where the user can find the deployed resources.

Resource Group

  1. Now get the HTTP endpoint from the HTTP Request connector and trigger it with the below given JSON body:

HTTP endpoint.png

{
"Topic": "BAM_Testing",
"UserId": "t360_u001475",
"DriverId": "t360_d0058962",
"DriverLocation": "Location1",
"UserLocation": "Pickup Location 1",
"Destination": "User Destination001",
"IsValid": false
}

Was this article helpful?