agenda-group not evaluating the rule

25 views
Skip to first unread message

Meghana Chejarla

unread,
Mar 13, 2023, 6:14:18 AM3/13/23
to Drools Usage
Hi, I'm using stateful session, and setting focus to a particular agenda group in this way: 

kieContainerSessionsPool contains a list of 60 sessions
KieSession session = kieContainerSessionsPool.newKieSession();
session.getAgenda().getAgendaGroup("endPoint1).setFocus();
session.insert(fact);
session.fireAllRules();
session.dispose();


drl:

rule "1"
agenda-group "endPoint1"

when
f : Fact ( map.get("fileName") == "abc.11032023.xml", 
map.get("documentType") == "Invoice" )

then
Action action1 = new Action();
action1.setValue("WorkflowId1");
List actions = new ArrayList();
actions.add(action1);
f.setActions(actions);
end



Rule is not matching even though the fact has the same values. I've populated few AgendaEventListeners in the code:

AgendaGroupPushedEvent endpoint1
Rule matches: 1
agendaGroupPopped: endpoint1

====
If I set auto-focus to true in the rule, it is working.

Can anyone please help me with this???

Matteo Mortari

unread,
Mar 13, 2023, 1:47:41 PM3/13/23
to drools...@googlegroups.com
Hi Meghana,
cannot reproduce based on the information you provided.

See https://github.com/tarilabs/drools-usage-YJ9duwVkMzY/blob/3f87c4bde40b3eac63f74211bda2e493cab53db4/src/test/java/org/drools/demo/RuleTest.java#L40-L50
This passes the assertion, which is what you would expect, as the rule matches the fact with the same value and therefore populating Fact.actions list of actions.

If you can share an alternative or modified reproducer, highlighting the alleged issue you described, we could take another look.

But based on the sole information provided, not a bug cannot reproduce per above link.

Hope this helps

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/2a9877e9-c822-445e-aea9-c5ea2900a6f0n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages