Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xtend] Deleting Objects
[Xtend] Deleting Objects [message #537013] Mon, 31 May 2010 22:54 Go to next message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Hi there,

during an Xtend transformation I've created a lot of objects. In one
function, some of them get optimized away, so I delete them from their
eContainer.

Then I get an exception saying that an Element is not contained by any
resource.
How can I avoid such exception? I just want to create and delete an
object within the same Xtend transformation. Is that not possible?

Cheers,
Hauke
Re: [Xtend] Deleting Objects [message #537036 is a reply to message #537013] Tue, 01 June 2010 06:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Hauke Fuhrmann schrieb:
> Hi there,
>
> during an Xtend transformation I've created a lot of objects. In one
> function, some of them get optimized away, so I delete them from their
> eContainer.
>
> Then I get an exception saying that an Element is not contained by any
> resource.
> How can I avoid such exception? I just want to create and delete an
> object within the same Xtend transformation. Is that not possible?

Such an error is usually raised when saving a resource which holds cross
references to EObjects which do not reside with a resource.
That is I suggest that the removed objects are cross referenced somewhere?

Sven

--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: [Xtend] Deleting Objects [message #537079 is a reply to message #537036] Tue, 01 June 2010 09:10 Go to previous message
Hauke Fuhrmann is currently offline Hauke FuhrmannFriend
Messages: 333
Registered: July 2009
Senior Member
Sven Efftinge schrieb:
> Such an error is usually raised when saving a resource which holds cross
> references to EObjects which do not reside with a resource.
> That is I suggest that the removed objects are cross referenced somewhere?

Ah, thanks for the hint, Sven. The CrossRef stdlib functions revealed
cross references that haven't been removed. Now it works. Great :-)

Cheers,
Hauke
Previous Topic:XPAND 1.0.0
Next Topic:[Announce] M2T XPAND 1.0.0RC3 is available
Goto Forum:
  


Current Time: Fri Mar 29 07:08:17 GMT 2024

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

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

Back to the top