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 18:54 Go to next message
Hauke Fuhrmann is currently offline Hauke Fuhrmann
Messages: 322
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 02:18 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven Efftinge
Messages: 1761
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


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: [Xtend] Deleting Objects [message #537079 is a reply to message #537036] Tue, 01 June 2010 05:10 Go to previous message
Hauke Fuhrmann is currently offline Hauke Fuhrmann
Messages: 322
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 Aug 29 01:43:04 EDT 2014

Powered by FUDForum. Page generated in 0.28101 seconds