Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » helper attribute
helper attribute [message #1062899] Tue, 11 June 2013 10:19 Go to next message
Eclipse UserFriend
Hello,

I use a helper attribute defined as follows:

helper def: resolved: Set(MM!Element) = Set{};


I add some elements to this set in the "do" section of a rule, to be used in the "using" section of another rule.
But I found that the set is empty in the "using" section, although it prints the contained values in the "do" section of both rules.

Anyone have a clue?
Re: helper attribute [message #1062941 is a reply to message #1062899] Tue, 11 June 2013 13:41 Go to previous messageGo to next message
Burak Karaboga is currently offline Burak KarabogaFriend
Messages: 9
Registered: June 2013
Junior Member

Hi Basma,

How are you adding elements to your helper attribute in the do section?

Just adding the elements is not enough, you should also assign the new Set to your attribute. Example below;

thisModule.resolved <- thisModule.resolved.union(anotherCollection);


Cheers
Re: helper attribute [message #1062989 is a reply to message #1062941] Tue, 11 June 2013 15:53 Go to previous messageGo to next message
Eclipse UserFriend
I do this ?!!

And the added elements appear in the do section of this rule and in the other rule.
But they don't appear in the using section.
Is this normal, or am I doing something wrong?

[Updated on: Tue, 11 June 2013 15:55] by Moderator

Report message to a moderator

Re: helper attribute [message #1063159 is a reply to message #1062989] Wed, 12 June 2013 13:54 Go to previous messageGo to next message
Burak Karaboga is currently offline Burak KarabogaFriend
Messages: 9
Registered: June 2013
Junior Member

I did a quick test and it seems that using sections are executed before rules and do sections no matter what.

I think more experienced ATL people would better explain why this is the case but I think you should find another way to achieve what you are trying to do.

If I understood what you are trying to do correctly, by copying your global attribute to another one and only using/modifying it in that specific rule, you might use it as if it is a local attribute.

Cheers
Re: helper attribute [message #1063193 is a reply to message #1063159] Wed, 12 June 2013 15:14 Go to previous message
Eclipse UserFriend

Thanks a lot for your help.
I made a work around and it worked.
Previous Topic:Performance
Next Topic:[ATL] Rule inheritance with several 'from' elements
Goto Forum:
  


Current Time: Tue Apr 23 08:22:21 GMT 2024

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

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

Back to the top