Hello community,
I have serveral models designed like this :
I have a top "structural elements" which contains either
- "cluster data / models" objects"
- or structural objects which contains "cluster data / models" or ... other structural objects
For example :
- Sales (structural element)
- Customer (data object)
- Export control (structural element)
- Licence (data object)
- etc
It's like having a top directory containing files or directories.
What I want is : start a report from the top structural element (the root directory) to get all data objects (listing all the files) and list attributes of these data objects
Is it possible using a wysiwyg report ? ( I think it is using queries but we cannot publish queries to Aris connect)
Thanks
Regards
Michel
Kay Fischbach on
Sure thing is possible.
It's easier to explain if you break your problem into two parts:
Identifying with which object to start with
I don't know which connection direction you used to connect your objects, but your topmost structural element must have either no incoming connections, or no outgoing connections. This sets it apart from all other structural elements in your hierarchy and should make it easily identifiable.
Note that your bottom-most objects also only have one of those connection directions, but it should be in a different direction.
You can retrieve a list of all structural object occurrences of a model and then use the javascript .filter(...) method to only keep those that have zero of the undesired connections. What remains should be one occurrence, your root element that stands at the top of the hierarchy.
If you could tell me the exact data type of your objects (API-Names), which connection types are in use (API-Names) and in which direction the connections connect objects, I could give you a sample code which may help you more than just my written explanation.
***
Writing a recursively callable function that can process any element in your hierarchy
Well as the name implies, you need a function to which you can pass one child element after another. The function must correctly write information with the output object and then call itself again on any sub child elements - one child element at a time.
You should be able to pass your root hierarchy element to this function and the function ensures that everything else in your hierarchy is correctly processed.