Logic App Standard
  • 31 Oct 2024
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Logic App Standard

  • Dark
    Light
  • PDF

Article summary

In this demo we are creating a business process visualization of a transaction where we load railcar updates into SAP.

We want to present the business and operations users with a simple view of what has been processed, if it was successful or not and to be able to open up the transaction for more info. You can see below the summary view of railcar updates.

image.png

I can click on the transaction instance to see more info about what happened.

image.png

Video Walk Thru

This video will give a walk through of this feature.

Queries used in this example

To help accelerate your use of this sample, below are the queries we use. You should be able to take them and modify which actions you point to and workflows and which properties you promote if you have tracked properties.

Parent Transaction Query

Below is the parent transaction query. In this case I am looking for an action start event in the workflow which I know has some promoted properties on it. I then link to a workflow complete event which indicates if the transaction ended successfully. This way I can workout success and failure at the transaction level.

let input_LogicApp_Name = 'ms-bootcamp-logicapp';
let input_Workflow_Name = 'Railcar-Loaded-ToSAP';
let input_StartActionName = 'Parse_JSON_-_Railcar_Message';
let input_EndActionName = 'HTTP_-_Send_to_SAP';
let startActionEvents = requests 
| where cloud_RoleName == input_LogicApp_Name
| where operation_Name == input_Workflow_Name
| where name == input_StartActionName
| extend LogicAppName = cloud_RoleName
| extend workflowName_ = operation_Name
| extend actionName_ = name
| extend workflowId_ = tostring(parse_json(tostring(customDimensions.resource)).workflowId)
| extend runId_ = tostring(parse_json(tostring(customDimensions.resource)).runId)
| extend trackedProperties_ = tostring(customDimensions.trackedProperties)
| extend Batch_ = tostring(parse_json(trackedProperties_).Batch)
| extend Load_Slip_Id_ = tostring(parse_json(trackedProperties_).Load_Slip_Id)
| extend Message_Type_ = tostring(parse_json(trackedProperties_).Message_Type)
| extend Product_Code_ = tostring(parse_json(trackedProperties_).Product_Code)
| extend Product_Code_Full_ = tostring(parse_json(trackedProperties_).Product_Code_Full)
| extend Production_Date_ = tostring(parse_json(trackedProperties_).Production_Date)
| extend Rail_Car_Id_ = tostring(parse_json(trackedProperties_).Rail_Car_Id)
| extend StartTime = timestamp
| extend StartSuccess = success;
let endActionEvents = requests 
| where cloud_RoleName == input_LogicApp_Name
| where operation_Name == input_Workflow_Name
| where name == input_StartActionName
| extend LogicAppName = cloud_RoleName
| extend workflowName_ = operation_Name
| extend actionName_ = input_EndActionName
| extend workflowId_ = tostring(parse_json(tostring(customDimensions.resource)).workflowId)
| extend runId_ = tostring(parse_json(tostring(customDimensions.resource)).runId)
| extend EndTime = timestamp
| extend EndSuccess = success;
startActionEvents | join kind=inner (endActionEvents) on runId_
| extend OverallStatus = case(
    EndSuccess == 'True', 'Succeeded',
    EndSuccess == 'False', 'Failed',
    'In Progress')
| extend Duration = EndTime - StartTime
| project timestamp, WorkflowName = workflowName_, LogicAppName, WorkflowRunId = runId_, OverallStatus, StartTime, EndTime, Duration, Batch_, Rail_Car_Id_, Production_Date_, Product_Code_Full_, Product_Code_, Message_Type_, Load_Slip_Id_
| order by StartTime desc

Message Validated Shape

When I open up the transaction, the below query will indicate that stage 1 has been executed and we can use the properties from the query result to show info to the user

let input_LogicApp_Name = "ms-bootcamp-logicapp";
let input_Workflow_Name = "Railcar-Loaded-ToSAP";
let input_StartActionName = "Parse_JSON_-_Railcar_Message";
requests 
| where cloud_RoleName == input_LogicApp_Name
| where operation_Name == input_Workflow_Name
| where name == input_StartActionName
| where operation_Id == {WorkflowRunId}
| extend LogicAppName = cloud_RoleName
| extend workflowName_ = operation_Name
| extend actionName_ = name
| extend workflowId_ = tostring(parse_json(tostring(customDimensions.resource)).workflowId)
| extend runId_ = tostring(parse_json(tostring(customDimensions.resource)).runId)
| extend trackedProperties_ = tostring(customDimensions.trackedProperties)
| extend Batch_ = tostring(parse_json(trackedProperties_).Batch)
| extend Load_Slip_Id_ = tostring(parse_json(trackedProperties_).Load_Slip_Id)
| extend Message_Type_ = tostring(parse_json(trackedProperties_).Message_Type)
| extend Product_Code_ = tostring(parse_json(trackedProperties_).Product_Code)
| extend Product_Code_Full_ = tostring(parse_json(trackedProperties_).Product_Code_Full)
| extend Production_Date_ = tostring(parse_json(trackedProperties_).Production_Date)
| extend Rail_Car_Id_ = tostring(parse_json(trackedProperties_).Rail_Car_Id)

SAP updated event

I can use the below query to light up the 2nd shape in the diagram to show the result of that step in the process

let input_LogicApp_Name = "ms-bootcamp-logicapp";
let input_Workflow_Name = "Railcar-Loaded-ToSAP";
let input_ActionName = "HTTP_-_Send_to_SAP";
requests 
| where cloud_RoleName == input_LogicApp_Name
| where operation_Name == input_Workflow_Name
| where name == input_ActionName
| where operation_Id == {WorkflowRunId}
| extend LogicAppName = cloud_RoleName
| extend workflowName_ = operation_Name
| extend actionName_ = name
| extend workflowId_ = tostring(parse_json(tostring(customDimensions.resource)).workflowId)
| extend runId_ = tostring(parse_json(tostring(customDimensions.resource)).runId)


Was this article helpful?