<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=566285914-29012007><FONT face=Arial 
color=#0000ff size=2>Thanks Steve,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=566285914-29012007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=566285914-29012007><FONT face=Arial 
color=#0000ff size=2>That worked a treat; it was a PEBKAC issue 
;-)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=566285914-29012007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=566285914-29012007><FONT face=Arial 
color=#0000ff size=2>The wonders a weekend can work!!</FONT></SPAN></DIV><BR>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org 
  [mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>Steven 
  Williams<BR><B>Sent:</B> 27 January 2007 21:34<BR><B>To:</B> Rules Users 
  List<BR><B>Subject:</B> Re: [rules-users] RE: Why not 
  retracting?<BR></FONT><BR></DIV>
  <DIV></DIV>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="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
    <DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Thanks 
    Jeff - I guess Rules Engines were common New Years resolution (I'm about 2 
    weeks in too) ;-)</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 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 "Two Phase Execution" (Agenda, 
    Section 1.6.5) reassessed which rules needed "firing" (activation?) and 
    hence some of the "Cost - calculate cost for 'Stamping process' on a 
    process" rules (in my example below) would be disposed of. Is the activation 
    not being dropped (perhaps because the "machine == ( m )" condition is still 
    met all be it that the Price to which it relates as been disposed of?). 
    </FONT></SPAN><SPAN><FONT face=Arial color=#0000ff size=2>I thought we were 
    encouraged to write rules that didn'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 face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>I'm not 
    ranting at you Jeff, I'm just confused.</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2>Cheers,</FONT></SPAN></DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
    size=2>Mike</FONT></SPAN></DIV><BR>
    <BLOCKQUOTE style="MARGIN-RIGHT: 0px">
      <DIV lang=en-us dir=ltr align=left>
      <HR>
      <FONT face=Tahoma size=2><B>From:</B> <A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="mailto:rules-users-bounces@lists.jboss.org" 
      target=_blank>rules-users-bounces@lists.jboss.org</A> [mailto:<A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="mailto:rules-users-bounces@lists.jboss.org" 
      target=_blank>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 face=Arial color=#0000ff size=2>Hi 
      Michael.&nbsp; I'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 face=Arial color=#0000ff 
      size=2></FONT></SPAN>&nbsp;</DIV>
      <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 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 "run".&nbsp; This may 
      have something to do with the behavior you are seeing.</FONT></SPAN></DIV>
      <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff 
      size=2></FONT></SPAN>&nbsp;</DIV>
      <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>For 
      more info on what I'm talking about, see&nbsp;section <A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="http://1.6.4.2" target=_blank>1.6.4.2</A> of the user docs.&nbsp; 
      </FONT></SPAN></DIV>
      <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2><A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="http://labs.jboss.com/file-access/default/members/jbossrules/freezone/docs/3.0.5/html/index.html" 
      target=_blank>http://labs.jboss.com/file-access/default/members/jbossrules/freezone/docs/3.0.5/html/index.html</A></FONT></SPAN></DIV>
      <DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
      <DIV><SPAN><FONT face=Arial color=#0000ff 
      size=2>Cheers,</FONT></SPAN></DIV>
      <P><SPAN lang=en-us><FONT face=Arial color=#0000ff 
      size=2>--Jeff</FONT></SPAN> </P>
      <DIV>&nbsp;</DIV><BR>
      <DIV lang=en-us dir=ltr align=left>
      <HR>
      <FONT face=Tahoma size=2><B>From:</B> <A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="mailto:rules-users-bounces@lists.jboss.org" 
      target=_blank>rules-users-bounces@lists.jboss.org</A> [mailto:<A 
      onclick="return top.js.OpenExtLink(window,event,this)" 
      href="mailto:rules-users-bounces@lists.jboss.org" 
      target=_blank>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 face=Arial color=#0000ff 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 face=Arial color=#0000ff size=2>However the problem of the 
      retraction having no obvious affect when operated within the same Agenda 
      Group remains.</FONT> </P>
      <P><FONT face=Arial color=#0000ff 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>'Rules Users List'</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 
        "Prices" that do not have the required "Economic Level" from working 
        memory, the other calculates a "Costs":-</FONT></P>
        <UL>
          <P><FONT face="Courier New" size=2>rule "Cost - remove prices that do 
          not have the required 'Economic Level'"</FONT> <BR><FONT 
          face="Courier New" size=2>agenda-group "stamping-costs"</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("Retracting 
          "+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 "Cost - calculate cost for 
          'Stamping process' on a process"</FONT> <BR><FONT face="Courier New" 
          size=2>agenda-group "stamping-costs"</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 "Cost" rule still 
        works upon ALL "Prices" (even those with an incorrect "Economic 
        Level").</FONT> </P>
        <P><FONT face=Arial size=2>If I change the line in the "Cost" rule to 
        also check the "Economic Level" the rules work as expected (i.e. "Costs" 
        are only calculated using "Prices" with an "Economic Level" of 
        01/01/2007).</FONT></P>
        <P><FONT face=Arial size=2>I've tried using "salience" levels too (as 
        commented in the above Rules) but this doesn'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 
</BLOCKQUOTE></BODY></HTML>