[rules-users] Dynamic rule creation

seeker janko.dimitroff at dai-labor.de
Tue Mar 6 06:37:27 EST 2007


How can I create a rule on the fly ?

I have some rules working, and I want the user let chance some values in the
conditions.

Say I have somthing like

rule "somerule"
	when 
		foo : Foo ( a : level -> ( a.floatValue() > 20.0) )
	then
               ...

I want change the "20.0" afterwards to some other value. Is this possible ?
What do I have to do for that?
The drools javadocs are not that much helpful on that matter.

Do I have to remove the rule, create a new one and insert it into the
agendagroup ? Or can I modify a rule?
What other things does somthing like this imply? (Do I have to reassert all
facts or something?)

The worst what I can think of is writing all rules including the modified
one into a new file and start reading the rules-file, creating the
workingmemory and building my facts once again.

IS there another way?
-- 
View this message in context: http://www.nabble.com/Dynamic-rule-creation-tf3354961.html#a9330444
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list