Skip to main content


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 08:14 Go to next message
Eclipse UserFriend
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 19:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Existing XMI, meta-model changes [message #1002002 is a reply to message #992839] Thu, 17 January 2013 17:28 Go to previous messageGo to next message
Eclipse UserFriend
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 08:19 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
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
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] Diagnostic/Reparation tool
Next Topic:[EMF] Configure code generation to respect existing modelpackage indexes
Goto Forum:
  


Current Time: Thu Apr 25 13:41:21 GMT 2024

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

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

Back to the top