title: Using drools for multiple object of same type and having relationships
body: <p>Hey I have a following problem to solve using drools-</p>
  
  <p>We have an Object-</p>
  
  <pre><code>Class Product{
   String name;
   double cost;
   double margin;
   double sellPrice;
  }
  </code></pre>
  
  <p>We have a Product object-P1 and it can have multiple parents/relations of type Product lets say P1, P2, P3.... so on</p>
  
  <p>Now the rule has to be like-</p>
  
  <pre><code>rule when: P1.cost&lt;100
  rule then: P1.sellPrice=P2.sellPrice+P3.sellPrice+.....
  </code></pre>
  
  <p>I am trying figure out a way/design to achieve this.</p>