Validation Using a Java Class Customization

While saving a record, the application performs the following standard validations:

  • PRODUCTID must be specified.
  • PRODUCTID and PRODUCTIDEXT must be unique within a repository.
  • For Boolean type attribute, value must be either TRUE or FALSE.

If you need to extend the validations and cleansing rules defined using a rulebase, you could consider using a validator class. The use of this class is considered advanced customization and should be approached only if customization cannot be done using rulebase and rulebase custom functions.

The standard validation applied on the records can be customized across all the repositories or for a specific repository by placing the class in the appropriate directory.

The application looks for a CatalogProductValidator class in the following order:

  • $MQ_COMMON_DIR/<enterpriseInternalName>/catalog/master/<id> directory specific to a repository. If a class is found, it is used for validation of the specified repository.
  • If it is not found, the application checks whether any class has been defined for all repositories.

    $MQ_COMMON_DIR/<enterpriseInternalName>/catalog/master

  • If no custom class is found, the standard record validations provided out-of-box are applied.