<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello guys, i'm trying to seek an object in an ArrayList, but I don't
know how I do it. I'm inserting this list as a global variable into
drools, but I'd like to check if there is an ojbect in this list with a
specific name. Could Anybody help me? The code is below:<br>
<blockquote cite="mid:46F90BD1.2050906@gmail.com" type="cite">global
java.util.List locacoes<br>
  <br>
rule "Cliente pode alugar"<br>
&nbsp;&nbsp;&nbsp; when<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $motorista : umMotorista()<br>
// &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $list : ArrayList() from collect( umLocacaoImediata( <font
 color="#ff6666">cliente == $motorista(nome)</font> ) )<br>
&nbsp;&nbsp;&nbsp; then<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $motorista.setPodeAlugar(false);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println($motorista.getNome() + " j&aacute; possui uma
alocacao");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; update($motorista);<br>
end<br>
  <br>
I'm trying to compare the attribute cliente from umLocacaoImediata with
the attribute nome from motorista. How do I do it?<br>
  <br>
If anybody can help me with the right way to do it, answer this mail,
please.<br>
  <br>
Rafael Alcemar
</blockquote>
<br>
</body>
</html>