"Visible in Documentation" attribute, for model elements

Hi,

I have read the three previous topics addressing this issue (1 2 3) and the resulting (closed) issue topic M2Doc for Capella should support the “Visible in documentation” field for diagrams · Issue #16 · ObeoNetwork/Capella-Extensions · GitHub.
My understanding at this time, is that to use the isVisibleInDoc() command, an if-statement should be applied whenever you want to retrieve a set of diagrams while taking into account the 'Visible in documentation" attribute, is this correct?
My current command structure, which seems to work fine, is as follows:

m:for diag | viewpoint::DRepresentation.allInstances()
m:if diag.isVisibleInDoc()=true Here the =true can also be removed, but can also be replaced with =false to find those that are set to false
m: diag.asImage etc…
m:endif
m:endfor

However, nowhere did I see addressed the need to account for this attribute when retrieving for example all operational capabilities from the model. The attribute itself is available in the properties of each model element but seemingly there is no way to use it.
When I retrieve all operational capabilities from my model in a simple for-loop, the ones for which the attribute is set to false also show up, and as the .isVisibleInDoc() command is a Sirius Service, the if-statement or select command can’t be applied when retrieving all operational capabilities.

Is there a way to also address this attribute for all other model elements?
Thanks in advance.

Kind regards,
Pieter Degeling

Hello Pieter,

After a quick test, it seems you can use the attribute “visibleInDoc” for this.

Example for getting a list of all Logical Capabilities having the “Visible In Documentation” attribute set to true :
m:for mycapa | self.eAllContents(la::CapabilityRealization)->select(x|x.visibleInDoc)

Regards

1 Like

Hi Dimitri,

Thank you for the response!
How did you find out that this command exists?

I just realised that you can use selection.eClass().eAllAttributes in the M2Doc interpreter to find this command. In general, I am having a hard time navigating between all the different commands that are availabe.

Regards,
Pieter

I usually look at the “Expert” or “Semantic” Tab (in the properties views, depending if you selected an object in the Project Explorer or on a diagram) to identify commands name (same name as in the Expert Tab, without space and without the first UpperCase)

Regards

1 Like