Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Existing XMI, meta-model changes
Existing XMI, meta-model changes [message #992257] Fri, 21 December 2012 03:14 Go to next message
Eclipse User
Hello,

suppose an existing Ecore model instance as serialized XMI. Now the meta
model is changed in a way that a solitary unidirectional reference is
added an opposite. When loading the XMI resource I get an
IndexOutOfBounds exception. SAXXMIHandler.handleForwardReferences seems
to make some fixups ending up in moving an element in a list to a
position, but the list is empty at that point.

I would have expected that the new opposite reference is automatically
populated on loading, but that does not seem to be the case.

What can I do to save the XMI? A fully manually restore on XML level
would be quite difficult I'm afraid.

TIA
Marius
Re: Existing XMI, meta-model changes [message #992839 is a reply to message #992257] Sat, 22 December 2012 14:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
Marius,

Comments below.

On 21/12/2012 12:14 AM, Marius Gröger wrote:
> Hello,
>
> suppose an existing Ecore model instance as serialized XMI. Now the meta
> model is changed in a way that a solitary unidirectional reference is
> added an opposite. When loading the XMI resource I get an
> IndexOutOfBounds exception. SAXXMIHandler.handleForwardReferences seems
> to make some fixups ending up in moving an element in a list to a
> position, but the list is empty at that point.
>
> I would have expected that the new opposite reference is automatically
> populated on loading, but that does not seem to be the case.
Do you need both ends serialized? I.e., is marking the new thing
transient is okay or is that a problem?
>
> What can I do to save the XMI? A fully manually restore on XML level
> would be quite difficult I'm afraid.
>
> TIA
> Marius
Re: Existing XMI, meta-model changes [message #1002002 is a reply to message #992839] Thu, 17 January 2013 12:28 Go to previous messageGo to next message
Eclipse User
On 22.12.2012 20:43, Ed Merks wrote:
> Marius,
>
> Comments below.
>
> On 21/12/2012 12:14 AM, Marius Gröger wrote:
>> Hello,
>>
>> suppose an existing Ecore model instance as serialized XMI. Now the meta
>> model is changed in a way that a solitary unidirectional reference is
>> added an opposite. When loading the XMI resource I get an
>> IndexOutOfBounds exception. SAXXMIHandler.handleForwardReferences seems
>> to make some fixups ending up in moving an element in a list to a
>> position, but the list is empty at that point.
>>
>> I would have expected that the new opposite reference is automatically
>> populated on loading, but that does not seem to be the case.
> Do you need both ends serialized? I.e., is marking the new thing
> transient is okay or is that a problem?

Well I actually had tried that before my post. However, this didn't work
in conjunction with Teneo, which we use in the project. Unfortunately I
don't recall the exact error I got.

It really would be great if there was at least some kind of load option
for this, so I could write some kind of workbench action which "fixes"
such half-complete models.

Regards
Marius
Re: Existing XMI, meta-model changes [message #1002235 is a reply to message #1002002] Fri, 18 January 2013 03:19 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
Marius,

How broken is the final loaded resource? Note that even if
ResourceSet.getResource(..., true) throws an exception, you can still
call ResourceSet.getResource(..., false) to find the resource that was
loaded and it will have contents to the extent to which they could be
populated during loading (minus the parts it couldn't deal with because
of exceptions). Look at how the generated editor does that...

On 17/01/2013 6:28 PM, Marius Gröger wrote:
> On 22.12.2012 20:43, Ed Merks wrote:
>> Marius,
>>
>> Comments below.
>>
>> On 21/12/2012 12:14 AM, Marius Gröger wrote:
>>> Hello,
>>>
>>> suppose an existing Ecore model instance as serialized XMI. Now the meta
>>> model is changed in a way that a solitary unidirectional reference is
>>> added an opposite. When loading the XMI resource I get an
>>> IndexOutOfBounds exception. SAXXMIHandler.handleForwardReferences seems
>>> to make some fixups ending up in moving an element in a list to a
>>> position, but the list is empty at that point.
>>>
>>> I would have expected that the new opposite reference is automatically
>>> populated on loading, but that does not seem to be the case.
>> Do you need both ends serialized? I.e., is marking the new thing
>> transient is okay or is that a problem?
> Well I actually had tried that before my post. However, this didn't work
> in conjunction with Teneo, which we use in the project. Unfortunately I
> don't recall the exact error I got.
>
> It really would be great if there was at least some kind of load option
> for this, so I could write some kind of workbench action which "fixes"
> such half-complete models.
>
> Regards
> Marius
>
>
Previous Topic:[CDO] Diagnostic/Reparation tool
Next Topic:[EMF] Configure code generation to respect existing modelpackage indexes
Goto Forum:
  


Current Time: Fri Aug 29 22:23:54 EDT 2014

Powered by FUDForum. Page generated in 0.03489 seconds