<!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"><br>
global java.util.List locacoes<br>
<br>
rule "Cliente pode alugar"<br>
when<br>
$motorista : umMotorista()<br>
// $list : ArrayList() from collect( umLocacaoImediata( <font
color="#ff6666">cliente == $motorista(nome)</font> ) )<br>
then<br>
$motorista.setPodeAlugar(false);<br>
System.out.println($motorista.getNome() + " já possui uma
alocacao");<br>
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>