[rules-users] Compiled rules differ KnowledgeAgent vs ResourceChangeScanner

lhorton LHorton at ABCLegal.com
Tue Jul 24 18:30:40 EDT 2012


I have found a solution for this problem, but I don't know why the solution
works.  I went through the decision table and modified or deleted each
condition column until I isolated the problem condition.  It's a long story,
but the short version is that the condition did a string comparison using
the == operator, like this:

     job.legalActionType == "$param"

the field legalActionType is defined as a String.  When I changed this
condition to compare using equals():

    job.legalActionType.equals("$param")

the problem went away, i.e. the rules fired normally whether loaded by
spring or by resource scanner.

In a nice twist, a few days after fixing this spreadsheet, one of our
business analyst rules writers came to me asking for help troubleshooting a
change he'd made to some rules.  He added some string comparisons but the
rules were not firing as expected.  I had him change the == comparisons to
equals(), and the rules fired normally.

I took this new file and stripped it down to a minimal drl file (3 rules)
and can repro this behavior in a unit test.  I found some other ways to
"fix" the rule, by adding conditions and by removing unused rules. I'm
working on building a set of files that I can load up in a bug report, but
in the meantime if anyone is interested, I'm attaching a short write-up of
the problem and the rule-based solutions.

Again if anyone has suggestions of other things I could look at to help
debug the problem, do let me know.  thanks also to Mark and Wolfgang for
earlier testing & debugging help.


http://drools.46999.n3.nabble.com/file/n4018884/equalsTesting.txt
equalsTesting.txt 




--
View this message in context: http://drools.46999.n3.nabble.com/Compiled-rules-differ-KnowledgeAgent-vs-ResourceChangeScanner-tp4018608p4018884.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list