[rules-users] running a small set of rules from a drl file.

Anstis, Michael (M.) manstis1 at ford.com
Fri Mar 20 05:51:27 EDT 2009


You could consider Agenda Groups.
 
You could either bunch groups of rules into discrete sets or have each
rule in its own Agenda Group.
 
You would then use workingMemory.setFocus(...) before calling
fireAllRules().
 
This is based upon 4.x and so could be different in 5 (which I haven't
had time to look at fully).
 
With kind regards,
 
Mike


________________________________

	From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Lucas de
Oliveira
	Sent: 19 March 2009 15:21
	To: rules-users at lists.jboss.org
	Subject: [rules-users] running a small set of rules from a drl
file.
	
	
	Hi,
	I was wondering if it's possible to pick up just a few rules
from a drl file to create the RuleExecutionSet. Something like:
	
	rules.drl ===>
	...
	
	rule "r1"
	 ...
	end
	
	rule "r2"
	 ...
	end
	
	...
	=============
	
	RunRules.java ===>
	...
	
	List<String> rulesToRun = new ArrayList<String>();
	rulesToTun.add("r1");
	
	RuleExecutionSet ruleExecutionSet =
ruleSetProvider.createRuleExecutionSet(ruleFileName, null, rulesToRun);
	ruleAdministrator.registerRuleExecutionSet("test.drl",
ruleExecutionSet, null);
	
	...
	=============
	
	I haven't found anything like that in the documentation. I'd
really like that otherwsie I'll have to split the rules through many
different files, which will be a bit of a havoc to unit test...
	
	thanks in advance!
	best regards,
	
	-- 
	Lucas de Oliveira Arantes
	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090320/b0e839e4/attachment.html 


More information about the rules-users mailing list