<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
using 'or' like that results in subrule generation, i.e. rules will
fire for all matching combinatinos - this is not what people normally
want. you can also do it using field constraints<br>
<br>
person : (Person (interests contains "Golf" || contains "Soccer") <br>
<br>
Jaikiran Pai wrote:
<blockquote cite="mid:330807.34221.qm@web7611.mail.in.yahoo.com"
 type="cite">
  <div>Hi,</div>
  <div>This is a very newbie question. I have a Person object which
contains a collection named "interests". This collection will contain
the activities that the Person is interested in. If the person is
interested in Golf, Soccer and Baseball, then this collection will
contain these 3 strings. I am trying to write a rule which checks
whether a person is interested in Soccer OR Golf and if he's interested
then do further logic. I looked at the documentation for Drools syntax,
and looks like this is how i have to write the rule:</div>
  <div>rule Testing<br>
&nbsp;when <br>
&nbsp;&nbsp;person : (Person (interests contains "Golf") or Person (interests
contains "Soccer") )</div>
  <div>&nbsp;then<br>
&nbsp;&nbsp;System.out.println("I am interested");<br>
end</div>
  <div><br>
Is this the correct way to do this? Is there a simpler construct like:</div>
  <div>person : Person (interests contains "Golf" or interests contains
"Soccer" )</div>
  <div>I was thinking on the lines of the "," (and) operator :</div>
  <div><br>
person : Person (interests contains "Golf", interests contains "Soccer"
)</div>
  <div>Thank you.</div>
  <p><!--1--> </p>
  <hr size="1"> Why delete messages? Unlimited storage is <a
 moz-do-not-send="true"
 href="http://in.rd.yahoo.com/tagline_mail_1/*http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/">just
a click away.</a>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
</blockquote>
<br>
</body>
</html>