Implement Validation Rules Using the Java Interface for Task-Level Validation

The definition of the Java interface for task-level validation is as follows:
cim1265
The definition of the Java interface for task-level validation is as follows:
  • Syntax
    public interface TaskValidator { public class StringRef {    public String reference = new String();    public String toString(){return reference;} public boolean validate(    BLTHContext ctx,    String attrValue,    StringRef updatedValue,    StringRef errorMessage    ) throws AttributeValidationException; }
  • Parameters
    • ctx
      Input parameter
      Specifies an object that contains methods for retrieving information in the current task session.
    • attrValue
      Input parameter
      Specifies the value of the attribute being validated.
    • updatedValue
      Output parameter
      Provides an optional transformation value that replaces the user-supplied value being validated. When no transformation is necessary, pass back null.
    • errorMessage
      Output Parameter
      If validation fails, it displays a message to the user.
  • Comments
    For more information about Java validation rules and on managed objects, see the 
    Javadoc.
  • Returns
    • True -- the implementation considers the value in
      attributeValue
      to be valid, or it passes back a transformed value in
      changedValue
      .
    • False -- the implementation considers
      attributeValue
      to be invalid.
  • Throws
    AttributeValidationException