You have to establish the age of one applicant as bound to a variable so that you<br>can ascertain this being equal to the age of all Applicants.<br><br>rule &quot;age-2&quot;<br>when<br>    $list : List( size &gt; 0 )  # ensure non-empty so that get(0) doesn&#39;t NPE<br>
    forall( Applicant( $age : age == ( ((Applicant)$list.get(0)).getAge() ) ) from $list )<br>then<br>    System.out.println( &quot;success&quot; );<br>end<br><br><div class="gmail_quote">On 15 September 2010 09:52, tushmish <span dir="ltr">&lt;<a href="mailto:Tushar.Mishra@lntinfotech.com">Tushar.Mishra@lntinfotech.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>
rule &quot;age&quot;<br>
        when<br>
                $list : List();<br>
                forall( $app : Applicant( $age : age) from $list<br>
                   Applicant( this == $app, age == $age ) );<br>
        then<br>
                System.out.println(&quot;success&quot; );<br>
end<br>
<br></blockquote><div><br>It&#39;s noteworthy that this rule would fire if you insert all Applicant objects that are in the List as 1st order facts. What is does is<br><br>   forall( $app | $app in List &amp;<br>                         forall ( $f | $f in WM &amp; $f instanceof Applicant &amp; $f == $app &amp; $f.age == $app.age ) )<br>
<br>where the inner &quot;forall&quot; is implied by the general fact matching algorithm. The last term of the inner conjunction is redundant as we have established the identity by $f == $app - the pattern just matches all list elements with themselves.<br>
<br>-W<br><br><br><br><br><br> </div><div><br> </div></div><br>