[rules-users] Re: How to validate boolean values..using Drools

Alexander Claus styjdt at claus4joy.de
Tue Jun 17 11:09:25 EDT 2008


> In My Employee Table column name HostVisible_YN. HostVisible_YN it's 
> boolen
> value.
>
> Condtion is: HostVisible_YN column value must be "Y" or "N".
>
>
> How to validate this condition using drools..

Hi Manya,

feel free to experiment with the DRL language! A simple test gave, that the 
most intuitive solution is possible:
$value in ("Y", "N")
Here you can read more: 
http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html/ch06s05.html#d0e3166
See section on Compound Value Restriction for details.

Alternatively you could use
$value == "Y" || "N"
which is the simplest solution which you should (!) have found even as a 
beginner as I am.
Again: experiment with the language!

Alexander Claus 




More information about the rules-users mailing list