Query UML-model with UML-profile: no matches [message #1716155] |
Tue, 01 December 2015 13:41  |
Eclipse User |
|
|
|
Hello everyone,
My setup is:
Eclipse Mars .1
EMF-IncQuery 1.0.1
What I have done so far to make the profile importable in EMF IncQuery:
- plugin project containing the UML profile
- create genmodel and ecore from the UML profile
- generate model code from the genmodel
- set the org.eclipse.emf.ecore.generated_package extension (as well as org.eclipse.uml2.uml.dynamic_package)
I have a UML model incorporating a state chart diagram and a UML profile extending state chart transitions with a stereotype named ensureRole. So, for testing purposes, I want to query all instances of ordinary state chart transitions and ensureRole instances, and my query definition file looks as follows:
package test
import "http:///UMLsecES.ecore"
import "http://www.eclipse.org/uml2/5.0.0/UML"
pattern findER(y){
ensureRole(y);
}
pattern findTrans(x){
Transition(x);
}
While all instances of the state chart transitions are found, the import of the profile works fine and ensureRole is recognized, but has no matches.
Any hints?
Thanks in advance
|
|
|
|
Re: Query UML-model with UML-profile: no matches [message #1716222 is a reply to message #1716160] |
Wed, 02 December 2015 05:18   |
Eclipse User |
|
|
|
Hi Zoltan,
thank you for your quick reply.
Zoltan Ujhelyi wrote on Tue, 01 December 2015 14:31
The only thing that comes to my mind that could cause such issues that the stereotypes in your instance model were using the dynamic version of the profile (e.g. not the one you have generated from the genmodel), while the query specification uses the static version.
This seems to be the case.
Looking at the XML file, appartently only the *profile.uml-file is referenced. However, I'm not sure how to tell Papyrus to apply the Ecore-version.
Zoltan Ujhelyi wrote on Tue, 01 December 2015 14:31
A further idea to check to turn on the dynamic mode in IncQuery.
I did that, it doesn't seem to make any difference.
For further investigation, I provide a zip-file containing
- the plugin containing the UML profile
- the EIQ-plugin also containing 2 minimalistic test models
Attachment: eiqtest.zip
(Size: 80.67KB, Downloaded 182 times)
|
|
|
|
Re: Query UML-model with UML-profile: no matches [message #1716287 is a reply to message #1716223] |
Wed, 02 December 2015 12:05  |
Eclipse User |
|
|
|
I think I have figured it out. Two things needed to be changed:
First, uris as defined in the profile, ecore and extension points need to be the same. Second, as stated by the blog post you reference, the extension point org.eclipse.uml2.uml.generated_package
needs to be set. After applying these two changes to the profile plugin project, EMF IncQuery finds instances of my stereotype!
Thanks a lot, now I can investigate how to build sophisticated queries and trigger them programmatically.
|
|
|
Powered by
FUDForum. Page generated in 0.04201 seconds