[ATL] get Source from Target [message #62834] |
Thu, 27 September 2007 10:39 |
Eclipse User |
|
|
|
Hello,
There are ways to get the target from the source (e.g. in the assignation
of the target part of a rule, or with thisModule.resolveTemp()).
thisModule.resolveTemp() crashes when the element cannot be resolved
because it has not been transformed.
1. Is there any function that makes the opposite, that is, to get the
source from the target?
2. In case not, is there a way to know if thisModule.resolveTemp() would
return a value prior the crash?
What I am trying to achieve is to assign from a collection only the
elements that have been transformed by a rule.
package MM {
class A {
reference collection[*] ordered container : B;
}
class B {
attribute name : String;
}
}
from in : MM!A
to out : MM!A (
collection <- a.collection
-- But I want only the elements matched by the following rule
)
from in : MM!B (condition-to-be-included-in-the-transformation)
to out : MM!B (
name <- b.name
)
If 1 or 2 would be possible, I could use (in my particular transformation)
something like
collection <- MM.allInstancesFrom('OUT')
-> collect(i | thisModule.invResolveTemp(i))
I know I could move the condition to the first rule and use a lazy rule
instead of the second. However, I would like to leave the second as normal
matched rule. (This is a simplified example)
|
|
|
Powered by
FUDForum. Page generated in 0.02420 seconds