[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.uml2] Re: UML Operation Object to EOperation

Hi Roshan,

Have a look at the UML2EcoreConverter as part of UMLUtil.   It will convert 
from UML to the corresponding Ecore representation.
You can also use the UML editor to access this functionality from a menu 
item.

- James.


"Roshan Soni" <roshan.soni1@xxxxxxxxx> wrote in message 
news:f2c15cde82bc298e3e102428c79b2283$1@xxxxxxxxxxxxxxxxxx
> I'm trying to map my org.eclipse.uml2.uml.Operation to an 
> org.eclipse.emf.ecore.EOperation.  I know that the uml classes are built 
> on top of EObject, but my question is there any easy way to convert UML to 
> EObject?
>
> I guess a way to do this would be map only the attributes I need like name 
> visibility, return type, parameters, etc..) something like this, but 
> before I start it'd be nice if there was a simpler approach.
>
> protected EOperation createUOpertion2EOperation(
>  org.eclipse.uml2.uml.Operation umlOperation){
>
> EOperation eOperation = EcoreFactory.eINSTANCE.createEOperation();
> //get umlOperation (type, name, parameters, etc) and map to eOperation
>
> return eOperation;
> }
>