|
Re: [ATL] resoveTemp and eopposite [message #656414 is a reply to message #656352] |
Fri, 25 February 2011 13:56 |
Cedric Gava Messages: 53 Registered: July 2009 |
Member |
|
|
Faiez avait soumis l'idée :
> Hi All, I 'd know if I can use the resolveTemp although I don't have an
> eopposite relation between my references ?
>
> thanks
Hi
I think resolveTemp has nothing to do with your question...
Where resolveTemp is used, is this case, for example :
Imagine the trivial transfomation that Map every Class to a Class, and
every operation to an operation belonging to the class, with just
adding a'T' after the name..
[Model] -> [ResultModel]
ClassA -> ClassAT
OperationA -> OperationAT
ClassB -> ClassBT
OperationB -> OperationBT
->You make one rule for mapping class 2 class
rule c2c {
from s : UML!Class
to outputClass : UML!Class ( name <- s.name + 'T')
}
->And another rule to map operation 2 operation
rule o2o {
from s : UML!Operation
to t : UML!Operation (
name <- i.name + 'T'
class <- <<This reference to the parent class is the purpose of
ResolveTemp>> )
}
-> But you have a problem to set the class reference of the target
operation because, in ATL, you cannot travel in the target model...
-> No you can't, don't insist, it is forbidden...
The tactic to have a reference to something in the target model is to
say :
what is the source element model (M), which, matched with a certain
rule-and-target (R), have created the reference I want in my target
model ?
In our case, the model (M) is the class of the operation i
And the rule-and-target identifier is outputClass...
If I transform the parent of my operation, I will very probably get the
parent for my transformed operation...
rule o2o {
from s : UML!Operation
to t : UML!Operation (
name <- i.name + 'T'
class <- thisModule.resolveTemp(s.class,'outputClass')
}
Kind Regards
NB : this forum seems slepping at that moment. Are every ATL-users on
holiday at Hawaï ??
Damn, I was not invited !
sooo lonely friends of eclipse on forum
|
|
|
Powered by
FUDForum. Page generated in 0.03257 seconds