Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » [solved] helper call two sentences ??
[solved] helper call two sentences ?? [message #1364108] Sun, 18 May 2014 06:21 Go to next message
Gianni Rosa is currently offline Gianni Rosa
Messages: 11
Registered: August 2013
Junior Member
Hi guys,
I am writing a complex ATL transformation and I need your help, in particular I have to resolve an OCL like Expression in a couple name value (ex. Person = objPerson). For do that, I have written a recoursive helper thathas a parameter of type OclExpression and resolve name and value depending on its Type.

My problem now arises when the type is of ObjectTemplateExp, because in this case I need to update the result string with the value and call the rule that creates new Element and continue to evaluate the sentence.

if (s.oclIsKindOf(JTLMM!ObjectTemplateExp)) then				thisModule.valueString.concat(s.name)  --helper with result value	thisModule.ObjTemplateExpr2Pattern(s)  --rule creates new Element


Obviously, I can do that in ATL, so, how can I resolve this issue?

I am probably wrong approach, any help will be appreciated!

Thanks,
Gianni

[Updated on: Tue, 20 May 2014 09:31]

Report message to a moderator

Re: helper call two sentences ?? [message #1366390 is a reply to message #1364108] Mon, 19 May 2014 05:39 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 522
Registered: July 2009
Senior Member
you can always "cheat" the declarative if expressions by using "let" expressions where you do imperative things.
e.g. :
let fakeVariable : String = thisModule.valueString.concat(s.name) in thisModule.ObjTemplateExpr2Pattern(s)
Re: helper call two sentences ?? [message #1369119 is a reply to message #1366390] Tue, 20 May 2014 08:30 Go to previous message
Gianni Rosa is currently offline Gianni Rosa
Messages: 11
Registered: August 2013
Junior Member
Thank you very much! It has been very helpful! Works ok!

Best regards,
Gianni
Previous Topic:Using of Sequence as global variable
Next Topic:[solved] Accessing to new model element
Goto Forum:
  


Current Time: Thu Jul 31 20:02:32 EDT 2014

Powered by FUDForum. Page generated in 0.11624 seconds