title: Drools: insertLogical and retract
body: <p>This is a follow up on my previous <a href="https://stackoverflow.com/questions/4887456/decision-trees-and-rule-engines">question</a>. I have a decision tree in the following form: <img src="https://i.stack.imgur.com/okefu.jpg" alt="Decision tree diagram"></p>
  
  <p>and I want to transform it into rules in Drools Expert. The use of <code>insertLogical</code> has been <a href="https://stackoverflow.com/questions/4887456/decision-trees-and-rule-engines">proposed</a>. Drools documentation says <a href="http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e5121" rel="nofollow noreferrer">this</a> about <code>insertLogical</code>:</p>
  
  <blockquote>
    <p><code>insertLogical(new Something())</code>; is
    similar to insert, but the object will
    be automatically retracted when there
    are no more facts to support the truth
    of the currently firing rule.</p>
  </blockquote>
  
  <p>The fact that these objects are retracted is useful (as I'll have tens of thousands of objects in memory and each will create a bunch of these). There's also a method <code>retract(object)</code>, which removes an object from working memory. When I get to an end node and remove (<code>retract</code>) the base object that would get there (following the decision tree), does it also remove all these <em>temporary</em> objects created with <code>insertLogical</code> during the traversal?</p>