If you want to keep your solution entirely within rules you&#39;ll need your Customers in WM too:-<br><br>rule &quot;find customer&quot;<br>when<br>$d : Data( )<br>Item( item == &quot;I1&quot;, $id : customerId) from $d.getData()<br>
$c : Customer( id == $id )<br>then<br>..<br>end<br><br><div class="gmail_quote">On 29 December 2010 09:44, wasim.khan318 <span dir="ltr">&lt;<a href="mailto:khanwasim07@yahoo.co.in">khanwasim07@yahoo.co.in</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;"><br>
public static class Item<br>
        {<br>
private String CustomerId;<br>
private String Item;<br>
}<br>
<br>
public static class Data<br>
{<br>
        public ArrayList&lt;Item&gt; items = new ArrayList&lt;Item&gt;();<br>
<br>
        public ArrayList&lt;Item&gt;  GetData()<br>
        {Item item1 = new Item();<br>
// some code<br>
from database<br>
item1.CustomerId=rs.getString(&quot;CustomerId&quot;);<br>
  item1.Price=rs.getString(&quot;item&quot;);<br>
                   items.add(item);<br>
return item1<br>
}<br>
1.how to write rule how to find customer of a perticular Item<br>
2. what i have written<br>
 $D:Data();<br>
                $I:Item();<br>
<br>
<br>
          $R:Item(item ==&quot;I1&quot;  )from $D.GetData() ;<br>
<br>
<br>
        then<br>
        System.out.println(&quot;hello&quot;);<br>
<font color="#888888"><br>
<br>
--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/working-with-aray-list-tp2161994p2161994.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/working-with-aray-list-tp2161994p2161994.html</a><br>

Sent from the Drools - User 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>