Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » toString helper
toString helper [message #1059487] Sun, 19 May 2013 17:04 Go to next message
Eclipse UserFriend

Dears,
I have a helper that's defined as this:

helper context MyPackage!MyClass def: toString() : String = 'Self To String;'


But I need to set a boolean attribute in self (MyPackage!MyClass) to true when the "toString" function is called.
I can't write self.myAttibute=true because my helper returns string.

How can I do this?
Re: toString helper [message #1059689 is a reply to message #1059487] Tue, 21 May 2013 08:46 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Hello,

If you want to set an attribute helper, you have to do it in the "do" section of the corresponding matched rule (e.g.; the one in which your toString helper is actually called).


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: toString helper [message #1059707 is a reply to message #1059689] Tue, 21 May 2013 10:02 Go to previous messageGo to next message
Eclipse UserFriend

But toString is called from another helper that is called from a query not a rule.
So, is there a way to set an attribute in a helper?
Re: toString helper [message #1059720 is a reply to message #1059707] Tue, 21 May 2013 11:24 Go to previous message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Unfortunately, you cannot add "do" sections to ATL queries.
Maybe you could try to express differently inside your query the needed condition.


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Previous Topic:How to execute ATL Transformation without using eclipse
Next Topic:implement the model in database
Goto Forum:
  


Current Time: Fri Apr 26 13:52:23 GMT 2024

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

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

Back to the top