<span style="font-family: courier new,monospace;"><span style="font-family: arial,helvetica,sans-serif;">You&#39;d be better off inserting the individual claim history objects</span></span>:-<br><br><span style="font-family: courier new,monospace;">when</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    $c : Claim( $a : aField )</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    $ch : ClaimHistory( aField == $a )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    ...</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">end</span><br style="font-family: courier new,monospace;"><br>IIRC you can achieve the same by inserting the Vector by providing another rule to expand it first:-<br><br><span style="font-family: courier new,monospace;">Vector&lt;ClaimHistory&gt; claimHistory = getClaimHistory();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">ksession.insert( claimHistory );</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">salience &lt;A value hIgher than your other rules&gt;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">when</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    $v : Vector( )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    $ch : ClaimHistory( ) from $v</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">then</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    insert( $ch );</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end</span><br><br>You can also achieve the latter example using a global.<br>
<br>With kind regards,<br><br>Mike<br style="font-family: courier new,monospace;"><br><div class="gmail_quote">On 4 May 2011 09:17, sdinoo <span dir="ltr">&lt;<a href="mailto:sdinoo@gmail.com">sdinoo@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I am new to drools<br>
<br>
I am inserting into a ksession a single claim POJO + vector of previous<br>
claims<br>
Like this<br>
<br>
                        ksession.insert(claim); // single claim<br>
                        ksession.insert(historyClaims); // vector of claims<br>
                        ksession.startProcess(&quot;com.dur.claim&quot;);<br>
                        ksession.fireAllRules();<br>
<br>
I want to compare single claim variable values with all the claims in the<br>
vector<br>
how do I loop through the vector objects and compare the values in the Rule<br>
(.drl) file?<br>
<br>
Can someone help me out?<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Looping-through-a-vector-object-in-a-rule-tp2897872p2897872.html" target="_blank">http://drools.46999.n3.nabble.com/Looping-through-a-vector-object-in-a-rule-tp2897872p2897872.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">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>