Thanks for your time and answers, and sorry for the incomplete information.
There is a 1:1 relationship
between EvemetierCalculDHF and EvemetierData objects. The reason for
the EvemetierCalculDHF is that we want the EvemetierData structure to be
independent from the rules, and therefore needed a declared fact
(EvemetierCalculDHF) to type safely store some information. Ideally, we
would like to add a trait to the EvemetierData instance, but is it possible
on externally managed beans ?
=> The $evCalcDHF.evemetier returns a single object (and Drools correctly
sees it a a single value and uses this value for the $obj). We could have
written $obj:EvemetierData(this==$evCalcDHF.evemetier) but this created
extra Tuples we want to avoid. And each time the EvemetierData is updated
so is the EvemetierCalculDHF ; therefore the modification propagation still
works despite the from. A binding variable would (correct me if I'm wrong)
have done the same thing but in a possibly clearer way.
The "null wrapping" is mostly historical and will be changed to an Option
in a near future. We functionally want that null + null = null and that
0+null=0. Similarly null/any should return null. But this is not related to
this "too many RightTuple" problem, sorry I did not clean up the rule
before sending it over.
I did not quite understand your last paragraph on a "representative". Do
you have an example I could study ?
In a more general way, if I have a LHS with the following conditions:
$x: A(someConditions)
accumulate ($y:A(someField==$x.somefield); ....)
It seems that the Drools engine will create one RightTuple per instance of
A (and per rule with a similar accumulate), even if no instance of A
matches the someConditions.
If I have many instances of A in the WM, is there a way to prevent Drools
to create the RightTuples for $y until it has found a valid $x, and
therefore create RightTuples only for the A matching someField ? I could
use a "from" in the accumulate, but then the engine will not see updates on
$y instances and won't recalculate the accumulate.
Regards,
Benoît
--
View this message in context:
http://drools.46999.n3.nabble.com/Analysing-OutOfMemory-too-many-RightTup...
Sent from the Drools: User forum mailing list archive at
Nabble.com.