Forum Discussion

bmcwilliams's avatar
bmcwilliams
New Contributor
21 days ago
Solved

Problem With DM Sequence Parameter Resolution Order

Good afternoon, I'm encountering an issue and hoping someone could share how they've worked around this in the past. We have a task that runs over a finite number of Entities.  Historically the...
  • FredLucas's avatar
    17 days ago

    I see, I misunderstood your initial question.

    Yes, the variables / filters are resolved prior to executing the sequence i.e.: the filters for both your step 1 and step 2 are resolved initially as you are experiencing.
    This means that if you want your Step1 to determine the entities that should run in your Step2 the obvious way would be, as you mention, to trigger your step 2 using the ExecuteCustomCalculateBusinessRule (so you can control the scope / list of entities it should run for).
    If you want to still allow your Step1 to be ran in isolation, you could add an optional parameter (if not specified it would not trigger step2) or define a auxiliar step2 that runs for a single dummy DU (i.e.: E#None, specific period, etc) and its whole purpose would be to call the proper Step 2 logic, for the defined Entities, via the ExecuteCustomCalculateBusinessRule. This way you could keep the same 2 step sequence config while controlling the scope of your step 2 logic.

    Another option would be to have your step 1 saving the list of entities in globals and configure the Step2 to run for all valid entities with an If at the very beginning to check if the api.Pov.Entity.MemberId is meant to run (i.e.: is part of the list) and 
    immediately returning Nothing if not. Depending on the number of valid entities I'd expect this option not to be as optimal from a performance POV when compared with the options above.