Dear all,
I tried to create template constructs (following https://www.m2doc.org/ref-doc/2.0.2/index.html#template-construct-example). in order to make M2Doc more user-friendly for my colleagues.
My first use would be to create a template that would display a PAB diagram.
For that, I made :
{m:template insertPABdiagram(DiagramName:String)}
{m:for myRepresentation | self.containedPhysicalArchitectures.ownedPhysicalComponent. representationByDescriptionName('Physical Architecture Blank') }
// then a filtering by name of the diagrams and a display of the diagram
{m:endtemplate}
However, an error ‘Couldn’t find the “self” variable’ has been raised,.
I was quite suprised that the ‘global’ variable self could not been used in ‘local’ template.
So my first though was to introduce it as a parameter of the functions (which will then be called by DiagramName.insertPABdiagram(self))
However, the {m:template insertPABdiagram(DiagramName:String, self:SystemEngineering)} raised also an error.
Has someome already solved that problem ?
Rgds,