Hello,
I just discovered recently that it is possible to use template block in order to implement queries or functions.
In this example ( M2Doc/tests//template/nominal/nominal-template.docx · GitHub), the template block called myTemplate allows to perform a mathematical operation on a Integer.
Up to know, I was using the Template blocks to directly inject content in the documentation generation (like write a Title, create a bullet list…).
Know I wanted to use this functionality to implement a complex query on Capella elements. Like for example, compute from a “Component” the list of external exchanges (exchanges which goes through the boundaries of the component).
The problem I have, is that I want to generate a list of Component Exchanges for example, but I want to be able to manipulate this list of Component Exchanges afterward.
And if I compute this list of Component Exchanges as part of the template block, M2Doc does not recognize the type of the result returned by the Template block, which makes it quite difficult to manipulate (it does not allow me to display the name of the Component Exchanges because it does not know that those elements have a property called name)…
Is it possible to somehow declare the type that will be returned by a Template block ?
Or is there some simple way to declare outside the Template block that the result is of a specific type to allow further manipulation?
Thank you