Skip to main content


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 18:39 Go to next message
Jean-Philippe Brabant is currently offline Jean-Philippe BrabantFriend
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 19:04 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Papyrus class diagram to ecore format [message #673198 is a reply to message #673189] Sun, 22 May 2011 20:07 Go to previous messageGo to next message
Jean-Philippe Brabant is currently offline Jean-Philippe BrabantFriend
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 20:09]

Report message to a moderator

Re: Papyrus class diagram to ecore format [message #673252 is a reply to message #673198] Mon, 23 May 2011 02:45 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
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 ?


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:MarteProfile
Next Topic:Should UML be MDD or agile ?
Goto Forum:
  


Current Time: Fri Mar 29 06:19:10 GMT 2024

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

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

Back to the top