Forum Discussion

bmcwilliams's avatar
bmcwilliams
New Contributor
23 hours ago

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 underlying Business Rule was kicked off via DM Step with Entity: E#Top.Base.  It's not exactly "Top" but something similar to hopefully capture all relevant Entities to this particular task.  The runtime was always a consideration as it also runs for all remaining periods within our current year.

In an effort to reduce runtime we introduced a "Unique Entity" parameter.  This is defined by a Business Rule that runs and queries a source table to determine only the Entities that this particular task needs to be run on.  In practice this has greatly reduced runtime on the task.  Runs more than 2x faster.

The problem:

The source table that populates the list of "unique entities" is also updated within the same Data Management Sequence.  Something like:

  1) Update source table

  2) Run task described above

Because both Steps are within the same Sequence, the "Unique Entity" business rule is being executed before #1 Update source table happens.  So any changes to the source table versus a previous run could cause an Entity to be missed.

I wish the Filter would get resolved when the Step is executed instead of when the Sequence is executed.

Hopefully that makes sense to everyone? The only workaround that I'm aware of is to kick off the 2nd Step at the end of the 1st step.  This removes a lot of the visibility and, as part of our current process, Step 1 is sometimes executed on its own to preview Stage data before the full Cube posting takes place.

I appreciate anyone who can provide guidance on this matter.

Thanks,

Brandon

2 Replies

  • FredLucas's avatar
    FredLucas
    Icon for OneStream Employee rankOneStream Employee

    Hi Brandon,

    Have you considered using Globals?
    You could try using globals to store the initial list of "unique entities".

    The sequence runs the entities in parallel so you can use synclock to ensure this object is updated one single time (the first time).

    You'd then update your code to get the unique entities list from the globals instead of the table. This way the process is not impacted by any updates to the source table that happen during the execution. 

    Hope this helps.

    Thanks,

    Fred

  • bmcwilliams's avatar
    bmcwilliams
    New Contributor

    I haven't considered Globals.  I don't really have any experience with them, yet, but I'll take a look.

    To your last point.  I actually want the 2nd Step in the Sequence to be impacted by the 1st Step in the Sequence - if that makes sense?  Step 1 updates the Table that determines the entities, and then Step 2 uses a unique list of entities from that Table as an Entity Filter.  Problem I'm running into is that Step 2 is currently using a unique list of entities from the last time the Sequence was ran instead of what's updated from Step 1.  The Filter is resolved before Step 1 of the current sequence is ever kicked off.

    If I'm trying to use this list of entities as an Entity Filter on Step 2 within a Sequence would it get retrieved from Globals before or after Step 1?

    Logically I would think Step 2 filters would get resolved when Step 2 is kicked off but that doesn't appear to be the case.

    My experience (Entity Filter is being set under Data Units on the Step itself; I've tried both parameter and XFBR rule here):

    Unique list of entities in the table before the Sequence is initiated: Entity1, Entity2, Entity5

    Unique list of entities after Step 1 finishes: Entity1, Entity3, Entity5

    Entity Filter that gets ran for Step 2: Entity1, Entity2, Entity5.  This is where I'm getting confused.  I wish it would use after Step 1 finishes.