So these are not "constants" :).
I think a better approach could be to model your "constants" in a Fact
class.
Then, you can insert/update/retract this fact inside your rules.
For examples:
rule 1
when
Something()
then
//init "values" fact
Values v = new Values();
v.set...
insert (v)
end
rule 2
when
$v: Values()
Other(amount > $v.maxAmount)
then
//you can also use $v here
end
Best Regards,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
- Developer @
http://www.plugtree.com
- Blog @
http://ilesteban.wordpress.com
On Tue, Nov 22, 2011 at 2:59 PM, Zhao Yi <zhaoyi0113(a)gmail.com> wrote:
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