[rules-users] (no subject)
Jason Partyka
Jason.Partyka at hightowerinc.com
Mon Mar 24 17:31:59 EDT 2008
Hi all,
I'm having an issue with my rule and Drools 4.0.4. The object that my rule is supposed to reason over has nested objects and Drools does not appear to be reasoning over it when I modify attributes. I've pasted the rule at the end of the e-mail. I am attempting to change the value of the ez_width and ez_drop properties and have the corresponding rule below invoked.
I have tried to use the StatefulSession.modifyRetract(FactHandle) and StatefulSession.modifyInsert(FactHandle, Object) methods, which I expected to work. I then, for the sake of trying, tried the StatefulSession.update(FactHandle, Object) method.
After both, I've tried StatefulSession.fireAllRules() as well and nothing.
It's possible I'm missing something in the rules editor but I do not know.
Any insights?
Thanks,
Jason
----
package com.hightower.templates;
dialect "mvel"
import com.hightower.tables.BasicBlindFridayTest_JP;
import com.hightower.tables.BasicMountFridayTest;
import com.hightower.tables.CRGtest;
global org.apache.commons.logging.Log LOG;
global com.hightower.drools.beans.hibernate.SoSalesOrderHeader SalesOrderHeader;
global com.hightower.drools.beans.hibernate.ArCustomer Customer;
global com.hightower.drools.beans.hibernate.ArCustomerContact Contact;
global com.hightower.drools.beans.hibernate.SyZipCode ZipCode;
global com.hightower.drools.beans.hibernate.SoShipToAddress ShipToAddress;
global com.hightower.drools.beans.hibernate.SoSalesOrderDetail SalesOrderDetail;
global com.hightower.drools.beans.hibernate.SoSalesHistory SalesHistory;
global com.hightower.drools.beans.hibernate.HtSalesOrderNo SalesOrderNo;
global com.hightower.drools.beans.hibernate.HtCustomerInstallation CustomerInstallation;
global com.hightower.drools.beans.hibernate.HtCustomerInfo CustomerInfo;
global com.hightower.drools.beans.hibernate.HtCustomerApplyDiscounts CustomerDiscounts;
global com.hightower.drools.beans.hibernate.HtOrderBasicsInfo OrderBasics;
global com.hightower.drools.beans.hibernate.Windows Window;
global com.hightower.drools.beans.hibernate.Rooms Room;
rule "awe"
dialect "mvel"
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( basicMountFridayTest.mountType == "T" )
then
$daObj.getBasicBlindFridayTest_JP().setRightwidht(44);
end
rule "priceTableValues_ValRule0"
dialect "mvel"
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop <= 50.00, priceTable.Ez_width <= 50.00 )
then
$daObj.getPriceTable().setEz_price("2500.00");
end
rule "priceTableValues_ValRule1"
dialect "mvel"
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop <= 100.00, priceTable.Ez_width <= 100.00 )
then
$daObj.getPriceTable().setEz_price("10000.00");
end
rule "priceTableValues_ValRule2"
dialect "mvel"
ruleflow-group 'Validation'
when
$daObj : AReallyWonderfulAndCrappyTest( priceTable.Ez_drop <= 25.00, priceTable.Ez_width <= 25.00 )
then
$daObj.getPriceTable().setEz_price("625.00");
end
More information about the rules-users
mailing list