[rules-users] using global variable in LHS
Miles, Eric
zemiles at choosehmc.com
Wed Aug 12 15:00:53 EDT 2009
Not necessarily, particularly since his global is a List. You could also use it in a from clause. Ie:
Global List someList;
Rule "my rule"
When
Fact(val > 45) from someList;
Then
System.out.println("Woo hoo I'm happy");
end
-----Original Message-----
From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Simon Thum
Sent: Wednesday, August 12, 2009 1:00 PM
To: Rules Users List
Subject: Re: [rules-users] using global variable in LHS
VÅM§Ï ® wrote:
> Hi ,
> i have inserted global variable into working memory.It is an Array list
> object.
> it is working fine in RHS i.e in the "then" part.
> i want to write a condition using this global variable in the LHS.
> please let me know how can i use global variable in "when" part?
Fact ( eval ( globVar.allFine ) )
AFAIK the evals are the only way.
HTH,
Simon
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information or otherwise protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
More information about the rules-users
mailing list