My problem boils down to finding matching entries in parallel arrays.<br><br>Here is a rule that succesfully does just that:<br><br>rule &quot;Find matching entry in parallel arrays&quot;<br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $first : ArrayList( )
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $second : ArrayList( this != $first )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $i : Integer( this &lt; $first.size )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; eval( $first.get($i) == $second.get($i) )<br>&nbsp;&nbsp;&nbsp; then<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println ( &quot;Found match at index &quot; + $i + &quot;!&quot; );
<br>end<br><br><br>To execute this rule, I must insert (assert) the two ArrayList facts as well as at least as many Integer facts as there are items in the ArrayLists.<br><br>What I don&#39;t like about this rule is that<br>
<br>&nbsp;&nbsp;&nbsp; (1) I have to assert the Integers<br>&nbsp;&nbsp;&nbsp; (2) I can&#39;t support arbitrarily-sized lists in my rules (without asserting that many Integer facts)<br><br>So -- Is there a better way? <br><br>What if a future version of Drools supported implicit Number facts that allowed for these kinds of indexing rules?
<br><br>Aaron<br><br><br><br><br>