[gme-users] How to use Guards with EnumAttributes
Ananth at isis.vanderbilt.edu
Tue Nov 29 11:15:38 CST 2005
you can try the following in the guard code:
return (temp == "single");
From: gme-users-bounces at list.isis.vanderbilt.edu
[mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Tobias
Sent: Tuesday, November 29, 2005 9:15 AM
Subject: [gme-users] How to use Guards with EnumAttributes
Currently, Im trying to use GReAT in order to make a transformation.
I want a rule only to be executed if certain conditions are fulfilled.
>From the tutorial I learnt that this can be done by a guard.
Unfortunately, I have serious problems to express the condition.
The rule should be executed if a certain EnumAttribute of a Class has a
specific value. I tried to use
return (<className>.<EnumAttributeName>() == <Value>);
e.g. return (person.martialStatus() == "single");
This does not function, I get an error message.
I wondered if someone could tell me, what I have to do in order to
achieve my aim.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gme-users