[rules-users] Re: How do i Load & Execute specific rules in my drl file

Bree breevanoss at gmail.com
Thu Jan 18 08:29:39 EST 2007


> 
> How do i load & execute specific rules in my drl file?
> 

Raja,

As Mark indicated, it appears that you are misunderstanding how JBoss Rules
(drools) should be used. Your example seems to indicate that you would place
"execution flow" logic in Java and simply call the "appropriate" rule from your
Java class. This is a sub-optimal solution as it does not use the power of JBoss
Rules effectively. Look at the documentation for "conflict resolution",
salience, and activation groups to understand how to impact execution flow.

That being said, following is a response to your actual questions.

The only way I've found to load specific rules is to define each rule (or group
of rules) in a separate .drl file and implement logic that loads only the rules
you need/want. 

The concept of "Agenda Groups" and "Agenda Filters" can be used at runtime to
partition rules such that only specific rules fire during a given execution. The
following link to the JBoss Rules 3.0.5 documentation describes the use of
Agenda Groups/Filters.

http://labs.jboss.com/file-access/default/members/jbossrules/freezone/docs/3.0.5/html_single/index.html#d0e789

Enjoy,

Bree








More information about the rules-users mailing list