<br>&nbsp;&nbsp; Are you sure that it is only the variable name that differs? I see you use an extra condition in your second rule:<br><br>id.spiProgram not in (null, &quot; &quot;, &quot;&quot;, $spiP )<br><br>&nbsp;&nbsp; You are testing for a single space here, while in the first rule you are not.<br>
<br>&nbsp;&nbsp; I&#39;m asking because drools does not make any &quot;processing&quot; on variable names... it does not matter if you call them xyz, banana or apple. Also, the &quot;$&quot; as you probably know is a valid variable name identifier and so, drools also does not care about it.<br>
<br>&nbsp;&nbsp; If you are positive that the variable name is the only difference, I ask you please to isolate a self contained test case that we can reproduce in order to fix whatever is happening there. In your example rule above, there is only one gotcha, but that should not cause any problem: since you are using a nested access (&quot;id.spiProgram&quot;), the actual constraint is delegated to MVEL for resolution, but again, mvel uses the variables injected by drools to resolve the constraint and drools makes no change on variable names.<br>
<br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><div class="gmail_quote">2008/6/16 Mike D &lt;<a href="mailto:mike.dalaker@kewill.com">mike.dalaker@kewill.com</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Just wondering if anyone else has come across this:<br>
<br>
I have a rule that has a variable with the same name as the element and when<br>
used in a &quot;not in&quot;, the rule does not fire properly.<br>
<br>
rule &quot;0620 Fail Invalid SPI Primary&quot;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;when<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exists ValidationControl(validationNo == 620)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CiLines($ciNo : ciNo, $ciLineNo : ciLineNo, $countryOrigin :<br>
countryOrigin)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Country(country == $countryOrigin, canadianProvince not in (&quot;Y&quot;,&quot;L&quot;))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CiTariffClass(id.ciNo == $ciNo, id.ciLineNo == $ciLineNo,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$spiPrimary : spiPrimary not in (null,&quot;&quot;,&quot;W&quot;,&quot;Z&quot;,&quot;Y&quot;,&quot;N&quot;), $tariffNo :<br>
tariffNo,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;spiPrimary0_1 not in (&quot;P&quot;,&quot;A&quot;,&quot;E&quot;), $tariffLineNo : tariffLineNo)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ShipmentHeader($dateEntry : dateEntry)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TariffClass(id.tariffNo == $tariffNo, dateTariffEffective &lt;= $dateEntry,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dateTariffExpiration &gt;= $dateEntry,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$dateTariffEffective : dateTariffEffective)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TariffValidSpi(id.tariffNo == $tariffNo, id.dateTariffEffective ==<br>
$dateTariffEffective)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; spiProgram1_1 not in (&quot;*&quot;,&quot;+&quot;), id.spiProgram not in (null, &quot;&quot;,<br>
$spiPrimary))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$status : ValidationPassFailStatus()<br>
 &nbsp; &nbsp; &nbsp; &nbsp;then<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ValidationData $data = new ValidationData(620);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data.setCiNo($ciNo);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data.setCiLine($ciLineNo);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data.setTariffLineNo($tariffLineNo);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data.setTariffNo($tariffNo);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data.setAdditionalInfo(&quot;SPI Primary: &quot;+$spiPrimary);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$status.fail($data);<br>
end<br>
<br>
whereas, if I change the rule to:<br>
<br>
rule &quot;0620 Fail Invalid SPI Primary&quot;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;when<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exists ValidationControl(validationNo == 620)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CiLines($ciNo : ciNo, $ciLineNo : ciLineNo, $countryOrigin :<br>
countryOrigin)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Country(country == $countryOrigin, canadianProvince not in (&quot;Y&quot;,&quot;L&quot;))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CiTariffClass(id.ciNo == $ciNo, id.ciLineNo == $ciLineNo,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$spiP : spiPrimary not in (null,&quot;&quot;,&quot;W&quot;,&quot;Z&quot;,&quot;Y&quot;,&quot;N&quot;), $tariffNo :<br>
tariffNo,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;spiPrimary0_1 not in (&quot;P&quot;,&quot;A&quot;,&quot;E&quot;), $tariffLineNo : tariffLineNo)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ShipmentHeader($dateEntry : dateEntry)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TariffClass(id.tariffNo == $tariffNo, dateTariffEffective &lt;= $dateEntry,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dateTariffExpiration &gt;= $dateEntry,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$dateTariffEffective : dateTariffEffective)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TariffValidSpi(id.tariffNo == $tariffNo, id.dateTariffEffective ==<br>
$dateTariffEffective)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; spiProgram1_1 not in (&quot;*&quot;,&quot;+&quot;), id.spiProgram not in (null, &quot; &quot;, &quot;&quot;,<br>
$spiP))<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$status : ValidationPassFailStatus()<br>
 &nbsp; &nbsp; &nbsp; &nbsp;then<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ValidationData $data = new ValidationData(620);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data.setCiNo($ciNo);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data.setCiLine($ciLineNo);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data.setTariffLineNo($tariffLineNo);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data.setTariffNo($tariffNo);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$data.setAdditionalInfo(&quot;SPI Primary: &quot;+$spiP);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$status.fail($data);<br>
end<br>
<br>
<br>
it works as it should. &nbsp;I found this when hardcoding the value it was<br>
looking for and it passed.<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://www.nabble.com/%22not-in%22-error-tp17867925p17867925.html" target="_blank">http://www.nabble.com/%22not-in%22-error-tp17867925p17867925.html</a><br>
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>
</font></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>