<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML DIR=ltr><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"></HEAD><BODY>
<DIV><FONT face=Arial size=2>Edson,</FONT></DIV>
<DIV><FONT face=Arial size=2>am getting the following output</FONT></DIV>
<DIV><FONT face=Arial size=2>[ b, a ]</FONT></DIV>
<DIV><FONT face=Arial size=2>[ a, b ]</FONT><BR>only the order of the output is
different. so if i check a equal to b according to the cross product law the
then part execute 2 times?</DIV>
<DIV>thats y i check the reference in the then part.</DIV>
<DIV> </DIV>
<DIV>how to use eval to variable comparison of objects in a single
line</DIV>
<DIV><BR>Thanks and regs,</DIV>
<DIV>Basha</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><BR> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#000000
size=2>/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////</FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2>Message: 3<BR>Date: Sat, 19 May 2007
09:53:29 -0300<BR>From: "Edson Tirelli" <tirelli@post.com><BR>Subject: Re:
[rules-users] [rule-users]how to create object
properties<BR>
in single stmnt<BR>To: "Rules Users List"
<rules-users@lists.jboss.org><BR>Message-ID:<BR>
<e6dd5ba30705190553p1f5f794ct91ad250fb1ad3753@mail.gmail.com><BR>Content-Type:
text/plain; charset="iso-8859-1"<BR><BR>
Sikkandar,<BR><BR> In 3.0.6, if you have 2 strings in the
working memory ("a" and "b" ) and<BR>you write:<BR><BR>rule "cross
product"<BR>when<BR> $s1: String()<BR> $s2:
String()<BR>then<BR> System.out.println("[ "+$s1+", "+$s2+"
]");<BR>end<BR><BR> The result MUST be:<BR><BR>[ a, b ]<BR>[ b, a
]<BR><BR> If it is not that, then we have a bug, but our integration
tests that<BR>test this specific situation are working fine. Plz let us know if
it is<BR>different for you.<BR> In 4.0, the result must be:<BR><BR>[
a, b ]<BR>[ b, a ]<BR>[ a, a ]<BR>[ b, b ]<BR><BR> So a fact (by
default) may match multiple simultaneous patterns.<BR><BR> Regarding
your second question, comparing properties of the same object<BR>is also
something we added for 4.0. In 3.0.x you need eval() too.<BR><BR>
[]s<BR> Edson<BR><BR>2007/5/19, Sikkandar Nawabjan
<Sikkandar.Nawabjan@ustri.com>:<BR>><BR>> Hi ,<BR>> The very
reason i used to compare two object reference is that i got then<BR>>
executed multiple time when i do duplicate check between object
properties.<BR>> so i beleive the pattern match happen more than a
time<BR>> for example<BR>>
when<BR>>
$obj1:object($code:code,$stdate:startdate);<BR>>
$obj2:object(code==$code,startdate=$stdate);<BR>> then<BR>>
if(obj1!=obj2)<BR>>
System.out.println("Fired");<BR>><BR>> My questions are<BR>><BR>> 1)
In 3.0.6 is there any other way to avoid this multiple check other than<BR>>
using eval(which affects performance i beleive). i can't use this
operator<BR>> in 3.0.6<BR>><BR>> 2) related to this i have one more
query. how to check properties within<BR>> the object itself<BR>><BR>>
for example i want to do<BR>>
when<BR>>
$obj1:object($code:code,$stdate:startdate,$enddate:enddate > $stdate,<BR>>
reasoncode == $code);<BR>> then<BR>>
System.out.println("Fired");<BR>> i beleive the above throws error in 3.0.6
(nullpointer related to alpha<BR>> node)<BR>><BR>> Earlier reply is
highly appreciated<BR>><BR>> Thanks and Regs,<BR>>
Bassha<BR>><BR>><BR></DIV></FONT></BODY></HTML>