Hi Bill,<br><br>I think it should be:<br><br>$a : Person(age &gt; 35 | &lt; 25, zipCode == 23546 | == 68590)<br><br>Edson, Mark or Michael can probably confirm or correct the above syntax.<br><br>Make sure you are running of the latest trunk. 
<br><br>cheers<br>Steve<br><br><div><span class="gmail_quote">On 2/18/07, <b class="gmail_sendername">Bill Zhang</b> &lt;<a href="mailto:billzhang2006@gmail.com">billzhang2006@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I tried:<br><br>$a : Person(age &gt; 35 || age &lt; 25, zipCode == 23546 || == 68590)<br><br>Errors:<br>org.drools.rule.InvalidRulePackage: unknown:39:30 Unexpected token &#39;||&#39;<br>unknown:39:40 mismatched token: [@246,1040:1041=&#39;&lt;=&#39;,&lt;47&gt;,39:40];
<br>expecting type &#39;(&#39;<br>unknown:39:92 mismatched token: [@258,1092:1092=&#39;&lt;&#39;,&lt;46&gt;,39:92];<br>expecting type &#39;(&#39;<br><br>I also tried<br><br>$a : Person(age &gt; 35 | age &lt; 25, zipCode == 23546 | == 68590)
<br><br>Pretty much the same error.<br><br>Based on the document, &quot;||&quot; is only valid for columns...<br><br><br>On 2/17/07, Bill Zhang &lt;<a href="mailto:billzhang2006@gmail.com">billzhang2006@gmail.com</a>&gt; wrote:
<br>&gt; Thank you Steve. But I got syntax error using the following.<br>&gt;<br>&gt; On 2/17/07, Steven Williams &lt;<a href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</a>&gt; wrote:<br>&gt; &gt; In trunk I think you can use connective constraints:
<br>&gt; &gt;<br>&gt; &gt; $a : Person(age &gt; 35 | &lt; 25, zipCode == 23546 | == 68590)<br>&gt; &gt; then<br>&gt; &gt; $a.setStatus(&quot;KT&quot;);<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; On 2/18/07, Bill Zhang &lt;
<a href="mailto:billzhang2006@gmail.com">billzhang2006@gmail.com</a>&gt; wrote:<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Hello,<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I am a new Drools user trying to convert the following simple logic into
<br>&gt; &gt; DRL:<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; IF (Person.Age &gt; 35 OR Person.Age &lt; 25) AND (Person.ZipCode = 23546 or<br>&gt; &gt; &gt; Person.ZipCode = 68590)<br>&gt; &gt; &gt; THEN<br>&gt; &gt; &gt; Person.Status
 = &quot;KT&quot;;<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I found that it is not easy to convert the above logic into ONE DRL rule.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I tried something like this<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; when
<br>&gt; &gt; &gt; $a: Person(age&gt;35) or Person (age&lt;25)<br>&gt; &gt; &gt; $b: Person(Zipcode==23456) or Person (ZipCode == 68590)<br>&gt; &gt; &gt; $c: $a and $b<br>&gt; &gt; &gt; Then<br>&gt; &gt; &gt; $c.setStatus(&quot;KT&quot;)
<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; But looks like I can not use<br>&gt; &gt; &gt; $c: $a and $b<br>&gt; &gt; &gt; becaue in Drools, you can only bind variable to column, not to other<br>&gt; &gt; varaibles.<br>&gt; &gt; &gt;
<br>&gt; &gt; &gt; Please advise how to do this. I would imagine this should be quite<br>&gt; &gt; &gt; simple, maybe I missed something quite obvious.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I know that I can write custom Java method to do this, but if I do
<br>&gt; &gt; &gt; that, I suppose I lose the power of RETEOO pattern matching (pattern<br>&gt; &gt; resuing,<br>&gt; &gt; &gt; etc.). So I prefer not to do that.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; I also understand I can break the above logic into 4 rules and that
<br>&gt; &gt; &gt; would be quite easy, but our business user is not used to think in<br>&gt; &gt; &gt; that way. Also, we have more complex logic than the above. So what I<br>&gt; &gt; &gt; want is to see if there is a way to convert this
<br>&gt; &gt; &gt; kind of logic in ONE DRL rule.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Thanks in advance.<br>&gt; &gt; &gt;<br>&gt; &gt; &gt; Bill<br>&gt; &gt; &gt; _______________________________________________<br>&gt; &gt; &gt; rules-users mailing list
<br>&gt; &gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>&gt; &gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br>&gt; &gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; --<br>&gt; &gt; Steven Williams<br>&gt; &gt;<br>&gt; &gt; Supervising Consultant<br>&gt; &gt;<br>&gt; &gt; Object Consulting<br>&gt; &gt; Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
<br>&gt; &gt; <a href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</a><br>&gt; &gt; <a href="http://www.objectconsulting.com.au">www.objectconsulting.com.au</a><br>&gt; &gt;<br>&gt; &gt; consulting | development | training | support
<br>&gt; &gt; our experience makes the difference<br>&gt; &gt; _______________________________________________<br>&gt; &gt; rules-users mailing list<br>&gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org
</a><br>&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>&gt; &gt;<br>&gt; &gt;<br>&gt;<br>_______________________________________________
<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Steven Williams<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501<br><a href="mailto:stevenw@objectconsulting.com.au">
stevenw@objectconsulting.com.au</a><br><a href="http://www.objectconsulting.com.au">www.objectconsulting.com.au</a><br><br>consulting | development | training | support<br>our experience makes the difference