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
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
>
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
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
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
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