Skip to main content
April 29, 2025
Solved

Workflow Lock / Unlock Dashboard

  • April 29, 2025
  • 2 replies
  • 0 views

Was asked to create a dashboard that gives the HQ admin the ability to lock and unlock Workflow profiles. Found bits and parts to use the user POV and descendants. Unlock descendants isn't working but.. Was looking at member tree and some of the other tree functionality, but couldn't get it to work for profiles. My thought is the profile hierarchy then they would select what to lock or unlock. Was curious if anyone had any recommendations or solutions they could share? Appreciate it in advance! 

Best answer by jayaleck

Figured it out, combination of the WorkflowStatus Method data adapter, BI Viewer and combo box. Here's the unlock code 

#Region "btn_unlock_wfPOV"
If args.FunctionName.XFEqualsIgnoreCase("UnlockwfPOV") Then
 
Dim wfName As String = args.NameValuePairs("wfName")
 
Dim wfChannelId As Guid = guid.Empty
 
Dim wfClusterPk = BRAPi.Workflow.General.GetWorkflowUnitClusterPk(si,wfName,ScenarioForStatus, WFTimeForStatus)
 
Dim profileInfos As List(Of WorkflowProfileInfo) = BRApi.Workflow.Metadata.GetRelatives(si, BRAPI.Workflow.General.GetWorkflowUnitClusterPk _ 
(si,wfName,ScenarioForStatus, WFTimeForStatus),WorkflowProfileRelativeTypes.Descendants,WorkflowProfileTypes.AllProfiles)
 
For Each profileInfo In profileInfos
BRApi.Workflow.Locking.UnlockWorkflowUnit(si, wfClusterPk)
BRapi.Workflow.Locking.UnlockWorkflowUnitDescendants(si, wfClusterPk, WorkflowProfileTypes.AllProfiles, wfChannelId)
 
Next 
 
'To change the icons
Dim selectionResult As New XFSelectionChangedTaskResult()
selectionResult.WorkflowWasChangedbyBusinessRule = True
Return selectionResult
 
End If
 
 
 

2 replies

May 6, 2025

Hello! The out-of-the-box UI allows you to accomplish everything you've listed in your post. I'm curious if there are specific requirements that prevent you from using it?



 

jayaleckAuthor
May 8, 2025

Thank you for your replay, appreciate it. They would like a dashboard where they could click on select members to lock and unlock.

May 9, 2025

I must be missing something... the UI allows you to lock/unlock specific members by right clicking the member and selecting Lock/Unlock.

jayaleckAuthorAnswer
May 28, 2025

Figured it out, combination of the WorkflowStatus Method data adapter, BI Viewer and combo box. Here's the unlock code 

#Region "btn_unlock_wfPOV"
If args.FunctionName.XFEqualsIgnoreCase("UnlockwfPOV") Then
 
Dim wfName As String = args.NameValuePairs("wfName")
 
Dim wfChannelId As Guid = guid.Empty
 
Dim wfClusterPk = BRAPi.Workflow.General.GetWorkflowUnitClusterPk(si,wfName,ScenarioForStatus, WFTimeForStatus)
 
Dim profileInfos As List(Of WorkflowProfileInfo) = BRApi.Workflow.Metadata.GetRelatives(si, BRAPI.Workflow.General.GetWorkflowUnitClusterPk _ 
(si,wfName,ScenarioForStatus, WFTimeForStatus),WorkflowProfileRelativeTypes.Descendants,WorkflowProfileTypes.AllProfiles)
 
For Each profileInfo In profileInfos
BRApi.Workflow.Locking.UnlockWorkflowUnit(si, wfClusterPk)
BRapi.Workflow.Locking.UnlockWorkflowUnitDescendants(si, wfClusterPk, WorkflowProfileTypes.AllProfiles, wfChannelId)
 
Next 
 
'To change the icons
Dim selectionResult As New XFSelectionChangedTaskResult()
selectionResult.WorkflowWasChangedbyBusinessRule = True
Return selectionResult
 
End If