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

Erroneous result and Info/Error thrown in some cases of type filtering #438

Open flatombe opened 3 years ago

flatombe 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 some cases, the validation fails to understand legit containment situations and throws INFO: Empty collection: Nothing will be left after calling ... or ERROR: Nothing will be left after calling ...

Minimal reproduction of the problem with instructions

In a Capella model with additional metamodel URIs http://www.polarsys.org/capella/common/re/1.4.0 and http://www.polarsys.org/kitalpha/emde/1.0.0, the following query self.eAllContents(re::CatalogElementLink) with self being an instance of SystemEngineering, throws the following log: INFO: Empty collection: Nothing will be left after calling eAllContents: EClassifier=SystemEngineering can't contain EClassifierLiteral=CatalogElementLink direclty or indirectly (4, 41) and returns an empty collection.

In the same context, the query self.eAllContents->filter(re::CatalogElementLink) works as expected.

Reversely, self.eAllContents->filter(re::CatalogElementLink).eContainer(capellamodeller::Project) throws error ERROR: Nothing will be left after calling eContainer: EClassifierLiteral=Project can't contain directly or indirectly EClassifier=CatalogElement.

Note that for some types of the "re" metamodel, the initial call to eAllContents works as expected (e.g. ReAbstractElement, ReNamedElement, etc.), and for others it produces the error above.

Environment


M2Doc version: 3.2.0.202105181517
Eclipse version: Capella 1.4.1.202006301603
Platform version:  Windows 10
ylussaud commented 2 months ago

This issue is related to this one, it comes from AQL and has been fixed in AQL 8.x. I don't think I'll back port this to AQL 7.x since Sirius is moving to AQL 8.x for it's next release. When M2Doc moves to AQL 8.x we need to check this.