Equality condition between BigDecimal property and numeric value does not work correctly in non executable model.
Issue
In non executable model, equality condition between BigDecimal property and numeric value does not work correctly when there are 3 or more different conditions for the same property.
For example, when we insert an object which has BigDecimal("10") as value property like (*2) for rules like (*1),
(*1) Example rules
rule "Rule 1"
when
$fact : Fact( value == 10 )
then
System.out.println("***** Action of " + kcontext.getRule().getName() + ": $fact = " + $fact);
end
rule "Rule 2"
when
$fact : Fact( value == 20 )
then
System.out.println("***** Action of " + kcontext.getRule().getName() + ": $fact = " + $fact);
end
rule "Rule 3"
when
$fact : Fact( value == 30 )
then
System.out.println("***** Action of " + kcontext.getRule().getName() + ": $fact = " + $fact);
end
(*2) Java code
:
:
Fact fact = new Fact();
fact.setValue(new BigDecimal("10"));
kSession.insert(fact);
System.out.println("***** start");
kSession.fireAllRules();
System.out.println("***** end");
:
:
Rule 1 does not match in non executable model.
(*3)
$ mvn clean compile exec:exec -DgenerateModel=NO
:
:
***** start
***** end <---------- Rule 1 does not match
:
:
Environment
- Red Hat Decision Manager (RHDM)
- 7.5.0 - 7.13.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.