Skip to content

RAW - NOT EMPTY

Description

The NOT EMPTY validator checks if an item is empty (including an empty String value), and if so, it throws a violation. It is designed to ensure that string data points do not contain empty values. This validator is particularly useful for scenarios where non-empty values are required.


Supported Data Types

  • String

Config Location

The configuration for the NOT EMPTY validator is defined within the <rawDPValidator> element of a schema data point. This section is crucial for specifying the logic that the validator will execute to determine if the data item meets the specified criteria.


Config Requirements

For the NOT EMPTY validator, the <config> element is not required. This means that the validator can be applied directly to string data types without the need for additional configuration parameters.


Example Config

Below is an example of a NOT_EMPTY raw validator configuration. This validator checks if the current item is not empty, and throws a violation if the condition is not met.

1
2
3
4
5
<dataPoint name="NAME" dataType="STRING">
    <rawDPValidators>
        <rawDPValidator name="CHECK_NOT_EMPTY" execPriority="10" entity="NOT_EMPTY"/>
    </rawDPValidators>
</dataPoint>

Example Results

Consider a scenario where the NOT_EMPTY validator is applied to a data item named "NAME" with a value of "John Doe". Since the value is not empty, the validator will pass successfully without throwing a violation.

On the other hand, if the value of "NAME" were an empty string (""), the validator would throw a violation because the value is empty, which is not acceptable according to the validation criteria.


Common Mistakes

  • Ensure that the data type of the data item being validated is String. The NOT EMPTY validator is designed to work with string data types only.
  • Remember that the NOT EMPTY validator does not require a <config> element, so ensure that the validator is correctly applied to the data item without additional configuration.
  • Verify that the entity attribute of the <rawDPValidator> element is correctly set to "NOT_EMPTY" to apply the NOT EMPTY validation logic.