Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Reference to input model in output model
[ATL] Reference to input model in output model [message #535712] Tue, 25 May 2010 11:17 Go to next message
Max Bureck is currently offline Max BureckFriend
Messages: 72
Registered: July 2009
Member
Hello,

is it possible to have a matched rule that creates an output element that has a reference to an input model element and not to the transformed element?
I have a rule like that:
rule Element {
	from s : InputMM!Element
	to t : OutputMM!Element(
		name <- s.name
		trace <- s
	)
}

I want the trace-reference (of type EObject) to reference the input model and not itself.

Thanks,
Max
Re: [ATL] Reference to input model in output model [message #535727 is a reply to message #535712] Tue, 25 May 2010 12:27 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
I did have that problem recently and managed to do it by injecting twice the model as input.

from IN : InputMM, IN2 : InputMM2;

then for the trace binding you have to identify the s element in your IN2 model.

trace <- InputMM2!Element.allInstancesFrom('IN2')->select()

I wanted to use the EMF URI system by doing : ->select(e | e.eResource().getURIFragment(e) = s.eResource().getURIFragment(s))->first()
but this only works in EMF VM because of the eResource() and then the s element is still used (which will become t)

So to make it work you have to use the Regular VM and find s yourself :
->select(e | e.name = s.name)->first() if the name is unique.

Don't forget to activate the allowInterModelReferences option.
Re: [ATL] Reference to input model in output model [message #535761 is a reply to message #535727] Tue, 25 May 2010 14:16 Go to previous messageGo to next message
Max Bureck is currently offline Max BureckFriend
Messages: 72
Registered: July 2009
Member
Thanks for your help! I found another solution: It is possible to set the reference in the do-block (only available in normal execution mode, not in refining mode). In the do block, no implicit matching is done.

Thanks again,
Max
Re: [ATL] Reference to input model in output model [message #535763 is a reply to message #535761] Tue, 25 May 2010 14:20 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Max Bureck wrote on Tue, 25 May 2010 10:16
Thanks for your help! I found another solution: It is possible to set the reference in the do-block (only available in normal execution mode, not in refining mode). In the do block, no implicit matching is done.

Thanks again,
Max

Great, I'll try that then
Previous Topic:[ATL]How to register ATL Meta Model
Next Topic:extract element of sequence
Goto Forum:
  


Current Time: Sat Apr 17 09:36:07 GMT 2021

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

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

Back to the top