[rules-users] check if a Enum object is present in condition
Ansgar Konermann
ansgar.konermann at googlemail.com
Sat Oct 22 15:06:10 EDT 2011
Am 22.10.2011 20:28 schrieb "Martin A" <wmlsub at gmail.com>:
>
> Hello,
>
> I try to put a condition in my LHS, such as:
>
> rule "initial_playground_dialog"
> #agenda-group "firstTimeUser"
> #salience 99
> when
> $gst :
GameStateController(!hasEventOccurred("initial_playground_dialog"))
> $list : List()
> $screen : FrontendScreen.PLAYGROUND
> then
> ....
> end
>
> where 'FrontendScreen' is an enum and PLAYGROUND is its property.
Is it actually a property of an enum or rather one of the enum literals?
If it is actually a property, you will need to obtain an instance of the
FrontendScreen enum first. If PLAYGROUND is actually an enum literal and you
want to bind this literal to a variable, use:
$screen: FrontendScreen( this == FrontendScreen.PLAYGROUND )
Regards
Ansgar
> However I get a syntax error. What's the proper way to check for and
assign such a session object?
>
> Any help is appreciated!
>
> Best regards,
> Martin
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111022/04a1109e/attachment.html
More information about the rules-users
mailing list