Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Problems with using the UML.ecore metamodel directly
Problems with using the UML.ecore metamodel directly [message #1059519] Mon, 20 May 2013 08:54 Go to next message
Arn Lapierrre is currently offline Arn LapierrreFriend
Messages: 1
Registered: May 2013
Junior Member
For a prototype of an UML-tool, I'd like to use the UML.ecore file which is part of Eclipse UML2 directly. Therefore, I searched for the org.eclipse.uml2.uml_<version>.jar file and extracted the UML.ecore and its genmodel file. Then I created a new "Empty EMF Project" in Eclipse and imported both files. At this point, everything looks fine, I can browse through the uml-core hierarchy etc. without getting any errors.

But when I try to generate the model code via the imported genmodel, the generation suddenly stops with a bunch of exceptions (see attachment #1).
I also tried to delete the genmodel and create it on my own, based on UML.ecore. This time, the model generation finishes without any problems, but the generated code contains errors (see attachment #2).

How could I fix this? thanks.
Re: Problems with using the UML.ecore metamodel directly [message #1059754 is a reply to message #1059519] Tue, 21 May 2013 14:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26281
Registered: July 2009
Senior Member
Arn,

UML.ecore needs to use UML2's extended version of GenModel to generate
properly; I don't think it makes sense to try to regenerate UML2 again.
You should just use what's already generated.


On 21/05/2013 2:49 PM, Arn Lapierrre wrote:
> For a prototype of an UML-tool, I'd like to use the UML.ecore file which is part of Eclipse UML2 directly. Therefore, I searched for the org.eclipse.uml2.uml_<version>.jar file and extracted the UML.ecore and its genmodel file. Then I created a new "Empty EMF Project" in Eclipse and imported both files. At this point, everything looks fine, I can browse through the uml-core hierarchy etc. without getting any errors.
>
> But when I try to generate the model code via the imported genmodel, the generation suddenly stops with a bunch of exceptions (see attachment #1).
> I also tried to delete the genmodel and create it on my own, based on UML.ecore. This time, the model generation finishes without any problems, but the generated code contains errors (see attachment #2).
>
> How could I fix this? thanks.
Re: Problems with using the UML.ecore metamodel directly [message #1059777 is a reply to message #1059754] Tue, 21 May 2013 14:40 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4184
Registered: July 2009
Senior Member
Hi

As Ed notes, this is a fairly dubious undertaking. But it should work.

Provided:

You use the same Eclipse tool versions as the UML code.
You use all the UML files (from GIT rather than Import Project)
You don't 'improve' the code by adding extra files such as Ecore.ecore.

I suggest that you practice regebnerating the unmodified source before
modifying, and thinking hard about why you want to modify at all.

Regards

Ed Willink




On 21/05/2013 15:07, Ed Merks wrote:
> Arn,
>
> UML.ecore needs to use UML2's extended version of GenModel to generate
> properly; I don't think it makes sense to try to regenerate UML2
> again. You should just use what's already generated.
>
>
> On 21/05/2013 2:49 PM, Arn Lapierrre wrote:
>> For a prototype of an UML-tool, I'd like to use the UML.ecore file
>> which is part of Eclipse UML2 directly. Therefore, I searched for the
>> org.eclipse.uml2.uml_<version>.jar file and extracted the UML.ecore
>> and its genmodel file. Then I created a new "Empty EMF Project" in
>> Eclipse and imported both files. At this point, everything looks
>> fine, I can browse through the uml-core hierarchy etc. without
>> getting any errors.
>>
>> But when I try to generate the model code via the imported genmodel,
>> the generation suddenly stops with a bunch of exceptions (see
>> attachment #1).
>> I also tried to delete the genmodel and create it on my own, based on
>> UML.ecore. This time, the model generation finishes without any
>> problems, but the generated code contains errors (see attachment #2).
>>
>> How could I fix this? thanks.
>
Previous Topic:How to write Eclipse UML2 XMI
Next Topic:Loading UML-Model with papyrus-profile applied
Goto Forum:
  


Current Time: Thu Dec 18 17:32:55 GMT 2014

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

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