[rules-users] using Globals in LHS (not using eval)

Wolfgang Laun wolfgang.laun at gmail.com
Sat Jan 28 02:31:26 EST 2012


Given that you have
   global Integer foo;
you can write
   when
      Person( age > foo )
without eval. But you have to be very careful: Don't expect changes of
foo to work like update for facts, and make sure to set the global
before you insert any facts where patterns for that fact refer to the
global.

You cannot use a global's type the way you use a fact type as a pattern.

-W



On 27/01/2012, domingo <sprabakkar at gmail.com> wrote:
> Hi,
> Thanks for your time,
> Can I use Globals in LHS without using in eval block? I search the forum no
> info available.most of them direct me to use eval but i dont want to use
> eval. Is it possible in 5.4? please let me know if there is a way to
> accomplish this......
> thanks,
>
> -----
> with kind regards,
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/using-Globals-in-LHS-not-using-eval-tp3694366p3694366.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