Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Saving AQL queries for use in Sirius model
Saving AQL queries for use in Sirius model [message #1858928] Tue, 02 May 2023 09:21 Go to next message
Jad El-khoury is currently offline Jad El-khouryFriend
Messages: 61
Registered: August 2015
Member

Is it possible to save AQL queries on a file somewhere, so that they can be called from within the Sirius odesign file?

In my odesign file, I call Acceleo queries saved in an MTL file. This allows me to reuse the same query from multiple locations in my design. This also makes the queries in the odesign file smaller, and easily readable.

I am trying to migrate these Acceleo queries to AQL, and would like to be able to do the same.
Re: Saving AQL queries for use in Sirius model [message #1858986 is a reply to message #1858928] Thu, 04 May 2023 06:35 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 705
Registered: July 2009
Senior Member
Hi,

No that is not possible with AQL.
If you feel the need to reuse parts of your queries because they start to become too long or too complex, the recommended approach is to write a Java service method for these parts.
AQL was designed to make this really easy: just write a Java class with methods following a simple convention, and register the class (instead of your .mtl) in your odesign file.
See this part of the documentation for the details: https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#service_methods

Regards,


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Saving AQL queries for use in Sirius model [message #1858987 is a reply to message #1858986] Thu, 04 May 2023 06:53 Go to previous message
Jad El-khoury is currently offline Jad El-khouryFriend
Messages: 61
Registered: August 2015
Member
Hi

I see. I have used Java classes in other contexts. I discovered 2 limiations (or uncertainties) when using Java - which I hope I am wrong about. Am I wrong in my conclusions below?

1. from the odesign file, I can call the java service starting with "service:". But I cannot call the Java service from an AQL/Acceleo query (for example: aql: aqlLogic(someJavaMethod())).
2. Acceleo (and I assume AQL) queries are stateless, which means that multiple calls to the same query (with the same parameters) result in only 1 call - since the same input results in the same output. Does this also apply to Java calls?

regards
Jad
Previous Topic:MTL query result don't match when tested in Sirius Interpreter
Next Topic:Setting choice of fonts
Goto Forum:
  


Current Time: Thu Oct 10 21:29:21 GMT 2024

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

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

Back to the top