[rules-users] can't refer to the bound column fields from the LHS?..

Olenin, Vladimir (MOH) Vladimir.Olenin at moh.gov.on.ca
Tue Mar 13 13:48:18 EDT 2007


Hi,

 

I always assumed that one can refer to the properties of the bound column in
the LHS like this:

 

MyRecord {

            String field1, field2;

}

 

MyRecord2 {

            String field1, field3;

}

 

Rule xxx

            When

                        $r1: MyRecord (field1 == "xxx")

                        $r2: MyRecord2 (field1 == $r1.field1)

            Then

                        System.out.println("found match: "+$r2+", "+$r1);

End

 

Compiler does complain on '$r1' usage in the LHS (as part of constraint for
MyRecord2 fact), but works OK if used only in RHS. The error I'm getting is:
"Unable to find class $r1". "$r1.getField1()" doesn't work either (getting
"mismatched token, expecting ')' " error).

 

Thanks,

 

Vlad

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070313/3123afd9/attachment.html 


More information about the rules-users mailing list