01-30-2023 12:58 PM - last edited on 05-02-2023 10:50 AM by JackLacava
I need to test if a workflow channel is locked in a BR before performing the BR actions. Can I test if the channel is locked? How?
Solved! Go to Solution.
01-30-2023 01:53 PM
You can get the status of a workflow.
Dim wfClusterPk As WorkflowUnitClusterPk = BRAPi.Workflow.General.GetWorkflowUnitClusterPk(si, "Workflow name", "ScenarioNAme", "timeName")
'Complete the IMPORT-VALIDATE-LOAD-PROCESS Workflow Steps
'Get the Workflow info so that we can determine which steps can be executed.
Dim wfInfo As WorkflowInfo = BRApi.Workflow.Status.GetWorkflowStatus(si, wfClusterPk, True)
01-30-2023 01:53 PM
You can get the status of a workflow.
Dim wfClusterPk As WorkflowUnitClusterPk = BRAPi.Workflow.General.GetWorkflowUnitClusterPk(si, "Workflow name", "ScenarioNAme", "timeName")
'Complete the IMPORT-VALIDATE-LOAD-PROCESS Workflow Steps
'Get the Workflow info so that we can determine which steps can be executed.
Dim wfInfo As WorkflowInfo = BRApi.Workflow.Status.GetWorkflowStatus(si, wfClusterPk, True)
01-30-2023 02:08 PM
I need to test the status of the workflow channel, not the Workflow itself. I have a WF channel that when locked should NOT allow the BR attached to the 'Load' button to run. When I click 'Complete' I get the below error (which is correct). But when I click the 'Load' button the BR attached executes. I need to test the status of the channel to see if it is locked prior to continuing with the BR
01-31-2023 04:06 PM
Thank you (code used below)
'Check If WF channel locked/unlocked
Dim wfStatus As WorkflowInfo = BRApi.Workflow.Status.GetWorkflowStatus(si, si.WorkflowClusterPk, True)
If wfStatus IsNot Nothing Then
If wfStatus.Locked Then
' Channel locked
else
' channel unlocked\
end if
End if
05-24-2023 06:12 AM
Hi,
I tried the above solution to check particular workflow's status and resulted in following error.
"The given key was not found in the dictionary"
Here is the code I tried:
05-24-2023 12:45 PM
Did you check whether you got the workflow info?