<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Bagwell, Allen F wrote:
<blockquote
cite="mid:095F63C9851E5B42ABFB0506D5EA55700F84561399@ES02SNLNT.srn.sandia.gov"
type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style>.EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; }</style><font
face="Arial, sans-serif" size="3">
<div> </div>
<div><font size="2">I'm writing rules in different agenda groups and
witnessing something curious.</font></div>
<div><font size="2"> </font></div>
<div><font size="2">Right now when I put my fireAllRules() in a
callback that is triggered every couple of seconds I have to do this:</font></div>
<div><font size="2"> </font></div>
<div><font face="Courier New, monospace" size="2">Callback executes
on receipt of a heartbeat message:</font></div>
<div><font face="Courier New, monospace" size="2">{</font></div>
<div><font face="Courier New, monospace" size="2">
session.setFocus("my_agenda");</font></div>
<div><font face="Courier New, monospace" size="2">
session.fireAllRules();</font></div>
<div><font face="Courier New, monospace" size="2">}</font></div>
<div><font face="Courier New, monospace" size="2"> </font></div>
<div><font size="2">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:</font></div>
<div><font size="2"> </font></div>
<div><font face="Courier New, monospace" size="2">Callback executes
on receipt of a heartbeat message:</font></div>
<div><font face="Courier New, monospace" size="2">{</font></div>
<div><font face="Courier New, monospace" size="2">
session.fireAllRules();</font></div>
<div><font face="Courier New, monospace" size="2">}</font></div>
<div><font face="Courier New, monospace" size="2"> </font></div>
<div><font size="2">But this doesn't work.</font></div>
<div><font size="2"> </font></div>
<div><font size="2">My understanding is that unless you explicitly
set the agenda-group each time, then fireAllRules() resets your agenda
group to "MAIN"?</font></div>
</font></blockquote>
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.<br>
<blockquote
cite="mid:095F63C9851E5B42ABFB0506D5EA55700F84561399@ES02SNLNT.srn.sandia.gov"
type="cite"><font face="Arial, sans-serif" size="3">
<div><font size="2"> </font></div>
<div><font size="2">Is there a way to get the session to retain focus
on the agenda group I specify until I see fit to change it?</font></div>
<div><font size="2"> </font></div>
<div><font color="#008080" face="Tahoma, sans-serif" size="2">Allen
F. Bagwell</font></div>
<div><font color="#008080" face="Tahoma, sans-serif" size="1">e-mail:
<a class="moz-txt-link-abbreviated" href="mailto:afbagwe@sandia.gov">afbagwe@sandia.gov</a></font></div>
<div><font color="#008080" face="Tahoma, sans-serif" size="1">phone:
505/284-4517</font></div>
<div><font color="#008080" face="Tahoma, sans-serif" size="1">fax:
505/ 844-7886</font></div>
<div><font color="#008080" face="Tahoma, sans-serif" size="1"> </font></div>
<div style="margin-top: 5pt; margin-bottom: 5pt;"><font
color="#008080" face="Tahoma, sans-serif" size="1">There is no
monument dedicated to the memory of a committee. -- Lester J. Pourciau</font></div>
<div><font face="Tahoma, sans-serif" size="1"> </font></div>
<div><font face="Tahoma, sans-serif" size="1"> </font></div>
<div><font size="2"> </font></div>
</font>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</body>
</html>