Skip to main content


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 10:21 Go to next message
Gianni Rosa is currently offline Gianni RosaFriend
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 13:31]

Report message to a moderator

Re: helper call two sentences ?? [message #1366390 is a reply to message #1364108] Mon, 19 May 2014 09:39 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
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 12:30 Go to previous message
Gianni Rosa is currently offline Gianni RosaFriend
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: Fri Apr 19 12:08:29 GMT 2024

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

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

Back to the top