Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Polarsys » M2Doc » AQL: How to find the owner of a port?
AQL: How to find the owner of a port? [message #1822353] Wed, 04 March 2020 17:36 Go to next message
Fábio Guarita is currently offline Fábio GuaritaFriend
Messages: 64
Registered: December 2019
Member
I'm trying to create a template to generate a list of interfaces (exchanges) among similar items, for instance: Behavior Components on Physical Architecture.

I was able to find the AQL expression to filter all ports in ComponentExchanges in the PA perspective:

aql:self.containedPhysicalArchitectures.eAllContents(fa::ComponentExchange).source

aql:self.containedPhysicalArchitectures.eAllContents(fa::ComponentExchange).target

self -> is the SystemEngineering element from my project.

but I wasn't able to get the name/ID of the owners of the ports I retrieved with this query. getSourcePart() and getTargetPart() doesn't seem to get me anywhere... I checked the Capella reference and couldn't find a hint of port property that could get me from port to owned component.

Is there any simple way of finding the owner of the port or do I have to list all Components and filter them with the port in question? (in the latter option, how can I do this?)
Re: AQL: How to find the owner of a port? [message #1822372 is a reply to message #1822353] Thu, 05 March 2020 07:54 Go to previous messageGo to next message
Yvan Lussaud is currently offline Yvan LussaudFriend
Messages: 63
Registered: July 2009
Member
You have a EReference sourcePort and targetPort on ComponentExchange:

self.containedPhysicalArchitectures.eAllContents(fa::ComponentExchange).sourcePort

self.containedPhysicalArchitectures.eAllContents(fa::ComponentExchange).targetPort

Both will return a Sequence of fa::ComponentPort
Re: AQL: How to find the owner of a port? [message #1822381 is a reply to message #1822372] Thu, 05 March 2020 10:24 Go to previous messageGo to next message
Fábio Guarita is currently offline Fábio GuaritaFriend
Messages: 64
Registered: December 2019
Member
Hi Yvan, thanks for your answer,

I was already able to list source and target ports of ComponentExchanges. What I really want is to find the Component that owns a specific port. The intent is to list the component exchanges and the source and target components (not the ports, since the readers of the docs will be familiar with component names).
Re: AQL: How to find the owner of a port? [message #1822383 is a reply to message #1822381] Thu, 05 March 2020 12:17 Go to previous messageGo to next message
Aurelien Pinsonneau is currently offline Aurelien PinsonneauFriend
Messages: 15
Registered: February 2020
Junior Member
Hello,
You can use the query "eContainer()" in order to navigate from the port toward it's parent element = the component
Re: AQL: How to find the owner of a port? [message #1822385 is a reply to message #1822383] Thu, 05 March 2020 12:25 Go to previous message
Fábio Guarita is currently offline Fábio GuaritaFriend
Messages: 64
Registered: December 2019
Member
Aurelien, that works perfectly, thanks!
Previous Topic:Impossible to delete blank line in generated word with template
Next Topic:Multi-column tables in M2Doc
Goto Forum:
  


Current Time: Sun Nov 27 13:40:05 GMT 2022

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

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

Back to the top