Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EMF-IncQuery » Variable has a type which has multiple definitions
Variable has a type which has multiple definitions [message #1244120] Tue, 11 February 2014 18:33 Go to next message
Emre T is currently offline Emre T
Messages: 119
Registered: April 2013
Senior Member
Hello,

I am getting the error written in the subject. It is a parameter in a @QueryBasedFeature pattern definition. The variable is defined as the Target and it is an EClass from an imported Ecore package. Though I don't get what I should understand from "multiple definitions", the only thing I can imagine is that it might have something to do with, that this target EClass has more than one ESuperType.

Do you have any idea what the reason might be?

Thanks!

Emre
Re: Variable has a type which has multiple definitions [message #1244399 is a reply to message #1244120] Wed, 12 February 2014 04:25 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan Ujhelyi
Messages: 203
Registered: July 2009
Senior Member
Hi,

such issues mostly happen when somehow in the background there are two (or more) ways to refer to EPackages. It could happen when you are using a metamodel that refers to another metamodel, and these metamodels are reached both via this cross-metamodel reference and a direct EPackage import.

I cannot be more concrete without seeing some pattern/metamodel code; so if this does not help, could you please share somehow an example that reproduces this issue?

Cheers,
Zoltán
Re: Variable has a type which has multiple definitions [message #1245204 is a reply to message #1244399] Thu, 13 February 2014 08:07 Go to previous messageGo to next message
Emre T is currently offline Emre T
Messages: 119
Registered: April 2013
Senior Member
Hello Zoltan,

yes, I believe that might b the case. Since the referenced elements from the imported package are indeed in different Ecore models, which have been brought together into this main model. I am unfortunately not allowed to alter this mentioned meta-model, though some how by using the IncQuery-project in runtime Eclipse instance are the warnings errors gone.

Best regards,
Emre
Re: Variable has a type which has multiple definitions [message #1245211 is a reply to message #1245204] Thu, 13 February 2014 08:17 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan Ujhelyi
Messages: 203
Registered: July 2009
Senior Member
Hi,

for these cases we are maintaining the option to define custom uris for metamodels in IncQuery Generator models in the project root. Such a generator model.

As an example, look at https://github.com/ujhelyiz/EMF-IncQuery-Examples/blob/master/school/school.incquery/generator.eiqgen; in this case it is commented out as it is not required anymore for that project.

Using this redirect you could enforce that the parent metamodel is only accessed through a consistent uri, thus removing the mentioned warning. In the runtime workspace, the warning is removed because there is no longer two different uri that is used to reach the metamodel.

I hope, this was clear.

Cheers,
Zoltán
Re: Variable has a type which has multiple definitions [message #1253909 is a reply to message #1245211] Sat, 22 February 2014 16:07 Go to previous messageGo to next message
Emre T is currently offline Emre T
Messages: 119
Registered: April 2013
Senior Member
Hi Zoltan,

is this generator.geneiq only for genmodels? Or can I import with it also EPackages?

Also, I have found the real reason, why this warning was being showed, since some imported Models and EPackages, I was referencing in my queries, were both in my Plugin registry of the development environment as well as in my workspace. I had imported these Plugins into the workspace for some digging in. But in another workspace, where they weren't imported, the warning were gone.

Best regards,
Emre
Re: Variable has a type which has multiple definitions [message #1255247 is a reply to message #1253909] Mon, 24 February 2014 03:38 Go to previous message
Zoltan Ujhelyi is currently offline Zoltan Ujhelyi
Messages: 203
Registered: July 2009
Senior Member
Hi,

the eiqfiles only support loading genmodels, as for an EPackage in a custom location there is no way to find the corresponding GenPackage, thus rendering our code generator mostly unusable.

Thanks for reporting back your solution to your issue - sadly, we do not have more easy-to-use solutions for finding such problems. We had some ideas about using the eiqgen file as a way to define _the_ solution for these problematic cases, but for now, we have only half of the solution, at least until https://bugs.eclipse.org/bugs/show_bug.cgi?id=398821 is fixed. After that point, the process of selecting EPackages/GenPackages should be well customizable.

Cheers,
Zoltán
Previous Topic:Unique names of derived features?
Next Topic:Accessing the values of attributes/references in pattern bodies
Goto Forum:
  


Current Time: Sat Aug 23 01:33:08 EDT 2014

Powered by FUDForum. Page generated in 0.02586 seconds