Home » Modeling » UML2 » Programmatically generating XMI
| | | |
Re: Programmatically generating XMI [message #478095 is a reply to message #478091] |
Tue, 23 December 2008 15:58 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Vikram,
The "native" .uml resources produced by the default resource implementation
in UML2 are actually XMI, but make use of some constructs/conventions
specific to Eclipse (EMF). All tools based on Eclipse UML2, which now
includes most of the major UML tool vendors, should directly support this
format. When you save a UML resource with an extension of .xmi (just a
convention, really), the serialization that is produced is also XMI, but all
of the constructs that are specific to the Eclipse implemenation are
embedded in XMI extension elements.
Producing the "compatible XMI" programmatically is just a matter of using a
different resource implementation (as Ed has implied) to save the resource.
One way to do this is to factory a new one using the .xmi extension,
copy/move the contents from your .uml resource, and save it. For more detail
on how to do this, take a look at the source for the UMLEditor class...
Kenn
"Vikram " <vikram.sjn@gmail.com> wrote in message
news:99c2cf5d4a7d23596d0cd12d7b2c8740$1@www.eclipse.org...
> Hello All,
>
> I am new to EMF, UML2, and XMI.
>
> 'Getting Started with UML2' article at Eclipse.org [1] was very helpful,
> and now I am able to create the model, and the .uml file.
>
> I have to save this model as xmi, so that it is compatible with file
> generated and expected by tools like RSA and Visual Paradigm.
>
> Please tell me how can I generate the compatible xmi programmatically. Or
> if there is class in Eclipse, or article that describes this.
>
> Thanks
> Vikram
>
>
> [1]
> http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Getti ng_Started_with_UML2/article.html
>
>
|
|
|
Re: Programmatically generating XMI [message #478096 is a reply to message #478094] |
Tue, 23 December 2008 16:02 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Vikram,
I've pointed out the difference between the two formats in my other reply.
RSx calls .uml resources "UML2 models" and .xmi resources (produced by UML2)
"UML2 XMI interchange models".
Use of a different file extension is just a way to tell the editor which
resource implementation to use; this convention was "borrowed" from the way
EMF provides support for EMOF serializations of Ecore models (i.e. with a
..emof extension). I agree that it's not all that intuitive... there should
probably be a separate save option or export/import wizard instead... but
then the UML editor is just a sample, so tool vendors are free to do what
makes (more) sense for their users...
Kenn
"Vikram " <vikram.sjn@gmail.com> wrote in message
news:894fd5700edba22bb24407965c0efa63$1@www.eclipse.org...
> Vlad,
>
> As I told I am new to EMF, UML2, XMI.
>
> I read some posts, and saw the import interface of Visual Paradigm (VP)
> that it expects XMI file to import UML model. Whereas RSA & RSM have
> options to export 'UML2 Model' & 'UML2 XMI Interchange Model'.
>
> This probably got me that .uml file is UML Model format, and XMI
> interchange model (.xmi) file will be file importable in VP and such
> tools.
>
> After your post I imported .uml file in VP and it imported fine.
> Thanks a lot.
>
> However I am still confused. Opting 'Save As...' in Eclipse 3.4 and
> specifying .xmi extension, the generated file is slightly in different
> format (with attributes like xmi:type="uml:Property").
> If .uml file is itself in XMI format, then why does specifying .xmi
> extension changes file contents?
>
> Vikram
>
|
|
| | | | |
Re: Programmatically generating XMI [message #627304 is a reply to message #478091] |
Tue, 23 December 2008 15:58 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Vikram,
The "native" .uml resources produced by the default resource implementation
in UML2 are actually XMI, but make use of some constructs/conventions
specific to Eclipse (EMF). All tools based on Eclipse UML2, which now
includes most of the major UML tool vendors, should directly support this
format. When you save a UML resource with an extension of .xmi (just a
convention, really), the serialization that is produced is also XMI, but all
of the constructs that are specific to the Eclipse implemenation are
embedded in XMI extension elements.
Producing the "compatible XMI" programmatically is just a matter of using a
different resource implementation (as Ed has implied) to save the resource.
One way to do this is to factory a new one using the .xmi extension,
copy/move the contents from your .uml resource, and save it. For more detail
on how to do this, take a look at the source for the UMLEditor class...
Kenn
"Vikram " <vikram.sjn@gmail.com> wrote in message
news:99c2cf5d4a7d23596d0cd12d7b2c8740$1@www.eclipse.org...
> Hello All,
>
> I am new to EMF, UML2, and XMI.
>
> 'Getting Started with UML2' article at Eclipse.org [1] was very helpful,
> and now I am able to create the model, and the .uml file.
>
> I have to save this model as xmi, so that it is compatible with file
> generated and expected by tools like RSA and Visual Paradigm.
>
> Please tell me how can I generate the compatible xmi programmatically. Or
> if there is class in Eclipse, or article that describes this.
>
> Thanks
> Vikram
>
>
> [1]
> http://www.eclipse.org/modeling/mdt/uml2/docs/articles/Getti ng_Started_with_UML2/article.html
>
>
|
|
|
Re: Programmatically generating XMI [message #627305 is a reply to message #478094] |
Tue, 23 December 2008 16:02 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Vikram,
I've pointed out the difference between the two formats in my other reply.
RSx calls .uml resources "UML2 models" and .xmi resources (produced by UML2)
"UML2 XMI interchange models".
Use of a different file extension is just a way to tell the editor which
resource implementation to use; this convention was "borrowed" from the way
EMF provides support for EMOF serializations of Ecore models (i.e. with a
..emof extension). I agree that it's not all that intuitive... there should
probably be a separate save option or export/import wizard instead... but
then the UML editor is just a sample, so tool vendors are free to do what
makes (more) sense for their users...
Kenn
"Vikram " <vikram.sjn@gmail.com> wrote in message
news:894fd5700edba22bb24407965c0efa63$1@www.eclipse.org...
> Vlad,
>
> As I told I am new to EMF, UML2, XMI.
>
> I read some posts, and saw the import interface of Visual Paradigm (VP)
> that it expects XMI file to import UML model. Whereas RSA & RSM have
> options to export 'UML2 Model' & 'UML2 XMI Interchange Model'.
>
> This probably got me that .uml file is UML Model format, and XMI
> interchange model (.xmi) file will be file importable in VP and such
> tools.
>
> After your post I imported .uml file in VP and it imported fine.
> Thanks a lot.
>
> However I am still confused. Opting 'Save As...' in Eclipse 3.4 and
> specifying .xmi extension, the generated file is slightly in different
> format (with attributes like xmi:type="uml:Property").
> If .uml file is itself in XMI format, then why does specifying .xmi
> extension changes file contents?
>
> Vikram
>
|
|
| |
Goto Forum:
Current Time: Sat Oct 19 17:23:28 GMT 2024
Powered by FUDForum. Page generated in 0.03797 seconds
|