Forum Discussion

OS_Pizza's avatar
OS_Pizza
Contributor III
2 years ago

Locking an import profile using custom created workflow channnel.

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 )

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    Have you tried using the relevant BRApi calls instead?

    BRApi.Finance.Account.GetWorkflowChannelID(si, memberId, varyByScenarioTypeId)
    BRApi.Finance.UD.GetWorkflowChannelID(si, dimTypeId, memberId, varyByScenarioTypeId)
    • MauroGallo's avatar
      MauroGallo
      New Contributor III

      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!

       

      • OS_Pizza's avatar
        OS_Pizza
        Contributor III

        MauroGallo JackLacava 

        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