This validates a field against a set of valid values for that field, as listed in a database table
For eg. Lets assume that there is database table 'VALID_FIELD_VALUE' which holds a set of valid values for certain fields in the system.
The structure of this table 'VALID_FIELD_VALUE' in oracle can be like -
TABLE_NAME NOT NULL VARCHAR2(20)
FIELD_NAME NOT NULL VARCHAR2(30)
LEGAL_VALUE NOT NULL VARCHAR2(20)
This table can hold values like -
TABLE_NAME FIELD_NAME LEGAL_VALUE
========== ========== ===========
USER DEPARTMENT ACCOUNTS
USER DEPARTMENT ENGINEERING
USER DEPARTMENT PERSONNEL
ITEM TYPE CONSUMABLE
ITEM TYPE NON-CONSUMABLE
This way, the table can hold valid values for the different fields
The generic implementation provides the ValidFieldValue domain class and its mapping file. Tweak its mapping file to map it to the correct table and fields.
Or specify your own domain class.
The GenericForeignKeyFieldValidator definition in validators.xml requires the appropriate values to be passed in parameters.
The RulesEngine will invoke this method to perform the field validation.
throws: ValidationException - if any validation rule fails. throws: FrameworkException - if any framework error occurs.
Methods inherited from org.jaffa.rules.fieldvalidators.AbstractFieldValidator