Precisely Enterworks

 View Only
  • 1.  Display Hierarchy Structure

    Posted 01-24-2022 21:35
    Hi all. We have a 5 level hierarchy with codes such as L1_1.L2_1.L3_1.L4_1.L5_1. We have an attribute that stores this node path. As you can tell, it's not use friendly. In the latest ver of EW, the description of the leaf node (L5_1) is displayed in the attribute field. But users would like to see the description corresponding to the other 4 levels. What are our options to make this user friendly? Is it possible to add 4 other attributes to the data model that automatically parse and display the description of each level, based on what's in the full node path attribute?

    Thanks in advance

    ------------------------------
    -Sidd
    ------------------------------


  • 2.  RE: Display Hierarchy Structure

    Posted 02-16-2022 11:49
    Hi Sidd,

    If your users are ok with seeing all the descriptions in a single attribute, you could basically substitute the node names with the node descriptions (by querying the code set tables) and store that result in a second attribute that's set for display-only.  This is an example you might try with a change notification registered to changes to the hierarchy node attribute.  Here, we have a hierarchy called "Catalog Manager Folder Hierarchy" and the node value is "ROOTS.ALLDESKTAB.CONFCLASSRMTBLS".  The results of this query return a single result of "Roots.All Desks + Tables.Conference + Classroom Tables" which is more reader friendly.

    DECLARE
    @NodeString nvarchar(200) = 'ROOTS.ALLDESKTAB.CONFCLASSRMTBLS',
    @HierarchyName nvarchar(200) = 'Catalog Manager Folder Hierarchy',
    @NodeSeparator nchar(1) = '.';
    WITH t AS (
    SELECT value, idx = CHARINDEX(@NodeSeparator + value + @NodeSeparator, @NodeSeparator + @NodeString + @NodeSeparator)
    ,CSD.*
    FROM STRING_SPLIT(@NodeString, @NodeSeparator)
    INNER JOIN B_CODE_SET_DETAIL AS CSD ON value = CSD.CODE
    INNER JOIN B_CODE_SET AS CS ON CSD.CODE_SET_ID = CS.CODE_SET_ID
    WHERE CS.NAME = @HierarchyName
    )
    SELECT 'LongDescription' = STUFF((SELECT '.' + DESCRIPTION FROM t ORDER BY idx FOR XML PATH('')),1,1,'')


    If the users don't like seeing that combined in a single field, then I think you could definitely get away with 4 additional, separate attributes that contain the individual pieces of the node.  If you do go that route, you could probably accomplish that with a VTL business rule.  So you wouldn't need to set up a new change notification.

    I hope that helps!
    Josh

    ------------------------------
    Joshua Swett | Sr Applications Engineer
    Steelcase, Inc | 2696251984
    ------------------------------