[rules-users] how to check reference

Edson Tirelli tirelli at post.com
Fri May 18 08:51:34 EDT 2007


   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 <woodrow.chris at gmail.com>:
>
> Hi,
> You can use eval();
>
> when
>     $obj1:object();
>     $obj2:object();
>     eval ($obj1!=$obj2);
> then
>     System.out.println("Fired");
>
> Hope this helps
> Chris
>
> 2007/5/18, Sikkandar Nawabjan <Sikkandar.Nawabjan at ustri.com >:
> >
> > Hi,
> > we are using drools version 3.0.6. I want to check the object references
> > of t inserted objects in working memory.
> > How to check the condition in LHS?
> > right now am doing the following way
> > when
> >     $obj1:object()
> >      $obj2:object()
> > then
> >    if($obj1!=$obj2)
> >          System.out.println("Fired");
> >
> > how to move the if(if($obj1!=$obj2)) statement to LHS? am not able to
> > use this operator in version 3.0.6
> > Thanks and Regs.
> > Basha
> >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> --
> woodrow.chris at gmail.com est ma nouvelle adresse e-mail. chris.woodrow at free.fr
> va disparaître, pensez à faire le changement.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070518/62be1a84/attachment.html 


More information about the rules-users mailing list