Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » resolveTemp's parameters are reversed after extraction to .atl
resolveTemp's parameters are reversed after extraction to .atl [message #636681] Tue, 02 November 2010 13:05 Go to next message
Marten Sijtema is currently offline Marten SijtemaFriend
Messages: 67
Registered: November 2009
Member
I have a HOT, that produces an ATL model from a FATL model (which I defined myself, FATL.ecore meta model is a modified version of ATL.ecore meta model).

My FATL is implemented by a TCS project, which provides me a nice concrete syntax for FATL, basically an extended ATL syntax. I use this TCS project to inject my .fatl file into a .xmi file, which is then correctly processed by my FATL2ATL.atl model transformation file.

However, when I extract the model using
	<atl.saveModel model="fatl2atl-output" path="${fatl2atlOutput}" >
		<extractor name="ATL" />
	</atl.saveModel>


the resolveTemp's parameters are reversed. So in my source editor I write:
ownerProject <- thisModule.resolveTemp(edt.ePackage, 'pjRoot')


and after extraction it is shown as:
ownerProject <- thisModule.resolveTemp('pjRoot', edt.ePackage)



Now, running this resulting atl file does not work. So I have to manually reverse the parameters every time, as you can imagine this is really annoying.

So it goes wrong upon injection, OR upon extraction. Is it the case that the TCS injection file (the .tcs file) is out of date? I used the ATL.tcs file as a starting point for creating my FATL.tcs file. Is there a new .tcs file maybe that DOES this correctly? Or is there a way to modify my current FATL.tcs file to make sure the resolveTemp is correctly injected?

An alternative solution would be to 'explain' ATL how to parse resolveTemp with reversed parameters.


Anyone some thoughts ?



My company: Sytematic, building business software from models.
Re: resolveTemp's parameters are reversed after extraction to .atl [message #636682 is a reply to message #636681] Tue, 02 November 2010 13:09 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Le 02/11/2010 14:05, Marten Sijtema a écrit :
> I have a HOT, that produces an ATL model from a FATL model (which I
> defined myself, FATL.ecore meta model is a modified version of ATL.ecore
> meta model).
>
> My FATL is implemented by a TCS project, which provides me a nice
> concrete syntax for FATL, basically an extended ATL syntax. I use this
> TCS project to inject my .fatl file into a .xmi file, which is then
> correctly processed by my FATL2ATL.atl model transformation file.
>
> However, when I extract the model using
>
> <atl.saveModel model="fatl2atl-output" path="${fatl2atlOutput}" >
> <extractor name="ATL" />
> </atl.saveModel>
>
>
> the resolveTemp's parameters are reversed. So in my source editor I write:
>
> ownerProject <- thisModule.resolveTemp(edt.ePackage, 'pjRoot')
>
>
> and after extraction it is shown as:
>
> ownerProject <- thisModule.resolveTemp('pjRoot', edt.ePackage)
>
You may examine the intermediate models to discover which step reverts
the order....
>
>
> Now, running this resulting atl file does not work. So I have to
> manually reverse the parameters every time, as you can imagine this is
> really annoying.
>
> So it goes wrong upon injection, OR upon extraction. Is it the case that
> the TCS injection file (the .tcs file) is out of date? I used the
> ATL.tcs file as a starting point for creating my FATL.tcs file. Is there
> a new .tcs file maybe that DOES this correctly? Or is there a way to
> modify my current FATL.tcs file to make sure the resolveTemp is
> correctly injected?
>
> An alternative solution would be to 'explain' ATL how to parse
> resolveTemp with reversed parameters.
>
> Anyone some thoughts ?
>
>


--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: resolveTemp's parameters are reversed after extraction to .atl [message #636686 is a reply to message #636681] Tue, 02 November 2010 13:23 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You get that problem only on resolveTemp or on all operations with parameters ?

That is really strange
Re: resolveTemp's parameters are reversed after extraction to .atl [message #636694 is a reply to message #636681] Tue, 02 November 2010 13:36 Go to previous messageGo to next message
Marten Sijtema is currently offline Marten SijtemaFriend
Messages: 67
Registered: November 2009
Member
with normal helpers it is not changed. I think it goes wrong with injection.

Is there another way to write an injector for a concrete syntax that is roughly the same (and based on) ATL?

I have a concrete syntax that is like ATL (called FATL), plus a new type of rule. My HOT compiles this .fatl file back into a .atl file.

I have a TCS project which injects the .fatl file, but the problem is that TCS is not supported anymore, and only works with ATL2.x

This means that I need 2 eclipse instances running, one with ATL 2 isntalled, and one with ATL 3. I use the ATL2 Eclipse instance solely to inject the .fatl file, which is quite a pain.


How would you write an ATL3.x compatible injector for a concrete syntax that looks roughly the same as normal ATL? How is the ATL3 parser written anyway?


My company: Sytematic, building business software from models.
Re: resolveTemp's parameters are reversed after extraction to .atl [message #636698 is a reply to message #636681] Tue, 02 November 2010 13:52 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You can still use TCS Parser and Lexer with ATL3.
So you need an ATL2.x compatible workspace with TCS only to conceive your TCS grammar. Then you can use the produced artifacts in your ATL3.x compatible workspace.

