Home | Using Katmandoo | Quick Start Guide | How-to | Task Menu | Table of Contents | See Also | Collapse All

Trait Validation Rule

Overview

Validation Rule of trait in Katmandoospecifies range of value that a trait can have. There are following two objectives of defining validation rule of a Trait
  1. To validate the value of the trait in the Business Rule component of Katmandoo before it can be saved in the database
  2. To allow data of the Trait for the Sub-system be stored in the database.

Detail

Validation Rule

This column in the TraitSubSystem table stores validation rule of a trait for a Sub-system ie a trait can have different validation rule for different Sub-system.

For trait with string data type, the validation rule must be regular expression where as for the trait with numeric data type, validation rule a range can be generated in the Trait Validation Rule Setup Form.

Important Note: If there is not any validation rule of the trait then this column and Validation Rule Error Message can have empty (blank) for a Sub-system so that the trait can be used with that Sub-system.

All the traits can have missing value as defined in the .config file. Default missing value is "NA" which can be changed in the .config file as required.



Examples:
Trait Name Validation Rule Validation Error Message
LeafColor ^(GREEN|YELLOW|LIGHT GREEN)$ Invalid Leaf Column. Please enter GREEN, YELLOW or LIGHT GREEN
GrainYield (TraitValue >= 10.0 And TraitValue <= 125.0) A value between 10 and 125 was expected

Validation Rule Error Message

This column stores the message that will be displayed to the user in case the entered value of the trait can not be validated by the Validation Rule of the Sub-system.

Table Structure

Column Name Description
TraitId (PK) Trait for which the validation rule is defined.
SubSystemId (FK) Sub-system for which the validation rule of the Trait is defined.
Validation Rule (optional) Validation rule of the trait for the Sub-system.
Validation Rule Error Message (optional) Message to notify user when validation rule for a value of a trait fails

Pre-requisite

The following information must exist before a validation rule of trait for a Sub-system can be added into the database.

Main Form

Click here for the Trait Main Form that displays validation rule of traits for each Sub-system.

Setup Form

To add/edit a validation rule, follow the steps below :
Illustrative snapshot:
Setup Form of Validation Rule (Click it to change its size)
  1. Information of the selected trait.
  2. READ THIS IMPORTANT NOTE BEFORE ADDING ANY NEW VALIDATION RULE.
  3. Click it after entering Minimum and Maximum values to generate Validation Rule (in the text box 5). 
  4. Sub-system for which this validation rule (or empty record) of the trait being setup. Once a validation rule is added, the Sub-system of the Validation rule can not be changed.
  5. Validation Rule of the trait for the selected Sub-system.
  6. Error Message that will be prompted when the value of the trait can not be validated by the validation rule.
  7. Tick it to validate existing data of the trait with the validation rule. If validation of any existing data fails, the validation rule can not be saved.
    • Note: If the new validation can not validate existing data, then UNCHECK it.
  8. Note on empty/blank validation rule of the trait.
When [ Save and Exit] is clicked, following dialog will prompt you to give a chance to add the validation rule of the selected Trait for all the other Sub-system (for which the Trait does not already have validation rule).
Setup Form of Validation Rule of selected Trait for All Sub-systems

How to exclude a trait from a Sub-system?

Some traits are required to be excluded from one or more Sub-systems so that data of the trait can not be entered for the Sub-system. The procedures are:
  1. [ Task > System > Manage Trait
  2. Find the trait
  3. Select the validation rule of the trait for the Sub-system in which you would like to exclude the trait
  4. [ Record > Delete Valiation Rule ]

See Also