M2DOC problem accessing a diagram inside a component package

Hello

I am trying to export a diagram with M2Doc. This diagram is “located” into a PhysicalComponentPkg, inside a PhysicalComponent, as shown below:

image

I have successfully verified the following query in the sirius interpreter:
aql:self.eInverse(viewpoint::DRepresentationDescriptor)
where self is the PhysicalComponent (e.g. PC4 in the picture above).
This query returns a collection of DRepresentationDescriptor, containing the expected diagram.

However, I cannot seem to retrieve this object with M2Doc with the equivalent M2Doc query:
{m: node.eInverse(viewpoint::DRepresentation)}

The above commands returns an empty collection, so not consistent with the sirius interpreter, unless of course I missed something in the process.

I also tried using the service asImageByRepresentationDescriptionName on the PhysicalComponentPkg, but that did not produce any result either.

Would anyone have a suggestion how to export this diagram using M2Doc ?

Cheers
Cedric

AQL (the query language used by M2Doc) use the crossfererencer provided by Sirius and I know that it doesn’t provide crossreferences to the representations. So I’m not sure why it works in the Sirius interpreter.
You can try the representationByDescriptionName() service:

 self.ownedPhysicalComponentPkgs->select(pp | pp.name = 'PhysicalComponentPkg 1').representationByDescriptionName('Physical Architecture Blank')

Works perfectly, thanks!

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