Tuesday, May 6, 2008

Flat File Schema Overview

Here I will go briefly through my Flat File Schema tags.
Root tag is Files which encapsulates files that should be validated.
File tag defines the file through Name, Alias and etc attributes.
File can have Columns as child element that contains column definitions.
Each column can have validation rules (Value, Length or Type) for the data. Each rule can include Where element that contains conditions when this rule should apply. This will allow you to build in your business logic into the validation process.
If you files have relations you can include Link element in Files element to link files. This will allow application to validate data in one file taking data from other files into account (You can reference column from the other file in the Where element of you rule).

Application runs all the checks from FFS and creates error.log file with errors and their descriptions.

Next Step
Next thing to do is an Action Element that will define the future of the record in flat file if it is not valid.
Possible flags are:
Delete Delete row with this record from validated file
Replace Replace Value with some default value or use value from replacement list
Move Append row with failed record to other file and delete from validated file
Copy Append row to other file without deleting it