<!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">
Thanks for your answer but I forgot to say that I want to use the
gloabal variable <b>locacoes</b>. <b>locacoes </b>is an ArrayList
containing a list of umLocacaoImediata. How do I iterate over <b>locacoes</b>
and discover if there is an object with the same name of the variable
$motorista??? <br>
<br>
Thanks!<br>
Rafael Alcemar<br>
<br>
Chris Woodrow escreveu:
<blockquote
cite="mid:16fdafe70709260448g2a925d95pa5ed6f84eb28a199@mail.gmail.com"
type="cite">Hi,<br>
Doesn't <span style="font-style: italic;">(client == $motorista.nome)</span>
work?<br>
<br>
<div><span class="gmail_quote">2007/9/26, Rafael Alcemar <<a
moz-do-not-send="true" 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;">
<div bgcolor="#ffffff" text="#000000">
<div lang="x-western">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>
<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
</div>
</div>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a moz-do-not-send="true"
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
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>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>