M2doc in Melody Advance Team (Capella Team)


for many companies, in all but few very small projects that use Melody (Capella) to do model-based system enigineering, Melody Advance Team is the de facto standard and the models are Team projects i.e. models located in remote repository, not local projects. This setting allows for shared coordinative work of multiple team menbers to take place in the same model, which is something that the Melody Advance does not support. Of course, in such projects documentation generation is also important. This raises the question why there is no availability of m2doc for Team projects? Is there any plan to add it?

I am aware of the differences between Melody Team and Melody and also about the background of all this but nevertheless the possible workarounds are not good. Would Obeo and/or TCE recommend any preferred way how to integrate m2doc template/gencof and a Team project? The ultimate goal is to automatize or integrate m2doc document generation into a kind of CI process, which also necessitates a CLI (as clarified here M2DOC command line interface)


Not sure to get your point. What exactly is preventing you to generate documentation?
As far as I know, there is no incompatibility between Team for Capella and M2Doc.

Does this relate to the specific configurations of Melody Advance?

…no, there is not, but there is one wrt to the remote projects (aka Team projects) as explained above. In the real projects, teams work only in such remote projects. A you cannot use m2doc in them.

This configuration should work, but if you have some issues you can report them here.

That would be really great! It would spare us a lot of effort. Our whole project is set up around models in remote repository in Melody Team, because this is the only feasible way how multiple team members can model simultaneously in a multisite project.

Now, when trying to create a new template in such a remote project there seems to be no way how to select a model element to map the template´s root variable (“Load Resource” button/dialog), becasue there is no .melodymodeller resource in remote projects. So we do not see the model element tree t oselect from when creating/editing properties of templates in remote projects. This is why we can´t even create the default HelloWorld template to check that the m2doc installation is ok. Do you have a hint what else whould we try? Or should I create an issue report on the github page you have included in your above comment?

Do you have the .aird file locally ? If yes check if the option SiriusSession is defined and reference the .aird file in your .genconf file. Once it’s done you should be able to select elements from your remote model. Note this can be a bit slower since objects a retrieved from the network.

The .aird in connected remote projects are called .team.aird and they contain mostly just references to the remote repository. A “SiriusSession” option is not present in them (nor is it the normal .aird fiels in local projects). Or do you mean another kind of option somewhere else?

The SiriusSession is an option in the .genconf file that you can add if it’s missing. It’s in the variables and options page of the generation configuration wizard.

I see. But the option was set already (automatically) and still no elements visible - psl see the attached screenshots-

The session seems to be opened correctly but you don’t have semantic resources loaded. Can you open a diagram and do this operation again see if it force a semantic resource to load ?
You should have a resource containing the Capella model here.

Also what is the type of the variable you try to set ?

It is the default variable and type: capellamodeller::SystemEngineering. Its default name mySystemEngineering is preset automatically as one traverses the model tree and stops at the root of the model element tree just below the .aird.

If the variable has a value, it should comes from the shared model. Did you try to launch the generation ?

Hi Yvan,

to be exact, when trying out this in Melody Tem with installed m2doc 3.1.1:

In Capella Project Explorer: right mouse click on selected remote project with opened .aird -> New -> Other… -> Mm2doc/New Template ->…… -> dialog without title showing “The variable value should be model element” -> Load Resource -> Browse Workspace -> the opened remote project is shown, but no capellamodeller, just .aird,.afm,.project , so no model elements can be selected for the variable – that is the problem

(I really do not know why it is not enough just to select a type for the variable when creating the template, becuae the actual mapping to the elements in the model is done in genconf anyway.)

Also, in Melody Team (but not Melody) we all experience this

Invalid query statement: Couldn’t find the ‘fromHTMLBodyString(EClassifier=EString)’ service”

when generating from a template (from a local project, not a remote one). Using the same template and project, his error is only present in Melody Team, but not in Melody. And it is not thrown during validation, but only during generating from the template. So besides the issue with remote projects described above there seems to be another difference between Melody Team and Melody, too.

M2Doc is using standard EMF to load model, and shared models use CDO. But and integration with Sirius allows to use the Sirius ResourceSet to get model elements. This allows to access models by delegating to Sirius the loading part. But in order to do that, you need to reference the Sirius session to use with the option of the genconf SirusSession. Once done you should be able to reference elements used by the Sirius session.

The service fromHTMLBodyString() is part of the HTML feature of M2Doc. You probably need to install it from the M2Doc update site.


the SiriusSession in genconf was always set. Now I´ve found a workaround: the template is created using a default template variable of any of the possible types (e.g. remoteResourceConfig) first, only after that Sirius and Capella nsURIs can be added in the template properties. Thereafter the type of the variable is changed to the correct type (e.g. capellamodeller:SystemEngineering) and mapped properly because the element types and elements to map in genconf becomes visible. But this suits as a workaround at best, it should not be the standard way.


… as far as the HTML is concerned, it seems to be installed:

Do you have any errors in the error log view ?


I did a complete reinstallation with Melody 4.5.2 and M2doc 3.1.1.
Still we get the error fromHTMLBodyString(EClassifier=EString).

I think, there is nothing in the logfile which is relevant for this.
But, here is what is in the logfile:

!SESSION 2021-02-03 17:37:23.326 -----------------------------------------------
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en
Command-line arguments: -os win32 -ws win32 -arch x86_64

!ENTRY org.obeonetwork.m2doc.word.addin.ide.ui 4 0 2021-02-03 17:37:25.419
!MESSAGE FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: org.obeonetwork.m2doc.word.addin.ide.ui [844]
Unresolved requirement: Require-Bundle: org.eclipse.jetty.server; bundle-version=“9.4.24”
Unresolved requirement: Require-Bundle: org.obeonetwork.m2doc.word.addin; bundle-version="[3.0.0,4.0.0)"
-> Bundle-SymbolicName: org.obeonetwork.m2doc.word.addin; bundle-version=“”
org.obeonetwork.m2doc.word.addin [843]
Unresolved requirement: Require-Bundle: org.eclipse.jetty.server; bundle-version=“9.4.24”

at org.eclipse.osgi.container.Module.start(Module.java:457)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$1.run(ModuleContainer.java:1820)
at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$2$1.execute(EquinoxContainerAdaptor.java:150)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1813)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1769)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1735)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1661)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)

!ENTRY com.thalesgroup.mde.melody.advance.flexlm 1 0 2021-02-03 17:37:27.659
!MESSAGE No FlexLM configuration found.

!ENTRY org.eclipse.egit.core 1 0 2021-02-03 17:37:29.049
!MESSAGE Using Apache MINA sshd as ssh client.

!ENTRY org.eclipse.egit.ui 2 0 2021-02-03 17:37:37.360
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: ‘O:’. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.

If the installation went without error you should have all dependencies installed. This issue can be caused by a limitation to 255 characters in the path under Windows.

Can you try installing a the root of one of your disk to see if it helps ?

Copyright © Eclipse Capella, the Eclipse Capella logo, Eclipse and the Eclipse logo are Trademarks of The Eclipse Foundation.