[rules-users] Dynamic Rules
Yamil Bracho
yamilbracho at hotmail.com
Mon Feb 8 14:00:12 EST 2010
Use a global variable.
In your java code use a property file and the "inject" to drools using the setGlobal method() of your session.
session.setGlobal("maxBalance", 100)
and in your drl
global java.lang.Integer maxBalance;
rule “basic rule” when Account($balance : balance < maxBalance) then System.out.println(“Account balance: “ + $balance + “ is less than " + maxBalance.toString() ); end
From: gmacgregor at pocketkings.ie
To: rules-users at lists.jboss.org
Date: Mon, 8 Feb 2010 18:11:57 +0000
Subject: [rules-users] Dynamic Rules
Hi All,
Just getting started using Drools and I have a question
about dynamic rules. I have written a simple application based on one of the
tutorials.
Rule:
rule “basic rule”
when
Account($balance
: balance < 100)
then
System.out.println(“Account
balance: “ + $balance + “ is less than 100“);
end
This rule works fine in my test application but is there a
way to replace the static 100 with a dynamic value like, AccountRulesConfig.lowBalance,
basically testing against the value of another object rather than a static
value?
Thanks
Glenn
_________________________________________________________________
Los auténticos Hotmail y Messenger en tu Blackberry con Movistar. ¡Descárgatelos ya!
http://serviciosmoviles.es.msn.com/messenger/blackberry.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100208/2c6ba43a/attachment.html
More information about the rules-users
mailing list