AQL query problems [message #1719321] |
Thu, 07 January 2016 03:31  |
Eclipse User |
|
|
|
Hi,
I would like to start using AQL queries but am a total novice, so I soon ran into some problems:
- my edge creation tool needs to query for a Precondition:
aql:preSource.successors->size() < aql.preSource->getMaxSuccessorCount()
where successors keeps references to other EObjects. size() works correctly, the query works if I replace the righthand side by an int constant.
getMaxSuccessorCount() is an EOperation defined in the model. However this query does not work, how do I call getMaxSuccessorCount() correctly?
- how do I debug such queries correctly?
The model requests interpreter simply shows no results, but also no error messages
(of course I replaced the preSource reference by self.target and selected the correct node)
thanks
Christian
|
|
|
|
|
|
Re: AQL query problems [message #1719401 is a reply to message #1719344] |
Thu, 07 January 2016 11:23  |
Eclipse User |
|
|
|
> still aql:self.target.getMaxSuccessorCount() does not work, neither in the Interpreter view, nor for the precondition. When used in the precondition it always returns false and edge creation is disabled.
This definitely looks like a bug then. Isn't the implementation called at all ? did you try setting a breakpoint ? Can you confirm your ecore model is deployed as a plugin and is not in the runtime workspace ?
Furthermore, errors should have been reported in the interpreter view, isn't there anything in the error log neither ?
These areas have been improved quite a bit in the last few months, could you please give us the exact versions of AQL (org.eclipse.acceleo.query) and Sirius (org.eclipse.sirius) involved please ?
A query like :
aql:preSource.getSuccessors().size() < 2
would mean "call the method size() on every element which is in the collection returned by getSuccessors() whereas ->size() means "call the method size() on the collection.
In this case I guess there is no such method (could be an EOperation or a method contributed through an external Java class with the signature :
public int size(Successor s)
Let's say you start from an EPackage :
aql:self.eAllContents(ecore::EAttribute).name
will return a list containing all the names, a list of String then.
aql:self.eAllContents(ecore::EAttribute).someCall()
will apply the call on every EAttribute and return a list containing the results of these calls.
|
|
|
Powered by
FUDForum. Page generated in 0.10535 seconds