<div dir="ltr">Thanks for your time and answers, and sorry for the incomplete information.<div><br></div><div>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 ?<div>

=&gt; <span style="font-family:arial,sans-serif;font-size:13px"> The </span><span style="font-family:arial,sans-serif;font-size:13px">$evCalcDHF.evemetier</span><span style="font-family:arial,sans-serif;font-size:13px"> 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==</span><span style="font-family:arial,sans-serif;font-size:13px">$evCalcDHF.evemetier) but this created extra Tuples we want to avoid. And each time the </span>EvemetierData is updated so is the EvemetierCalculDHF ; therefore the modification propagation still works despite the from. A binding variable would (correct me if I&#39;m wrong) have done the same thing but in a possibly clearer way.</div>

<div><div><br></div><div>The &quot;null wrapping&quot; 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 &quot;too many RightTuple&quot; problem, sorry I did not clean up the rule before sending it over. </div>

<div><br></div><div>I did not quite understand your last paragraph on a <span style="font-family:arial,sans-serif;font-size:13px">&quot;representative&quot;. Do you have an example I could study ?</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>

</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">In a more general way, if I have a LHS with the following conditions:</span></div>

<div><span style="font-family:arial,sans-serif;font-size:13px">  $x: A(someConditions)</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">  </span><font face="arial, sans-serif">accumulate ($y:A(someField==$x.somefield); ....) </font></div>

<div><br></div><div>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 <span style="font-family:arial,sans-serif;font-size:13px">someConditions.</span></div>

<div>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 &quot;from&quot; in the accumulate, but then the engine will not see updates on $y instances and won&#39;t recalculate the accumulate.</div>

</div></div><div><br></div><div>Regards,</div><div>Benoît</div></div>


        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://drools.46999.n3.nabble.com/Analysing-OutOfMemory-too-many-RightTuple-tp4029988p4030011.html">Re: [rules-users] Analysing OutOfMemory, too many RightTuple</a><br/>
Sent from the <a href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html">Drools: User forum mailing list archive</a> at Nabble.com.<br/>