Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to get all of the instances of a class using AQL queries
How to get all of the instances of a class using AQL queries [message #1823940] Sat, 04 April 2020 09:47 Go to next message
maryam mehrabi is currently offline maryam mehrabiFriend
Messages: 25
Registered: May 2019
Junior Member
Hello all,

I have a situation in my metamodel just like the figure below. Now I created a graphical editor using sirius for it but I had two questions when the elements generated by the user using pallette.

metamodel:
index.php/fa/37747/0/

viewpoint file:
index.php/fa/37748/0/

1. I want when the user tries to create classA element the creation will check using an AQL query and if the element generated before the element doesn't create again. Now the problem is how could I get all of the classA instances in AQL ?????

2. In advance, how could I check the att1 attribute type in each instance and for example if the att1 is T1 the element does not create?????? how could I reach to this attribute type in instances?????

I will appreciate if anyone could help :-)

Maryam
Re: How to get all of the instances of a class using AQL queries [message #1824020 is a reply to message #1823940] Mon, 06 April 2020 15:02 Go to previous messageGo to next message
maryam mehrabi is currently offline maryam mehrabiFriend
Messages: 25
Registered: May 2019
Junior Member
any help????
Re: How to get all of the instances of a class using AQL queries [message #1824139 is a reply to message #1823940] Wed, 08 April 2020 13:17 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 701
Registered: July 2009
Senior Member
Hi,

to find all the instances of a class in the same model/resource, you can use an expression like this:

aql:self.eResource().eAllContents(my::Type)


See the AQL reference documentation for more details: https://www.eclipse.org/acceleo/documentation/aql.html



Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Can't use aql due to java.lang.IllegalStateException
Next Topic:Readonly attribute
Goto Forum:
  


Current Time: Fri Mar 29 07:17:37 GMT 2024

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

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

Back to the top