Please ignore this, I figured it out!<br><br><div><span class="gmail_quote">On 7/6/07, <b class="gmail_sendername">Ronald R. DiFrango</b> <<a href="mailto:ron.difrango@gmail.com">ron.difrango@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Changed the loading order and now I get the following:<span class="q"><br><br>Exception in thread "main"
java.lang.ExceptionInInitializerError<br> at com.circuitcity.rtvcrms.test.MainBasedTester.testRules(MainBasedTester.java
:31)<br> at com.circuitcity.rtvcrms.test.MainBasedTester.main(MainBasedTester.java:23)<br>Caused by: java.lang.RuntimeException: Failure loading the Rules<br> at com.circuitcity.rtvcrms.rules.RtvDecisionEngine.<clinit>(
RtvDecisionEngine.java:47)<br> ... 2 more<br></span>Caused by: org.drools.rule.InvalidRulePackage: [1,0]: unknown:1:0 required (...)+ loop (decision=2) did not match anything; token=[@0,0:6='created',<8>,1:0]
<br>
at org.drools.rule.Package.checkValidity(Package.java:409)<br> at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:262)<br> at com.circuitcity.rtvcrms.rules.RtvDecisionEngine.<clinit>(RtvDecisionEngine.java
:43)<br> ... 2 more<div><span class="e" id="q_1139d4a8da0849a1_3"><br><br><div><span class="gmail_quote">On 7/6/07, <b class="gmail_sendername">Ronald R. DiFrango</b> <<a href="mailto:ron.difrango@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
ron.difrango@gmail.com</a>> 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 am getting the following exception all of a sudden:<br><br>Exception in thread "main" java.lang.ExceptionInInitializerError<br> at com.circuitcity.rtvcrms.test.MainBasedTester.testRules(MainBasedTester.java
:31)
<br> at com.circuitcity.rtvcrms.test.MainBasedTester.main(MainBasedTester.java:23)<br>Caused by: java.lang.RuntimeException: Failure loading the Rules<br> at com.circuitcity.rtvcrms.rules.RtvDecisionEngine.<clinit>(
RtvDecisionEngine.java:47)<br> ... 2 more<br>Caused by: org.drools.compiler.PackageBuilder$MissingPackageNameException: Missing package name for rule package.<br> at org.drools.compiler.PackageBuilder.validatePackageName
(PackageBuilder.java:278)<br> at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:214)<br> at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:147)<br> at com.circuitcity.rtvcrms.rules.RtvDecisionEngine
.<clinit>(RtvDecisionEngine.java:40)<br> ... 2 more<br><br><br>Here are my DRL files:<br><br>created on: Dec 7, 2006<br>package com.circuitcity.rtvcrms.rules<br><br>#list any import classes here.<br>import java.math.BigDecimal
;<br>import java.math.BigInteger;<br>import com.circuitcity.rtvcrms.bw.Constants;<br>import com.circuitcity.rtvcrms.bw.DocumentTypes;<br>import com.circuitcity.rtvcrms.bw.StatusConstants;<br><br>import com.circuitcity.rtvcrms.Adjustment
;<br>import com.circuitcity.rtvcrms.DetailLine;<br>import com.circuitcity.rtvcrms.EffectivePrice;<br>import com.circuitcity.rtvcrms.RepaymentCode;<br>import com.circuitcity.rtvcrms.MatchingOutput;<br><br>#declare any global variables here
<br>global java.util.List matchedList;<br><br>rule "CM Qty EQ RTV Qty"<br> salience 10<br> <br> when<br> cmDetailLine : DetailLine(cmNumber != null, lineNumber != null, status != StatusConstants.MATCHED
, cmRtvNumber : cmRtvNumber, cmBrand : brand , cmModel : model, cmQuantity : availableQuantity )<br> rtvDetailLine : DetailLine(rtvNumber != null, rtvNumber == cmRtvNumber, lineNumber != null, status != StatusConstants.MATCHED
, brand == cmBrand, model == cmModel, availableQuantity == cmQuantity ) <br> then <br> System.out.println(StatusConstants.MATCHED);<br><br> MatchingOutput output =<br> buildMatchingOutput(<br>
rtvDetailLine.getBrand(),<br> rtvDetailLine.getClazz(),<br> cmDetailLine.getLineNumber(),<br> cmDetailLine.getCmNumber(),<br> (String)null, // defTag<br>
rtvDetailLine.getEffectivePrice(),<br> (BigDecimal)null, // keyRecNo<br> rtvDetailLine.getItemCost(),<br> rtvDetailLine.getAvailableQuantity(),<br> rtvDetailLine.getModel
(),<br> (String)null, // originalRepaymentCode<br> (BigDecimal)null, // rrLineNumber<br> rtvDetailLine.getLineNumber(),<br> rtvDetailLine.getRtvNumber(),<br>
StatusConstants.MATCHED,<br> DocumentTypes.RTV_CM,<br> (String)null); // vendorNumber<br><br> matchedList.add(output);<br> <br> cmDetailLine.setAvailableQuantity(Constants.NO_MORE_QUANTITY
);<br> cmDetailLine.setStatus(StatusConstants.MATCHED);<br> rtvDetailLine.setAvailableQuantity(Constants.NO_MORE_QUANTITY);<br> rtvDetailLine.setStatus(StatusConstants.MATCHED);<br>end<br><br>rule "RNR Qty EQ RTV Qty"
<br> salience 10<br> <br> when<br> rnrDetailLine : DetailLine(keyRecNo != null, lineNumber != null, status != StatusConstants.MATCHED, cmRtvNumber : cmRtvNumber, cmBrand : brand , cmModel : model, cmQuantity : availableQuantity )
<br> rtvDetailLine : DetailLine(rtvNumber != null, rtvNumber == cmRtvNumber, lineNumber != null, status != StatusConstants.MATCHED, brand == cmBrand, model == cmModel, availableQuantity == cmQuantity )<br> then
<br> System.out.println(StatusConstants.MATCHED);<br> <br> MatchingOutput output =<br> buildMatchingOutput(<br> rtvDetailLine.getBrand(),<br> rtvDetailLine.getClazz
(),<br> (BigDecimal)null, // cmDetailLine.getLineNumber(),<br> (String)null, // cmDetailLine.getCmNumber(),<br> (String)null, // defTag<br> rtvDetailLine.getEffectivePrice
(),<br> rnrDetailLine.getKeyRecNo(), // keyRecNo<br> rtvDetailLine.getItemCost(),<br> rtvDetailLine.getAvailableQuantity(),<br> rtvDetailLine.getModel(),<br> (String)null, // originalRepaymentCode
<br> rnrDetailLine.getLineNumber(), // rrLineNumber<br> rtvDetailLine.getLineNumber(),<br> rtvDetailLine.getRtvNumber(),<br> StatusConstants.MATCHED,<br>
DocumentTypes.RTV_RR,<br> (String)null); // vendorNumber<br> <br> matchedList.add(output);<br> <br> rnrDetailLine.setAvailableQuantity(Constants.NO_MORE_QUANTITY);<br>
rnrDetailLine.setStatus(StatusConstants.MATCHED);<br> rtvDetailLine.setAvailableQuantity(Constants.NO_MORE_QUANTITY);<br> rtvDetailLine.setStatus(StatusConstants.MATCHED);<br>end<br><br>#created on: Apr 10, 2007
<br>package com.circuitcity.rtvcrms.rules<br><br>#list any import classes here.<br>import java.math.BigDecimal;<br><br>import com.circuitcity.rtvcrms.bw.ModelDiscrepancyOutput;<br>import com.circuitcity.rtvcrms.bw.StatusConstants
;<br>import com.circuitcity.rtvcrms.Adjustment;<br>import com.circuitcity.rtvcrms.DetailLine;<br>import com.circuitcity.rtvcrms.RepaymentCode;<br>import com.circuitcity.rtvcrms.MatchingOutput;<br>import org.drools.WorkingMemory
;<br>import org.drools.QueryResults;<br>import org.drools.QueryResult;<br>import java.util.Iterator;<br><br>#declare any global variables here<br><br>rule "Sum CM"<br> salience 90<br> <br> when<br> mdOutput : ModelDiscrepancyOutput ()
<br> repaymentCode : RepaymentCode( code == "MD")<br> cmAdjustment : Adjustment(cmNumber != null, lineNumber != null, originalRepaymentCode == "MD" )<br> then<br> System.out.println
("Sum CM"); <br> mdOutput.setSumCmAndRnr(cmAdjustment.getAvailableQuantity());<br>end<br><br>Any thoughts?<br>
</blockquote></div><br>
</span></div></blockquote></div><br>