I have a similar issue. I use sqlDefaultDate() and maxDate() in several of my rules. What
I did was to create a static function for each. Each function simply returns a static
variable. The variable is initialized on first use. This ensure maxium performance.
Then in my rules, I just put the function name in my DRL file where ever I need it
referenced. But I also made sure to import external function in my imports statements to
make the function available to my applications.
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of Zhao Yi
Sent: Tuesday, November 22, 2011 5:59 AM
To: rules-users(a)lists.jboss.org
Subject: Re: [rules-users] How to define static constant variable
There are some constant variables will be used in rules. For example, I have a maximum and
minimum value which are used to limited other values. So I need to define these values in
rules. If I set global variable, I have to set these global on the session in java code.
How can I set them in rules without change Java code?
--
View this message in context:
http://drools.46999.n3.nabble.com/How-to-define-static-constant-variable-...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users