Diversity workbench
Hierarchy
The extraction of the hierarchies in some cases are very time consuming. To speed up the queries including hierarchies these are cached in cache tables. Therefor procedures are available to set the hierarchies in the cache tables to the current state after any changes in the original data.
The example below shows the hierarchy in the table collection in DC. The procedure procRefreshCollectionHierarchyCache checks the function CollectionHierarchyRefillBlocked. In case it returns true, nothing is changed as another process is active. In case of false, the function CollectionHierarchyRefillBlocked is set to true and the data in the cache table are refilled with the current state of the data. As a last step, the function CollectionHierarchyRefillBlocked is set to false.
graph TD; Start(Try to set<br>the hierarchy to<br>the current state) Cache[<i class="fa-fw fas fa-table"></i> Cache table] proc[proc Refresh<br>cache table] procCheck(Check state) procSetTrue(Set to true) procRefill[Refill<br>cache table<br>with current data] procSetFalse(Set to false) func{<i class="fa-fw fas fa-eye"></i> function<br>Refill<br>Blocked} Start --> func func -->|false| proc func -->|true| Start proc --> |check if false, set to true| procCheck procCheck --> func procCheck --> |true| Start procCheck --> |false| procSetTrue procSetTrue --> func procSetTrue --> procRefill procRefill --> Cache procRefill --> procSetFalse procSetFalse --> func
The procedure is executed only by users with the necessary permissions. The cache needs an update after any changes to the original data e.g. via an import. So e.g. the ImportWizard should either include the execution of the procedures as a last step after the import or the user should get an according message to update the cache.