Validations

In this topic: Hide

 

Validations are used to detect unwanted files or data. DataSmith will perform validations before attempting to scan a data file. If the data file does not meet the requirements set up in your validations, DataSmith will not continue to process the file and will move on to the next config.

Validations are created by writing instructions which look for data within your files that can be used as identifiers. For example, you may already know that all of your data files contain certain types of information in the header. Writing a validation that checks to make sure the header contains the desired information could eliminate unwanted files.

Create Validation

To create a new validation, right click Validations and select New Validation from the menu.

Modify Validation Feature

Validations define a section of your data file, comparable to the way a feature does.

Label

Enter a label for the Validation.

Occurrence Count

By selecting an Occurrence Count in the properties dialog, a validation or a validation characteristic will set up your Validation Object to occur as many or as few times as indicated by the selected radio button.

Color

See the topic, Colors.

Type

There can be two types of validations; a validation which is Used for Filtering, and a validation which Generates Errors. Filter validations are processed first, then error generating validations. To select the type of validation, right click the validation, select properties, then select Used for Filtering or Generates Errors.

Used for Filtering

Filter validations can be used when you want some but not all of the configs to process a file. For example, you may have three different configs in a DataSmith file, for three different types of data. You may want only one of the configs to process the file. Filter validations can be used to discern which config should be used. A file must pass all filter validations on at least one config, or the file will not be processed, and will be placed in the ErrBox.

Generates Errors

If any error generating validation fails, the file will not be processed within that config, and will be placed in the ErrBox. Error generating validations are used to eliminate files which are not the correct type, or have errors in them.

There are circumstances under which a file would fail a filter validation and fail an error generating validation, but would not be placed in the Errbox. For example, a file may pass one filter validation and fail second filter validation. The file will not be placed in the ErrBox, because it passed at least one filter validation, but it will not be processed because it failed the error generating validation.

On a given config, if a file fails any filter validations, error generating validation will not be checked, and therefore no error will be generated and the file will not be placed in the ErrBox. A record of what happened to the file can be seen in the Summary or the DataSmith log file.

 

Modify Validation Characteristic

Like Features, Validations also may have characteristics defined.