One way it has been done in the past is to have some rule with a higher salience take that "root" object and "explode" it into the children objects (as deep as needed). <br><br><div class="gmail_quote">
On Fri, Feb 5, 2010 at 3:01 AM, gazzaaa87 <span dir="ltr"><<a href="mailto:dan_hopwood@hotmail.co.uk">dan_hopwood@hotmail.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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's say you have a class called 'Father', which holds a collection of<br>
'Child' objects. By calling session.execute(fatherObject) I need rules to<br>
fire that use the Child pattern without having to loop through 'insert'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'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><br clear="all"><br>-- <br>Michael D Neale<br>home: <a href="http://www.michaelneale.net">www.michaelneale.net</a><br>blog: <a href="http://michaelneale.blogspot.com">michaelneale.blogspot.com</a><br>