Access to Related Diagrams

You can use:
senario.representationByDescriptionName(‘Exchange Scenario’)
It returns a Sequence of DRepresentation.
PS: there was a typo in the documentation referencing an other service in the example. I fixed it.

I have a strange error with a script like this:

{m:for f | self.eAllContents()}{m:for rep | f.representationByDescriptionName(‘Exchange Scenario’)}

Nothing issue !! even if I have plenty of Exchange Scenario ([ES] & [LES]

if I change the ‘Exchange Scenario’ by ‘Class Diagram Blank’ it works, I have all my CDB

I tried another way :
aql: self.getAllDAnalysis().ownedViews.ownedRepresentationDescriptors->select(x |‘Scenario’) = true)

It works in the Sirius interpreter but in a Template it tells me that it does not find getAllDAnalysis() !?!

This should not create any error.
Do you have a stack trace in the error log ?

The service getAllDAnalysis() is declared in the org.polarsys.capella.core.sirius.analysis.CapellaServices, you can try to import it using the template property wizard. It will be included in the M2Doc extensions for Capella 5.0.0 when selecting the Capella token.

You should use “Component Exchanges Scenario” instead of “Exchange Scenario”


I just see this also using : !!!

aql: self.getAllDAnalysis().ownedViews.ownedRepresentationDescriptors->select(x |‘ges Scenario’) = true)

my learning curve is very low :frowning:

Thank you for your expert support folks !!

{ m: self.getAllDAnalysis().ownedViews.ownedRepresentationDescriptors->select(x |‘Scenario’) = true)}

I put is like that in a Capella model

Couldn’t find the ‘getAllDAnalysis(EClassifier=SystemEngineering)’ service
Couldn’t find the ‘aqlFeatureAccess(org.eclipse.acceleo.query.runtime.impl.Nothing,java.lang.String)’ service
Couldn’t find the ‘aqlFeatureAccess(org.eclipse.acceleo.query.runtime.impl.Nothing,java.lang.String)’ service
Couldn’t find the ‘select(org.eclipse.acceleo.query.runtime.impl.Nothing,org.eclipse.acceleo.query.runtime.impl.LambdaValue)’ service

That’s the awnser …
I do not see how to add the feature you told me : org.polarsys.capella.core.sirius.analysis.CapellaServices

I guess it is in the Tab “Service (expert)” where I find the Service Class
but clicking on Add does not provide me anymore item to install
Thanks in advance !! :slight_smile:

Took me a while but you can also use AQL to get all available representations from a representation:
{m:rep.oclAsType(viewpoint::DRepresentation).precedingSiblings(viewpoint::DAnalysis).ownedViews.ownedRepresentationDescriptors->select(x |‘Scenario’) = true)}

You can get the first representation (rep) using Sirius services.

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