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
Basma Moukhtar is currently offline Basma Moukhtar
Messages: 27
Registered: June 2010
Junior Member

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 Bruneliere
Messages: 607
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 - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
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
Basma Moukhtar is currently offline Basma Moukhtar
Messages: 27
Registered: June 2010
Junior Member

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 Bruneliere
Messages: 607
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 - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Previous Topic:How to execute ATL Transformation without using eclipse
Next Topic:implement the model in database
Goto Forum:
  


Current Time: Thu Oct 23 04:03:38 GMT 2014

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

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