Validation Constraints - 6.3

Talend Data Mapper User Guide

EnrichVersion
6.3
EnrichProdName
Talend Big Data Platform
Talend Data Fabric
Talend Data Management Platform
Talend Data Services Platform
Talend MDM Platform
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend Studio

Validation constraints are implicitly specified in the definition of a structure. This includes things like the data type, number of occurrences, and element length. Validation constraints can also be specified either in the structure or map definition in terms of expressions in the Validate expression tab for each map element.

Validation constraints can be specified either in a structure or a map. When you specify constraints in a structure, they are copied into the map at the time the structure is mapped. If the validation constraint is updated in the structure subsequently, it has no effect on the map.

Validation Expressions

The validation expression is associated with both map and structure elements. You specify the expression in the Validate expression tab. These expressions require a Boolean value. If the value is true, the element is consider valid. If false, a validation report is generated. The validation report is generic in that it only indicates the validation of the element failed and gives the location of the failure.

If you want to provide more information, use the CondValidateReport function, which you can put at the root of the validation expression.

Validation Report Functions

The ValidateReport function unconditionally indicates a validation failure and can be used in any type of expression. The CondValidateReport is the same, except that you can specify a condition that indicates a validation failure if false.

With both of these functions, you can provide a severity, error number, and error message text. In addition, you can provide any other data necessary to provide context for the report, such as the value of a map element. All of this will be captured for the validation report.