[rules-users] Chart notation, update, and infinite loops

Earnest Dyke earniedyke at yahoo.com
Tue Nov 4 13:33:16 EST 2008


Dan,

Why would you have more than one Charge when you are not qualifying it? Are they all the same? Do you not care which one matches?

Earnie!



________________________________
From: Dan Seaver <dan.seaver at ge.com>
To: rules-users at lists.jboss.org
Sent: Tuesday, November 4, 2008 12:50:09 PM
Subject: [rules-users] Chart notation, update, and infinite loops


I'm trying to find a good technique for updating specific facts in working
memory. What I'm currently doing is something like this:

Rule "Update Amount"
   when
      amountFact : Fact(name == "Amount")
      charge : Charge()
   then
      Double amount = amountFact.getAmount();
      Double chargeAmount = charge.getAmount();
      amountFact.setAmount(amount + chargeAmount);
      update(amountFact);
end

The update statement causes an infinite loop.
I tried using no-loop, which works if there is 1 charge, but not if there
are more than one.

Any help with solutions or strategies would be much appreciated.
-- 
View this message in context: http://www.nabble.com/Chart-notation%2C-update%2C-and-infinite-loops-tp20327483p20327483.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
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/20081104/6b5687e5/attachment.html 


More information about the rules-users mailing list