If globalService.getCustomObjects() returns a collection then there is no point in doing a from/collect to iterate and collect (again) what was a collection to start with.<br><br>Simply use<br>   for (Object obj: globalService.getCustomObjects()) insert(obj);<br>
<br>-W<br><br><br><div class="gmail_quote">2011/10/27 Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Why not get get List using &quot;from&quot; in the LHS and iterate this in the RHS adding individual facts?<div><div></div><div class="h5"><br><br><div class="gmail_quote">On 27 October 2011 21:39, RK <span dir="ltr">&lt;<a href="mailto:rmeiappan@datacert.com" target="_blank">rmeiappan@datacert.com</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;">I want to insert multiple facts sourced by a &#39;from&#39; clause to a service<br>
method.<br>
For Ex:<br>
<br>
when<br>
...<br>
then<br>
 insert( mycustomobject() from globalService.getCustomObjects())<br>
<br>
getCustomObjects() method will return several instances of custom objects<br>
based on a sql query and i want to insert them into the knowledge session.<br>
I&#39;ll be using these custom objects in other subsequent rules.<br>
<br>
Is it possible to do something like this ?<br>
<br>
Thanks<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/inserting-multiple-facts-in-RHS-tp3459071p3459071.html" target="_blank">http://drools.46999.n3.nabble.com/inserting-multiple-facts-in-RHS-tp3459071p3459071.html</a><br>


Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
</font></blockquote></div><br>
</div></div><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>