How to handle derived types using GMF? [message #215218] |
Wed, 14 January 2009 15:54 |
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 20:28 |
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04111 seconds