Bagwell, Allen F wrote:
I'm writing rules in different agenda groups and witnessing something
curious.
Right now when I put my fireAllRules() in a callback that is triggered
every couple of seconds I have to do this:
Callback executes on receipt of a heartbeat message:
{
session.setFocus("my_agenda");
session.fireAllRules();
}
What I would prefer to do is this is set my agenda group external to
the callback so I have the liberty to simply use the callback to
execute rules on whatever agenda I give focus to elsewhere:
Callback executes on receipt of a heartbeat message:
{
session.fireAllRules();
}
But this doesn't work.
My understanding is that unless you explicitly set the agenda-group
each time, then fireAllRules() resets your agenda group to "MAIN"?
No not
quite. It's a stack. when you setFocus, you are assigning that
group to the top of the stack. when you call fireAllRules() it iterates
through that stack, firing all the rules in the top one, popping it,
firing all the rules in the next group until it reaches MAIN (which is
always at the bottom of the stack) and returns when that is empty.
Is there a way to get the session to retain focus on the agenda group
I specify until I see fit to change it?
Allen F. Bagwell
e-mail: afbagwe(a)sandia.gov
phone: 505/284-4517
fax: 505/ 844-7886
There is no monument dedicated to the memory of a committee. -- Lester
J. Pourciau
------------------------------------------------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users