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
_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Reply via email to