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’)}
{m:f.name}
{m:endfor}{m:endfor}

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 | x.description.name.endsWith(‘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.

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

Regards

I just see this also using : aql:self.description.name !!!

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

my learning curve is very low :frowning:

Thank you for your expert support folks !!

{ m: self.getAllDAnalysis().ownedViews.ownedRepresentationDescriptors->select(x | x.description.name.endsWith(‘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
org.obeonetwork.capella.m2doc.aql.queries.M2DocGenService
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 | x.description.name.endsWith(‘Scenario’) = true)}

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