[rules-users] Double

Mark Proctor mproctor at codehaus.org
Tue May 29 11:26:34 EDT 2007


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.

Mark
Matthew Shaw wrote:
> Hi there,
>  
> seeing some very strange behaviour from the following rule
>  
> * *
>
> *rule* "sum higher rate totals"
>
> *salience* 970
>
> *no-loop* *true*
>
> *when*
>
> timesheet : TimesheetTransferObject( )
>
> total : SheetTotalTransferObject($ihrisType : ihrisType -> 
> ($ihrisType.equals(ihrisType.getDutyHourTotal())), $payRate : payRate 
> -> ($payRate.equals(timesheet.getOfficer().getSubstantiativeRate()) == 
> *false*))
>
> *eval*(total.getValue().doubleValue() > 0)
>
> highDutyTotal : Double( )
>
> *then*
>
> highDutyTotal = *new* 
> Double(DateUtils.addElapsedTimes(highDutyTotal.doubleValue(), 
> total.getValue().doubleValue()));
>
> modify(highDutyTotal)
>
> *end*
>
> In my test the rule fires twice when I don't call modify. Which is the 
> expected behaviour because I have two unqiue SheetTotalTransferObject 
> objects.
>
> However when I call modify on the Double object the rule only runs 
> once. This is incorrect behaviour.
>
>  
>
> Can anyone offer any clues as to what may be happening here. Is it to 
> do with my use of the Double type?
>
> This correspondence is for the named persons only.
> It may contain confidential or privileged information or both.
> No confidentiality or privilege is waived or lost by any mis 
> transmission.
> If you receive this correspondence in error please delete it from your 
> system immediately and notify the sender.
> You must not disclose, copy or relay on any part of this 
> correspondence, if you are not the intended recipient.
> Any opinions expressed in this message are those of the individual 
> sender except where the sender expressly,
> and with the authority, states them to be the opinions of the 
> Department of Emergency Services, Queensland.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070529/240af56d/attachment.html 


More information about the rules-users mailing list