Hi,<br><br>To check the length of a Box object use:<br><br>when<br><div style="margin-left: 40px;">$box : Box(length == 10)<br></div>then<br><div style="margin-left: 40px;">...<br></div><br>There are two ways to iterate over your list depending the version you are using. Assuming BoxList has a property boxes returning a collection. In 
3.0.5 you can use:<br><br>when<br><div style="margin-left: 40px;">BoxList($b : boxes)<br></div>then<br><div style="margin-left: 40px;">for(Iterator it = $b.iterator();it.hasNext();) {<br><div style="margin-left: 40px;">assert(
it.next());<br></div>}<br></div>end<br><br>On trunk you can use the from keyword to combine the iteration and the rule<br><br>when<br><div style="margin-left: 40px;">$list : BoxList()<br></div><div style="margin-left: 40px;">
$box : Box(length == 10) from $list.getBoxes()<br></div>then<br><div style="margin-left: 40px;">...<br></div><br>cheers<br>Steve<br><br><div>
<span class="gmail_quote">On 2/19/07, <b class="gmail_sendername">Diwakar</b> &lt;<a href="mailto:raja_diwakar@yahoo.co.in" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">raja_diwakar@yahoo.co.in</a>
&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>I am a beginner.<br>I have an ArrayList object - Say BoxList Object&nbsp;&nbsp;containing 10 Box objects .<br>I need to check if the length of the bos is 10cm on each box object.<br><br><br>How do I write this as rule condition.
<br>Is there any way to write the rule for iterating the BoxList to check the<br>length of each box<br><br>Can you please help?<br><br>--<br>View this message in context: <a href="http://www.nabble.com/Handling-ArrayList-objects-in-rule-conditions-tf3251245.html#a9037969" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

http://www.nabble.com/Handling-ArrayList-objects-in-rule-conditions-tf3251245.html#a9037969</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Nabble.com</a>.<br><br>_______________________________________________
<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.jboss.org/mailman/listinfo/rules-users
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Steven Williams<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501<br><a href="mailto:stevenw@objectconsulting.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

stevenw@objectconsulting.com.au</a><br><a href="http://www.objectconsulting.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.objectconsulting.com.au</a><br><br>consulting | development | training | support
<br>our experience makes the difference