Niteshkumar152 opened a new issue, #6238:
URL: https://github.com/apache/incubator-kie-drools/issues/6238
I am using drools version 8.44.0.Final.
I have observed that the when conditions of other rules with different
agenda group are getting evaluated even though the focus is not set on them.
Below is the logic that I am using to apply a Rule on incoming requestFact,
can you please suggest what is the thing that is being done incorrectly so that
only the rule belonging to a specific agenda group gets executed.
```
public boolean applyRule(RequestFact requestFact, String agendaGroup) {
var kieSession = atomicKieContainer.get().newKieSession();
try {
kieSession.insert(requestFact);
if (isNotEmpty(agendaGroup) &&
isNotNull(kieSession.getAgenda().getAgendaGroup(agendaGroup))) {
kieSession.getAgenda().getAgendaGroup(agendaGroup).setFocus();
}
kieSession.fireAllRules();
} catch (Exception e) {
System.out.println("Drools Execution Failed");
System.out.println(e.getMessage())
} finally {
kieSession.destroy();
}
return true;
}
```
Thanks in advance!!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]