Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Polarsys » M2Doc » List of Referencing Elements
List of Referencing Elements [message #1818852] Mon, 30 December 2019 13:47 Go to next message
Mathias Cocheri is currently offline Mathias CocheriFriend
Messages: 21
Registered: December 2019
Junior Member
Hello,

Any hints on how I could retrieve the list of referencing elements for an element of the model ?

More specifically, I want to get the list of the scenarios referencing a specific component.

Mathias

Re: List of Referencing Elements [message #1818962 is a reply to message #1818852] Fri, 03 January 2020 15:48 Go to previous messageGo to next message
Yvan Lussaud is currently offline Yvan LussaudFriend
Messages: 63
Registered: July 2009
Member
If the scenario directly reference the Component you can use:
{m:myComponent.eInverse()}
you can also filter with the type of scenario or use the name of the reference between scenario and component as parameter.
{m:myComponent.eInverse(interaction::Scenario)}

But it doesn't seems like a direct relation. Maybe someone having a deeper understanding of the Capella metamodel can help you.
Re: List of Referencing Elements [message #1818965 is a reply to message #1818962] Fri, 03 January 2020 16:09 Go to previous messageGo to next message
Mathias Cocheri is currently offline Mathias CocheriFriend
Messages: 21
Registered: December 2019
Junior Member
Yes, it is not a direct relation.

The component does not appear in the "Referenced Elements" list of the scenarios. Somehow the Semantic Browser is able to do that so the relation exists, but not sure that there is an aql attribute or method to get those.
Re: List of Referencing Elements [message #1818972 is a reply to message #1818965] Fri, 03 January 2020 18:57 Go to previous messageGo to next message
Stephane LACRAMPE is currently offline Stephane LACRAMPEFriend
Messages: 217
Registered: July 2009
Senior Member
Here is a query that may help (I am not saying that this is the most efficient one), it is finding all the OA Scenarios that are containing an "Aircraft" entity...
eAllContents()->filter(interaction::Scenario)->select(s | s.ownedInstanceRoles->one(i | i.representedInstance.name = 'Aircraft'))

I hope this helps
Stéphane


Stephane LACRAMPE
Obeo Canada
Re: List of Referencing Elements [message #1819055 is a reply to message #1818972] Mon, 06 January 2020 13:30 Go to previous messageGo to next message
Mathias Cocheri is currently offline Mathias CocheriFriend
Messages: 21
Registered: December 2019
Junior Member
Hello Stéphane,

It is working as expected ! Thanks !

--
My 2 cents:

Sadly, the learning curve with M2Doc is really slow and one have to constently invent new ways to extract the information from the model.

I think that it could be easier if the possibiity of M2Doc was at least aligned with what the Semantic Browser displays.

Example:The Semantic Browser displays a relation between 2 elements -> Just use self.nameOfTheRelation or something similar but with always the same syntax.

While being true for some of them, it is not always the case (and sometimes it is only because the name is slightly different).
Re: List of Referencing Elements [message #1819117 is a reply to message #1819055] Wed, 08 January 2020 08:59 Go to previous message
Yvan Lussaud is currently offline Yvan LussaudFriend
Messages: 63
Registered: July 2009
Member
This could be a service for instance semanticRelation('relation name'). You can open a bug here this way it might be implemented.

The main problem with M2Doc is the lack of completion. I'm working on this.
Previous Topic:M2Doc template migration
Next Topic:State Fragments are doubled
Goto Forum:
  


Current Time: Fri Apr 26 21:30:00 GMT 2024

Powered by FUDForum. Page generated in 0.03096 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top