[rules-users] how to check reference

Mark Proctor mproctor at codehaus.org
Fri May 18 08:58:21 EDT 2007


in 4.0 MR2 you have access to the "this" object, which makes thins a bit 
more declarative:

when
    $obj1:object();
    $obj2:object( this != $obj1 )
then

Also don't use ; after each pattern, Im surprised that even works.

Mark


Chris Woodrow wrote:
> 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 
> <mailto: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 <mailto:rules-users at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/rules-users
>     <https://lists.jboss.org/mailman/listinfo/rules-users>
>
>
>
>
> -- 
> woodrow.chris at gmail.com <mailto:woodrow.chris at gmail.com> est ma 
> nouvelle adresse e-mail. chris.woodrow at free.fr 
> <mailto: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
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070518/8be4d1e7/attachment.html 


More information about the rules-users mailing list