[rules-dev] boolean DRL function causes crashes in 5.[45].0

Wolfgang Laun wolfgang.laun at gmail.com
Tue Dec 17 02:09:26 EST 2013


This self-contained .drl runs fine with 5.3.0, crashes (with two
different exceptions) in 5.[45].0, and is back to OK with 6.0.0.

package decl

declare Cont
  answer : String
end

function boolean isValid( String s ){
    try {
        Double.valueOf( s );
        return true;
    } catch( NumberFormatException nfe ){
        return false;
    }
}

rule isString
when
    $s: Cont( $a: answer, isValid( answer ) )
then
    System.out.println( "isString: " + $a );
end

rule isX
when
then
    insert( new Cont( "123.456" ) );
end


More information about the rules-dev mailing list