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:
- Syntaxpublic 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
- ctxInput parameterSpecifies an object that contains methods for retrieving information in the current task session.
- attrValueInput parameterSpecifies the value of the attribute being validated.
- updatedValueOutput parameterProvides an optional transformation value that replaces the user-supplied value being validated. When no transformation is necessary, pass back null.
- errorMessageOutput ParameterIf validation fails, it displays a message to the user.
- CommentsFor more information about Java validation rules and on managed objects, see the Javadoc.
- Returns
- True -- the implementation considers the value inattributeValueto be valid, or it passes back a transformed value inchangedValue.
- False -- the implementation considersattributeValueto be invalid.
- ThrowsAttributeValidationException