<p>Since the auto manufacturers data is reasonably static you could also use a &quot;bootstrap&quot; rule that inserts all Parts, Models and Brands from the AutoManufacturer objects inserted by your java code.</p>
<p>I assume your rules will probably look at supply or costing decisions updating the static reference data less frequent than the decisions you make based on the reference data - but I could easily be wrong!</p>
<p>sent on the move</p>
<p>On 2 May 2012 20:20, &quot;Wolfgang Laun&quot; &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Yes, the idea is to insert Models, Brands, Parts, and possibly additional facts.<br>
<br>
You might want to keep lists of child objects or used parts in the<br>
parent objects - see Michael&#39;s rule.<br>
<br>
Otherwise:<br>
Relating a Model to a Brand and a Brand to a Manufacturer is simple: a<br>
&quot;parent&quot; reference is sufficient. For Parts, you might want to<br>
establish a Gozinto fact, combining a Part and a Model.<br>
<br>
rule &quot;whereIsPV999999&quot;<br>
when<br>
     $part: Part( partName == &quot;PV999999&quot; )<br>
     Gozinto( part == $part, $model: model )<br>
     Model( this == $model, $brand: brand )<br>
     Brand( this == $brand, $manu: manufacturer )<br>
     Manufacturer( this == $manu )<br>
then<br>
    System.out.println( &quot;PV999999 used in &quot; +  $model + &quot;/&quot; + $brand +<br>
&quot; by &quot; + $manu );<br>
end<br>
<br>
For deciding between using this or the &quot;contains&quot; search in potential parents,<br>
there are issues w.r.t. the number of objects you have, the rules<br>
you&#39;d really use, and how frequently what is evaluated, and concerning<br>
the ease of rule maintenance.<br>
<br>
It is indeed possible to extract all from a small set of Manufacturer<br>
facts, but nested &quot;from&quot; CEs are most likely bad for performance.<br>
<br>
-W<br>
<br>
<br>
<br>
On 02/05/2012, James K &lt;<a href="mailto:james_kosa@verizon.net">james_kosa@verizon.net</a>&gt; wrote:<br>
&gt; Luane - Yes, it would be a normalized database, there would be only one<br>
&gt; entry<br>
&gt; for a manufacturer with all of the child records related by Foreign Keys or<br>
&gt; relational tables.<br>
&gt;<br>
&gt; Excuse my ignorance I am relatively new to Drools, can you please expand on<br>
&gt; the following:<br>
&gt;<br>
&gt; &quot;...(...$p.getPartsName()...) &quot;<br>
&gt;<br>
&gt; This is where I am having a hard time on how to navigate into the nested<br>
&gt; collections. Or are you saying to insert the PART, MODEL, BRAND, etc as<br>
&gt; individual facts?  How would I relate it back Automanufacturer fact?<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context:<br>
&gt; <a href="http://drools.46999.n3.nabble.com/Accessing-properties-of-an-object-within-a-Nested-Collection-of-a-Nested-Collection-tp3955591p3956880.html" target="_blank">http://drools.46999.n3.nabble.com/Accessing-properties-of-an-object-within-a-Nested-Collection-of-a-Nested-Collection-tp3955591p3956880.html</a><br>

&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></p>