<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
it's not just enough to update the field,. you must also call update(
object ).<br>
update($dayInWeek)<br>
<br>
Mark<br>
<br>
Martin Book wrote:
<blockquote cite="mid:001001c7d851$97958e60$884f06d4@free" type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<div class="Section1">
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">Hello,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;" lang="EN-GB">i am a
newbie at JBoss Rules and have a problem with
a ruleset. Here are my rules:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p> </o:p></span></font></p>
<p class="MsoNormal" style=""><b><font color="#960000"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: rgb(150, 0, 0); font-weight: bold;"
lang="EN-GB">rule</span></font></b><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> </span></font><font color="green" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB">"1.CallsPerDay"
</span></font><font color="green" face="Wingdings" size="2"><span
style="font-size: 10pt; font-family: Wingdings; color: green;"
lang="EN-GB">à</span></font><font color="green" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB"> Modifies the “</span></font><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">CallsPerDayOfWeek” objects.</span></font><font
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> </span></font><b><font color="#960000"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: rgb(150, 0, 0); font-weight: bold;"
lang="EN-GB">salience</span></font></b><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> 35 </span></font><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> </span></font><b><font color="#960000"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: rgb(150, 0, 0); font-weight: bold;"
lang="EN-GB">when</span></font></b><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">
$dayObj: CallsPerDay( $day: dayOfWeekS != </span></font><b><font
color="#960000" face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: rgb(150, 0, 0); font-weight: bold;"
lang="EN-GB">null</span></font></b><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">, $calls:calls > 0 )</span></font><font
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">
$dayInWeek: CallsPerDayOfWeek( day == $day )</span></font><font
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> </span></font><b><font color="#960000"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: rgb(150, 0, 0); font-weight: bold;"
lang="EN-GB">then</span></font></b><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">
$dayInWeek.addCalls($calls); </span></font><font color="black"
face="Wingdings" size="2"><span
style="font-size: 10pt; font-family: Wingdings; color: black;"
lang="EN-GB">à</span></font><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> Changes call variable.</span></font><font
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">
System.out.println(</span></font><font color="green" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB">"Drools:
"</span></font><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">+$dayObj.getInfo()+</span></font><font color="green"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB">" / "</span></font><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">+$dayInWeek.getCalls());</span></font><font
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> </span></font><b><font color="#960000"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: rgb(150, 0, 0); font-weight: bold;"
lang="EN-GB">End<o:p></o:p></span></font></b></p>
<p class="MsoNormal" style=""><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p> </o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">//Output: Drools: On Mo 02/19/2007 12:00:00 AM 97 calls
came in. /
104</span></font><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> </span></font><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><b><font color="#960000"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: rgb(150, 0, 0); font-weight: bold;"
lang="EN-GB">rule</span></font></b><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> </span></font><font color="green" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB">"2.ProcessAgents"
-> Should only process on changed “</span></font><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">CallsPerDayOfWeek” objects (calls
must be 104 but seem to be still 0)</span></font><font color="green"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="green" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB"> </span></font><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">
</span></font><b><font color="#960000" face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: rgb(150, 0, 0); font-weight: bold;"
lang="EN-GB">salience</span></font></b><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> 35</span></font><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> </span></font><b><font color="#960000"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: rgb(150, 0, 0); font-weight: bold;"
lang="EN-GB">when</span></font></b><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">
$dayInWeek:CallsPerDayOfWeek ($callsTMP: calls==0, sum == 0)</span></font><font
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"> </span></font><b><font color="#960000"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: rgb(150, 0, 0); font-weight: bold;"
lang="EN-GB">then</span></font></b><font face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">
System.out.println(</span></font><font color="green" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB">"Sum
= "</span></font><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">+$dayInWeek.getSum()+</span></font><font color="green"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB">" for "</span></font><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">+$dayInWeek.getDay()+</span></font><font color="green"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB">" CallTMP: "</span></font><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">+$callsTMP+</span></font><font color="green"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB">" /CallReally: "</span></font><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">+$dayInWeek.getCalls());</span></font><font
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New";" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="black" face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">
</span></font><b><font color="#960000" face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: rgb(150, 0, 0); font-weight: bold;"
lang="EN-GB">end</span></font></b><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p> </o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">//Output= Sum = 2 for Mo CallTMP: 0 /CallReally: 104<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"><o:p> </o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">Why is the “calls” variable still 0 at the beginning
of rule </span></font><font color="green" face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB">"2.ProcessAgents"</span></font><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">, although it was modified by the rule </span></font><font
color="green" face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: green;"
lang="EN-GB">"1.CallsPerDay"</span></font><font color="black"
face="Courier New" size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">?<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"><o:p> </o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">with kind regards<o:p></o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB"><o:p> </o:p></span></font></p>
<p class="MsoNormal" style=""><font color="black" face="Courier New"
size="2"><span
style="font-size: 10pt; font-family: "Courier New"; color: black;"
lang="EN-GB">Martin<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p> </o:p></span></font></p>
</div>
<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>