I need to validate all attributes of a dataset. This can be done using a single AttributeValidator, but that gives me the following problems:
- It gives multiple errors on missing mandatory attributes (first error would be something like 'attribute fails check for <attribute> is not null', the second error could be something like 'attribute fails check for Maximum Length =12'). If a mandatory attribute is missing I only want the first error message as I know all other checks will fail.
- It gives unwanted errors for optional attributes without value. I only want to check the value if there is a value.
I have solved this by making parallel paths in which each path checks one attribute. For optional attributes there is first a Tester which tests if the attribute has a value and next there is the AttributeValidator. For mandatory attributes the path consists of two AttributeValidators: the first checks on 'Not Null' and the seconds checks on 'minimum length' / 'range' / etc. All parallel paths are combined at a ListExploder to be able to create a report in Excel with all error messages. See the image.
As I have many more datasets to check, I would like if there is a way in which my checks on attributes can be done with less transformers.
Kind regards,
Maarten.