Skip to content

CONSOLIDATED - NON NEGATIVE

Description

The NON NEGATIVE validator is designed to ensure that a field's value is not negative. This validator is particularly useful for data validation in scenarios where negative values are considered invalid or an error. It supports all numeric data types, making it versatile for various data validation needs.


Config Location

To configure the NON NEGATIVE validator, you need to define it within the consDPValidators section of your data point configuration within the schema. This involves specifying the validator name and entity.


Supported Data Types

  • Double
  • Decimal
  • Integer

Config Requirements

Config ({}) options are not required for the NON NEGATIVE validator. This validator is designed to perform a straightforward check for non-negative values without the need for additional configuration parameters.


Example Config

Below is an example of how to configure the NON NEGATIVE validator in XML format. This example demonstrates a validator that checks if the "QUANTITY" data point is not negative.

1
2
3
4
5
<dataPoint name="QUANTITY" dataType="INTEGER">
    <consDPValidators>
        <consDPValidator name="CHECK_NON_NEGATIVE" entity="NON_NEGATIVE"/>
    </consDPValidators>
</dataPoint>

Example Result

Upon successful configuration and execution, the NON NEGATIVE validator will check the current "QUANTITY" value to ensure it is not negative. If the value is negative, a violation will be triggered, indicating that the value does not meet the criteria for acceptability.


Common Mistakes

  • Ensure that the validator name and entity are correctly defined in the configuration to ensure that the validator is correctly identified and applied during the data processing pipeline.
  • Remember that the NON NEGATIVE validator does not require any configuration. If you attempt to provide a <config> block, it will be ignored.