Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » [AQL] allInstances operator not available
[AQL] allInstances operator not available [message #1810893] Wed, 21 August 2019 12:14 Go to next message
Nico Jansen is currently offline Nico JansenFriend
Messages: 10
Registered: August 2019
Junior Member
Hi,

I have a hard time using the allInstances() operator for AQL (in "normal" OCL, for example in the ecore metamodel this works fine for me). In a Sirius editor I try to select all instances of a specific class via AQL. The documentation of https://www.eclipse.org/acceleo/documentation/ indicates that something similimar to the following should be possible:

aql:basicfamily::Women.allInstances()

Unfortunately, this does not work. I have tried several variants of this but did not succeed. Is there something I am missing? I simply want to grep all instances of the class "Women", which are in my model.

Best regards and thank you in advance,
Nico
Re: [AQL] allInstances operator not available [message #1811004 is a reply to message #1810893] Fri, 23 August 2019 13:19 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 228
Registered: August 2010
Senior Member
Hi,

A bugzilla has been raised about this issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=487946
You can use this expression on the root object of your model instead: EObject.eAllContents(EClass) : Sequence{EObject}

Note that might cause important performance issues. It is really recommended to avoid requests that will iterate over the whole model. It is preferable to use more specific requests if you know the metamodel.

Regards,

Florian
Re: [AQL] allInstances operator not available [message #1811174 is a reply to message #1811004] Wed, 28 August 2019 07:31 Go to previous message
Nico Jansen is currently offline Nico JansenFriend
Messages: 10
Registered: August 2019
Junior Member
Hello Florian,

thank you for your response. I implemented a solution similar to your suggestion. I agree you should avoid anything like allInstances() at all costs ;)

Best regards,
Nico
Previous Topic:edge creation automatically
Next Topic:the value of radio and select widgets did'nt save after user choosing
Goto Forum:
  


Current Time: Sun Oct 20 14:37:09 GMT 2019

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

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

Back to the top