Use the "from" CE. Something like:<br><br>Fact( ... ) from yourGlobalList<br><br><br><div><span class="gmail_quote">2007/9/27, Rafael Alcemar <<a href="mailto:rafael.alcemar@gmail.com">rafael.alcemar@gmail.com
</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Rafael Alcemar escreveu:<br>> Thanks for your answer but I forgot to say that I want to use the
<br>> gloabal variable *locacoes*. *locacoes *is an ArrayList containing a<br>> list of umLocacaoImediata. How do I iterate over *locacoes* and<br>> discover if there is an object with the same name of the variable
<br>> $motorista???<br>><br>> Thanks!<br>> Rafael Alcemar<br>><br>> Chris Woodrow escreveu:<br>>> Hi,<br>>> Doesn't (client == $motorista.nome) work?<br>>><br>>> 2007/9/26, Rafael Alcemar <
<a href="mailto:rafael.alcemar@gmail.com">rafael.alcemar@gmail.com</a><br>>> <mailto:<a href="mailto:rafael.alcemar@gmail.com">rafael.alcemar@gmail.com</a>>>:<br>>><br>>> Hello guys, i'm trying to seek an object in an ArrayList, but I
<br>>> don't know how I do it. I'm inserting this list as a global<br>>> variable into drools, but I'd like to check if there is an ojbect<br>>> in this list with a specific name. Could Anybody help me? The
<br>>> code is below:<br>>><br>>> global java.util.List locacoes<br>>><br>>> rule "Cliente pode alugar"<br>>> when<br>>> $motorista : umMotorista()
<br>>> // $list : ArrayList() from collect( umLocacaoImediata(<br>>> cliente == $motorista(nome) ) )<br>>> then<br>>> $motorista.setPodeAlugar(false);<br>>>
System.out.println($motorista.getNome() + " já possui uma<br>>> alocacao");<br>>> update($motorista);<br>>> end<br>>><br>>> I'm trying to compare the attribute cliente from
<br>>> umLocacaoImediata with the attribute nome from motorista. How do<br>>> I do it?<br>>><br>>> If anybody can help me with the right way to do it, answer this<br>>> mail, please.
<br>>><br>>> Rafael Alcemar<br>>><br>>> _______________________________________________<br>>> rules-users mailing list<br>>> <a href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a> <mailto:<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">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br>>><br>>><br>>> ------------------------------------------------------------------------<br>>><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">https://lists.jboss.org/mailman/listinfo/rules-users</a>
<br>>><br>><br><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">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646
<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>