<br>&nbsp;&nbsp; Jaikiran,<br><br>&nbsp;&nbsp; This is only supported in Drools 4.<br>&nbsp;&nbsp; In 3.0.x, you will have to use either a predicate or do what you were doing, but note that as Mark mentioned, the OR CE will cause subrule generation, meaning the rule will fire twice if both conditions are true.
<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/8/13, Jaikiran Pai &lt;<a href="mailto:jai_forums2005@yahoo.co.in">jai_forums2005@yahoo.co.in</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">Thanks for the inputs, Mark.</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">
&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">I just modified the Helloworld example to try this out. I added a collection to the Message class:</span></div>
  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">public static class Message {
</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>public static final int HELLO<span>&nbsp;&nbsp; </span>= 0;</span></div>  <div style="margin: 0in 0in 0pt;">
<span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>public static final int GOODBYE = 1;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">
&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>private String<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>message;</span></div> 
 <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>private int<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>status;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>private List headers = new ArrayList();</span></div>  <div style="margin: 0in 0in 0pt;">
<span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>public void setHeaders(List test) {
</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp; </span>//ignore the param as of now</span></div>  <div style="margin: 0in 0in 0pt;">
<span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp; </span>headers.add(&quot;hello header1&quot;);</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp; </span>headers.add(&quot;hello header2&quot;);</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span></div>
  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>public List getHeaders() {</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;&nbsp; </span>return this.headers;</span>
</div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">
….</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">}</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">
&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">And then changed the rule to:</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">
&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: windowtext;">
rule &quot;Hello World&quot;</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: windowtext;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>when</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: windowtext;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>m : (Message (headers contains &quot;hello header1&quot; ||<span>&nbsp; </span>contains &quot;hello header2&quot;))</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;">
<span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: windowtext;"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</span>then</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: windowtext;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: windowtext;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>System.out.println( &quot;bye&quot; ); </span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: windowtext;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: windowtext;">
End</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: windowtext;">&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">
However, the rule compilation fails with this error:</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: red;">
org.drools.rule.InvalidRulePackage: unknown:7:49 Unexpected token &#39;||&#39;</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: red;">
unknown:7:53 mismatched token: [@51,170:177=&#39;contains&#39;,&lt;49&gt;,7:53]; expecting type ID</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: red;">
unknown:8:1 mismatched token:
 [@58,199:202=&#39;then&#39;,&lt;33&gt;,8:1]; expecting type &#39;(&#39;</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: red;">
unknown:10:2 mismatched token: [@65,211:216=&#39;System&#39;,&lt;5&gt;,10:2]; expecting type &#39;)&#39;</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: windowtext;">
&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: red;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>at org.drools.rule.Package.checkValidity(Unknown Source)</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: red;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: red;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>at org.drools.examples.HelloWorldExample.readRule(</span><u><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: navy;">
HelloWorldExample.java:65</span></u><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: red;">
)</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: red;">
<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>at org.drools.examples.HelloWorldExample.main(</span><u><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: navy;">
HelloWorldExample.java:23</span></u><span style="background: white none repeat scroll 0% 50%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: red;">
)</span><span style="font-size: 10pt; color: windowtext;"></span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: red;">&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: red;">
&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">I tried out a few more combinations with the || constraint, but each time it failed with similar errors complaining about the token.
</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">
Anything that I am doing incorrectly, here? I am using 3.0.6 version.</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">&nbsp;</span></div>  <div style="margin: 0in 0in 0pt;">
<span style="font-size: 10pt; color: navy; font-family: Arial;">Regards,</span></div>  <div style="margin: 0in 0in 0pt;"><span style="font-size: 10pt; color: navy; font-family: Arial;">-Jaikiran</span><span style="font-size: 10pt; color: windowtext;">
</span></div><div><span class="e" id="q_1145f8be1c0e7631_1"><br><br><b><i>Mark Proctor &lt;<a href="mailto:mproctor@codehaus.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mproctor@codehaus.org
</a>&gt;</i></b> wrote:  <blockquote style="border-left: 2px solid rgb(16, 16, 255); padding-left: 5px; margin-left: 5px;">using &#39;or&#39; 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 &quot;Golf&quot; || contains &quot;Soccer&quot;) <br><br>Jaikiran Pai wrote:   
<blockquote type="cite">  <div>Hi,</div>  <div>This is a very newbie question. I have a Person object which contains a collection named &quot;interests&quot;. 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&#39;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 &quot;Golf&quot;) or Person (interests contains &quot;Soccer&quot;) )</div> 
 <div>&nbsp;then<br>&nbsp;&nbsp;System.out.println(&quot;I am interested&quot;);<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 &quot;Golf&quot; or interests contains &quot;Soccer&quot; )
</div>  <div>I was thinking on the lines of the &quot;,&quot; (and) operator :</div>  <div><br>person : Person (interests contains &quot;Golf&quot;, interests contains &quot;Soccer&quot; )</div>  <div>Thank you.</div>  <div>
</div>  <hr size="1">  Why delete messages? Unlimited storage is <a href="http://in.rd.yahoo.com/tagline_mail_1/*http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
just a click away.</a> <pre><hr size="4" width="90%">  _______________________________________________  rules-users mailing list  <a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
rules-users@lists.jboss.org</a>  <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users</a>
    </pre></blockquote><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br></blockquote><br></span></div><p> 


      </p><hr size="1"> Bollywood, fun, friendship, sports and more. You name it, <a href="http://in.rd.yahoo.com/tagline_groups_1/*http://in.groups.yahoo.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
 we have it.</a><p></p><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div>
<br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">
www.jboss.com</a>