0
votes

How can I get the drl from the KieBase when a match occurs. For example, I have 5 rules in a drl file and if the second rule matches, then I need to get the second rule drl alone from the KieBase. Is there any way to do that?. I tried,

match.getRule() //to get the rule object

But I am not able to get the drl of that rule. I used this to find rule name. But I need the drl of this rule with both when and then.

String ruleName = match.getRule().getName();
1

1 Answers

0
votes

No, Drools doesn't provide any capability to do that. You will need to create your own dictionary from your DRLs and fetch the corresponding DRL for when a rule gets fired.