| toString helper [message #1059487] |
Sun, 19 May 2013 13:04  |
Basma Moukhtar Messages: 22 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 04:46   |
Hugo Bruneliere Messages: 469 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 #1059720 is a reply to message #1059707] |
Tue, 21 May 2013 07:24  |
Hugo Bruneliere Messages: 469 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
------------------------------------------
|
|
|
Powered by
FUDForum. Page generated in 0.01638 seconds