How to display the diagrams linked to a model element (as in the semantic browser)

Hello everyone,

Currently I am working with M2Doc and I want to display the diagrams that are linked to an element (actor, component, function…)

I found a post about it ( link below ) , in this forum, “it’s how to display diagrams linked to a model element ( as in semantic browser )”, I tried to follow how it did but the result is that I display all diagrams of type ( System Data Flow Blank ).

In the Capella example, the “Aircraft” element is linked to 3 diagrams of type System Data Flow Blank, which are :

  • [SDFB] [BUILD] All functions.
  • [SDFB] [CAPABILITY] Provide audio and video intercommunication.
  • [SDFB] [CTX] Manage audio and video broadcast.

I just wanted to get these three diagrams, and in the end I I find myself with all 9 diagrams.

Do you have any ideas or suggestions?

In advance, thank you for your feedback.

Kinds
Meziane

https://forum.mbse-capella.org/t/diagram-related-to-an-element-in-m2doc/4457

The first step of the AQL expression in the referenced post can be simplified, but I think you need to select representations where the semantic element is present and visible (in the case of a diagram):

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

You will need to replace semanticElement by the AQL expression returning the value of your semantic element (for instance “Aircraft”).

NOTE: in the version of M2Doc extensions for Capella 5.1.0, services from the semantic browser will be added. You will be able to call the getAllRelatedDiagrams() service.

1 Like

Hello Yvan,

Thanks for your feedback, I’ll try this and I’ll also download the 5.1.0 version of Capella

Kinds
Meziane

M2doc extensions for Capella 5.1.0 are not released yet, so for the moment you probably want to stick with the AQL expression.

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