Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Cannot assign the same elements/reference multiple times [on progress]
[ATL] Cannot assign the same elements/reference multiple times [on progress] [message #796876] Sun, 12 February 2012 18:51 Go to next message
Zheng Cheng is currently offline Zheng ChengFriend
Messages: 15
Registered: February 2012
Junior Member
Hi, all

I have the following ATL rule.

rule mmA2mmB{
	from 
		A : MMA!TypeC
	to
		B : MMB!TypeC(
			refOne <- newElem,
                        refTwo <- newElem	
		),
		newElem : MMB!TypeD(
                        attr <- '12345'
                )
}


I am expected something like this:
<TypeC>
    <refOne attr='12345'>
    <refTwo attr='12345'>
</TypeC>


But, here is what I got
<TypeC>
    <refTwo attr='12345'>
</TypeC>



Of course, we could do something like below to overcome this issue:
rule mmA2mmB{
	from 
		A : MMA!TypeC
	to
		B : MMB!TypeC(
			refOne <- newElem,
                        refTwo <- newElemSame 
		),
		newElem : MMB!TypeD(
                        attr <- '12345'
                )
                newElemSame : MMB!TypeD(
                        attr <- '12345'
                )
}


But, it becomes very unpractical if you want to use pattern match from other rule.
(wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Language#Simple_target_pattern_element)

May I ask is there other way to achieve my expectation? or any reason why ATL
won't allow me to reuse the elements?

[Updated on: Tue, 14 February 2012 14:55]

Report message to a moderator

Re: [ATL] Cannot assign the same elements/reference multiple times [on progress] [message #798336 is a reply to message #796876] Tue, 14 February 2012 14:58 Go to previous message
Zheng Cheng is currently offline Zheng ChengFriend
Messages: 15
Registered: February 2012
Junior Member
Hi,

The question is still open. My understanding is that src(or created) elements are binding(assign) to a specific target elements. Thus, they are not navigable afterwards[1].

Might be the case that assign the same elements/reference multiple times is bad practice in ATL transforming.

Regards,
Zheng

[1] ATL tutorial. EclipseCon 2008, p. 20

[Updated on: Tue, 14 February 2012 15:00]

Report message to a moderator

Previous Topic:KM3
Next Topic:[QVTo] Disambiguation of black-box operations
Goto Forum:
  


Current Time: Wed Oct 09 22:04:25 GMT 2024

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

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

Back to the top