Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Loop through an "hierarchy" array in JavaScript

3733555Oct 18 2018 — edited Oct 23 2018

Hi guys.

Need to implement a validation in DRM for a new node and  for this I need to loop the nodes in a given hierarchy to check if already exist part of a name within the hierarcy.

Is it possible to loop the nodes of a hierarchy using java scripting in DRM?

The validation is meant to assure the the numeric part of a node's code does not repeat through the  hierarchy.

The code is formed by something in the style of "XRnn-dddddd"  being "dddddd" a number. The "dddddd" part can not  be repeated in the hierarchy.

This be said ... codes like "XR01-123456", "XR02-123400" are OK   while  "XR02-123456" it's not because the "123456" part repeats  (assuming already exists a  "XR01-123456" node in the hierarchy)...

I was thinking of something in the style of

               var HierList = version.Hierarchy("myHierarchy");

               var TotHiers = HierList.length;

               for(i = 0; i <= TotHiers-1; i++)

               {   

               var HierNode = version.HierNodeAbbrev(HierList[i]);   

                 check node's description and validate against new node's name          

                            .

                            .

               }

Any help will be greatly appreciated.

Thanks and regards

This post has been answered by Dharmaraj Borse on Oct 23 2018
Jump to Answer
Comments