Forum Discussion

Marco's avatar
Marco
Contributor II
10 days ago

How do I assign the entity to my Data Management for my Calculation Definitions?

Hi Everyone.

I have a question about how I can assign the entity that appears in my Calculation Definitions to my assigned Data Management Step. Currently, I have it set to E#Root.WFProfileEntities, but since I have it in a Profile that does not have entities assigned (because it is a Profile where I want to mark all my WF as complete), it gives me an error when I try to use it from there.

 

  • Russell's avatar
    Russell
    New Contributor II

    Not sure the requirements of the DM job or if it is used in other workflows but you could use an XFBR for the entity or you could just hard code it.

  • In your NoCalculate BR, you can retrieve the Calculation Definition Entity with the following lines of code:

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

    If EntitName is set to let's say "(Assigned Entities)", your NoCalculate rule will be called for each specific assigned entity.  You don't need your NoCalculate BR to decode the various (*) options.

    Next, change your DM package to use a Parameter such as |!EntityName!|.  You don't actually have to define a Dashboard Parameter.

    When calling the DM package, simply pass the EntityName through as substitution variable.

    I make all the Calculation Definition fields available to the DM package, along with extra parameters that I can append in the FilterValue.  Depending on the DM package I'm calling, I may or may not use any of these parameters.

    • Marco's avatar
      Marco
      Contributor II

      Hi Rhankey.

      From what I see in the code, this is what executes the Calculation Definitions part. I noticed that WFProfile is used, but it is correctly assigned to a country

      BRApi.DataQuality.Process.ExecuteProcessCube(si, wfChildClusterPk, StepClassificationTypes.ProcessCube, False)
      • rhankey's avatar
        rhankey
        Contributor

        ExecuteProcessCube() does what the "Process" button does in the Workflow, executing each of the Calculation Definition rows that you have defined.

        Rows 2 & 3 in the screen shot you provided of your Calculation Definition are NoCalculate rows that will by usual convention have the Data Quality Event Handler run a DM package whose name is specified in the Filter Value column.

        The couple lines of code need to be included in your NoCalculate Data Quality Event Handler, so it can pass along the Entity information from the NoCalculate row being processed.  That way your DM package can be made to run for only the relevant Entity(s) you wish, which could vary between Workflows.