Have a look here
Re: resolveTemp's parameters are reversed after extraction to .atl [message #636699 is a reply to message #636681] Tue, 02 November 2010 13:59 Go to previous messageGo to next message
Marten Sijtema is currently offline Marten SijtemaFriend
Messages: 67
Registered: November 2009
Member
Yes, I kind of did that a while ago.

And it works: I have a java program in ATL3.x EClipse that injects the .fatl, so I can run the whole transformation sequence with one click. BUT: my injection is based on the ATL2.x compatible ATL.tcs right? So my injection would still reverse the resolveTemp parameters.

So, two potential solutions:
1) fix injector
2) make ATL able to process resolveTemps with reversed parameters

for one of the two points I need a solution, any thoughts?


My company: Sytematic, building business software from models.
Re: resolveTemp's parameters are reversed after extraction to .atl [message #636702 is a reply to message #636681] Tue, 02 November 2010 14:05 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You're assuming ATL has a problem but I inject/extract ATL files containing resolveTemp operations without that problem. Are you sure the problem isn't located elsewhere ?
Re: resolveTemp's parameters are reversed after extraction to .atl [message #636706 is a reply to message #636681] Tue, 02 November 2010 14:08 Go to previous messageGo to next message
Marten Sijtema is currently offline Marten SijtemaFriend
Messages: 67
Registered: November 2009
Member
But you are probably injecting normal ATL files in an ATL3.x workspace, am I right? Then it would work, because you can just use :
<atl.loadModel name="someModel" metamodel="atl" path="${path}" >
    <injector name="ATL" />
</atl.loadModel>


This works with resolveTemp. But what if you want to extend the syntax of ATL? How would you do it? Using TCS and an ATL2.x workspace?

(By the way: thanks for the quick replies!)


My company: Sytematic, building business software from models.

[Updated on: Tue, 02 November 2010 14:10]

Report message to a moderator

Re: resolveTemp's parameters are reversed after extraction to .atl [message #636709 is a reply to message #636681] Tue, 02 November 2010 14:18 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
Hmm there may be an underlying problem then. Well you could also pre-process your model before extraction to reverse the resolveTemp parameters.
Re: resolveTemp's parameters are reversed after extraction to .atl [message #636711 is a reply to message #636681] Tue, 02 November 2010 14:21 Go to previous messageGo to next message
Marten Sijtema is currently offline Marten SijtemaFriend
Messages: 67
Registered: November 2009
Member
Yep, I think I will resolve to that hack... Well, hopefully, one day, TCS project is maintained again Smile



My company: Sytematic, building business software from models.
Re: resolveTemp's parameters are reversed after extraction to .atl [message #636717 is a reply to message #636681] Tue, 02 November 2010 14:36 Go to previous messageGo to next message
Marten Sijtema is currently offline Marten SijtemaFriend
Messages: 67
Registered: November 2009
Member
Woooow...

I just discovered something. After injecting, and inspecting the .xmi, the order is correct! (Why I thought it wasn't, beats me...)

So, my HOT actually reverses it, it seems! because before extraction, when the result model is a .xmi, the order is already reversed.

Ergo: only the HOT can be the one that transforms it wrongly. I'll have a look into that.

I should have seen this earlier Sad So you were right after all with the fact that it is maybe a prolbem somewhere else.

Thanks for all the help.


My company: Sytematic, building business software from models.
Re: resolveTemp's parameters are reversed after extraction to .atl [message #636744 is a reply to message #636717] Tue, 02 November 2010 15:52 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Le 02/11/2010 15:36, Marten Sijtema a écrit :
> Woooow...
> I just discovered something. After injecting, and inspecting the .xmi,
> the order is correct! (Why I thought it wasn't, beats me...)
>
> So, my HOT actually reverses it, it seems! because before extraction,
> when the result model is a .xmi, the order is already reversed.
> Ergo: only the HOT can be the one that transforms it wrongly. I'll have
> a look into that.
>
> I should have seen this earlier :( So you were right after all with the
> fact that it is maybe a prolbem somewhere else.
>
> Thanks for all the help.

Debugging MDE problems is like in programming: you first need to find
WHERE the problem takes place before trying to understand WHAT goes
wrong :-)
--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: resolveTemp's parameters are reversed after extraction to .atl [message #636745 is a reply to message #636681] Tue, 02 November 2010 16:15 Go to previous message
Marten Sijtema is currently offline Marten SijtemaFriend
Messages: 67
Registered: November 2009
Member
totally agree. but due to my sloppiness i was ASSUMING the injector was a problem.

Now: assumption is the mother of all f*ckups, as we all know Wink


My company: Sytematic, building business software from models.
Previous Topic:[ATL] Run transformation sequence with HOT programmatically
Next Topic:[QVTo] Bug in type checking in QVTo 2.1.0??
Goto Forum:
  


Current Time: Fri Sep 20 03:46:54 GMT 2019

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

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

Back to the top