Wolfgang -
Thanks for your reply. As I said in the original subject line -- bizarre
bug or user error?
Well, it turns out to have been user error -- There was another rule in
the rulebase that was altering values on the PolicySet objects, but
failing to update() them. This caused the Rule Engine to evaluate using
old matches and produced wrong results.
If you did file a JIRA, you can probably cancel it.
-- <red faced> --
Sorry for the confusion.
Date: Tue, 7 Apr 2009 08:59:46 +0200
From: Wolfgang Laun <wolfgang.laun(a)gmail.com>
Subject: Re: [rules-users] Bizarre bug or user error:
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<17de7ee80904062359w449a42e3y71d218634dc76b6e(a)mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Hi,
On 4/7/09, Tom.E.Murphy(a)wellsfargo.com <Tom.E.Murphy(a)wellsfargo.com>
wrote:
I have the following rule, which is executing in the midst of a
complex
data set and a couple hundred other rules:
rule "RS6492.1.2"
when
TransactionSummary
(
$LTVRatioPrcnt : LTVRatioPrcnt
)
PolicySet
(
$maxLTVRatioPrcnt : maxLTVRatioPrcnt,
maxLTVRatioPrcnt < $LTVRatioPrcnt
)
This is better written as a single field restriction with binding, all
in one:
PolicySet( $maxLTVRatioPrcnt : maxLTVRatioPrcnt < $LTVRatioPrcnt )
Nevertheless, you are right: This should either succeed (firing only
once) even when written separately or be flagged as an error. I'll
file a JIRA.
-W
then
System.out.println("RS6492.1.2 fired. $maxLTVRatioPrcnt
= " + $maxLTVRatioPrcnt + ", $LTVRatioPrcnt = " + $LTVRatioPrcnt);
// actual actions removed ...
end
In the dataset, there are two PolicySets with maxLTVRatioPrcnt values
of
95.0 and 80.0 respectively. The LTVRatioPrcnt in the
TransactionSummary
is 85.0.
When my rules run, The above rule should fire only once, for the
PolicySet with 80.0 as its maxLTVRatioPrcnt. However, it fires twice -
once for each PolicySet - with the following outputs:
RS6492.1.2 fired. $maxLTVRatioPrcnt = 95.0, $LTVRatioPrcnt = 85.0
RS6492.1.2 fired. $maxLTVRatioPrcnt = 80.0, $LTVRatioPrcnt = 85.0
How is this possible? Why is the comparison of maxLTVRatioPercnt <
$LTVRatioPrcnt succeeding in both cases, causing the rule to fire on
both PolicySets?
I'm running Drools 5.0.0 with jars dated 15 Jan 09.
Thanks in advance...
Tom Murphy
Wells Fargo HCFG - CORE Deal Decisioning Platform
This message may contain confidential and/or privileged information.
If
you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on
this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.