Missing diagram in M2Doc generated document

Hi all,
I am using the following snippet to discover and draw diagrams associated to an Operational Entity

While the Operational Role Blank diagrams are found and included in the documentation, the Operational Architecture Blank diagrams are missing. All diagrams have the same “target”.
The same result is obtained using the M2doc interpreter embedded in M2Doc 3.2.0. I am using Capella 1.4.1.

Any suggestion or workaround? Is it a bug or am I missing something?

Thanks
Pier Giorgio

The Operational Architecture Blank diagrams are defined on oa::EntityPkg and not oa::Entity elements. You can check that using the following AQL expression in the interpreter and select the background of a Operational Architecture Blank diagram:

self.target.eClass()

So to retrieve the diagram with representationBydescriptionName() you should call the service using an EntityPkg. Also for this kind diagram the displayed representation description name and the real representation description name is not the same. To retrieve the name of a diagram description, you can click on the backgroun of a diagram and use the following AQL expression in the interpreter:

self.description.name

In this case you should see ‘Operational Entity Blank’

So the complete expression should be:

someEntityPkg.representationBydescriptionName('Operational Entity Blank')

If you want to insert a diagram that represent a given Entity, you can use this AQL expression:

diagram::DSemanticDiagram.allInstances()->select(d | d.representationElements->select(re | if re.oclIsKindOf(diagram::DDiagramElement) then re.visible else true endif)->including(d).target->includes(semanticElement)).name

Where semanticElement is your Entity.