Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » EMF-IncQuery » Query UML-model with UML-profile: no matches
Query UML-model with UML-profile: no matches [message #1716155] Tue, 01 December 2015 18:41 Go to next message
Jens Bürger is currently offline Jens BürgerFriend
Messages: 55
Registered: October 2012
Member
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 #1716160 is a reply to message #1716155] Tue, 01 December 2015 19:31 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi Jens,

the scenario you are describing should be working. 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. To check this, you have to look into the uml files at the xml level, and check how the profile is referenced.

A further idea to check to turn on the dynamic mode in IncQuery. For the Query Explorer, you could turn this on in the Preferences (EMF-IncQuery/Query Explorer page), while for the runtime you could add an extra setting for EMFScope.

If neither of these ideas help, I'd like to ask to somehow share an example that we can try out. It would help in figuring out where the issue lies.

Cheers,
Zoltán
Re: Query UML-model with UML-profile: no matches [message #1716222 is a reply to message #1716160] Wed, 02 December 2015 10:18 Go to previous messageGo to next message
Jens Bürger is currently offline Jens BürgerFriend
Messages: 55
Registered: October 2012
Member
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 136 times)
Re: Query UML-model with UML-profile: no matches [message #1716223 is a reply to message #1716222] Wed, 02 December 2015 10:24 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan UjhelyiFriend
Messages: 392
Registered: July 2015
Senior Member
Hi Jens,

basically, dynamic profiles are not supported currently by EMF-IncQuery. You have created a static profile in a separate plug-in, but you have to install it for Papyrus to know about it. To prepare everything, you can have a look at the blog post of Alexander Nyssen: http://nyssen.blogspot.hu/2009/09/defining-static-profiles-with-eclipse.html; and then you have to install this plug-in. After the installation, the profile definition should be available from Papyrus.

I will try to have a more detailed look at your example to provide more concrete hints, but I am not sure I can do that today.

Cheers,
Zoltán
Re: Query UML-model with UML-profile: no matches [message #1716287 is a reply to message #1716223] Wed, 02 December 2015 17:05 Go to previous message
Jens Bürger is currently offline Jens BürgerFriend
Messages: 55
Registered: October 2012
Member
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.
Previous Topic:How to generate java files from inc query definition file (.eiq files)
Next Topic:Using IncQuery to compute derived values
Goto Forum:
  


Current Time: Thu Apr 18 10:59:49 GMT 2024

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

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

Back to the top