M2DOC - Capella - Newbie 's question

Hello everybody,

I want to use M2DOC to publish documentation concerning Capella Models.
Can we find a reference of EMF model corresponding to “SystemEngineering” (the root element of Capella model if I correctly understand)?
From that, I imagine I will be able to use AQL to use this model. Am I right?
Any clarification will be welcome ;)!
Thank you by advance,

Nicolas

Welcome Nicolas,

You can use the M2Doc interpreter view to have some content assist and rendering of your AQL expressions in the context of your template. It also allows to work with the current selection (selection variable) for testing purpose. It has an annoying bug at the moment that lock the template when it’s opened in the M2Doc interpreter view, as a workaround (while waiting for M2Doc 3.3.3) you can use a copy of your template in the M2Doc interpreter view to work on the initial template with MS Word.

For a reference of Capella metamodels you can have a look at the Ecore files and also the Capella code, I know its not optimal but it can be usefull to import and reuse some Java code for your M2Doc templates. For a better understanding of Capella you can have a look at the wiki.

I hope this will get you started with M2Doc in the context of Capella. Also note that M2Doc works with any Ecore model. That can be outside of Capella or with Capella addons.

Hello Yvan,

Thank you for your prompt reply and the different references.
I don’t know Ecore files. Do they describe the structure, method or properties of each obbject which can be accessed by AQL expression?
Is there any reader of ecore files?
In the same manner, I am a bit lost in front of Capella Code. I don’t know the language and the manner to read the project…
I am sorry, as announced in the title, I am a real newbie it seems :smile:

1 Like

Yes, Ecore files are metamodels from which the Java code is generated (ie SystemEngineering) and it defines all EAttributes and EReferences as well as EOperations.

You can open Ecore files in an Eclipse with EMF installed for a basic tree editor. An other option that can help you visualize the Capella metamodel is Ecore Tools that will allow you to make diagrams from Ecore metamodels. It use Sirius the same component used by Capella to edit diagrams. A simple way to get all this tools in an Eclipse is to use the Modeling bundle. Then you can clone the Capella git repository and import the project containing the Ecore files.

AQL is agnostic from any domain (for instance Capella), it use the ecore metamodel to navigate any model from that domain. And a nice thing with Ecore is that Ecore conforms to itself (the metamodel of Ecore is Ecore). That’s how AQL can be independent from a domain. Also you can navigate from a model to its metamodel using:

self.eClass()

From this you can explore the metamodel like any model:

self.eClass().eAllStructuralFeatures

eAllStructuralFeatures is a derived reference that list all EStructuralFeature from an EClass.

For the Java code part, it’s not mandatory to know Java to use M2Doc. Most people in the context of Capella never write a line of Java. So you can skip this for the moment.

And don’t worry we are all new in something :wink: