Validation
Overview
The ValidationWorkEntryExecutor class generates and executes SQL statements to check for error conditions in the data. Select Target Level Target and Target Types TableSet and TableCursor for this executable class.
The VALIDATION_TYPE executable parameter defines the validation type. Possible values are the following. For more information, see Default validations.
REQUIREDFKERRORLOOKUPCUSTOM
The validation results are written to the UA_RUN_VALIDATION table and can be viewed through the Report menu.
Default validations
For REQUIRED, FKERROR, and LOOKUP validation executables, the tables to validate are specified on the Task through their associated Targets. For each table linked to a task for one of these executables, the appropriate validation will be performed.
| Validation type | Validation on each table linked to the task | Executable |
|---|---|---|
REQUIRED | Each required column on each table linked to the task is validated to check that the column is populated. | The executable class uses the DIH database table and field metadata to determine which columns to validate and whether they should be validated for spaces, zeros, or nulls. |
FKERROR | Each foreign key reference on each table linked to the task is validated to check that its parent row exists. | The executable class uses the OUAF constraint metadata to determine which foreign key references to validate. |
LOOKUP | Each lookup flag field on each table linked to the task is validated to check that the lookup flag value exists in the CI_LOOKUP_VAL table. | The executable class uses the OUAF table and lookup field metadata to determine which fields to validate. |
Custom validations
For CUSTOM validation executables, the validation rules are specified in the code blocks. The tables to validate are specified in the validation rules, so the Task for a custom executable does not identify any specific targets.
A validation rule must be specified for each type of validation required. Each validation rule must be in a separate code block sequence. For example,
disabled: false
table: CX_PER
rule: INVALID-EMAIL
condition: not REGEXP_LIKE(emailid, '^(\S+)\@(\S+)\.(com|org|net)$')
fields: PER_ID, EMAILID
primaryKeys: PER_ID, EMAILID
stopOnCondition: false
The above example checks that the EMAILID column on table CX_PER does not end in .com, .org, or .net. If the condition is met, the email address is considered invalid, and an entry for that CX_PER record will be added to the UA_RUN_VALIDATION table.
Properties
The following are the properties of a validation rule:
| Property | Definition |
|---|---|
disabled |
If set to |
table |
Name of the table to be validated. |
rule |
Specifies the validation rule ID that should be existing in the UA_VALIDATION_RULE table. |
condition |
Defines a WHERE SQL condition to identify errors on the associated table. The condition can have multiple lines. |
fields |
Specifies one or more comma separated field names that helps identify the problem specified in a validation report. The field names are written to the GROUPING_VALUEn columns on table UA_RUN_VALIDATION and can be used to group similar errors. |
primaryKeys |
Identifies the primary key columns on the associated table. The values of these columns are in the PRIMARY_KEYn columns on table |
stopOnCondition |
Determines whether a task will stop or continue id the error condition is met. |