|Processing recursive data structures? [message #1768130]
||Thu, 13 July 2017 21:25
| Reinhold Usolf
Registered: December 2016
My models are basically trees (with some objects between the tree nodes carrying additional data, i.e. an edge between a parent A and a child B looks like A->E->B). I would like to generate a document that reflects the tree structure. That means for a node A with two children B (with child C) and D, the output should look like
My problem: I don't want to impose a limit on the depth of the tree!
I don't see how I can process such a recursive data structure in a gendoc template. I first thought I can do recursive calls between fragments, but that's not allowed in gendoc.
Then I thought that maybe I could first flatten the tree structure (with Acceleo/Ocl collect) and process all children iteratively. However, that also doesn't work. The collect function doesn't know how to handle the edges (it probably only works for simple package structures with contain-relationships).
Any other idea? Invoke a Java function?
[Updated on: Thu, 13 July 2017 21:34]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01843 seconds