[rules-users] How to let a rule run only one time

Zhao Yi zhaoyi0113 at gmail.com
Wed Dec 7 10:43:19 EST 2011


This is my code:

                 session.getAgenda().getAgendaGroup("add").setFocus();
                 try {
			int rule=session.fireAllRules();
			System.out.println(rule+" rules fired");
		} catch (Exception e) {
			e.printStackTrace();
		}

The rule doesn't print the message and the code print "0 rules fired". I am
using drools 5.1.1. Is this the version you are using?

My rule file is:

rule "add2"
	agenda-group "add"
	dialect "java" 
	lock-on-active
	when 
		eval(true)
	then 
		System.out.println("add2");
end

--
View this message in context: http://drools.46999.n3.nabble.com/How-to-let-a-rule-run-only-one-time-tp3550555p3567777.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list