[rules-users] Using Enums in when clause

Wolfgang Laun wolfgang.laun at gmail.com
Fri Aug 7 01:47:59 EDT 2009


In gameWinner == PARTICIPANTS.HOME.getId(), the second operand isn't an
enum, it's a method call on an enum object. Hence, it must be written as a
"Return Value Restriction" (cf. Expert doc on a Rule's LHS), thus
   ..., gameWinner == ( PARTICIPANTS.HOME.getId() ), ...

-W


2009/8/6 Zevenbergen, Alex <azevenbergen at paddypower.com>

>  Hi,
>
>
>
> This is my where clause:
>
>
>
> *when*
>
>       resultInfo : TennisResultInfo(endGame == *true* , setNumber ==
> 5,gameWinner == PARTICIPANTS.HOME.getId() , gameLoseScore == 0)
>
> *then*
>
> * *
>
> * *
>
> the rule falls over on PARTICIPANTS.HOME.getId()
>
>
>
> PARTICIPANTS.HOME.getId() is an enum and returns an integer.
>
>
>
> If I replace this line with the value that it would return the rule runs
> perfectly.
>
>
>
> Do I have to reference this in a certain way because it is an integer?
>
>
>
> (Note all imports are present and correct)
>
>
>
> Thanks,
>
>
>
> Alex
>
> ________________________________________________________________________
> Privileged, confidential and/or copyright information may be contained in
> this communication. This e-mail and any files transmitted with it are
> confidential and intended solely for the use of the individual or entity to
> whom they are addressed. If you are not the intended addressee, you may not
> copy, forward, disclose or otherwise use this e-mail or any part of it in
> any way whatsoever. To do so is prohibited and may be unlawful. If you have
> received this email in error
> please notify the sender immediately.
>
> Paddy Power PLC may monitor the content of e-mail sent and received for the
> purpose of ensuring compliance with its policies and procedures.
>
> Paddy Power plc, Airton House, Airton Road, Tallaght, Dublin 24 Registered
> in Ireland: 16956
> ________________________________________________________________________
>
> _______________________________________________
> 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/20090807/dc620f25/attachment.html 


More information about the rules-users mailing list