Forum Discussion

Marco's avatar
Marco
Contributor II
2 months ago

Error executing a Process Cube (Parameter not recognized)

Hi Everyone.

The issue is that I want to run the following Process, but upon execution, I receive the error shown below the code. I do not understand this error because a WFProfile is correctly sent in wfChildClusterPK, specifically 'PLP ARGENTINA.Export to Cube'. This Workflow does have an assigned entity, so I do not see what could be causing the error in this process.

Dim pcProcessInfo As ProcessCubeProcessInfo = BRApi.DataQuality.Process.ExecuteProcessCube(si, wfChildClusterPk, StepClassificationTypes.ProcessCube, False)

' Summary: Business Rule error. DataQualityEventHandler. Unable to execute Business Rule 'DataQualityEventHandler'. Error processing Data Management Step 'CLEAR_PLP_WF'. Invalid parameter. Entity Filter, E#Root.WFProfileEntities.

I am executing this process in another WFProfile because I want to create a complete workflow for everyone. However, the current process is the one causing this error.

  • It sounds like you have created a Sub for your NoCalculate rule, as is normal.  You need to make sure you include args As DataQualityEventHandler as one of your passed in parameters to that function.  It's been a long time since I looked at the very basic sample GolfStream NoCalculate function that most people use as is, but I'm pretty sure that sample includes the parameter.  Rip it off from there, if it's still not making sense.

     

    • Marco's avatar
      Marco
      Contributor II
      Dim wfProfileInfo As WorkflowProfileInfo = BRApi.Workflow.Metadata.GetProfile(si, wfChildClusterPk.ProfileKey)
      Dim wfText2 As String = wfProfileInfo.GetAttributeValue(scenarioType.Forecast.Id, sharedconstants.WorkflowProfileAttributeIndexes.Text2)
      Dim sValue As String = BRApi.Workflow.Metadata.GetProfileEntitiesAsMemberFilter(si, wfChildClusterPk.ProfileKey)
      
      Dim ParamsDict As New Dictionary(Of String, String)
      ParamsDict.Add("EntityParam", sValue)
      
      Dim obj_ProcessPLP As TaskActivityItem = BRApi.Utilities.ExecuteDataMgmtSequence(si, "PROCESS_PLP", ParamsDict)
      Dim obj_Copy = BRApi.Utilities.ExecuteDataMgmtSequence(si, "COPY_PLP_TO_PLN", ParamsDict)
      
      If obj_ProcessPLP.TaskActivityStatus <> TaskActivityStatus.Completed Or obj_Copy.TaskActivityStatus <> TaskActivityStatus.Completed Then
          completed = False
      End If

      I have the following code where I retrieve the same entity name that appears in the image, except that it was located in Text2. My question is whether this part is correctly implemented or if it needs any changes to function the same as the ProcessCube.

  • I think you have a misunderstanding in how the NoCalculate event handler works.  The event handler gets invoked for EACH applicable entity in the Calculation Definition Entity column.   For example, If Entity="M_ARGENTINA", as it would appear in your example, then the event handler is invoked just once for that entity.  If Entities="(Assigned Entities)", the event hander is invoked for each of the entities that have been assigned to the WF.  Given that, I think you might now understand why setting the DM Package Step Entity Filter=E#Root.WFProfileEntities might be problematic, beyond the error you received.

    What you need to do is pass CalcInfo.DataUnitNames.EntityName as a Dashboard Parameter to the Data Management Package Sequence, to be used wherever an Entity Filter is required.  If you are intending it to run for all WFEntities, then that is probably what the Entity column should be defined as in the NoCalculate definition.

    • Marco's avatar
      Marco
      Contributor II

      Hi Rhankey.

      Could you please provide an example of how I could implement what you mentioned? I do not fully understand the part about using CalcInfo.DataUnitNames.EntityName in my process.

      • rhankey's avatar
        rhankey
        Contributor

        Dim CalcInfo As DataUnitInfo=DirectCast(args.Inputs(2),DataUnitInfo)

        Dim ParamsDict As New Dictionary(Of String,String)

        ParamsDict.Add("EntityParam",CalcInfo.DataUnitNames.EntityName)

        BRApi.Utilities.ExecuteDataMgmtSequence(si,DMSequenceName,ParamsDict)

        In the Data Management Package Step, you would set the EntityFilter=|!EntityParam!|