03-10-2023 05:26 AM
I am trying to use LockWorkflowUnitDescendants with a non standard channel. The logic seems to allow express use of 'NoDataLock', 'AllChannelInput' and 'Standard', but for custom WF Channels, can't seem to identify how to get the GUID.
'Dim wfChannelId As Guid = WorkflowChannel.Standard.UniqueID -> THis works
'Dim wfChannelId As Guid = WorkflowChannel.custommadechannel.Uniqueid -> this doesnt work
BRApi.Workflow.Locking.LockWorkflowUnitDescendants(si, wfClusterPk, WorkflowProfileTypes.InputImportChild,wfChannelId )
03-10-2023 06:08 AM
Have you tried using the relevant BRApi calls instead?
BRApi.Finance.Account.GetWorkflowChannelID(si, memberId, varyByScenarioTypeId)
BRApi.Finance.UD.GetWorkflowChannelID(si, dimTypeId, memberId, varyByScenarioTypeId)
03-11-2023 08:37 AM - edited 03-11-2023 08:57 AM
I'm facing the same problem, which cannot be resolved by the Finance engine.
The requirement is simple: from a Base Input parent step, lock all descendants that are not Central Form Input, for example. Those Central Form Input correspond to channels that have been handed over to a different user, so the LockWorkflowUnitDescendants should not lock them, but lock the rest. LockWorkflowUnitDescendants uses:
1. WorkflowProfileTypes - This correspond to the type of WF, not the WF Name (e.g., Central Form Input).
2. WorkflowChannelKey - This would be a valid approach like @OS_Pizza suggests, but apparently we can only filter on AllChannelInput, NoDataLock, and Standard.
It seems to me that either WorkflowChannelKey is missing channels, or LockWorkflowUnitDescendants is missing a morphism that leverages StepClassificationTypes (like SetWorkflowStatus does).
Has anyone resolved this? I've found additional post on Locking Descendants on Custom Channels all with no resolution.
Thanks!
03-13-2023 09:58 AM - edited 03-14-2023 06:06 AM
FOUND THE SOLUTION 🙂
If you check WorkFlow Channel table. It shows the uniuqe id corresponding to the custommadechannel.
Use that unique id to convert into GUID and then use it in the same function directly.
Dim stringToConvert As String = "3d07sf7f-b95e-4ab5-ac0d-021a71de616d"
Dim customchannelid As Guid = Guid.Empty
customchannelid = stringToConvert.XFConvertToGuid(Guid.Empty)
BRApi.Workflow.Locking.LockWorkflowUnitDescendants(si, wfClusterPk, WorkflowProfileTypes.InputImportChild,customchannelid)
Thanks,
Manish