[rules-users] Extended rule doesn't have reference to variable created in super rule

Wolfgang Laun wolfgang.laun at gmail.com
Fri Mar 1 01:00:16 EST 2013


On 01/03/2013, arul.prashanth at gmail.com <arul.prashanth at gmail.com> wrote:
> I have the below rules written but $xyz isn't available or visible in Rule
> 2.
> Is this the way extends keyword works?
>
> rule "test 1"
> when
>     $xyz : XYZ(value == 0);
> then
>     // do somethings
>
> rule "test 2" extends "test 1"
> when
>      eval($xyz.reference == 1)

Try this:
    eval($xyz.getReference() == 1)

-W

> then
>  // do something.
>
> Exception:
>
> Error: unable to resolve method using strict-mode: java.lang.Object.$xyz()
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Extended-rule-doesn-t-have-reference-to-variable-created-in-super-rule-tp4022647.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list