Hello,
I have been talking to a friend who used M2DOC, and he said he approached M2DOC with a trial and error method.
I tried this method and I still find myself asking many questions, I would rather MASTER M2DOC than “trying and experimenting and being stuck sometimes without knowing what is the error”.
So I would like to put on the table all I have found about M2DOC in my short time of research, and I would like you to give me a feedback on what kind of inputs/documentations i might be missing.
To approach M2DOC, i found i should:
- Learn basic Acceleo, using the available documentation on eclipse website.
- Check the xml codes of “.capella” files on my project and search for the attributes “xsi:type” of the xml tags. Then make use of the last part of the value of that attribut, example
( xsi:type=“org.polarsys.capella.core.data.fa:ComponentPort”), the useful part here is : “fa:ComponentPort” --> Which becomes “fa::ComponentPort” is AQL/sirius. - Define a very high level variable (named self) Type such as “capellamodeller::SystemEngineering”, in order to be able to summon any item located on a lower level of the hiearchy of items, using this : “aql:self.eAllContents(Insert what i found on point 2)” this becomes --> “m:self.eAllContents(la::LogicalComponent)” (Supposedly). The strategy here is to follow the example shown on the Acceleo docu:
https://www.eclipse.org/acceleo/documentation/aql.html
The " eAllContents()" example but instead of “travel agency” as a top class, i have “capellamodeller::SystemEngineering”. - So as mentioned in point 3, all I need to call for an item from my project is to insert it inside “m:self.eAllContents(item_xsi_type)”
- Furthermore, check all the “services” available on the nightly M2DOC documentation, to find functions as “isRepresentationDescriptionName()” and such.
Here? https:// github. com / ObeoNetwork/M2Doc/tree/master/tests
And Here? https ://www.m2doc.org/ref-doc/nightly/m2doc_service_paginationservices.html - Finally, one last option is to use the example given through the Flight fun project, check the template and the generated document and compare (trial and fail).
- Test that on my proper project.
But i am hitting some walls, i am noticing.
First of all:
A) I see that this code : {m:self.eAllContents(la::LogicalComponent)->size()}
would work on the sirius interpreter and provide me with the number of logical components (2 for a very simplistic testing project)
yet the Generated product would produce an error:
{m:self.eAllContents(la::LogicalComponent)->size()}<—Expression “self.eAllContents(la::LogicalComponent)->size()” is invalid: invalid type literal la::LogicalComponent
B) Also when i read the comments from a previous post (post i mentioned on one of my posts) a person had a problem using this :
“self.eAllContents(fa::ComponentExchange).source”
he had to add “oclAsType()” instead, to solve it:
“ce.source.oclAsType(fa::ComponentPort).orientation”
( AQL query works on Sirius interpreter, returns error on M2DOC - Document Generation - Eclipse Capella Forum (mbse-capella.org) - last post)
Something i would have never thought.
C) I can’t find the the xmi:type for NOTES/Notations.
indeed, they are not defined in the .capella file, but rather in the .aird file which contains different set of attributes and tags.
How can i get their content (“Text i would like to extract” and “Text2 I would like to extract aswell”) using aql? I mean M2DOC?
D) Also, i can see all the services and nsURI available on my template edit options, but I can’t seem to be able to identify the precise role of each one of them, i have seen some descriptions of services on the nightly docu for M2DOC but it does it is not necessarily associated with the items shown the window. I would rather identify the role of each nsURI/service.
Finally, i must explain that I have never used Capella Studio, and i have No idea what are the exact classes and objects of Capella modelisation, will that be a problem that i should attend to in order to hope to achieve mastery in M2DOC?
Also, is there some Classes diagram for Capella classes? (One that describes all classes in one big diagram).
What am I missing?
Thanks