<!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">
It's standard java pass by reference stuff:<br>
String a = "xxx";<br>
String b = a;<br>
System.out.println( b ); // gives "xxx"<br>
a = "yyyy";<br>
System.out.println( b ); // still gives "xxx"<br>
<br>
Mark<br>
<br>
Matthew Shaw wrote:
<blockquote
 cite="mid:48703C6F55B7D546A572FDA807A5FDBCD6968A@BNEEML01.desqld.internal"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta content="MSHTML 6.00.2900.3059" name="GENERATOR">
  <div dir="ltr" align="left"><span class="734231900-30052007"><font
 color="#0000ff" face="Arial" size="2">Why is it seeing it as a new
object? I am asserting it into the working memory before hand.</font></span></div>
  <br>
  <div class="OutlookMessageHeader" dir="ltr" align="left" lang="en-us">
  <hr tabindex="-1"><font face="Tahoma" size="2"><b>From:</b>
<a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Mark
Proctor<br>
  <b>Sent:</b> Wednesday, 30 May 2007 1:27 AM<br>
  <b>To:</b> Rules Users List<br>
  <b>Subject:</b> Re: [rules-users] Double<br>
  </font><br>
  </div>
highDutyTotal is a new fact inside of your consequence, so when you
call modify, it's actually working as an assert - you are not doing a
modify there at all.<br>
  <br>
Mark<br>
Matthew Shaw wrote:
  <blockquote
 cite="mid:48703C6F55B7D546A572FDA807A5FDBCD6957A@BNEEML01.desqld.internal"
 type="cite">
    <meta content="MSHTML 6.00.2900.3059" name="GENERATOR">
    <div><span class="238193603-29052007"><font face="Arial" size="2">Hi
there,</font></span></div>
    <div><span class="238193603-29052007"></span>&nbsp;</div>
    <div><span class="238193603-29052007"><font face="Arial" size="2">seeing
some very strange behaviour from the following rule</font></span></div>
    <div><span class="238193603-29052007"></span>&nbsp;</div>
    <div><span class="238193603-29052007">
    <p align="left"><b><font color="#960000" size="2">rule</font></b><font
 size="2"> </font><font color="#008000" size="2">"sum higher rate
totals"</font></p>
    <p align="left"><b><font color="#960000" size="2">salience</font></b><font
 size="2"> 970</font></p>
    <p align="left"><b><font color="#960000" size="2">no-loop</font></b><font
 size="2"> </font><b><font color="#960000" size="2">true</font></b></p>
    <p align="left"><b><font color="#960000" size="2">when</font></b></p>
    <p align="left"><font size="2">timesheet : TimesheetTransferObject(
)</font></p>
    <p align="left"><font size="2">total :
SheetTotalTransferObject($ihrisType : ihrisType -&gt;
($ihrisType.equals(ihrisType.getDutyHourTotal())), $payRate : payRate
-&gt; ($payRate.equals(timesheet.getOfficer().getSubstantiativeRate())
== </font><b><font color="#960000" size="2">false</font></b><font
 size="2">))</font></p>
    <p align="left"><b><font color="#960000" size="2">eval</font></b><font
 size="2">(total.getValue().doubleValue() &gt; 0)</font></p>
    <p align="left"><font size="2">highDutyTotal : Double( )</font></p>
    <p align="left"><b><font color="#960000" size="2">then</font></b></p>
    <p align="left"><font size="2">highDutyTotal = </font><b><font
 color="#960000" size="2">new</font></b><font size="2">
Double(DateUtils.addElapsedTimes(highDutyTotal.doubleValue(),
total.getValue().doubleValue()));</font></p>
    <p align="left"><span class="238193603-29052007"><font size="2">modify(highDutyTotal)</font></span></p>
    <font color="#960000">
    <p><font size="2"><strong>end</strong></font></p>
    <p><span class="238193603-29052007"><font color="#000000"
 face="Arial" size="2">In my test the rule fires twice when I don't
call modify. Which is the expected behaviour because I have two unqiue <font
 face="Times New Roman">SheetTotalTransferObject objects.</font></font></span></p>
    <p><span class="238193603-29052007"><font color="#000000" size="2">However
when I call modify on the Double object the rule only runs once. This
is incorrect behaviour.</font></span></p>
    <p><span class="238193603-29052007"></span>&nbsp;</p>
    <p><span class="238193603-29052007"><font color="#000000" size="2">Can
anyone offer any clues as to what may be happening here. Is it to do
with my use of the Double type?</font></span></p>
    </font></span></div>
    <table>
      <tbody>
        <tr>
          <td bgcolor="#ffffff"><font color="#000000">This
correspondence is for the named persons only. <br>
It may contain confidential or privileged information or both. <br>
No confidentiality or privilege is waived or lost by any mis
transmission. <br>
If you receive this correspondence in error please delete it from your
system immediately and notify the sender. <br>
You must not disclose, copy or relay on any part of this
correspondence, if you are not the intended recipient. <br>
Any opinions expressed in this message are those of the individual
sender except where the sender expressly, <br>
and with the authority, states them to be the opinions of the
Department of Emergency Services, Queensland.<br>
          </font></td>
        </tr>
      </tbody>
    </table>
    <pre wrap=""><hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true" 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>
  <table>
    <tbody>
      <tr>
        <td bgcolor="#ffffff"><font color="#000000">This correspondence
is for the named persons only. <br>
It may contain confidential or privileged information or both. <br>
No confidentiality or privilege is waived or lost by any mis
transmission. <br>
If you receive this correspondence in error please delete it from your
system immediately and notify the sender. <br>
You must not disclose, copy or relay on any part of this
correspondence, if you are not the intended recipient. <br>
Any opinions expressed in this message are those of the individual
sender except where the sender expressly, <br>
and with the authority, states them to be the opinions of the
Department of Emergency Services, Queensland.<br>
        </font></td>
      </tr>
    </tbody>
  </table>
  <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>