Checkpoint
  • 31 Mar 2022
  • 4 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Checkpoint

  • Dark
    Light
  • PDF

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 Serverless360 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:

  • 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

IsTransactionComplete and SL360-ArchiveMessage.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

Header Description
SL360-BusinessProcess Required. Tracking Name of the Business Process
SL360-Transaction Required. Tracking Name of the Business Process Transaction
SL360-TransactionInstanceId Transaction instance Id of a Business Process transaction
SL360-Stage Required. Tracking Name of a Stage in a transaction
SL360-ArchiveMessage Archive the tracked message body
SL360-StageStatus Required. Status of the stage (Success, Failure, InProgress)
SL360-BatchId Unique Id to correlate batch of transactions
SL360-isBatched Required if a Transaction must take on the role of a Parent.
SL360-Exception Required if SL360-ExceptionCode is given. Exception Message
SL360-ExceptionCode Required if SL360-Exception is given. Exception code
SL360-IsTransactionComplete Required 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:

Step 1: Open the Azure portal.

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

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

Cloud Shell.png

Step 4: 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/Serverless360/serverless360-bam-lib/master/Kovai.Serverless360.Sample/BamCustomConnector.json

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

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

Step 5: Business Activity Monitoring (BAM) API Endpoint and Key can be found in the Serverless360 portal by moving to the below-mentioned path:

BAM -> Actions -> BAM Connection Details

BAM Connection details.png

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

ProvisioningState: Succeeded

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

Resource Group

Step 7: 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": "sl360_u001475",
"DriverId": "sl360_d0058962",
"DriverLocation": "Location1",
"UserLocation": "Pickup Location 1",
"Destination": "User Destination001",
"IsValid": false
}

Was this article helpful?