thisModule.resolveTemp [message #544188] |
Thu, 01 July 2010 19:00  |
Eclipse User |
|
|
|
hi, Can some one explain what is the need and use for the ATL Module Operation resolveTemp.
I read the tutorial but could not get how from a matched rule, I can point to a target element and in which case i prefer to use it.
I also read example but did not get it,
packagedElement <- Set {
s.packagedElement,
UML2!Class.allInstancesFrom('IN')->collect(e | thisModule.resolveTemp(e, 'extension'))
thanks in advanced
wafaa
[Updated on: Thu, 01 July 2010 19:01] by Moderator
|
|
|
|
|
Re: thisModule.resolveTemp [message #544634 is a reply to message #544188] |
Mon, 05 July 2010 03:41  |
Eclipse User |
|
|
|
Let's say you have that rule :
rule Class {
from s : UML!Class
to t : UML!Class(),
extension : UML!Class()
}
now you have another rule :
rule Package {
from s : UML!Package
to t : UML!Package(
packagedElement <- s.packagedElement
)
}
Now imagine a package P containing a class C.
The resulting package P' will contain C' (corresponding to 't' of the Class rule because the 'from' element is automatically and only mapped to the first 'to' element. In fact, the packagedElement <- s.packagedElement binding is equivalent to packagedElement <- s.packagedElement->collect(e | thisModule.resolveTemp(e,'t')). But the extension class won't be in the package.
If you want to also put the classes resulting from the 'extension' output pattern then you can use resolveTemp :
rule Package {
from s : UML!Package
to t : UML!Package(
packagedElement <- s.packagedElement,
packagedElement <- s.packagedElement->collect(e | thisModule.resolveTemp(e,'extension'))
)
}
|
|
|
Powered by
FUDForum. Page generated in 0.05708 seconds