&nbsp;&nbsp; <br>&nbsp; &nbsp;&nbsp; Assuming your class name is &quot;umLocacaoImediata&quot;:<br><br>$list : ArrayList() from collect( umLocacaoImediata( <font color="#ff6666">cliente == $motorista.nome</font> ) )<br><br>&nbsp;&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp;&nbsp; Edson<br>
<br><div><span class="gmail_quote">2007/9/25, Rafael Alcemar &lt;<a href="mailto:rafael.alcemar@gmail.com">rafael.alcemar@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  

<div bgcolor="#ffffff" text="#000000">
Hello guys, i&#39;m trying to seek an object in an ArrayList, but I don&#39;t
know how I do it. I&#39;m inserting this list as a global variable into
drools, but I&#39;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 type="cite">global
java.util.List locacoes<br>
  <br>
rule &quot;Cliente pode alugar&quot;<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() + &quot; já possui uma
alocacao&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; update($motorista);<br>
end<br>
  <br>
I&#39;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>
</div>

<br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646
<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>