Re: [rules-users] Rule does not fire after 'Modify/Update' of a fact - Drools 5.1.1 !

2011-04-05 Thread groovenarula
oh - ok - My bad then - I need to read up more on how to write proper hashing algorithm - for what ever reason, I thought that == use object reference when comparing objects ! I guess that's not the case and that it's using the object's hash code to compare objects. Thanks for pointing this issue

Re: [rules-users] Rule does not fire after 'Modify/Update' of a fact - Drools 5.1.1 !

2011-04-05 Thread Wolfgang Laun
Your Product.hashCode uses dynamic information: price. -W On 5 April 2011 15:22, groovenarula wrote: > Just ran another test, I removed the check for 'price == null' in the 'Set > Options Price' rule - so the rules now reads : > > rule "Set Options price" >salience 50 >when >

Re: [rules-users] Rule does not fire after 'Modify/Update' of a fact - Drools 5.1.1 !

2011-04-05 Thread groovenarula
Just ran another test, I removed the check for 'price == null' in the 'Set Options Price' rule - so the rules now reads : rule "Set Options price" salience 50 when $prod : Product ( ) $option : Option ( product == $prod ) then

Re: [rules-users] Rule does not fire after 'Modify/Update' of a fact - Drools 5.1.1 !

2011-04-05 Thread groovenarula
Thanks for the response Wolfgang. I am not calling ksession.fireAllRules(1). I just have ksession.fireAllRules(); I tried inserting 2 pairs - One product with a price set and the other left as null. The one with the null still does not fire the 'Set Options Price' after it's price has been set by

Re: [rules-users] Rule does not fire after 'Modify/Update' of a fact - Drools 5.1.1 !

2011-04-04 Thread Wolfgang Laun
What happens if you insert two Product/Option pairs, one with the price already set and the other still with price == null? One thing that could explain the effect you describe it is calling ksession.fireAllRules( 1 ) to run the engine. If this isn't the cause, we'd need to see all the code, in

[rules-users] Rule does not fire after 'Modify/Update' of a fact - Drools 5.1.1 !

2011-04-04 Thread groovenarula
Hello all, For some reason I have a rule that does not fire after a Modify/Update. I have 2 facts - Product and Option. The relationship between them is that a 'Product' can have 0 - N 'Option'(s). Based on that, I added a 'product' field to the 'Option' object. I'm creating and inserting my fac