Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Show only parent nodes.
Show only parent nodes. [message #1804450] Tue, 26 March 2019 10:36 Go to next message
Bushra Harraq is currently offline Bushra HarraqFriend
Messages: 5
Registered: February 2019
Junior Member
Hi,

in the follwing the metamodel constellation is documented:

http://prntscr.com/n32fnd

http://prntscr.com/n32fnd

To get all the Processes:
aql: self.process


Now, I want to show all node, which don't have a parent Process. Here is my approach, which does not work. Please correct me.

aql: self.process -> select(myProcess | myProcess.eInverse(subProcesses) -> size = 0)


Thank you,
Bushra

[Updated on: Tue, 26 March 2019 13:12]

Report message to a moderator

Re: Show only parent nodes. [message #1804476 is a reply to message #1804450] Tue, 26 March 2019 14:28 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 463
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Bushra,

The AQL documentation can be found here: https://www.eclipse.org/acceleo/documentation/

There are several eInverse method with or without parameters:
- eInverse() (no parameter) : returns any element which as a relationship with the current one
- eInverse(packageName::EClassName) : returns only instances of the given type.
- eInverse('featureName') : more explicit and query for a specific reference name

Please also note that
- -> isEmpty is equivalent to -> size() = 0
- the opposites would be myEelement.ref1.ref2 -> size() <> 0 or not (myElement.ref1.ref2 -> isEmpty())

In your case, you should try:
aql: self.process -> select(myProcess | myProcess.eInverse('subProcesses') -> isEmpty())


Regards,


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

Join the Sirius community at SiriusCon. Register for free: Nov. 9th Paris
http://www.siriuscon.org/
Previous Topic:Integrating sirius into xtext
Next Topic:Automatic creation diagram
Goto Forum:
  


Current Time: Wed Oct 23 21:37:59 GMT 2019

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

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

Back to the top