Have you considered  using the &quot;from&quot; Conditional Element, which lets you<br>reason over components of a fact&#39;s collection-type element, without them<br>being inserted as facts. See the Drools Expert manual for details.<br>
<br>-W<br><br><div class="gmail_quote">On Thu, Feb 4, 2010 at 5:01 PM, gazzaaa87 <span dir="ltr">&lt;<a href="mailto:dan_hopwood@hotmail.co.uk">dan_hopwood@hotmail.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi all,<br>
<br>
I am using a StatelessKnowledgeSession and therefore call the execute method<br>
to invoke the rules engine. Having carried out a basic test, it would appear<br>
that calling execute on an arbitrarily complex object does not insert child<br>
objects, rather rules will only fire if they are based on the parent.<br>
<br>
e.g. let&#39;s say you have a class called &#39;Father&#39;, which holds a collection of<br>
&#39;Child&#39; objects. By calling session.execute(fatherObject) I need rules to<br>
fire that use the Child pattern without having to loop through &#39;insert&#39;ing<br>
all the child elements manually.<br>
<br>
Has anyone come across a way around this? The only thing I managed to find<br>
was the use of a Batch Executor but you have to set that up before calling<br>
execute and therefore it&#39;s still effectively a manual process.<br>
<br>
If only Drools used java annotations, it would be ideal to specify behaviour<br>
similar to cascade with JPA.<br>
<br>
Any help or pointers much appreciated!<br>
<br>
Dan<br>
<font color="#888888">--<br>
View this message in context: <a href="http://n3.nabble.com/Executing-on-a-arbitrarily-complex-object-tp187271p187271.html" target="_blank">http://n3.nabble.com/Executing-on-a-arbitrarily-complex-object-tp187271p187271.html</a><br>

Sent from the Drools - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</font></blockquote></div><br>