[rules-users] Issue with nested objects (Repost from message with no subject so that there is a subject)...

Jason Partyka Jason.Partyka at hightowerinc.com
Wed Mar 26 08:47:34 EDT 2008


So it turns out my issue has something to do with rule-flow groups. I'm invoking the WorkingMemory.startProcess(String) method, with a parameter of "QuoteBuilder" to invoke the proper rule-flow, but I'm getting an error that says there is no such process id.

I know I am adding the proper .rf file when I build the pacakge and no error is occurring when I do that.

-Jason

________________________________________
From: rules-users-bounces at lists.jboss.org [rules-users-bounces at lists.jboss.org] On Behalf Of Jason Partyka [Jason.Partyka at hightowerinc.com]
Sent: Monday, March 24, 2008 4:46 PM
To: rules-users at lists.jboss.org
Subject: [rules-users] Issue with nested objects (Repost from message with no subject so that there is a subject)...

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


_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




More information about the rules-users mailing list