AttributeValidator
Validates any number of attributes against specific test conditions and routes the feature according to the outcome of the test(s). Features that fail one or more tests will have the reasons for failure documented on an attribute and list attribute on the output feature.
Input Ports
This transformer accepts any feature.
Output Ports
If the test(s) pass, the feature is output via the Passed port.
If the test(s) fail, the feature is output via the Failed port, with additional attributes describing the failure.
Parameters
The AttributeValidator’s parameters are configured as rows in a table. Each row describes a different validation rule that can be applied to multiple attributes. The first column allows the user to select the attributes that they wish to validate against a particular test or rule. The user may select one or more attributes here. The second column allows the user to specify the type of test to apply to the attributes selected in the first column. The available tests are described in the operators section below. If a test requires the user to enter additional configuration information, it will be entered in the third column.
In order for a feature to be output via the passed port all of the validation rules must pass. In the event an attribute fails one of the validation rules specified, a description of the failure will be added to the fme_validation_message{} list attribute. This list will contain information on each failure. Additionally an fme_validation_message attribute will be added which will list the last reason for failure.
The Operator column is one of: Type, In Range, Case, Minimum Length, Maximum Length,In, Matches Regular Expression, Encoding, Not Null, and Unique.
Operator | Description | Example |
---|---|---|
Type |
Is the value of the attribute convertible to one of the listed types? Types included are Integer, Double, Numeric and Boolean. You may select multiple types, when multiple types are selected, if a feature is convertible to one or more of the listed types it will fast. Integer and Double types test if the contents of an attribute is representable as an integer or floating point number respectively. Numeric tests if the value is convertible to a number (behaviour is identical to double). Boolean tests if the string matches one of the Boolean representations (TRUE,True,true,1,FALSE,False,false,0)
|
X=7, if X is Numeric (yes = Passed) X=true, If X is Booelan (yes =Passed) |
In range |
Does the value fall within the numeric range specified with the set notation? In this notation []s denote inclusive bounds i.e [0,8] corresponds to 0<=X<=8. While ()s denote exclusive bounds i.e (0,8) corresponds to 0<X<8. It is possible to have one bound exclusive and the other inclusive ie (0,8]. It is also possible to set no bound by leaving one side empty ie [0,] is any number greater than or equal to 0 |
X=3, if X In Range [3,8] (yes = Passed) X=3, if X In Range (3,8] (no = Failed) |
Case |
Does the value of the attribute comply with the selected case pattern? |
X=The pen is blue, if X Case Title Case (yes = Passed) X=The Pen Is Blue, if X Case Full Title Case (yes = Passed) |
Minimum Length |
Does the value of the specified attribute have greater than the minimum length in characters? |
X=Cat If X Minimum Length 2 (yes =Passed) X=Cat If X Minimum Length 4 (no =failed) |
Maximum Length |
Does the value of the specified attribute have under the maximum length in characters?
|
X=Cat If X Maximum Length 4 (yes =Passed) X=Cat If X Maximum Length 2 (no =failed) |
In |
A list of values in which you are testing for a certain value. The Right Value is a comma-delimited list of values, or a range. |
X=bird, if X In Set cat,dog,horse (no = Failed) X=bird, if X In Set cat,dog,bird (yes = Passed) |
Matches Regular Expression |
Does a value match a regular expression?
|
X=abcd, if X Matches Regex .*bc.* (yes = Passed) |
Encodable in |
Is the value of the specified attribute encodable in the specified encoding without data loss? |
If x=本 If X encoding cp392 passed Japanese Windows If encoding DOS Icelandic failed
|
Not Null |
Is the attribute present on the feature and not null? |
|
Unique |
Has another feature had an attribute value the same as the value as this attribute before?
Note this is a non blocking operation the first occurrence of a value will pass while subsequent occurrences will fail |
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Transformer Categories
Technical History
This transformer replaced the AttributeClassifier transformer.
Search FME Knowledge Center
Search for samples and information about this transformer on the FME Knowledge Center.