Forum Discussion

danszczepanski's avatar
danszczepanski
New Contributor III
3 days ago

Get WF Status

Hello, 

In my BR, I need to incorporate logic that executes code based off the status of a separate WF Channel.

E.g. I have 2 workflow channels and the first contains Workspace-->Import-->Validate--Load

The second is simply Workspace. This second workspace has a button that kicks off a DM job that executes a BR.

In the BR, the code needs to read the status of the first channel, and if it is not completed through process, execute specific code.

Any ideas?

1 Reply

  • yhussien's avatar
    yhussien
    New Contributor II

    Hello,

    I had to do a similar logic. The approach I took was:

    Dim wfUnitPk As WorkflowUnitPk = BRApi.Workflow.General.GetWorkflowUnitPk(si, profileName, scenarioName, timeName)

    Dim wfStatus As WorkflowInfo = BRApi.Workflow.Status.GetWorkflowStatus(si, wfUnitPk, throwOnError)

    Then you can query the wfStatus for the specific status you want to base your if statement on.

    Hopefully that works for you.