Just wondering if anyone else has come across this:
I have a rule that has a variable with the same name as the element and when
used in a "not in", the rule does not fire properly.
rule "0620 Fail Invalid SPI Primary"
when
exists ValidationControl(validationNo == 620)
CiLines($ciNo : ciNo, $ciLineNo : ciLineNo, $countryOrigin :
countryOrigin)
Country(country == $countryOrigin, canadianProvince not in
("Y","L"))
CiTariffClass(id.ciNo == $ciNo, id.ciLineNo == $ciLineNo,
$spiPrimary : spiPrimary not in
(null,"","W","Z","Y","N"), $tariffNo :
tariffNo,
spiPrimary0_1 not in ("P","A","E"), $tariffLineNo :
tariffLineNo)
ShipmentHeader($dateEntry : dateEntry)
TariffClass(id.tariffNo == $tariffNo, dateTariffEffective <= $dateEntry,
dateTariffExpiration >= $dateEntry,
$dateTariffEffective : dateTariffEffective)
TariffValidSpi(id.tariffNo == $tariffNo, id.dateTariffEffective ==
$dateTariffEffective)
spiProgram1_1 not in ("*","+"), id.spiProgram not in (null,
"",
$spiPrimary))
$status : ValidationPassFailStatus()
then
ValidationData $data = new ValidationData(620);
$data.setCiNo($ciNo);
$data.setCiLine($ciLineNo);
$data.setTariffLineNo($tariffLineNo);
$data.setTariffNo($tariffNo);
$data.setAdditionalInfo("SPI Primary: "+$spiPrimary);
$status.fail($data);
end
whereas, if I change the rule to:
rule "0620 Fail Invalid SPI Primary"
when
exists ValidationControl(validationNo == 620)
CiLines($ciNo : ciNo, $ciLineNo : ciLineNo, $countryOrigin :
countryOrigin)
Country(country == $countryOrigin, canadianProvince not in
("Y","L"))
CiTariffClass(id.ciNo == $ciNo, id.ciLineNo == $ciLineNo,
$spiP : spiPrimary not in
(null,"","W","Z","Y","N"), $tariffNo :
tariffNo,
spiPrimary0_1 not in ("P","A","E"), $tariffLineNo :
tariffLineNo)
ShipmentHeader($dateEntry : dateEntry)
TariffClass(id.tariffNo == $tariffNo, dateTariffEffective <= $dateEntry,
dateTariffExpiration >= $dateEntry,
$dateTariffEffective : dateTariffEffective)
TariffValidSpi(id.tariffNo == $tariffNo, id.dateTariffEffective ==
$dateTariffEffective)
spiProgram1_1 not in ("*","+"), id.spiProgram not in (null, "
", "",
$spiP))
$status : ValidationPassFailStatus()
then
ValidationData $data = new ValidationData(620);
$data.setCiNo($ciNo);
$data.setCiLine($ciLineNo);
$data.setTariffLineNo($tariffLineNo);
$data.setTariffNo($tariffNo);
$data.setAdditionalInfo("SPI Primary: "+$spiP);
$status.fail($data);
end
it works as it should. I found this when hardcoding the value it was
looking for and it passed.
--
View this message in context:
http://www.nabble.com/%22not-in%22-error-tp17867925p17867925.html
Sent from the drools - user mailing list archive at
Nabble.com.