Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Mistake when I try to do an extension genmodel with the M6 version
Mistake when I try to do an extension genmodel with the M6 version [message #227497] Mon, 27 April 2009 08:52 Go to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 341
Registered: July 2009
Location: Paris Saclay, France
Senior Member
Hi,

I try to migrate may work with the last version of gmf.
In my case I use an extension genmodel to add particularities in the code
generation.

To do the extension for gen model, I create an ecore file, and I add a
reference to the GenCommon base. Then
I generate the genModel, but I obtain the following warning:
"The generic type associated to the 'EJavaClass' Classifier shoudl have 1
type argument(s) to match the number of type parameter(s) of the
classifier".

And if I continue I cannot fo reference to It in my custom template.

Patrick
Re: Mistake when I try to do an extension genmodel with the M6 version [message #227501 is a reply to message #227497] Mon, 27 April 2009 09:23 Go to previous messageGo to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 341
Registered: July 2009
Location: Paris Saclay, France
Senior Member
I downloaded the plugin codegen, and I don't succed to validate the viewmap
element of the gmfgen.ecore
This is the same mistake as before.

Patrick

"Patrick Tessier" <Patrick.Tessier@cea.fr> a
Re: Mistake when I try to do an extension genmodel with the M6 version [message #227609 is a reply to message #227501] Mon, 27 April 2009 12:14 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Patrick,

There is a validation problem in gmfgen.ecore, but even with this problem
it is possible to successfully generate working code from there, so the reason
is not in a validation of .ecore file i think.

-----------------
Alex Shatalin
Re: Mistake when I try to do an extension genmodel with the M6 version [message #227640 is a reply to message #227609] Mon, 27 April 2009 13:39 Go to previous messageGo to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 341
Registered: July 2009
Location: Paris Saclay, France
Senior Member
Yes, indeed I have succeed to generate the genmodel and generated code.

I try to modify a template. The completion by taking in account the model
extension runs but when I generate code, I obtain the following error for
the element of my model extension:
org.eclipse.gmf.internal.xpand.model.EvaluationException: Unrecognized
variable:

Patrick


"Alex Shatalin" <vano@borland.com> a
Re: Mistake when I try to do an extension genmodel with the M6 version [message #227661 is a reply to message #227640] Mon, 27 April 2009 13:52 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Patrick,

Do you know exactly wich variable was not recognized?
Onfortunately there is no debug support for xpand in GMF, so you have to
debug templates by tracing/modifying it..

-----------------
Alex Shatalin
Re: Mistake when I try to do an extension genmodel with the M6 version [message #227668 is a reply to message #227661] Mon, 27 April 2009 14:02 Go to previous messageGo to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 341
Registered: July 2009
Location: Paris Saclay, France
Senior Member
The variable that is not recognized is the meta element.

I have tried this test in the template:

Re: Mistake when I try to do an extension genmodel with the M6 version [message #227688 is a reply to message #227668] Mon, 27 April 2009 14:38 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Patrick,

> //ExtendedeGenNode.allInstances()->size()
> ExtendedeGenNode is a element of my model gmfgenextension.
> The error is the variable ExtendedeGenNode is not recognised.
Can you try something like:
<<gmfgenextension::ExtendedeGenNode.allInstances()->size()> >?
BTW, in do you have any compilation errors from xpand? It should highlight
this place.


-----------------
Alex Shatalin
Re: Mistake when I try to do an extension genmodel with the M6 version [message #227803 is a reply to message #227688] Tue, 28 April 2009 07:50 Go to previous messageGo to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 341
Registered: July 2009
Location: Paris Saclay, France
Senior Member
There is a mistake :" couldn't find operation 'allInstances' for EClass"

"Alex Shatalin" <vano@borland.com> a
Re: Mistake when I try to do an extension genmodel with the M6 version [message #227845 is a reply to message #227803] Tue, 28 April 2009 11:18 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Patrick,

Can you please tell me more about your problem? Do you have code generated
for this model? Are you executing one more instance of Eclipse having gmfgenextension
model registered in package registry or you are working with EMF dynamic
instances loaded from .ecore file located nearby?

> There is a mistake :" couldn't find operation 'allInstances' for EClass"
Original error message was a bit different did you change anything to get
this message? Is is a compilation-time error or runtime one?

I've tried to use allinstacnes in my custom templates for the custom model
type loaded dynamically from .ecore file located nearby and it works ok..

-----------------
Alex Shatalin
Re: Mistake when I try to do an extension genmodel with the M6 version [message #228021 is a reply to message #227845] Tue, 28 April 2009 14:16 Go to previous messageGo to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 341
Registered: July 2009
Location: Paris Saclay, France
Senior Member
Hi Alex,
now it runs, but I don't know why.
To respond to your question:
-I have done a ecore model for the extension gmfgen. I have generated
the code and the model is registered withe the extensionpoint generated
package.
- I also done a feature and a updatesite. I install this plugin in my
environment.
- then I use the procedure to add an extension model on the gen model.
- In template file I refer registered metamodel and work on it.

now it runs. I remark that if I write the paclage of the metamodel in the
template, I have no the completion.

I wonder if there is cache to clean that it explain why my template run now.

Patrick


"Alex Shatalin" <vano@borland.com> a
Re: Mistake when I try to do an extension genmodel with the M6 version [message #228027 is a reply to message #228021] Tue, 28 April 2009 14:31 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Patrick,

> - I also done a feature and a updatesite. I install this plugin in
> my environment.
So, if you have this plugin installed then corresponding meta-model should
be available in EMF package registry, so there should be no problems with
finding it.

> now it runs. I remark that if I write the paclage of the metamodel in
> the template, I have no the completion.
We have a number of problems with code completion in xpand editor, so I know
it. ;-)

> I wonder if there is cache to clean that it explain why my template
> run now.
Nothing except model registry. In case you have somewhere in workspace checked
out verion of .ecore genmodel extension model then it can be loaded by xpand
and incorrectly mized with one from EMF package registry, otherwise I can
not see any reasons for this problem.

-----------------
Alex Shatalin
Previous Topic:2 diagram editors for the same domain metamodel
Next Topic:Copy Diagram to image file problem
Goto Forum:
  


Current Time: Tue Apr 23 06:09:57 GMT 2024

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

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

Back to the top