Skip to main content



      Home
Home » Modeling » ATL » Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL?
Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL? [message #983915] Wed, 14 November 2012 03:46 Go to next message
Eclipse UserFriend
I have a refining transformation of the MoDisco Java model where I drop some if statements. When I run the transformation I get the error output:
Quote:

The object 'org.eclipse.gmt.modisco.java.emf.impl.SingleVariableAccessImpl(at)50f904b1
variable declaration = org.eclipse.gmt.modisco.java.emf.impl.SingleVariableDeclarationImpl(at)ca329ff (name: audit, proxy: false) (extraArrayDimensions: 0) (varargs: false)' is not contained in a resource.


This happens when the if statement
if(audit == null) {
    // other code here
}

contains a reference to the variable audit in its expression. But a variable declaration also contains a list of usageInVariableAccess that refers also to that expression of the if statement. So the variable access is a dangling reference after the if statement is dropped.

Is there a nice way to drop all such dangling references from within an ATL transformation?
Re: Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL? [message #983929 is a reply to message #983915] Wed, 14 November 2012 04:00 Go to previous messageGo to next message
Eclipse UserFriend
drop everything that isn't needed anymore
Re: Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL? [message #984234 is a reply to message #983929] Wed, 14 November 2012 09:23 Go to previous messageGo to next message
Eclipse UserFriend
The problem with this is, that it produces a lot of boiler plate code. You have to have a rule for every type which may have dangling references.
Re: Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL? [message #984277 is a reply to message #984234] Wed, 14 November 2012 10:02 Go to previous messageGo to next message
Eclipse UserFriend
With the current version of the refining mode, only the contained elements are automatically deleted when the container is "dropped".
If required, simply referenced elements (that are contained elsewhere) have to be explicitly deleted in other rules or via their container.

Hugo
Re: Is there a way to handle 'The object is not contained in a resource.' nicely from within ATL? [message #985163 is a reply to message #984277] Thu, 15 November 2012 02:44 Go to previous message
Eclipse UserFriend
There already exists a bug for that problem. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=332194
Previous Topic:How to compare model attribute that contains an enum with an enum constant?
Next Topic:ATL VM question about exclusive pattern matching execution
Goto Forum:
  


Current Time: Tue Nov 04 22:30:59 EST 2025

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

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

Back to the top