Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Serialization in older XMI format
EMF Serialization in older XMI format [message #910918] Mon, 10 September 2012 16:12 Go to next message
Ian Carr is currently offline Ian Carr
Messages: 12
Registered: July 2009
Junior Member
How can I serialize an EMF (UML) model using one of the older XMI formats.

I need to export in XMI 2.1 to import into another tool, but my models are being
serialized as 2.4.1 format using the latest Juno.
Re: EMF Serialization in older XMI format [message #910921 is a reply to message #910918] Mon, 10 September 2012 16:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26138
Registered: July 2009
Senior Member
Maybe XMIResource.setXMIVersion can help, but I suppose you need UML to
do it for you so please ask about UML on the eclipse.modeling.mdt.uml2
forum.


On 10/09/2012 6:12 PM, Ian Carr wrote:
> How can I serialize an EMF (UML) model using one of the older XMI
> formats.
>
> I need to export in XMI 2.1 to import into another tool, but my models
> are being
> serialized as 2.4.1 format using the latest Juno.
Re: EMF Serialization in older XMI format [message #910929 is a reply to message #910921] Mon, 10 September 2012 16:39 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4097
Registered: July 2009
Senior Member
Hi

I thought this was asked previously on the UML2 newsgroup, but cannot
find the message.

MDT/UML2 supports backwards compatibility; reading old UML versions.

It does not support forwards compatibility; if you really want it, raise
a Bugzilla. But generally the rationale is that if you don't want UML
2.4.1 don't use it at all; install the older support.

Regards

Ed Willink




On 10/09/2012 17:20, Ed Merks wrote:
> Maybe XMIResource.setXMIVersion can help, but I suppose you need UML
> to do it for you so please ask about UML on the
> eclipse.modeling.mdt.uml2 forum.
>
>
> On 10/09/2012 6:12 PM, Ian Carr wrote:
>> How can I serialize an EMF (UML) model using one of the older XMI
>> formats.
>>
>> I need to export in XMI 2.1 to import into another tool, but my
>> models are being
>> serialized as 2.4.1 format using the latest Juno.
>
Re: EMF Serialization in older XMI format [message #910930 is a reply to message #910921] Mon, 10 September 2012 16:42 Go to previous messageGo to next message
Ian Carr is currently offline Ian Carr
Messages: 12
Registered: July 2009
Junior Member
Thanks for that, I have a Resource which I can probably cast down to an XMIResource?

I assume the string parameter is intended to take values from XMIResource such as VERSION_2_1_VALUE?
Re: EMF Serialization in older XMI format [message #910933 is a reply to message #910929] Mon, 10 September 2012 16:46 Go to previous messageGo to next message
Ian Carr is currently offline Ian Carr
Messages: 12
Registered: July 2009
Junior Member
It seems to be a catch 22.

I need the bug fixed tools (including Acceleo code generation) from Juno, which now exports in 2.4.1 format by default. But I am trying to round trip the UML through visual paradigm which in it's latest incarnation supports XMI up to version 2.1 but not beyond. Hence the question.
Re: EMF Serialization in older XMI format [message #910937 is a reply to message #910930] Mon, 10 September 2012 16:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26138
Registered: July 2009
Senior Member
Ian,

Yes, UML is using a derived XMIResourceImpl so you should be able to
downcast and use that constant.

On 10/09/2012 6:42 PM, Ian Carr wrote:
> Thanks for that, I have a Resource which I can probably cast down to
> an XMIResource?
>
> I assume the string parameter is intended to take values from
> XMIResource such as VERSION_2_1_VALUE?
Re: EMF Serialization in older XMI format [message #911768 is a reply to message #910937] Wed, 12 September 2012 09:29 Go to previous message
Ian Carr is currently offline Ian Carr
Messages: 12
Registered: July 2009
Junior Member
Many thanks,

setting the version or the namespace property seems to work.

For reference, to migrate a file I am able to:
   resource.load
   ((XMIResource)resource).setXMINamespace(XMIResource.XMI_2_1_URI)
   resource.save


Not sure this is changing anything other than the namespace and version properties (I assume that there is nothing exploiting any schema content change), but my files are now being recognised by VP again.

Ian
Previous Topic:[CDO HibernateStore] Cannot use identity column key generation with <union-subclass> mapping f
Next Topic:convert or refactor classic-uml model?
Goto Forum:
  


Current Time: Fri Oct 24 08:07:03 GMT 2014

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

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