Hi ,
The very reason i used to compare two object reference is that i got then 
executed multiple time when i do duplicate check between object properties. so 
i beleive the pattern match happen more than a time
for example
 when
     $obj1:object($code:code,$stdate:startdate);
     $obj2:object(code==$code,startdate=$stdate);
 then
if(obj1!=obj2)
     System.out.println("Fired");

My questions are 

1) In 3.0.6 is there any other way to avoid this multiple check other than 
using eval(which affects performance i beleive). i can't use this operator in 
3.0.6

2) related to this i have one more query. how to check properties within the 
object itself

for example i want to do

 when
     $obj1:object($code:code,$stdate:startdate,$enddate:enddate > $stdate, 
reasoncode == $code);
 then
     System.out.println("Fired");
i beleive the above throws error in 3.0.6 (nullpointer related to alpha node)
 
Earlier reply is highly appreciated
 
Thanks and Regs,
Bassha

 

 


 
 
 
 
 
 
----------------------------------------------------------------------

Message: 1
Date: Fri, 18 May 2007 09:51:34 -0300
From: "Edson Tirelli" <[EMAIL PROTECTED]>
Subject: Re: [rules-users] how to check reference
To: "Rules Users List" <[email protected]>
Message-ID:
        <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"

   Yes, in 3.0.6 you will need eval. But also it is important to remember
that by default, in 3.0.6, an object will never match more than one pattern.
So in the given example, ob1 and ob2 will always be different and the check
is not needed.
   In 4.0, things are a bit different, as by default a single object may
match more than one pattern at once and we introduced the "this" keyword to
check for object identity.

   []s
   Edson


2007/5/18, Chris Woodrow <[EMAIL PROTECTED]>:
>
> Hi,
> You can use eval();
>
> when
>     $obj1:object();
>     $obj2:object();
>     eval ($obj1!=$obj2);
> then
>     System.out.println("Fired");
>
> Hope this helps
> Chris

_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to