Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to handle derived types using GMF?
How to handle derived types using GMF? [message #215218] Wed, 14 January 2009 10:54 Go to next message
Michael Moser is currently offline Michael Moser
Messages: 914
Registered: July 2009
Senior Member
I am getting the error "Can't find genClass for class 'A' in package
foo" when trying to create the generator model for a given set of .ecore
and .gmf* fiels. I believe the reason being, that I have a type B that
extends ("generalizes") from that type A.

Originally (and designwise correct) would be if type B simply extends
type A. Since type A then didn't show up at all in selection lists when
trying to generate the GMF mappings, I guessed, that GMF maybe only
includes leaf types (i.e. types not further derived from) as valid
selections. To correct that I defined a type "AbstractA" and now have
two types A and B deriving from it, where A only extends but doesn't add
anything to it (i.e. functionality wise it's the same as before, only
the class hierarchy has slightly changed). That way ALL types that I
want to later see and manipulate in the diagram are leaf types. But,
alas, that didn't help much since I now get the error message "Can't
find genClass for class 'AbstractA' in package foo".

Is GMF not able to cope with such class hierarchies? I would be very
amazed, if it wouldn't.
But if it does, then why am I getting this error and what do I have to
do to get this working?

This is using the latest GMF 2.1.2 (Sept. 17, 2008) version.

Michael
Re: How to handle derived types using GMF? [message #215443 is a reply to message #215218] Thu, 15 January 2009 15:28 Go to previous messageGo to next message
Linda Damus is currently offline Linda Damus
Messages: 85
Registered: July 2009
Member
Michael,

I am also using GMF 2.1.2 to generate an editor. In my experience it
has no difficulty with hierarchies like you describe.

Michael Moser wrote:
> I am getting the error "Can't find genClass for class 'A' in package
> foo" when trying to create the generator model for a given set of .ecore
> and .gmf* fiels. I believe the reason being, that I have a type B that
> extends ("generalizes") from that type A.
>
> Originally (and designwise correct) would be if type B simply extends
> type A. Since type A then didn't show up at all in selection lists when
> trying to generate the GMF mappings, I guessed, that GMF maybe only
> includes leaf types (i.e. types not further derived from) as valid

I can't tell exactly what's wrong with your models, but if I were were I
would check the following:

- was 'A' abstract?
- did I pick a containment feature whose type is restricted to 'B' when
it should have been generalized to 'A'?
- did I reload the .gmfmap file after making changes in my .ecore model?

> selections. To correct that I defined a type "AbstractA" and now have
> two types A and B deriving from it, where A only extends but doesn't add
> anything to it (i.e. functionality wise it's the same as before, only
> the class hierarchy has slightly changed). That way ALL types that I
> want to later see and manipulate in the diagram are leaf types. But,
> alas, that didn't help much since I now get the error message "Can't
> find genClass for class 'AbstractA' in package foo".

Sounds like you forgot to reload the .genmodel after you modified the
..ecore model.

>
> Is GMF not able to cope with such class hierarchies? I would be very
> amazed, if it wouldn't.
> But if it does, then why am I getting this error and what do I have to
> do to get this working?
>
> This is using the latest GMF 2.1.2 (Sept. 17, 2008) version.
>
> Michael
>

Hope that helps,
Linda
Re: How to handle derived types using GMF? [message #215530 is a reply to message #215443] Fri, 16 January 2009 10:39 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander Shatalin
Messages: 2928
Registered: July 2009
Senior Member
Hello Linda, Michael,

> Sounds like you forgot to reload the .genmodel after you modified the
> .ecore model.
Exactly. This is a usual reason of such problems.

-----------------
Alex Shatalin
Re: How to handle derived types using GMF? [message #1044093 is a reply to message #215530] Thu, 18 April 2013 09:31 Go to previous message
Nicolas Scardilla is currently offline Nicolas Scardilla
Messages: 15
Registered: April 2013
Junior Member
Hello! I have the same problem! I do not try! Help please!
Previous Topic:Can't find genClass for class 'ATAGPlan' in package atagmetamodel' in package atagmetamodel
Next Topic:Best practice
Goto Forum:
  


Current Time: Sun Apr 20 22:58:02 EDT 2014

Powered by FUDForum. Page generated in 0.06973 seconds