<div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Thanks for the inputs, Mark.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></div> <div class=MsoNormal 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:<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">public static class Message {<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN>public static final int HELLO<SPAN style="mso-spacerun: yes"> </SPAN>= 0;<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN>public static final int GOODBYE = 1;<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN>private String<SPAN style="mso-spacerun: yes"> </SPAN>message;<o:p></o:p></SPAN></div>
<div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN>private int<SPAN style="mso-spacerun: yes"> </SPAN>status;<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN>private List headers = new ArrayList();<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun:
yes"> </SPAN><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN>public void setHeaders(List test) {<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>//ignore the param as of now<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>headers.add("hello header1");<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in
0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>headers.add("hello header2");<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN>}<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN>public List getHeaders() {<o:p></o:p></SPAN></div> <div class=MsoNormal
style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN>return this.headers;<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><SPAN style="mso-spacerun: yes"> </SPAN>}<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">….<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">}<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">And then changed the rule to:<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: windowtext; FONT-FAMILY: 'Courier New'; mso-highlight: white">rule "Hello World"</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: windowtext; FONT-FAMILY: 'Courier New'; mso-highlight: white"><SPAN style="mso-tab-count: 1"> </SPAN>when</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: windowtext; FONT-FAMILY: 'Courier New'; mso-highlight: white"><SPAN style="mso-tab-count: 2"> </SPAN>m : (Message (headers contains "hello header1" ||<SPAN style="mso-spacerun: yes"> </SPAN>contains "hello header2"))</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: windowtext; FONT-FAMILY: 'Courier New'; mso-highlight: white"><SPAN style="mso-tab-count: 1"> </SPAN>then</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN
style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: windowtext; FONT-FAMILY: 'Courier New'; mso-highlight: white"><SPAN style="mso-tab-count: 2"> </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: windowtext; FONT-FAMILY: 'Courier New'; mso-highlight: white"><SPAN style="mso-tab-count: 2"> </SPAN>System.out.println( "bye" ); </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: windowtext; FONT-FAMILY: 'Courier New'; mso-highlight: white"><SPAN
style="mso-tab-count: 2"> </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: windowtext; FONT-FAMILY: 'Courier New'; mso-highlight: white">End</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">However, the rule compilation fails with this error:<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></div> <div
class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: 'Courier New'; mso-highlight: white">org.drools.rule.InvalidRulePackage: unknown:7:49 Unexpected token '||'</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: 'Courier New'; mso-highlight: white">unknown:7:53 mismatched token: [@51,170:177='contains',<49>,7:53]; expecting type ID</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: 'Courier New'; mso-highlight: white">unknown:8:1 mismatched token:
[@58,199:202='then',<33>,8:1]; expecting type '('</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: 'Courier New'; mso-highlight: white">unknown:10:2 mismatched token: [@65,211:216='System',<5>,10:2]; expecting type ')'</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: 'Courier New'; mso-highlight: white"><SPAN style="mso-tab-count:
1"> </SPAN>at org.drools.rule.Package.checkValidity(Unknown Source)</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: 'Courier New'; mso-highlight: white"><SPAN style="mso-tab-count: 1"> </SPAN>at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: 'Courier New'; mso-highlight: white"><SPAN style="mso-tab-count: 1"> </SPAN>at org.drools.examples.HelloWorldExample.readRule(</SPAN><U><SPAN style="FONT-SIZE: 10pt;
BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-highlight: white">HelloWorldExample.java:65</SPAN></U><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: 'Courier New'; mso-highlight: white">)</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: 'Courier New'; mso-highlight: white"><SPAN style="mso-tab-count: 1"> </SPAN>at org.drools.examples.HelloWorldExample.main(</SPAN><U><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-highlight: white">HelloWorldExample.java:23</SPAN></U><SPAN style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: red; FONT-FAMILY: 'Courier New'; mso-highlight: white">)</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY:
'Courier New'"><o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"><o:p> </o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><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.<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR:
navy; FONT-FAMILY: Arial">Anything that I am doing incorrectly, here? I am using 3.0.6 version.<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Regards,<o:p></o:p></SPAN></div> <div class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">-Jaikiran</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></div><BR><BR><B><I>Mark Proctor <mproctor@codehaus.org></I></B> wrote: <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">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> when <BR> person : (Person (interests contains "Golf") or Person (interests contains "Soccer") )</DIV>
<DIV> then<BR> 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> <div><!--1--></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/" moz-do-not-send="true">just a click away.</A> <PRE wrap=""><HR width="90%" SIZE=4> _______________________________________________ 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>_______________________________________________<BR>rules-users mailing list<BR>rules-users@lists.jboss.org<BR>https://lists.jboss.org/mailman/listinfo/rules-users<BR></BLOCKQUOTE><BR><p> 
<!--1--><hr size=1></hr> Bollywood, fun, friendship, sports and more. You name it, <a href="http://in.rd.yahoo.com/tagline_groups_1/*http://in.groups.yahoo.com"> we have it.</a>