Skip to main content
September 26, 2024
Solved

Getting WF Profile Status in BR and using it in Cube View

  • September 26, 2024
  • 2 replies
  • 2 views

Hello,

is there a BR function where I can get a Workflow Status (example "Pre-Process Completed, Locked")? When I am using brapi.Workflow.Status.GetWorkflowStatus I only get UniqueId and Name.

I want to use the status in a Cube View to display for users.

Thank you!

Best answer by FredLucas

Hi LuciaPank ,

I'm not sure what you mean by only getting the UniqueId and Name.

Assuming you want to show the status of the selected WF step, you could try something like this:

Dim wfInfo As WorkflowInfo = BRApi.Workflow.Status.GetWorkflowStatus(si, si.WorkflowClusterPk)
Dim wfStepStatus As WorkflowStatusTypes = wfInfo.CurrentStep.Status
brapi.ErrorLog.LogMessage(si,$"Current Step Status: {wfStepStatus.ToString}")

 

2 replies

FredLucasAnswer
September 26, 2024

Hi LuciaPank ,

I'm not sure what you mean by only getting the UniqueId and Name.

Assuming you want to show the status of the selected WF step, you could try something like this:

Dim wfInfo As WorkflowInfo = BRApi.Workflow.Status.GetWorkflowStatus(si, si.WorkflowClusterPk)
Dim wfStepStatus As WorkflowStatusTypes = wfInfo.CurrentStep.Status
brapi.ErrorLog.LogMessage(si,$"Current Step Status: {wfStepStatus.ToString}")

 

LuciaPankAuthor
September 27, 2024

Thank you very much, this works.

August 27, 2025

Hi danszczepanski​, in that case you might want to use the same GetWorkflowStatus function but feed it with the WFClusterPk of the WF you want to check.

One way to get the WFClusterPK of a specific WF is by using the following function:
Dim wfClusterPk As WorkflowUnitClusterPk = BRApi.Workflow.General.GetWorkflowUnitClusterPk(si, profileName, scenarioName, timeName)

Note: this wfClusterPk variable would be what you pass on to the GetWorkflowStatus function.

Hope this helps.