How to fire only a set of rules in drools

54 views
Skip to first unread message

Vishnu Chalil

unread,
Feb 1, 2021, 1:31:27 AM2/1/21
to Drools Development
Hi I have been experimenting with drools and drools template. I have a few template files from which I generate rules. The problem is I only want to fire rules generated from a single template file. The fireAllRules() function typically fires all the rules in the kieBase. Is there is a way to fire the rules generated by a single template. I have seen something called Agenda group, but that fires the main agenda that is rest of rules when none of the rules in an agenda matches. Is there a way fire only a set of rules in my case the rules that are generated from a single template?

Abhijit Humbe

unread,
Feb 1, 2021, 6:53:32 AM2/1/21
to drools-de...@googlegroups.com
Bydefault rules from main agenda will be executed. How about adding all rules to specific agenda group ?
Abhijit Humbe


On Mon, Feb 1, 2021 at 12:01 PM Vishnu Chalil <vishnu...@gmail.com> wrote:
Hi I have been experimenting with drools and drools template. I have a few template files from which I generate rules. The problem is I only want to fire rules generated from a single template file. The fireAllRules() function typically fires all the rules in the kieBase. Is there is a way to fire the rules generated by a single template. I have seen something called Agenda group, but that fires the main agenda that is rest of rules when none of the rules in an agenda matches. Is there a way fire only a set of rules in my case the rules that are generated from a single template?

--
You received this message because you are subscribed to the Google Groups "Drools Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-development/78112389-b849-47a8-8b02-8e26b0da739fn%40googlegroups.com.

Vishnu Chalil

unread,
Feb 4, 2021, 6:14:19 AM2/4/21
to drools-de...@googlegroups.com
But even with an agenda the `main ` agenda would fire if no rules are fired from the specified agenda right? Is there anyway to stop that?

Bishnu Shankar Pandey

unread,
Feb 4, 2021, 6:47:32 AM2/4/21
to Drools Development
Hi Vishnu,
If you want to fire a specific rule which comes under some category you can try specifying the entry point for each category. Rules and events under one entry point do not share with any other entry point. https://docs.jboss.org/jbpm/v6.0.1/javadocs/org/kie/api/runtime/rule/EntryPoint.html

Reply all
Reply to author
Forward
0 new messages