External validation rules are a set of requirements used
to validate the content of data being submitted in InfoSphere® MDM Custom Domain Hub transactions.
An external validation rule consists of following several validation
parts: the target, context, condition, function, parameters, and definition.
- Validation target—Specifies the target data where the validation
rule will be applied. There are three categories of validation based
on different validation target:
- Context only validation—There is no need to specify validation
target. This type of validation has a specific validation context
associated with a pre-known target data.
- Fixed type data validation—The type metadata is stored
in V_GROUP and V_ELEMENT tables for class and attribute information.
Groups
are defined in the V_GROUP table which associates a group name with
an object within a specific application.
The V_ELEMENT table defines all the fields or attributes
that make up an object (group), and associates them with element names.
Figure 2. V_ELEMENT table
- Variable type data validation—The type metadata is stored
in SPECFMT table containing XSD schema information for external and
internal XSD files.
- Validation context—Specifies the context under which the
validation will be executed. The context has two parts: application
and transaction type. The V_TRANSACTION table is used to store the
context definition.
The application and transaction types group a set of related
validation rules. For example, a delete operation can require different
values in a field than an update operation. Most data validation rules
apply across all transactions, and are assigned to a general transaction
type.
IBM® InfoSphere Master Data Management Custom
Domain Hub offers
four generic predefined transaction types: create, delete, general,
and update. Any validation defined with transaction type of GENERAL
will also apply to a transaction type of CREATE or DELETE or UPDATE.
Fixed type validation and variable type validation only supports the
four predefined transaction types.
Context only data validation
requires you to specify a detailed transaction name as transaction
type. In this case, validation defined for this transaction type only
applies to this specific transaction. For example, if you define a
context only validation, you can define the context as an application
of TCRM and a transaction type of addParty for a specific transaction.
- Validation condition—Decides if the validation should be
executed. The validation condition points to an external rule to be
evaluated. The EXTRULE table is used to store any external rules.
For details about external rules, refer to Configuring external business rules The
validation condition is optional.
- Validation function—Requires the V_FUNCTION table to store
function information. It is pointing to a Java™ class
created by the user or packaged with the InfoSphere MDM Custom Domain Hub.
This Java class has to extend abstract class ValidatorCommon
for the validation engine to process it. It must implement the abstract
method validateObject for validation logic and override the setValidatorParameter
method for any parameter initialization.
Figure 4. V_FUNCTION
table
- Validation parameters—Makes the function more flexible
so that it can be reused. For example, a range check function can
use two parameters to specify its upper bound and lower bound value.
Validation parameters are associated with a specific validation rule
definition and have many to one relationship. It is part of the validation
definition.
You can use a ParameterType and ParameterValue to describe
a parameter. You can have multiple parameters. You can have many parameters
with same ParameterType and different ParameterValue.
- Validation definition—Defines what should be validated.
A full external validation definition links validation target, validation
context, validation condition, validation function, and validation
parameters together. It also contains an error code to be used in
case validation fails. For details about error handling, refer to Configuring logging and error handling.
There
are three categories of validation definitions, one for each of the
validation types:
- Definitions for fixed type data validation—Element or attribute
validation definition is stored in V_ELEMENT_VAL and V_ELEMENT_PARAM
tables.
Figure 5. V_ELEMENT_VAL table
Figure 6. V_ELEMENT_PARAM table
Group or cross attribute validation definition is stored
in the V_GROUP_VAL and V_GROUP_PARAM tables.
Figure 7. V_GROUP_VAL
table
Figure 8. V_GROUP_PARAM table
- Definitions for variable type data validation—Variable
data validation definition is stored in V_VAL and V_PARAM tables.
- Definitions for context only validation—Validation definition
is stored in V_VAL and V_PARAM tables. It has no target data. The
TARGET_ID column will be null.