newbie with weird DRL parse error v4.0.7
by Alpert, Stephen R (GE Healthcare)
Eclipse Ganymede: Saving the following drl file: (based on article
http://www.onjava.com/lpt/a/6093)
package BusinessRules
#list any import classes here.
import com.drools.test.StockOffer;
#declare any global variables here
function void printStock( StockOffer stock ) {
#function content (can have multiple functions)
System.out.println("Name: "
+ stock.getStockName()
+ " Price: " + stock.getStockPrice()
+ " BUY: " + stock.getRecommendPurchase());
}
rule "Stock Price Low Enough"
when
#conditions
offer : StockOffer(recommendPurchase == null, stockPrice < 100)
then
#actions
offer.setRecommendPurchase( StockOffer.YES );
printStock( offer );
end
Results in:
Description Resource Path Location Type
Missing package name for rule package. BusinessRules.drl
DroolsStockSample/src/rules Unknown Drools Error
Yet the test application runs fine!
/steve
Stephen R. Alpert, PhD
GE Healthcare
Clinical Business Solutions
Principal Technical Architect
T 617 519 2216
F 617 519 2625
E steve.alpert(a)ge.com <blocked::mailto:steve.alpert@ge.com>
www.gehealthcare.com