Tutorial 06 – Hierarchy Depth Changes
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):
Flat Hierarchy

Hierarchical Structure

Recursive Hierarchy

Run And Inspect
Run the model and compare the target structures to note their differences.
Deploy the Changes
Deploy the changes and run the test scripts.
These classes ne3ed to be deployed:
- Flat organization hierarchy
- Fixed level organization level 3
- Fixed level organization unit
- Recursive organization unit
| Script | Source data | Main points of interest |
|---|---|---|
| Step 1: Reload flat organization | A flat organization hierarchy one level deeper and with repeating elements | The flat structure got two more columns into its existing satellite |
| Step 2: Inspect hierarchical organization | A flat organization hierarchy one level deeper and with repeating elements | The fixed level structure got one new hub/satellite/link set. |
| Step 3: Inspect recursive organization | A flat organization hierarchy one level deeper and with repeating elements | The recursive structure got one new satellite.
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. |
