<br>&nbsp;&nbsp; Yes, parser error. For Drools 5 we rewrote the parser from scratch with complete new error handling and better error messages, but for 4, we need to live with that.<br><br>&nbsp;&nbsp; Simplified rule then is:<br><br>Person( sourceType==&#39;Insurance&#39;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; age &gt;17,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( cholesterol &gt;= 200 ) ||<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( hdlCholesterol &lt; 60 ) ||<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( bodyFat &gt; 0.24 &nbsp;&amp;&amp; sbjGdrCd == &#39;M&#39; &amp;&amp; age &gt;=60 ) <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br><br>&nbsp;&nbsp;&nbsp; Must work.<br><br>&nbsp;&nbsp;&nbsp; Also:<br><br>&quot;even when I&#39;m changing the values of its variables&quot;<br><br>&nbsp;&nbsp;&nbsp; Are you changing the attributes in modify() blocks? or calling update()?<br><br>&nbsp;&nbsp;&nbsp; []s<br>
&nbsp;&nbsp;&nbsp; Edson<br><br><br><div class="gmail_quote">2008/11/18 vanshi <span dir="ltr">&lt;<a href="mailto:nilu.thakur@gmail.com">nilu.thakur@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Thanks Edson for the reply but it didn&#39;t work.<br>
<br>
First off, I want to do a null check for age and return false if age or any<br>
variable is null.<br>
Secondly, I tried that &quot;,&quot; connective but didn&#39;t work either and counted<br>
again..... there is no extra () pair.<br>
<br>
Actually the business rule here is sourceType==&#39;Insurance&#39; &amp;&amp; age!=null &amp;&amp;<br>
&gt;17 and after that if any of the bracketted value surrounded by the ( )<br>
validates to true then, rule should validate to TRUE. So, the simplified<br>
rules is:<br>
<br>
sourceType==&#39;Insurance&#39; &amp;&amp; (age not null &amp;&amp; &gt;17) AND ANY OF FOLLOWING<br>
TRUE...(validation1) || (validation2) || (validation3)...and so on. that&#39;s<br>
why I had put another () to surround the set of validations starting from<br>
cholesterol.<br>
<br>
Also, what is this error about?? line 6:342 required (...)+ loop did not<br>
match anything at character &#39; &#39; I think this is bcoz rule is not getting<br>
parsed properly by antlr grammer..but I&#39;m not able to see...where the<br>
mistake is.<br>
<br>
Also, I noticed while debugging that person object which I&#39;m inserting in<br>
working memory ...retains the previous value...even when I&#39;m changing the<br>
values of its variables.....why is that?<br>
<br>
Plz people take a look n point out the mistake here. I would really<br>
appreciate any help<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
Edson Tirelli-3 wrote:<br>
&gt;<br>
&gt; &nbsp; &nbsp; Ouch.<br>
&gt;<br>
&gt; &nbsp; &nbsp; Start by removing all those null checks, since things like:<br>
&gt;<br>
&gt; age &gt; 17<br>
&gt;<br>
&gt; &nbsp; &nbsp; Will always return false if the age field is null, so the null check<br>
&gt; is<br>
&gt; redundant.<br>
&gt; &nbsp; &nbsp; Also, replace top level &amp;&amp; by &quot;,&quot;, since this will make your<br>
&gt; constraint<br>
&gt; groups clear.<br>
&gt; &nbsp; &nbsp; Then finally, make sure your ()-pairs are all fine and it should work.<br>
&gt;<br>
&gt; &nbsp; &nbsp; Just taking a quick look here I see an extra &quot;)&quot; here:<br>
&gt;<br>
&gt; bodyFat &gt; 0.31)<br>
&gt;<br>
&gt; &nbsp; &nbsp; []s<br>
&gt; &nbsp; &nbsp; Edson<br>
&gt;<br>
&gt; &nbsp; &nbsp; []s<br>
&gt; &nbsp; &nbsp; Edson<br>
&gt;<br>
&gt; 2008/11/18 vanshi &lt;<a href="mailto:nilu.thakur@gmail.com">nilu.thakur@gmail.com</a>&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi all,<br>
&gt;&gt;<br>
&gt;&gt; Can somebody help me here?? I&#39;ve a business rule presented in bold here<br>
&gt;&gt; that<br>
&gt;&gt; I&#39;ve put in the DRL file in the simplest form but compilation of rule is<br>
&gt;&gt; generating this error &quot;line 6:342 required (...)+ loop did not match<br>
&gt;&gt; anything at character &#39; &#39;&quot;<br>
&gt;&gt; And any set of value is getting evaluated to TRUE.....that means rule<br>
&gt;&gt; validation is not happening.....I understand that I can use helper<br>
&gt;&gt; function<br>
&gt;&gt; in java classes and call them in the rule but wanted to know how can I do<br>
&gt;&gt; the same entirely in DRL file OR what&#39;s wrong with this. I&#39;ve spent<br>
&gt;&gt; entire<br>
&gt;&gt; day to figure out but completely clueless and afraid to try function<br>
&gt;&gt; approach due to project deadline. Plz help.<br>
&gt;&gt;<br>
&gt;&gt; pers: Person(sourceType == &#39;Insurance&#39; &amp;&amp; (age != null &nbsp;&amp;&amp; &gt; 17) &amp;&amp;<br>
&gt;&gt; ((cholesterol !=null &amp;&amp; &gt;= 200) || (hdlCholesterol !=null &amp;&amp; &lt; 60) ||<br>
&gt;&gt; (cholesterolToHdlRation !=null &amp;&amp; &gt; 4.5) ||<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (ldlCholesterol !=null &amp;&amp; &nbsp;&gt;160) || (vldl !=null &amp;&amp; &gt; 40)<br>
&gt;&gt; ||<br>
&gt;&gt; (triglyceride !=null &amp;&amp; &nbsp;&gt; 50) || (glucose !=null &amp;&amp; &nbsp;&gt;130) || (bmi<br>
&gt;&gt; !=null<br>
&gt;&gt; &amp;&amp; &gt;=25) &nbsp;||<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(bodyFat &gt; 0. 25 &amp;&amp; &nbsp;sbjGdrCd !=null &amp;&amp; &nbsp;== &#39;F&#39; &nbsp;&amp;&amp; &nbsp;age<br>
&gt;&gt; !=null &amp;&amp; &gt; 17<br>
&gt;&gt; &amp;&amp; &lt; 40) ||<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(bodyFat &gt; 0.30 &amp;&amp; sbjGdrCd !=null &amp;&amp; &nbsp;== &#39;F&#39; &amp;&amp; age<br>
&gt;&gt; !=null &amp;&amp; &gt; 39 &amp;&amp; &lt;<br>
&gt;&gt; 60) ||<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(bodyFat &gt; 0.31) &amp;&amp; sbjGdrCd !=null &amp;&amp; == &#39;F&#39; &amp;&amp; age<br>
&gt;&gt; !=null &amp;&amp; age &gt; 60)<br>
&gt;&gt; ||<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(bodyFat &gt; 0.19 &amp;&amp; sbjGdrCd !=null &amp;&amp; &nbsp;== &#39;M&#39; &amp;&amp; &nbsp;age<br>
&gt;&gt; !=null &amp;&amp; &gt;17 &amp;&amp; &lt;<br>
&gt;&gt; 40) ||<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(bodyFat &gt; 0.23 &amp;&amp; sbjGdrCd !=null &amp;&amp; == &#39;M&#39; &amp;&amp; age<br>
&gt;&gt; !=null<br>
&gt;&gt; &amp;&amp; age &gt; 39 &lt;<br>
&gt;&gt; 60) ||<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(bodyFat &gt; 0.24 &nbsp;&amp;&amp; sbjGdrCd !=null &amp;&amp; == &#39;M&#39; &nbsp;&amp;&amp; age<br>
&gt;&gt; !=null &amp;&amp; &gt;=60)))<br>
&gt;&gt;<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//Age&gt;=18 AND Total Cholesterol &gt;=200 OR HDL &lt;60 OR<br>
&gt;&gt; Cholesterol Ratio<br>
&gt;&gt; &gt;4.5 OR LDL &gt;160 OR VLDL &gt;40 OR Triglycerides &gt;150 OR Glucose &gt;130 OR BMI<br>
&gt;&gt; &gt;=25 OR Body Fat % greater than the range of &nbsp;14% and 25% when gender = F<br>
&gt;&gt; and age between or equal to 18 and 39 OR Body Fate % greater than the<br>
&gt;&gt; range<br>
&gt;&gt; of &nbsp;18% and 30% when gender = F and age between or equal to 40 and 59 OR<br>
&gt;&gt; Body Fat % greater than the range of &nbsp;21% and 31% when gender = F and age<br>
&gt;&gt; &gt;60 OR Body Fat % greater than the range of &nbsp;7% and 19% when gender = M<br>
&gt;&gt; and<br>
&gt;&gt; age between or equal to 18 and 39 OR Body Fat % greater than the range of<br>
&gt;&gt; 14% and 23% when gender = M and age between or equal to 40 and 59 OR Body<br>
&gt;&gt; Fat % greater than the range of &nbsp;15% and 24% when gender = M and age &gt;60<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://www.nabble.com/What%27s-wrong-with-the-connectives--tp20571531p20571531.html" target="_blank">http://www.nabble.com/What%27s-wrong-with-the-connectives--tp20571531p20571531.html</a><br>
&gt;&gt; Sent from the drools - user mailing list archive at Nabble.com.<br>
&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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; &nbsp;Edson Tirelli<br>
&gt; &nbsp;JBoss Drools Core Development<br>
&gt; &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
<br>
--<br>
</div></div>View this message in context: <a href="http://www.nabble.com/What%27s-wrong-with-the-connectives--tp20571531p20572073.html" target="_blank">http://www.nabble.com/What%27s-wrong-with-the-connectives--tp20571531p20572073.html</a><br>

<div><div></div><div class="Wj3C7c">Sent from the drools - user mailing list archive at Nabble.com.<br>
<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>