What We Learn
We see what kind of changes are required when a flat hierarchy gets a new level.
Scenario
Continuing on the last tutorial, OrgMaster Pro now publishes a structure that is one level deeper than previously. We will make the necessary changes to all three previous implementations.
Our data now looks like this:
- the new level is LEVEL3_ID/LEVEL3_NAME
- some elements exist in several levels:
- 1220 Financial
- 1230 HR
- 1260 Marketing
- 1300 Legal
Modeling
The three target structures look like this, with level 3 that has snuck in between the organisation unit and level 2:
With the following details:
do this… | …and this will happen |
---|---|
In Fixed level organisation level 3, set Code to Business key |
This will still work. |
Mapping
The basic rules for mapping to these structures are like follows:
- Mapping to the 1:1 flat structure is still trivial, no alias
- In the fixed level as well as the recursive case, add a new aliased mapping set symmetrical to the existing ones
- In both, remap the lowest organisation unit level to the new next-to-last level
- Using where-clauses, only load the first (highest level) of those units that repeat on consecutive levels
So the mappings will look like this (changes and additions indicated by the red frames):
Refresh and Inspect
Refresh D♯ Engine with the current model export and mappings. Use the D♯ Engine UI to compare the target structures to understand their differences (ignoring administrative tables):
- The flat structure got two more columns into its existing satellite
- The fixed level structure got one new hub/satellite/link set
- The recursive structure got one new satellite
Deploy the Changes And Try It Out
Deploy the new classes and run the test script.
Script | Source data | Main points of interest |
---|---|---|
Step 1: Reload organization data | A flat organisation hierarchy one level deeper and with repeating elements | The structural changes.
Also, the recursive structure is actually the only structure that stores the correct hierarchy information as it truly is, without repeating dummy elements. Repeating elements only exist in the data in order to fix the ragged hierarchy so that the data works in a reporting context. The original flat hierarchy is not the correct representation for the actual hierarchy. |