jayaleck
2 months agoNew Contributor III
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 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!
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") ThenDim wfName As String = args.NameValuePairs("wfName")Dim wfChannelId As Guid = guid.EmptyDim 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 profileInfosBRApi.Workflow.Locking.UnlockWorkflowUnit(si, wfClusterPk)BRapi.Workflow.Locking.UnlockWorkflowUnitDescendants(si, wfClusterPk, WorkflowProfileTypes.AllProfiles, wfChannelId)Next'To change the iconsDim selectionResult As New XFSelectionChangedTaskResult()selectionResult.WorkflowWasChangedbyBusinessRule = TrueReturn selectionResultEnd If