Refining mode: problems with drop feature [message #1053710] |
Tue, 07 May 2013 06:55  |
Javier García Messages: 70 Registered: April 2013 |
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 08:00   |
Hugo Bruneliere Messages: 469 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 - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
|
|
|
|
| Re: Refining mode: problems with drop feature [message #1055657 is a reply to message #1053731] |
Wed, 08 May 2013 06:50   |
Javier García Messages: 70 Registered: April 2013 |
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!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01801 seconds