Hi Bill,<br><br>To implement your rules in 3.0.5 you would need to implement a rule for&nbsp; each combination of age and zipCode.<br><br>$a : Person(age &gt; 35 zipCode == 23546)<br>then<br>$a.setStatus(&quot;KT&quot;);<br><br>
$a : Person(age &lt; 25, zipCode == 23546 )<br>then<br>$a.setStatus(&quot;KT&quot;);<br><br>$a : Person(age &gt; 35, zipCode == 68590)<br>then<br>$a.setStatus(&quot;KT&quot;);<br><br>etc..<br><br>Steve<br><br><div><span class="gmail_quote">
On 2/19/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;">
So Alex, if I only want to use the old syntax that is in production,<br>there is no way to implement my seemingly simple logic conditioning?<br><br>Thanks for your help.<br><br>On 2/18/07, Alexander Varakin &lt;<a href="mailto:avarakin@optonline.net">
avarakin@optonline.net</a>&gt; wrote:<br>&gt; As far as I know this syntax is new and is available in SVN only, you<br>&gt; will have to wait till 3.1 is released or take source from SVN and build it.<br>&gt;<br>&gt; Bill Zhang wrote:
<br>&gt; &gt; Hi Steven,<br>&gt; &gt;<br>&gt; &gt; Thank you very much for your help. Really appreciate.<br>&gt; &gt;<br>&gt; &gt; I still got the same error, Unexpected token &#39;|&#39;. I did not see &quot;|&quot; in<br>
&gt; &gt; the document, only saw &quot;||&quot;, which is supposed to be used with<br>&gt; &gt; columns.<br>&gt; &gt;<br>&gt; &gt; Ye<br>&gt; &gt;<br>&gt; &gt; On 2/18/07, Steven Williams &lt;<a href="mailto:stevenw@objectconsulting.com.au">
stevenw@objectconsulting.com.au</a>&gt; wrote:<br>&gt; &gt;&gt; Hi Bill,<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; I think it should be:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; $a : Person(age &gt; 35 | &lt; 25, zipCode == 23546 | == 68590)
<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Edson, Mark or Michael can probably confirm or correct the above syntax.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Make sure you are running of the latest trunk.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; cheers
<br>&gt; &gt;&gt; Steve<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;<br>&gt; &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; &gt;<br>&gt; &gt;&gt; &gt; I tried:
<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; $a : Person(age &gt; 35 || age &lt; 25, zipCode == 23546 || == 68590)<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Errors:<br>&gt; &gt;&gt; &gt; org.drools.rule.InvalidRulePackage
: unknown:39:30<br>&gt; &gt;&gt; Unexpected token &#39;||&#39;<br>&gt; &gt;&gt; &gt; unknown:39:40 mismatched token:<br>&gt; &gt;&gt; [@246,1040:1041=&#39;&lt;=&#39;,&lt;47&gt;,39:40];<br>&gt; &gt;&gt; &gt; expecting type &#39;(&#39;
<br>&gt; &gt;&gt; &gt; unknown:39:92 mismatched token:<br>&gt; &gt;&gt; [@258,1092:1092=&#39;&lt;&#39;,&lt;46&gt;,39:92];<br>&gt; &gt;&gt; &gt; expecting type &#39;(&#39;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; I also tried
<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; $a : Person(age &gt; 35 | age &lt; 25, zipCode == 23546 | == 68590)<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Pretty much the same error.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Based on the document, &quot;||&quot; is only valid for columns...
<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; On 2/17/07, Bill Zhang &lt;<a href="mailto:billzhang2006@gmail.com">billzhang2006@gmail.com</a>&gt; wrote:<br>&gt; &gt;&gt; &gt; &gt; Thank you Steve. But I got syntax error using the following.
<br>&gt; &gt;&gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &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;&gt; &gt; &gt; &gt; In trunk I think you can use connective constraints:
<br>&gt; &gt;&gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; $a : Person(age &gt; 35 | &lt; 25, zipCode == 23546 | == 68590)<br>&gt; &gt;&gt; &gt; &gt; &gt; then<br>&gt; &gt;&gt; &gt; &gt; &gt; $a.setStatus(&quot;KT&quot;);
<br>&gt; &gt;&gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &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; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; Hello,<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; I am a new Drools user trying to convert the following simple
<br>&gt; &gt;&gt; logic<br>&gt; &gt;&gt; into<br>&gt; &gt;&gt; &gt; &gt; &gt; DRL:<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; IF (Person.Age &gt; 35 OR Person.Age &lt; 25) AND (Person.ZipCode
 =<br>&gt; &gt;&gt; 23546<br>&gt; &gt;&gt; or<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; Person.ZipCode = 68590)<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; THEN<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; Person.Status = &quot;KT&quot;;<br>
&gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; I found that it is not easy to convert the above logic into<br>&gt; &gt;&gt; ONE DRL<br>&gt; &gt;&gt; rule.<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; I tried something like this
<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; when<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; $a: Person(age&gt;35) or Person (age&lt;25)<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; $b: Person(Zipcode==23456) or Person (ZipCode == 68590)
<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; $c: $a and $b<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; Then<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; $c.setStatus(&quot;KT&quot;)<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; But looks like I can not use
<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; $c: $a and $b<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; becaue in Drools, you can only bind variable to column, not<br>&gt; &gt;&gt; to other<br>&gt; &gt;&gt; &gt; &gt; &gt; varaibles.<br>
&gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; Please advise how to do this. I would imagine this should be<br>&gt; &gt;&gt; quite<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; simple, maybe I missed something quite obvious.
<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; I know that I can write custom Java method to do this, but if<br>&gt; &gt;&gt; I do<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; that, I suppose I lose the power of RETEOO pattern matching
<br>&gt; &gt;&gt; (pattern<br>&gt; &gt;&gt; &gt; &gt; &gt; resuing,<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; etc.). So I prefer not to do that.<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; I also understand I can break the above logic into 4 rules
<br>&gt; &gt;&gt; and that<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; would be quite easy, but our business user is not used to<br>&gt; &gt;&gt; think in<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; that way. Also, we have more complex logic than the above. So
<br>&gt; &gt;&gt; what I<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; want is to see if there is a way to convert this<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; kind of logic in ONE DRL rule.<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; Thanks in advance.
<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; Bill<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; _______________________________________________<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; rules-users mailing list
<br>&gt; &gt;&gt; &gt; &gt; &gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>&gt; &gt;&gt; &gt; &gt; &gt; &gt;<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; &gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; --
<br>&gt; &gt;&gt; &gt; &gt; &gt; Steven Williams<br>&gt; &gt;&gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; Supervising Consultant<br>&gt; &gt;&gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; Object Consulting<br>
&gt; &gt;&gt; &gt; &gt; &gt; Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501<br>&gt; &gt;&gt; &gt; &gt; &gt; <a href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</a><br>&gt; &gt;&gt; &gt; &gt; &gt; 
<a href="http://www.objectconsulting.com.au">www.objectconsulting.com.au</a><br>&gt; &gt;&gt; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt; consulting | development | training | support<br>&gt; &gt;&gt; &gt; &gt; &gt; our experience makes the difference
<br>&gt; &gt;&gt; &gt; &gt; &gt; _______________________________________________<br>&gt; &gt;&gt; &gt; &gt; &gt; rules-users mailing list<br>&gt; &gt;&gt; &gt; &gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org
</a><br>&gt; &gt;&gt; &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; &gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; &gt; &gt;<br>
&gt; &gt;&gt; &gt; &gt;<br>&gt; &gt;&gt; &gt; _______________________________________________<br>&gt; &gt;&gt; &gt; rules-users mailing list<br>&gt; &gt;&gt; &gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org
</a><br>&gt; &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; &gt;<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;<br>&gt; &gt;&gt;<br>
&gt; &gt;&gt; --<br>&gt; &gt;&gt; Steven Williams<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Supervising Consultant<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Object Consulting<br>&gt; &gt;&gt; Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
<br>&gt; &gt;&gt; <a href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</a><br>&gt; &gt;&gt; <a href="http://www.objectconsulting.com.au">www.objectconsulting.com.au</a><br>&gt; &gt;&gt;<br>&gt; &gt;&gt; consulting | development | training | support
<br>&gt; &gt;&gt; our experience makes the difference<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;&gt;<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;<br>&gt; _______________________________________________<br>&gt; rules-users mailing list<br>&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users">
https://lists.jboss.org/mailman/listinfo/rules-users</a><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