[rules-users] Need Syntax help for a string match
Greg Barton
greg_barton at yahoo.com
Tue Nov 17 16:19:05 EST 2009
Use the "in" keyword:
rule "Age Factor"
when
m : Customer( age in("18","21","33","28","40","41") )
then
System.out.println("Customer falls in age group ");
doAgeTasks();
end
--- On Tue, 11/17/09, Lindy hagan <lindyhagan at gmail.com> wrote:
> From: Lindy hagan <lindyhagan at gmail.com>
> Subject: [rules-users] Need Syntax help for a string match
> To: rules-users at lists.jboss.org
> Date: Tuesday, November 17, 2009, 2:42 PM
>
> Need to do some tasks if customers age is in
> 18,21,33,28,40,41. Can't use contains as age is a string
> value.Could any one help me out. Below rule does not work.
>
>
> rule "Age Factor"
> when
>
> m : Customer( age matches
> "18,21,33,28,40,41")
> then
> System.out.println("Customer falls in
> age group ");
> doAgeTasks();
> end
>
> Thanks,
> Lindy.
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
More information about the rules-users
mailing list