Details
-
Bug
-
Resolution: Done
-
Minor
-
4.0.0.MR3
-
None
-
None
Description
if you change the FibonacciExample like this:
(...)
import java.lang.Math;
function boolean approxEqual(double val1, double val2) {
return (Math.abs(val1-val2)<0.01);
}
(....)
rule Calculate
when
f1 : Fibonacci( s1 : sequence, value != -1 )
f2 : Fibonacci( s2 : sequence -> (approxEqual(sequence,(s1 + 1))), value != -1 )
f3 : Fibonacci( sequence == (s2 + 1 ), value == -1 )
then
f3.setValue( f1.getValue() + f2.getValue() );
update( f3 );
retract( f1 );
System.out.println( f3.getSequence() + " == " + f3.getValue() );
end
thus introducing a function inside a predicate value constraint, the example works well, however a NullPointerException is printed out during the call of the addPackageFromDrl method.
I tried in many examples, also calling directly the java.lang.Math.abs function, and the message is always printed with no apparent side effect.