[ATL] same source element(s) in two bindings: why the binding order matters? [message #75239] |
Thu, 21 February 2008 18:48 |
Eclipse User |
|
|
|
Originally posted by: zhuj.in.tum.de
Hi you ATL guys, I have a question:
I have the following two binding inside a UML2!Class rule, to copy the
attributes to attributes, and generate operations from the same attributes:
1) ownedAttribute <- s.ownedAttribute
2) ownedOperation <- s.ownedAttribute->iterate(a; attrs :
Set(UML2!Property)
= Set{} |
if(a.oclIsTypeOf(UML2!Property))
attrs->including(a)
else
attrs
endif
)
->collect(p | thisModule.Property2Operation(p)),
The question is:
the binding order 2), 1) works, i.e. Operations can be generated from
attributes.
But the order 1), 2) doesn't work: after binding 1) is finished, the
source part of 2) is always an empty Set{}.
Can someone explain this to me?
Thx.
|
|
|
Re: [ATL] same source element(s) in two bindings: why the binding order matters? [message #75326 is a reply to message #75239] |
Sat, 23 February 2008 14:55 |
Frédéric Jouault Messages: 572 Registered: July 2009 |
Senior Member |
|
|
Hello,
The reason why you have this issue is that you are allowing inter-model
references, and not transforming Propertys. Therefore, the source
attributes are actually removed from the source resource, and added to
the target resource, effectively modifying the source model.
Regards,
Frédéric Jouault
Jinhui a écrit :
> Hi you ATL guys, I have a question:
>
> I have the following two binding inside a UML2!Class rule, to copy the
> attributes to attributes, and generate operations from the same attributes:
>
>
> 1) ownedAttribute <- s.ownedAttribute
> 2) ownedOperation <- s.ownedAttribute->iterate(a; attrs :
> Set(UML2!Property) = Set{} |
> if(a.oclIsTypeOf(UML2!Property))
> attrs->including(a)
> else
> attrs
> endif
> )
> ->collect(p | thisModule.Property2Operation(p)),
>
>
> The question is: the binding order 2), 1) works, i.e. Operations can be
> generated from attributes. But the order 1), 2) doesn't work: after
> binding 1) is finished, the source part of 2) is always an empty Set{}.
>
> Can someone explain this to me?
>
> Thx.
|
|
|
Powered by
FUDForum. Page generated in 0.02771 seconds