ObeoNetwork / M2Doc

The M2Doc technology enables the generation of Office Open XML documents from models.
http://obeonetwork.github.io/M2Doc/
Eclipse Public License 2.0
39 stars 22 forks source link

Addin problem: Missing EPackage registration #393

Closed adaussy closed 3 years ago

adaussy commented 3 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please have a look to the support pages of our website : http://m2doc.org/support/

Current behavior

In the current implementation of the Addin, it happens (not all the time) that we get a validation message that says that it does not know one of the Eclass it should (registered in the platform). Other symptomes can be that the completion do not offer the attributes on that current type. Moreover it do not implies that the query is not successfully executed. The behavior can't be reproduce all the time. If you rewrite the same query again and again the behavior may change (Validation, Completion and execution).

A workaround is to provider an implemementation of org.obeonetwork.m2doc.services.configurator.IServicesConfigurator that manually register you metamodel on each method that give you access to the IReadOnlyQueryEnvironment. For example by:

((IQueryEnvironment)queryEnvironment).registerEPackage(YourEpackagePackage.eINSTANCE);

Expected behavior

Minimal reproduction of the problem with instructions

Hard to reproduce. But try using the addin on a template that use a meta model other than Ecore.

What is the motivation / use case for changing the behavior?

Environment


M2Doc version: 2.9.1
Eclipse version: 2019-09
Platform version: Windows 10

Others:

adaussy commented 3 years ago

This bug affect more that EPackage registration. It happen some time that older results from the server (validation for example) are not returned in order making the displayed validation message deprecated.

One solution could be to add a date to all request and answer from the server and the only keep last valid answer from the server for query evaluation, validation etc...