Refining mode: problems with drop feature [message #1053710] |
Tue, 07 May 2013 10:55 |
Javier García Messages: 129 Registered: April 2013 |
Senior Member |
|
|
Hi everybody,
I recently started using the refining mode on ATL, I write -- @atlcompiler atl2010 at the start of the compiler, and all my rules right now seemed to work ok.
Then I tried to use the 'drop' feature as follows:
rule Classes2Drop {
from
s: UML2!Class (
s.getAppliedStereotypes().isEmpty()
)
to
drop
}
And there seems to be some kind of error that I don't understand at all, it just says:
Quote:The object 'org.eclipse.uml2.uml.internal.impl.ClassImpl@110b4ae (name: CreateNewIncidentActionDelegate, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false)' is not contained in a resource.
So I wondered why this happened and I came up with several questions:
1 - do all the elements contained in these classes get deleted too?
2 - What happenes to the elements that reference these classes, or any other dropped element? is that what causes this error?
3 - what else could be the cause for this error?
I know it says that that element is not contained in a resource, but that doesn't seem to be the cased, also it seems to be an element of the type class, I don't get it.
If I change the code to address a certain stereotype like this:
rule Classes2Drop {
from
s: UML2!Class (
s.getAppliedStereotype('profile::Perspective').oclIsUndefined()
)
to
drop
}
I get exactly the same error.
I didn't find much information online, so I'm completely lost here, I hope you guys can help!
Regards,
Javier
|
|
|
Re: Refining mode: problems with drop feature [message #1053726 is a reply to message #1053710] |
Tue, 07 May 2013 12:00 |
Hugo Bruneliere Messages: 674 Registered: July 2009 |
Senior Member |
|
|
Hello,
Javier García wrote on Tue, 07 May 2013 12:55Hi everybody,
I recently started using the refining mode on ATL, I write -- @atlcompiler atl2010 at the start of the compiler, and all my rules right now seemed to work ok.
Then I tried to use the 'drop' feature as follows:
rule Classes2Drop {
from
s: UML2!Class (
s.getAppliedStereotypes().isEmpty()
)
to
drop
}
And there seems to be some kind of error that I don't understand at all, it just says:
Quote:The object 'org.eclipse.uml2.uml.internal.impl.ClassImpl@110b4ae (name: CreateNewIncidentActionDelegate, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false)' is not contained in a resource.
So I wondered why this happened and I came up with several questions:
1 - do all the elements contained in these classes get deleted too?
Yes, as described in the documentation the "drop" feature is implementing a cascade-delete strategy (only considering containment references of course).
Quote:
2 - What happenes to the elements that reference these classes, or any other dropped element? is that what causes this error?
Such references are then supposedly set to OclUndefined (i.e.; no element).
Quote:
3 - what else could be the cause for this error?
It seems that one Class element is not contained anymore in any other element.
Have you already tried to remove your rule to see if this error actually comes from this specific rule?
Have you taken a look to other rules manipulating Class elements and that may cause the error (in conjunction with this deletion rule)?
Quote:
I know it says that that element is not contained in a resource, but that doesn't seem to be the cased, also it seems to be an element of the type class, I don't get it.
If I change the code to address a certain stereotype like this:
rule Classes2Drop {
from
s: UML2!Class (
s.getAppliedStereotype('profile::Perspective').oclIsUndefined()
)
to
drop
}
I get exactly the same error.
I didn't find much information online, so I'm completely lost here, I hope you guys can help!
Regards,
Javier
Best regards,
Hugo
--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
|
|
|
|
Re: Refining mode: problems with drop feature [message #1055657 is a reply to message #1053731] |
Wed, 08 May 2013 10:50 |
Javier García Messages: 129 Registered: April 2013 |
Senior Member |
|
|
Hi,
Yes, it seems to be a warning as the transformation actually gets done properly (or so it seems) but since it shows up in red I just assumed it was an exception and the transformation wasn't being done.
Hugo, regarding what you said, yes I tested it was that rule the one bringing up the issue, since when I delete it it runs smoothly.
I've been testing more the refining mode and I don't quite understand this warning, as in some cases what I actually want to do is delete the elements that are not contained in a resource (and it does delete said elements) so I don't know if this means that the element is transformed but without a container, which also doesn't seem right since all elements are contained in something.
Anyways, if it's just a warning it's no big deal and I can go on, thank you both!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Refining mode: problems with drop feature [message #1057980 is a reply to message #1055672] |
Fri, 10 May 2013 10:08 |
Javier García Messages: 129 Registered: April 2013 |
Senior Member |
|
|
Hi again guys,
first sorry for writing the same message so many times, I don't even know how that happened.
Second, I am still getting the same error or warning as you pointed out, BUT now I'm using Ant to run the transformation and after running this, it can't save the file because it shows this same error, the exact message is:
Quote:
BUILD FAILED
C:\Users\A555206\e3.6\workspace\RCP2GWTTransformationChain\build.xml:22: The object 'org.eclipse.uml2.uml.internal.impl.InterfaceImpl@2140bb (name: MapGraphic, visibility: <unset>) (isLeaf: false, isAbstract: false)' is not contained in a resource.
I thought that since it uses the same input and output model it'd get saved if I didn't use the save feature, but that doesn't seem to work.
Anyways, it runs the transformation without an error, the error is when saving the file, so I don't know if that really makes a difference though.
Hope someone knows what's wrong!
|
|
|
|
Re: Refining mode: problems with drop feature [message #1058452 is a reply to message #1058306] |
Tue, 14 May 2013 07:46 |
Javier García Messages: 129 Registered: April 2013 |
Senior Member |
|
|
Hi Hugo,
Yes, if I launch them with the normal launch configuration they work perfectly but showing the message "The object 'org.eclipse.uml2.uml.internal.impl.InterfaceImpl@2140bb (name: MapGraphic, visibility: <unset>) (isLeaf: false, isAbstract: false)' is not contained in a resource." which I thought to be an error, but it creates the transformed model anyways.
No, the element doesn't exist, I can open the model perfectly with any editor, but I tried finding the element this error refers to an I couldn't find it in the output model, but it does exist in the input model.
The object does exist in the input model, and in the input model it's not contained in any resource, which is exactly the reason I use this refining module, to delete any element that is not contained in any resource.
To explain a bit further my transformation chain:
1st - Run ATL module with a superimposed module to copy only the packages and classes I want.
2nd - (Refining)Delete all the elements that are not contained in any resource
3rd - (Refining) Delete elements that point to deleted elements (dependencies, associations, interfacerealizations...)
So the first transformation leaves some elements outside of any model, they appear in the root, at the same level as the root model.
The second transformation deletes these elements and shows up that error above, but the input model generated is clean.
The third transformation shows up an error of the same kind, but with a dependency, but I don't understand it since all elements in its input model are contained in a resource.
I hope I explained myself good, but if there's anything that needs more explanation just ask
Thanks for your help!
regards,
Javier
|
|
|