Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Papyrus class diagram to ecore format
Papyrus class diagram to ecore format [message #673184] Sun, 22 May 2011 14:39 Go to next message
Jean-Philippe Brabant is currently offline Jean-Philippe Brabant
Messages: 17
Registered: May 2011
Junior Member
Using Papyrus, I created a class diagram that I now want to convert to ecore. I can do it using eclipse with the EMF Generator model (Uml2Ecore) but I would like to be able to do it using Java code. I looked at UMLUtil.UML2EcoreConverter, org.eclipse.uml2.uml.ecore.exporter and then importer but know I'm a little bit lost. I would like to feed it a .uml file and get a .ecore file. Can someone give me a hint.


Regards,
JP Brabant
Re: Papyrus class diagram to ecore format [message #673189 is a reply to message #673184] Sun, 22 May 2011 15:04 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25999
Registered: July 2009
Senior Member
JP,

I don't think someone is going to come up with a tutorial for you. In
general, what you see on the documentation pages is all there is. I'd
suggest setting some breakpoints and using the debugger to see what's
going on when you run the exporter.


forums-noreply@eclipse.org wrote:
> Using Papyrus, I created a class diagram that I now want to convert to
> ecore. I can do it using eclipse with the EMF Generator model
> (Uml2Ecore) but I would like to be able to do it using Java code. I
> looked at UMLUtil.UML2EcoreConverter,
> org.eclipse.uml2.uml.ecore.exporter and then importer but know I'm a
> little bit lost. I would like to feed it a .uml file and get a .ecore
> file. Can someone give me a hint.
>
>
> Regards,
> JP Brabant
Re: Papyrus class diagram to ecore format [message #673198 is a reply to message #673189] Sun, 22 May 2011 16:07 Go to previous messageGo to next message
Jean-Philippe Brabant is currently offline Jean-Philippe Brabant
Messages: 17
Registered: May 2011
Junior Member
Yes I know no one is going to do the work for me and this is not what I want anyway. After looking at what you told me here is what I got so far.

In org.eclipse.uml2.uml.util.UMLUtil in the subclass UML2EcoreConverter I found the public method "convert" which seem interesting but I don't yet understand it arguments.

I looked at org.eclipse.uml2.uml.ecore.exporter but I found stuff more interesting in the importer class. For exemple, in UMLImporterApplication.java I found a usage String (look at the getUsage() methode here http://pastebin.com/eGrCaBm0). So I guess I probably can use those method as a command line which is a great thing. I still need to figure out how. I might fire the debugger sometime tomorrow but I still have some difficulties to understand the whole picture.

In the UMLImporter.java I found a protected method doComputeEPackages() that create instance of UML2EcoreConverter so I started by looking at that to understand how the converter work.

So overall, what do you think, am I going in the right direction ?

[Updated on: Sun, 22 May 2011 16:09]

Report message to a moderator

Re: Papyrus class diagram to ecore format [message #673252 is a reply to message #673198] Sun, 22 May 2011 22:45 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25999
Registered: July 2009
Senior Member
Yes, you're headed in the right direction. It's very hard to understand
the whole picture just looking at static code. When you run it in the
debugger, you can see exactly who calls who and with what arguments.
I.e., it's much easier to understand the dynamic big picture than to try
to deduce it from static analysis of the source code. I'm not sure, but
most of the other converters have associated Ant tasks, so you might
want to just try to reuse those rather than trying to write new command
line interface...


forums-noreply@eclipse.org wrote:
> Yes I know no one is going to do the work for me and this is not what
> I want anyway. After looking at what you told me here is what I got so
> far.
>
> In org.eclipse.uml2.uml.util.UMLUtil in the subclass
> UML2EcoreConverter I found the public method "convert" which seem
> interesting but I don't yet understand it arguments.
> I looked at org.eclipse.uml2.uml.ecore.exporter but I found stuff more
> interesting in the importer class. For exemple, in
> UMLImporterApplication.java I found a usage String (look at the
> getUsage() methode here http://pastebin.com/eGrCaBm0). So I guess I
> probably can use those method as a command line which is a great
> thing. I still need to figure out how. I might fire the debugger
> sometime tomorrow but I still have some difficulties to understand the
> whole picture.
> In the UMLImporter.java I found a protected method
> doComputeEPackages() that create instance of UML2EcoreConverter so I
> started by looking at that.
> So overall, what do you think, am I going in the right direction ?
Previous Topic:MarteProfile
Next Topic:Should UML be MDD or agile ?
Goto Forum:
  


Current Time: Wed Aug 20 16:39:31 EDT 2014

Powered by FUDForum. Page generated in 0.01574 seconds