The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
LuciaPank
1 year agoNew Contributor II
Getting WF Profile Status in BR and using it in Cube View
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!
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}")
4 Replies
- FredLucas
OneStream Employee
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}")- LuciaPankNew Contributor II
Thank you very much, this works.
- danszczepanskiNew Contributor III
QQ - is there similar code I can write that looks at a different channel?
Ex. I have a BR that needs a conditional calculation based on if a different WF is complete or not. I'd want it to view the status of the specified WF channel and if it's loaded or processed or not at all, run code based off that condition.
- FredLucas
OneStream Employee
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.
Related Content
- 2 years ago
- 2 years ago