Hi Mike,<br><br>I suggest using the Audit view in eclipse (documented in the help) which will allow you to see what rules are being added to and removed from the agenda.<br><br>cheers<br>Steve<br><br><div><span class="gmail_quote">
On 1/27/07, <b class="gmail_sendername">Anstis, Michael (M.)</b> &lt;<a href="mailto:manstis1@ford.com">manstis1@ford.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Thanks Jeff - I guess Rules Engines were common New Years 
resolution (I&#39;m about 2 weeks in too) ;-)</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">I understood that the LHS side was operated upon when Facts 
were asserted which, I think,&nbsp;creates the RHS Activation in the Agenda. 
However I also thought that if the RHS modified Facts in the Working Memory (by 
retracting, asserting or modifying them) the &quot;Two Phase Execution&quot; (Agenda, 
Section 1.6.5) reassessed which rules needed &quot;firing&quot; (activation?) and hence 
some of the &quot;Cost - calculate cost for &#39;Stamping process&#39; on a process&quot; rules 
(in my example below) would be disposed of. Is the activation not being dropped 
(perhaps because the &quot;machine == ( m )&quot; condition is still met all be it that 
the Price to which it relates as been disposed of?). </font></span><span><font color="#0000ff" face="Arial" size="2">I thought we were 
encouraged to write rules that didn&#39;t need to be ran in any particular order 
whereas I now find myself having to run some before others?</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">I&#39;m not ranting at you Jeff, I&#39;m just 
confused.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Cheers,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Mike</font></span></div><br>
<blockquote style="margin-right: 0px;">
  <div dir="ltr" align="left" lang="en-us">
  <hr>
  <font face="Tahoma" size="2"><b>From:</b> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users-bounces@lists.jboss.org</a> 
  [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Grimshaw, 
  Jeffrey<br><b>Sent:</b> 26 January 2007 16:34<br><b>To:</b> Rules Users 
  List<br><b>Subject:</b> RE: [rules-users] RE: Why not 
  retracting?<br></font><br></div><div><span class="e" id="q_1105f5d80b9e5274_1">
  <div></div>
  <div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Hi Michael.&nbsp; I&#39;ve only been using JBoss Rules for 
  about 2 weeks, so keep that in mind when reading my reply.&nbsp; 
  </font></span></div>
  <div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
  <div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">The way I understand it works is that facts are evaluated 
  against&nbsp;the LHS of all the rules in the&nbsp;ruleset as they are 
  asserted.&nbsp; That is, when a fact is added to the WorkingMemory, the engine 
  determines which rules&nbsp;apply to that&nbsp;fact.&nbsp;&nbsp;You may expect 
  that evaluation to take place when&nbsp;the rules are &quot;run&quot;.&nbsp; This may 
  have something to do with the behavior you are seeing.</font></span></div>
  <div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span>&nbsp;</div>
  <div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">For more info on what I&#39;m talking about, see&nbsp;section 
  <a href="http://1.6.4.2" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">1.6.4.2</a> of the user docs.&nbsp; </font></span></div>
  <div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"><a href="http://labs.jboss.com/file-access/default/members/jbossrules/freezone/docs/3.0.5/html/index.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://labs.jboss.com/file-access/default/members/jbossrules/freezone/docs/3.0.5/html/index.html</a></font></span></div>
  <div><font color="#0000ff" face="Arial" size="2"></font>&nbsp;</div>
  <div><span><font color="#0000ff" face="Arial" size="2">Cheers,</font></span></div>
  <p><span lang="en-us"><font color="#0000ff" face="Arial" size="2">--Jeff</font></span> 
  </p>
  <div>&nbsp;</div><br>
  <div dir="ltr" align="left" lang="en-us">
  <hr>
  <font face="Tahoma" size="2"><b>From:</b> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users-bounces@lists.jboss.org</a> 
  [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Anstis, 
  Michael (M.)<br><b>Sent:</b> Friday, January 26, 2007 8:08 AM<br><b>To:</b> 
  Rules Users List<br><b>Subject:</b> [rules-users] RE: Why not 
  retracting?<br></font><br></div>
  <div></div>
  <p><font color="#0000ff" face="Arial" size="2">By way of an update; if the 
  retraction is made within a different Agenda Group the rules work as 
  expected.</font> </p>
  <p><font color="#0000ff" face="Arial" size="2">However the problem of the retraction 
  having no obvious affect when operated within the same Agenda Group 
  remains.</font> </p>
  <p><font color="#0000ff" face="Arial" size="2">Is this a bug?</font> </p>
  <ul>
    <p><font face="Tahoma" size="1">_____________________________________________ 
    </font><br><b><font face="Tahoma" size="1">From: &nbsp;</font></b> <font face="Tahoma" size="1">Anstis, Michael (M.)&nbsp; </font><br><b><font face="Tahoma" size="1">Sent:&nbsp;&nbsp;</font></b> <font face="Tahoma" size="1">26 
    January 2007 11:32</font> <br><b><font face="Tahoma" size="1">To:&nbsp;&nbsp;&nbsp;&nbsp;</font></b> <font face="Tahoma" size="1">&#39;Rules Users List&#39;</font> <br><b><font face="Tahoma" size="1">Subject:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b> <font face="Tahoma" size="1">
Why not retracting?</font> </p>
    <p><font face="Arial" size="2">Hello,</font> </p>
    <p><font face="Arial" size="2">I have the following rules; one removes &quot;Prices&quot; 
    that do not have the required &quot;Economic Level&quot; from working memory, the 
    other calculates a &quot;Costs&quot;:-</font></p>
    <ul>
      <p><font face="Courier New" size="2">rule &quot;Cost - remove prices that do not 
      have the required &#39;Economic Level&#39;&quot;</font> <br><font face="Courier New" size="2">agenda-group &quot;stamping-costs&quot;</font> <br><font face="Courier New" size="2">//</font><font face="Courier New" size="2">
salience 1</font> 
      <br><font face="Courier New" size="2">when</font> 
      <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">p : Price ( economicLevel != ( Utilities.makeDate(1, 1, 2007) ) 
      )</font> <br><font face="Courier New" size="2">then</font> 
      <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">System.out.println(&quot;Retracting &quot;+p.toString());</font> 
      <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">retract(p);</font> <br><font face="Courier New" size="2">end</font> 
      </p>
      <p><font face="Courier New" size="2">rule &quot;Cost - calculate cost for 
      &#39;Stamping process&#39; on a process&quot;</font> <br><font face="Courier New" size="2">agenda-group &quot;stamping-costs&quot;</font> <br><font face="Courier New" size="2">//</font><font face="Courier New" size="2">
salience</font> <font face="Courier New" size="2">2</font> <br><font face="Courier New" size="2">when</font> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">r : ResourceEntry ( m : machine )</font> 
      <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">//</font><font face="Courier New" size="2">p : Price ( economicLevel 
      == ( Utilities.makeDate(1, 1, 2007) ), machine == ( m ) )</font> 
      <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">p : Price ( machine == ( m ) )</font> <br><font face="Courier New" size="2">then</font> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">Cost cost = new Cost(r, p);</font>
 
      <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">cost.setCost((float) (r.getUsage() * p.getRate()));</font> 
      <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Courier New" size="2">assert(cost);</font> <br><font face="Courier New" size="2">end</font> 
      </p></ul>
    <p><font face="Arial" size="2">The problem is that the &quot;Cost&quot; rule still works 
    upon ALL &quot;Prices&quot; (even those with an incorrect &quot;Economic Level&quot;).</font> 
    </p>
    <p><font face="Arial" size="2">If I change the line in the &quot;Cost&quot; rule to also 
    check the &quot;Economic Level&quot; the rules work as expected (i.e. &quot;Costs&quot; are only 
    calculated using &quot;Prices&quot; with an &quot;Economic Level&quot; of 
01/01/2007).</font></p>
    <p><font face="Arial" size="2">I&#39;ve tried using &quot;salience&quot; levels too (as 
    commented in the above Rules) but this doesn&#39;t have any effect 
    either.</font> </p>
    <p><font face="Arial" size="2">What am I doing wrong?</font> </p>
    <p><font face="Arial" size="2">Cheers,</font> </p>
    <p><font face="Arial" size="2">Mike</font> </p></ul></span></div></blockquote></div>

<br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Steven Williams<br><br>Supervising Consultant<br><br>Object Consulting<br>Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
<br><a href="mailto:stevenw@objectconsulting.com.au">stevenw@objectconsulting.com.au</a><br><a href="http://www.objectconsulting.com.au">www.objectconsulting.com.au</a><br><br>consulting | development | training | support
<br>our experience makes the difference