[rules-users] WG: Second Rule does not recognize changes from first rule?

Martin Book m.book at web.de
Mon Aug 6 13:45:34 EDT 2007


Hello,

 

i am a newbie at JBoss Rules and have a problem with a ruleset. Here are my
rules:

 

rule "1.CallsPerDay"  --> Modifies the "CallsPerDayOfWeek" objects.

      salience 35 

      when

            $dayObj: CallsPerDay( $day: dayOfWeekS != null, $calls:calls > 0
)

            $dayInWeek: CallsPerDayOfWeek( day == $day )

      then

            $dayInWeek.addCalls($calls);       --> Changes call variable.

            System.out.println("Drools: "+$dayObj.getInfo()+" /
"+$dayInWeek.getCalls());

      End

 

//Output: Drools: On Mo 02/19/2007 12:00:00 AM 97 calls came in. / 104

      

rule "2.ProcessAgents" -> Should only process on changed "CallsPerDayOfWeek"
objects (calls must be 104 but seem to be still 0)

      salience 35

      when

            $dayInWeek:CallsPerDayOfWeek ($callsTMP: calls==0, sum == 0)

      then

            System.out.println("Sum = "+$dayInWeek.getSum()+" for
"+$dayInWeek.getDay()+" CallTMP: "+$callsTMP+" /CallReally:
"+$dayInWeek.getCalls());

      end

 

//Output= Sum = 2 for Mo CallTMP: 0 /CallReally: 104

 

Why is the "calls" variable still 0 at the beginning of rule
"2.ProcessAgents", although it was modified by the rule "1.CallsPerDay"?

 

with kind regards

 

Martin

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070806/7a105aa1/attachment.html 


More information about the rules-users mailing list