Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Papyrus class diagram to ecore format
Papyrus class diagram to ecore format [message #672297] Fri, 20 May 2011 11:28 Go to next message
Jean-Philippe Brabant is currently offline Jean-Philippe Brabant
Messages: 17
Registered: May 2011
Junior Member
Is it possible to automatically convert a class diagram created using Papyrus into an Ecore formatted file ?
Re: Papyrus class diagram to ecore format [message #672300 is a reply to message #672297] Fri, 20 May 2011 11:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4003
Registered: July 2009
Senior Member
Hi

I'm not quite sure what you mean by an Ecore formatted file. Ecore is
normally XMI. Perhaps you mean OCLinEcore or Emfatic.

Anyway. For Helios, load the UML file with the UML model editor and
convert to Ecore. You can then load the Ecore file with the OCLinEcore
editor and perhaps SaveAs OCLinEcore.

For Indigo, you should be able to load the UML file directly in the
OCLinEcore editor, though the editor is not directly registered so you
need to tunnel down the Open With options. (Don't try this with earlier
than RC1 - auto translation of UML is a very late addition.).

Regards

Ed Willink

On 20/05/2011 16:28, forums-noreply@eclipse.org wrote:
> Is it possible to automatically convert a class diagram created using
> Papyrus into an Ecore formatted file ?
Re: Papyrus class diagram to ecore format [message #672324 is a reply to message #672300] Fri, 20 May 2011 13:15 Go to previous messageGo to next message
Patrick Tessier is currently offline Patrick Tessier
Messages: 142
Registered: July 2009
Senior Member
As said Ed, if you want to transform a uml file into ecore, follow its instructions. A diagram in papyrus is only a view of your model.
Re: Papyrus class diagram to ecore format [message #672523 is a reply to message #672324] Sat, 21 May 2011 11:25 Go to previous messageGo to next message
Jean-Philippe Brabant is currently offline Jean-Philippe Brabant
Messages: 17
Registered: May 2011
Junior Member
I'm new to EMF so I'm probably using the wrong term but here is what I did using eclipse to do what I wanted :


  1. I created a new Papyrus project
  2. I created a class diagram in Papyrus
  3. I created a new EMF empty project
  4. I used the EMF Generator Model to convert my .uml file (created with Papyrus) into an .ecore file


Now I want to create some java code to do that.

I found someone who did this but from XSD : http://stackoverflow.com/questions/671555/how-to-convert-xsd-to-ecore-emf/4614035#4614035. He use Xsd2Ecore. I would like something like Uml2Ecore but I didn't find anything like that. Do you guys know what eclipse use to do what I described earlier ?

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

Report message to a moderator

Re: Papyrus class diagram to ecore format [message #672537 is a reply to message #672523] Sat, 21 May 2011 11:58 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25910
Registered: July 2009
Senior Member
UMLUtil.UML2EcoreConverter does the bulk of the work. You'll want to
look at all the scaffolding in org.eclipse.uml2.uml.ecore.exporter.


forums-noreply@eclipse.org wrote:
> I'm new to EMF so I'm probably using the wrong term but here is what I
> did using eclipse to do what I wanted :
>
> I created a new Papyrus project
> I created a class diagram in Papyrus
> I created a new EMF empty project
> I used the EMF Generator Model to convert my .uml file (created with
> Papyrus) into an .ecore file
>
>
> Now I want to create some java code to do that.
> I found someone who did this but from XSD :
> hxxp://stackoverflow.com/questions/671555/how-to-convert-xsd-to-ecore-emf/4614035#4614035.
> He use Xsd2Ecore. I would like something like Uml2Ecore but I didn't
> find anything like that. Do you guys know what eclipse use to do what
> I described earlier ?
>
> (sorry I can't post link yet, change the hxxp to http).
Re: Papyrus class diagram to ecore format [message #672543 is a reply to message #672537] Sat, 21 May 2011 12:38 Go to previous messageGo to next message
Jean-Philippe Brabant is currently offline Jean-Philippe Brabant
Messages: 17
Registered: May 2011
Junior Member
Thank you, I'll go look at that.
Re: Papyrus class diagram to ecore format [message #672568 is a reply to message #672523] Sat, 21 May 2011 15:16 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4003
Registered: July 2009
Senior Member
Hi

On 21/05/2011 16:25, forums-noreply@eclipse.org wrote:
> I'm new to EMF so I'm probably using the wrong term but here is what I
> did using eclipse to do what I wanted :
>
> I created a new Papyrus project
> I created a class diagram in Papyrus
> I created a new EMF empty project
> I used the EMF Generator Model to convert my .uml file (created with
> Papyrus) into an .ecore file
>
>
> Now I want to create some java code to do that.
Your "that" is variously ambiguous and unlikely for a new user, so I'm
not sure that you're getting the answer you want.

What do you want your Java code to do?

Regards

Ed Willink
Re: Papyrus class diagram to ecore format [message #673158 is a reply to message #672568] Sun, 22 May 2011 11:47 Go to previous messageGo to next message
Jean-Philippe Brabant is currently offline Jean-Philippe Brabant
Messages: 17
Registered: May 2011
Junior Member
From what I'm understanding, ecore is a meta-model which support a subset of element from the UML Class diagram. EMF provide a good API to work with ecore and I want to use it. So my workflow should be like this : Create a Papyrus class diagram, lunch my java application, select the .uml file created using Papyrus, then my apps should convert it to ecore and I would do some stuff with it. I'm now looking at a way to do the conversion.
Re: Papyrus class diagram to ecore format [message #673172 is a reply to message #673158] Sun, 22 May 2011 12:50 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4003
Registered: July 2009
Senior Member
Hi

I'm not clear why you want to write any Java, the functionality is
already fully available (interactively).

If you want automation then there are integrations already available for
at least ANT (see UML, Ecore documentation on ANT tasks) and MWE2 (see
org.eclipse.ocl.examples.build).

Regards

Ed Willink


On 22/05/2011 16:47, forums-noreply@eclipse.org wrote:
> From what I'm understanding, ecore is a meta-model which support a
> subset of element from the UML Class diagram. EMF provide a good API
> to work with ecore and I want to use it. So my workflow should be like
> this : Create a Papyrus class diagram, lunch my java application,
> select the .uml file created using Papyrus, then my apps should
> convert it to ecore and I would do some stuff with it. I'm now looking
> at a way to do the conversion.
Re: Papyrus class diagram to ecore format [message #673174 is a reply to message #673172] Sun, 22 May 2011 13:35 Go to previous messageGo to next message
Jean-Philippe Brabant is currently offline Jean-Philippe Brabant
Messages: 17
Registered: May 2011
Junior Member
Is there already any built-in tools to compare diagrams ?
Re: Papyrus class diagram to ecore format [message #673177 is a reply to message #673158] Sun, 22 May 2011 13:08 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25910
Registered: July 2009
Senior Member
Note too that the EcoreTools project provides a graphical editor that
supports class diagrams directly for Ecore. No UML nor conversion is
involved. I'm sure the Papyrus editor is much fancier though...

forums-noreply@eclipse.org wrote:
> From what I'm understanding, ecore is a meta-model which support a
> subset of element from the UML Class diagram. EMF provide a good API
> to work with ecore and I want to use it. So my workflow should be like
> this : Create a Papyrus class diagram, lunch my java application,
> select the .uml file created using Papyrus, then my apps should
> convert it to ecore and I would do some stuff with it. I'm now looking
> at a way to do the conversion.
Re: Papyrus class diagram to ecore format [message #673180 is a reply to message #672537] Sun, 22 May 2011 14:12 Go to previous messageGo to next message
Jean-Philippe Brabant is currently offline Jean-Philippe Brabant
Messages: 17
Registered: May 2011
Junior Member
Ed Merks wrote on Sat, 21 May 2011 11:58
UMLUtil.UML2EcoreConverter does the bulk of the work. You'll want to
look at all the scaffolding in org.eclipse.uml2.uml.ecore.exporter.


Is it possible that it is ecore.importer instead of exporter ?
Re: Papyrus class diagram to ecore format [message #673254 is a reply to message #673180] Sun, 22 May 2011 22:50 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25910
Registered: July 2009
Senior Member
Good point. I think so.

forums-noreply@eclipse.org wrote:
> Ed Merks wrote on Sat, 21 May 2011 11:58
>> UMLUtil.UML2EcoreConverter does the bulk of the work. You'll want to
>> look at all the scaffolding in org.eclipse.uml2.uml.ecore.exporter.
>
>
> Is it possible that it is ecore.importer instead of exporter ?
>
Previous Topic:OCL constraints creation
Next Topic:SySML Requirement Diagram creation problem
Goto Forum:
  


Current Time: Wed Jul 23 03:54:32 EDT 2014

Powered by FUDForum. Page generated in 0.01927 seconds