PrevTopNext

Rules for Checking Field Values

  • Validation should be considered part of the "business logic"
  • Use RBS for validation, especially when used for the actual processing stage
  • But the naive approach results in many rules like this one:
    rule "Check Item.code"
    when
        $item: Item( $c: code < 1 || code > 10 )
    then
        System.out.println( "Invalid code " + $c + " in " + $item );
    end
    
  • Too many similar rules...

PrevTopNext