I normally do something like<br><br>when<br>&nbsp;&nbsp;&nbsp; $creditContract : CreditContract()<br>&nbsp;&nbsp;&nbsp; $o : Applicant() from $creditContract.coApplicantArray<br>then<br>&nbsp;&nbsp;&nbsp; insert($o);<br>end<br><br>retract would be something like<br><br>
when<br>&nbsp;&nbsp;&nbsp; $o : Applicant( )<br>&nbsp;&nbsp;&nbsp; CreditContract( coApplicantArray contains $o )<br>then<br>&nbsp;&nbsp;&nbsp; retract($o);<br>end<br><br>cheers<br>Steve<br><br>
<br><br><div class="gmail_quote">On Tue, Feb 10, 2009 at 6:36 AM,  <span dir="ltr">&lt;<a href="mailto:kfs2@chryslerfinancial.com">kfs2@chryslerfinancial.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;">

<br><font face="sans-serif" size="2">There may be a better way but I did
it using a function as below:</font>
<br>
<br><font color="#a00000" face="Courier New" size="2"><b>function</b></font><font face="Courier New" size="2">
</font><font color="#a00000" face="Courier New" size="2"><b>void</b></font><font face="Courier New" size="2">
insertArray(WorkingMemory workingMemory, Object[] array)</font>
<br><font face="Courier New" size="2">{</font>
<br><font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; </font><font color="#a00000" face="Courier New" size="2"><b>for</b></font><font face="Courier New" size="2">
(</font><font color="#a00000" face="Courier New" size="2"><b>int</b></font><font face="Courier New" size="2">
i=0;i&lt;array.length;i++)</font>
<br><font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; {</font>
<br><font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; workingMemory.</font><font color="#a00000" face="Courier New" size="2"><b>insert</b></font><font face="Courier New" size="2">(array[i]);</font>
<br><font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; }</font>
<br><font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; </font><font color="#a00000" face="Courier New" size="2"><b>return</b></font><font face="Courier New" size="2">;</font>
<br><font face="Courier New" size="2">}</font>
<br>
<br><font face="sans-serif" size="2">...</font>
<br>
<br><font color="#a00000" face="Courier New" size="2"><b>rule</b></font><font face="Courier New" size="2">
</font><font color="#008000" face="Courier New" size="2">&quot;StarCoApplicants&quot;</font><font face="Courier New" size="2">
</font><font color="#a00000" face="Courier New" size="2"><b>ruleflow-group</b></font><font face="Courier New" size="2">
</font><font color="#008000" face="Courier New" size="2">&quot;STAR&quot;</font>
<br><font color="#a00000" face="Courier New" size="2"><b>dialect</b></font><font face="Courier New" size="2">
</font><font color="#008000" face="Courier New" size="2">&quot;mvel&quot;</font>
<br><font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; </font><font color="#a00000" face="Courier New" size="2"><b>when</b></font>
<br><font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; $creditContract : CreditContract ()</font>
<br><font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; </font><font color="#a00000" face="Courier New" size="2"><b>then</b></font><font face="Courier New" size="2">
</font>
<br><font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; insertArray(drools.workingMemory,$creditContract.coApplicantArray);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font color="#a00000" face="Courier New" size="2"><b>end</b></font>
<br>
<br>
<br><font face="sans-serif" size="2">Kent Symanzik<br>
</font>
<br>
<br>
<br>
<table width="100%">
<tbody><tr valign="top">
<td width="40%"><font face="sans-serif" size="1"><b>techy &lt;<a href="mailto:techluver007@gmail.com" target="_blank">techluver007@gmail.com</a>&gt;</b>
</font>
<br><font face="sans-serif" size="1">Sent by: <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a></font>
<p><font face="sans-serif" size="1">02/09/2009 10:15 AM</font>
</p><table border="1">
<tbody><tr valign="top">
<td bgcolor="white">
<div align="center"><font face="sans-serif" size="1">Please respond to<br>
Rules Users List &lt;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;</font></div></td></tr></tbody></table>
<br>
</td><td width="59%">
<table width="100%">
<tbody><tr valign="top">
<td>
<div align="right"><font face="sans-serif" size="1">To</font></div>
</td><td><div class="Ih2E3d"><font face="sans-serif" size="1"><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a></font>
</div></td></tr><tr valign="top">
<td>
<div align="right"><font face="sans-serif" size="1">cc</font></div>
</td><td>
</td></tr><tr valign="top">
<td>
<div align="right"><font face="sans-serif" size="1">Subject</font></div>
</td><td><font face="sans-serif" size="1">Re: [rules-users] Inserting collection
of facts in rule Consequence</font></td></tr></tbody></table>
<br>
<table>
<tbody><tr valign="top">
<td>
</td><td></td></tr></tbody></table>
<br></td></tr></tbody></table><div><div></div><div class="Wj3C7c">
<br>
<br>
<br><tt><font size="2"><br>
I would appreciate If someone can clarify this.<br>
<br>
Thanks in advance<br>
<br>
<br>
techy wrote:<br>
&gt; <br>
&gt; Hello,<br>
&gt; <br>
&gt; Is there way to insert all facts from collection (similar to<br>
&gt; session.execute(collection)) in the rule consequence ? <br>
&gt; <br>
&gt; Thanks!<br>
&gt; <br>
<br>
-- <br>
View this message in context: </font></tt><a href="http://www.nabble.com/Inserting-collection-of-facts-in-rule-Consequence-tp21814308p21914860.html" target="_blank"><tt><font size="2">http://www.nabble.com/Inserting-collection-of-facts-in-rule-Consequence-tp21814308p21914860.html<br>

Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
rules-users@lists.jboss.org<br>
</font></tt></a><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank"><tt><font size="2">https://lists.jboss.org/mailman/listinfo/rules-users<br>
</font></tt><font face="sans-serif" size="2"> &nbsp;</font></a>
<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>