Hi D,<div><br></div><div>I don&#39;t know which version of drools are you using. If u are using drools 4 or higher you can use &#39;<span class="Apple-style-span" style="font-weight: bold;">from</span>&#39; &nbsp;to write rules on nested objects. All u need to do is insert the root pbject in the working memory</div>
<div><br></div><div>Regards,</div><div>sudhir.<br><br><div class="gmail_quote">On Mon, Feb 23, 2009 at 2:56 PM, Divya Rajendranath <span dir="ltr">&lt;<a href="mailto:divya.rajendranath@gmail.com">divya.rajendranath@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font size="2">
<p>Hi, </p>
<p>I am planning to use Drools - JBoss Rules Engine. My requirement is to disburse mails from my application to different groups based on various criteria. I want to use Drools here.</p>
<p>My object structure is as follows:</p>
<p>class A{</p>
<p>String B = &quot;&quot;;</p>
<p>B b;</p>
<p>C c;<br>}</p>
<p>Hence Obj A has embedded objects within it, and obj B and C further has embedded objects.</p>
<p>class B {</p>
<p>String X;</p>
<p>Z z;</p>
<p>}</p>
<p>class Z{</p>
<p>String t;</p>
<p>String s;</p>
<p>}</p>
<p>The decision on sending the mails based on the fields in embedded objects of A. I pass instance of A to Drools</p>
<p>Format of drl file:</p>
<p>package...;</p>
<p>import ..;</p>
<p>rule &quot;Test&quot;</p>
<p>when $a:A(B(Z(s == &quot;testvalue&quot;)))</p>
<p>then</p>
<p>$a.setSomething();</p>
<p>update($a);</p>
<p>end</p>
<p>I wanted to know if this (accessing fields in embedded/child object) is feasible with Drools.</p>
<p>I get an error saying &quot;UNable to compile myfile.drl when i try to fo this.</p>
<p>Could some one look into this issue and let me know the reason for this ?</p>
<p>&nbsp;</p>
<p>Thanks</p>
<p>-D</p></font>
<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>
<br></blockquote></div><br></div>