Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] same source element(s) in two bindings: why the binding order matters?
[ATL] same source element(s) in two bindings: why the binding order matters? [message #75239] Thu, 21 February 2008 18:48 Go to next message
Eclipse UserFriend
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 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
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.
Previous Topic:[ATL] xmi::id for elements refereced by diagram
Next Topic:ATL, AM3 version
Goto Forum:
  


Current Time: Tue Apr 23 10:11:37 GMT 2024

Powered by FUDForum. Page generated in 0.02771 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top