Home » Archived » EMF-IncQuery » IncQuery for RCP Applications
|
Re: IncQuery for RCP Applications [message #1687038 is a reply to message #1686262] |
Thu, 19 March 2015 13:18 |
Zoltan Ujhelyi Messages: 392 Registered: July 2015 |
Senior Member |
|
|
Hi,
(1) in general, the code snippet you have shown should be working, unless there is something unexpected in either the (compiled) pattern definition or the model. I would like you to look whether there is anything the either EMF-IncQuery itself reports in the development environment, or there is some more detailed log available from your application. There can be multiple causes that might result in this feature not working, but it is almost certainly either a configuration or compilation error. I can try helping figuring out, what happened, but I need some additional information, e.g. more detailed log, or source code that reproduces the issue itself, the version of EMF-IncQuery used.
(2) Yes, modelPath refers to the instance model file.
(3) In the incquery.net page, that uses an older version of EMF-IncQuery, the example there is not up-to-date. Use instead the Headless example from the wiki, that uses the generated patterns. The goal of using the fqn is to define generic code that handles different queries together generically; but if you want only to use specific queries, the generated API is a much better solution.
Cheers,
Zoltán
|
|
| |
Re: IncQuery for RCP Applications [message #1687262 is a reply to message #1687222] |
Thu, 19 March 2015 15:29 |
Zoltan Ujhelyi Messages: 392 Registered: July 2015 |
Senior Member |
|
|
Hi,
(1) that discussion concerns with EMF-IncQuery versions prior to 0.8.0, as since that release it is possible to execute queries with EMF-IncQuery; however in case of RCP applications it should work out-of-the-box with EMF-IncQuery 0.7.0 as well.
(2) This trace is much more helpful, as it contains the root cause: for some reason, an EReference is found that has no EPackage attribute set, which means more than likely there is an issue with accessing the metamodel. I would check the following things:
a) Is the metamodel project added to your RCP application?
b) Is your metamodel correctly registered? More specifically, in the plugin.xml of your metamodel project, there should be an extension of the extension point "org.eclipse.emf.ecore.generated_package"; please check whether its parameters are set up correctly, e.g. in synch with the metamodel itself (in case of moving the generated metamodel code, or changing the nsURI this often gets incorrect).
c) Is there any error message present in the log related to unloadable plug-ins (e.g. missing dependencies).
Finally, I would like to ask whether there is a reason for using version 0.7.0 of EMF-IncQuery, instead of 0.8 (released in June 2014) or 0.9 (relesed in Feb 2015), that feature several performance and usability enhancements over the 0.7 series (relesed in June 2013). If not, I would recommend updating it to a more current version.
Cheers,
Zoltán
|
|
| |
Re: IncQuery for RCP Applications [message #1689441 is a reply to message #1689430] |
Mon, 23 March 2015 15:33 |
Zoltan Ujhelyi Messages: 392 Registered: July 2015 |
Senior Member |
|
|
Hi,
about the original problem, I am out of ideas without seeing/debugging the code, sorry. However, if you could either provide me with the code, or give a reproducible example, I would be glad to look into it.
About the update issues, we changed the runtime API quite a bit in 0.8.0, but provided an updater tool for existing projects. Basically, right-click your IncQuery project, and select "Update/Add EMF-IncQuery Nature" from the "Configure" submenu. See also https://wiki.eclipse.org/EMFIncQuery/Releases/MigrateTo0.8
Cheers,
Zoltán
|
|
|
Re: IncQuery for RCP Applications [message #1690085 is a reply to message #1689441] |
Wed, 25 March 2015 08:01 |
Harkirat Singh Lamba Messages: 8 Registered: March 2015 |
Junior Member |
|
|
Hi,
I am using Incquery 0.8.1 with xText 2.6 and Eclipse Emf 2.10.2
The problem is the same as described above. As soon as I create a pattern, there are errors in the generated code.
I used the updater tool. But I created the project in Incquery 0.8.1 only and updater tool is used to migrate projects written using 0.7 version to 0.8 version. (Correct me if I'm wrong here)
Below is the link to the Incquey Project and ecore model.
github.com/Harkirat94/query-rcp-app
I have some doubts:
(1). Is generated class <patternname>QuerySpecification.java supposed to implement these methods ?
public IPatternMatch newEmptyMatch() { }
public IPatternMatch newMatch(Object... parameters) { }
public String getFullyQualifiedName() { }
public List<PParameter> getParameters() { }
protected Set<PBody> doGetContainedBodies() throws IncQueryException { }
If yes, then why they are not implemented ?
If it is not supposed to implement them, why the methods are declared in the base class?
(2). Methods getBundleName() and patternName() in the <patternname>QuerySpecification.java have @Override annotation but they are not declared in any of the Base classes. So they are reported as errors.
(3). I checked, the reference to the Base classes are done from proper Jars. (as in all base classes are referenced from jars of version 0.8.1).
I was not able to find the 0.9 version on the site. The integration build in the Eclipse site: www.eclipse.org/incquery/download.php is still an older version: 0.7.1
Could you suggest any particular stable working version I could use ?
Note 1: The same errors are reported in version 0.8.0 and 0.8.1. Only when these errors are resolved I will be able to proceed further to create the IncqueryEngine in which I faced the problem due to which I started this discussion.
Note 2: The RCP application I am working on is licensed. So, I have made a sample ecore model. Since, the problem concerns at the time of writing the pattern and at the time of auto-generated classes and ecore model is not traversed at this moment, so I don't think the complexity of ecore model is of concern. Correct me if I am wrong.
It would be very grateful if you could look into this matter and help me so that I could start working on querying model from within an RCP application.
Thank you.
[Updated on: Wed, 25 March 2015 08:05] Report message to a moderator
|
|
|
Re: IncQuery for RCP Applications [message #1690737 is a reply to message #1690085] |
Mon, 30 March 2015 22:48 |
Zoltan Ujhelyi Messages: 392 Registered: July 2015 |
Senior Member |
|
|
Hi,
first of all, I want to apologize for not getting back earlier, but I had some things to do in the meanwhile, and I almost forgotten about your post.
I downloaded your example in a new environment with EMF-IncQuery 0.8.1, and I was able to notice your issues. The missing method issues can be fixed by running the project updater: right click on the project, and select Configure/Update EMF-IncQuery nature. It changes the dependencies and builder settings a bit to accomodate for the new changes in version 0.8.0; for projects created in (or after) version 0.8.0, the new layout is used.
However, after that, some issues still remain: the code generator was having issues with the main EMF Package having the same name as the class referred by the query; more specifically, it was having trouble with the class 'Picklist.model.picklist.Picklist'. I have opened a bug for it in bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=463525; as a workaround I'd suggest renaming the 'base package' in the EMF generator model to 'picklist.model'; that solved the compile errors to me.
After compiling the project, I have adapted the headless application from the incquery example to run this single query, and it worked to me as expected. I have put my version of the projects online in a clone of your repository: https://github.com/ujhelyiz/query-rcp-app
Finally, thank you for reminding me of not putting out a downloadable zip file for IncQuery 0.9.0 onto the download site. We will get it out shortly.
I hope, these results are helpful, and sorry again for the answer to take this long.
Cheers,
Zoltán
|
|
| | |
Goto Forum:
Current Time: Fri Sep 20 02:20:22 GMT 2024
Powered by FUDForum. Page generated in 0.05560 seconds
|