Forum Discussion

jayaleck's avatar
jayaleck
New Contributor II
2 months ago
Solved

Workflow Lock / Unlock Dashboard

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 bu...
  • jayaleck's avatar
    5 days ago

    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