How to convert the .uml generated from Magic draw to .ecore using UML2EcoreConverter [message #1722895] |
Wed, 10 February 2016 02:43  |
Eclipse User |
|
|
|
I have created my UML model in magic draw and generated its .uml files. Along with the .uml file for my model, there are also .uml files for the profiles used. I have converted it to corresponding .ecore using the 'import uml model' through EMF project wizard and it converts correctly. Now i want to convert my model .uml to corresponding .ecore programatically. How can i do it? from different resources, i read that UML2EcoreConverter.convert() can be used for this purpose but i am not sure how will the uml input be passed as an input parameter to this convert method. I also looked it UMLUtil.convertToEcore() but as i understood it takes a package as input and converts it. However, in my case, i have my uml model with different comprising packages so i dont think I can somehow pass my complete model to UMLUtil.convertToEcore() to convert it. Can somebody help me in this regard.
|
|
|
|
|
|
Re: How to convert the .uml generated from Magic draw to .ecore using UML2EcoreConverter [message #1722951 is a reply to message #1722908] |
Wed, 10 February 2016 08:07  |
Eclipse User |
|
|
|
Hi
If you want to convert UML to XSD once , yes, go via Ecore, manually.
If you want to convert UML to XSD many times, reconsider, use of XSD is
unnecessary and arguably unhelpful for modeling purposes.
All the UML facilities should work programmatically; you just need to
get your initialization correct.
Regards
Ed Willink
On 10/02/2016 09:32, Zille Huma wrote:
> Hi Ed,
>
> thanks for the prompt reply and further guiding references.
>
> I would try to explain my problem in more detail. At the moment, I
> have my .uml generated through magic draw. My goal is to generate its
> corresponding .xsd programmatically. First i tested it with EMF
> project wizard. Here, I created a project and imported this .uml as
> uml model. This step generated an EMF project with corresponding
> .ecore and .genmodel. Later i exported the .genmodel by the option
> 'Export model' and exported to it corresponding .xsd.
> Now, when i am trying to do it programmatically, I assume that i have
> to carry out in similar steps, i.e., .uml--> .ecore --> .xsd. What is
> your opinion in this regard? I do not have to convert the .uml to
> .ecore before converting it to .xsd? can i do this conversion directly?
>
> THanks in advance.
|
|
|
Powered by
FUDForum. Page generated in 0.03973 seconds