In Anjana Data it is possible to define a set of validations on the metadata attributes configured in the templates of each object. The goal of these validations is to ensure correct data entry and guarantee coherence, consistency and control in the documentation of data assets.
Table Template Attribute Validations in the Configuration Panel (Administrator view)
These validations are recorded in the Template Attribute Validations table and allow applying rules to the attributes assigned to a specific template.
Supported validation types
Validations can cover different functional needs:
-
Required attributes (
REQUIRED)
Identify the attributes that must mandatorily be filled in within a template. -
Non-editable attributes (
NOT_EDITABLE)
Restrict the editing of an attribute, blocking its modification in the templates. -
Value dependency (
DEPENDS_ON)
Link the values of a selector-type attribute (SELECT,SELECT_IMG,SELECT_IMG_TXT,MULTI_SELECT, etc.) to the value chosen in another attribute. -
Value inheritance (
HERITABLE)
Identify boolean attributes whose value is inherited from other related objects according to the metamodel (e.g.: a dataset inherits the boolean value true indicating it has personal data if any of its dataset fields has it set to true). Inheritance can only occur between entities that have a parent-child relationship according to the native metamodel of Anjana Data, i.e., the following cases:-
DATASET attributes inherit boolean values from DATASET FIELD attributes.
-
DSA attributes inherit boolean values from attributes of the entities contained in the
dsaContentattribute. -
INSTANCE attributes inherit boolean values from attributes of the entities contained in the
datasetsinputininstanceanddatasetsoutputininstanceattributes.
-
-
Value ranges (
MIN/MAX)
Define minimum and maximum values for numeric attributes. -
String lengths (
MIN_LENGTH/MAX_LENGTH)
Set character count restrictions on short/long text attributes. -
Decimal precision (
MIN_DECIMAL_PRECISION/MAX_DECIMAL_PRECISION)
Define the minimum or maximum number of decimal places for decimal attributes. -
Array restrictions (
MIN_LENGTH_ARRAY/MAX_LENGTH_ARRAY)
Control the minimum or maximum number of values in multi-value attributes. -
Subtype filter (
SUBTYPE_FILTER)
Limits the subtypes of entities that can be associated in attributes of typeENTITY_CONTAINER,ENTITY_SEARCHorARRAY_ENTITY. -
Relationship type (
RELATIONSHIP_TYPE)
Determines the native relationship that is automatically created from anENTITY_CONTAINERattribute.
Note: When using entities from the native metamodel, the following RELATIONSHIP_TYPE validations must exist:
-
On the
dsaContentattribute of DSA, this validation must be entered withDSA_CONTENTas the parameter. -
On the
instanceInDatasetattribute of INSTANCE, this validation must be entered withINSTANCE_DATASET_INas the parameter. -
On the
instanceoUTDatasetattribute of INSTANCE, this validation must be entered withINSTANCE_DATASET_OUTas the parameter. -
On the
solutionRelatedInstanceattribute of SOLUTION, this validation must be entered withSOLUTION_RELATED_INSTANCEas the parameter.
Validation matrix by attribute types
|
Numeric attribute type |
Validations |
|||||||
|
MIN |
MAX |
MAX DECIMAL PRECISION |
MIN DECIMAL PRECISION |
MAX LENGTH ARRAY |
MIN LENGTH ARRAY |
REQUIRED |
NOT EDITABLE |
|
|
ARRAY DECIMAL |
x |
x |
x |
x |
x |
x |
x |
x |
|
ARRAY NUMBER |
x |
x |
|
|
x |
x |
x |
x |
|
INPUT DECIMAL |
x |
x |
x |
x |
|
|
x |
x |
|
INPUT NUMBER |
x |
x |
|
|
|
|
x |
x |
|
INPUT RANGE |
x |
x |
|
|
|
|
x |
x |
|
Alphanumeric attribute type |
Validations |
|||||
|
MAX LENGTH |
MIN LENGTH |
MAX LENGTH ARRAY |
MIN LENGTH ARRAY |
REQUIRED |
NOT EDITABLE |
|
|
ARRAY ALPHANUMERICAL |
x |
x |
x |
x |
x |
x |
|
ARRAY UPLOAD URL |
|
|
x |
x |
x |
x |
|
ENRICHED TEXT AREA |
x |
x |
|
|
x |
x |
|
INPUT TEXT INTERNATIONAL |
x |
x |
|
|
x |
x |
|
ENRICHED TEXT AREA INTERNATIONAL |
x |
x |
|
|
x |
x |
|
TEXT AREA INTERNATIONAL |
x |
x |
|
|
x |
x |
|
INPUT TEXT |
x |
x |
|
|
x |
x |
|
TEXT AREA |
x |
x |
|
|
x |
x |
|
UPLOAD URL |
|
|
|
|
x |
x |
|
Value selection attribute type |
Validations |
||||||
|
DEPENDS ON |
MAX LENGTH ARRAY |
MIN LENGTH ARRAY |
REQUIRED |
NOT EDITABLE |
SUBTYPE FILTER |
RELATIONSHIP TYPE |
|
|
ARRAY ENTITY |
|
x |
x |
x |
x |
x |
|
|
MULTI ORGANIZATIONAL UNIT |
|
x |
x |
x |
x |
|
|
|
MULTI USERS |
|
x |
x |
x |
x |
|
|
|
ENTITY CONTAINER |
|
x |
x |
x |
x |
x |
x |
|
ENTITY SEARCH |
|
|
|
x |
x |
x |
|
|
MULTI SELECT |
x |
x |
x |
x |
x |
|
|
|
MULTI SELECT IMG |
x |
x |
x |
x |
x |
|
|
|
MULTI SELECT IMG TXT |
x |
x |
x |
x |
x |
|
|
|
SELECT ORGANIZATIONAL UNIT |
|
|
|
x |
x |
|
|
|
SELECT |
x |
|
|
x |
x |
|
|
|
SELECT IMG |
x |
|
|
x |
x |
|
|
|
SELECT IMG TXT |
x |
|
|
x |
x |
|
|
|
TREE SELECT |
|
|
|
x |
x |
|
|
|
TREE MULTISELECT |
|
x |
x |
x |
x |
|
|
|
SELECT USERS |
|
|
|
x |
x |
|
|
|
Other attribute types |
Validations |
||||
|
HERITABLE |
MAX LENGTH ARRAY |
MIN LENGTH ARRAY |
REQUIRED |
NOT EDITABLE |
|
|
ARRAY BOOLEAN |
|
x |
x |
x |
x |
|
ARRAY DATE |
|
x |
x |
x |
x |
|
ARRAY UPLOAD FILE |
|
x |
x |
x |
x |
|
INPUT CHECKBOX |
x |
|
|
|
x |
|
INPUT DATE |
|
|
|
x |
x |
|
UPLOAD FILE |
|
|
|
x |
x |
Structure of the Template Attribute Validations table
Each recorded validation is characterized by the following elements:
-
templateAttribute: Unique identifier of an attribute within the object's template for which the validation is defined.
Note: It should be noted that an attribute can have different validations in each template (e.g. the attribute indicating Sensitivity can be required in a DATASET but not in a DSA)
-
key: validation key. It must correspond to one of the following values:-
DEPENDS_ON: dependency on another attribute in the same template. It is configured for the target attribute, i.e., the attribute whose reference values appear pre-filtered based on the values selected in the attribute on which it depends.-
Applies to: value selection attributes (
SELECT,SELECT_IMG,SELECT_IMG_TXT,MULTI_SELECT,MULTI_SELECT_IMG,MULTI_SELECT_IMG_TXT,TREE_SELECT,TREE_MULTISELECT)
-
-
HERITABLE: in case its value is inherited from another metadata attribute.-
Applies to: boolean attributes (
INPUT_CHECKBOX) and boolean arrays (ARRAY_BOOLEAN).
-
-
MAX: maximum number.-
Applies to: numeric attributes (
INPUT_NUMBER,INPUT_DECIMAL,INPUT_RANGE,ARRAY_NUMBER,ARRAY_DECIMAL).
-
-
MIN: minimum number.-
Applies to: numeric attributes (
INPUT_NUMBER,INPUT_DECIMAL,INPUT_RANGE,ARRAY_NUMBER,ARRAY_DECIMAL).
-
-
MAX_DECIMAL_PRECISION: maximum number of decimal precision for decimal values.-
Applies to: decimal attributes (
INPUT_DECIMAL,ARRAY_DECIMAL).
-
-
MIN_DECIMAL_PRECISION: minimum number of decimal precision for decimal values.-
Applies to: decimal attributes (
INPUT_DECIMAL,ARRAY_DECIMAL).
-
-
MAX_LENGTH: maximum length in number of characters.-
Applies to: text attributes (
INPUT_TEXT,TEXT_AREA,ENRICHED_TEXT_AREA,INPUT_TEXT_INTERNATIONAL,TEXT_AREA_INTERNATIONAL,ENRICHED_TEXT_AREA_INTERNATIONAL,ARRAY_ALPHANUMERICAL).
-
-
MIN_LENGTHMIN_LENGTH: minimum length in number of characters.-
Applies to: text attributes (
INPUT_TEXT,TEXT_AREA,ENRICHED_TEXT_AREA,INPUT_TEXT_INTERNATIONAL,TEXT_AREA_INTERNATIONAL,ENRICHED_TEXT_AREA_INTERNATIONAL,ARRAY_ALPHANUMERICAL).
-
-
MAX_LENGTH_ARRAY: maximum number of array elements.-
Applies to: multi-value attributes (
ARRAY_BOOLEAN,ARRAY_DATE,ARRAY_NUMBER,ARRAY_DECIMAL,ARRAY_ALPHANUMERICAL,ARRAY_UPLOAD_FILE,ARRAY_UPLOAD_URL,MULTI_SELECT,MULTI_SELECT_IMG,MULTI_SELECT_IMG_TXT,MULTI_USERS,MULTI_ORGANIZATIONAL_UNIT,TREE_MULTISELECT).
-
-
MIN_LENGTH_ARRAY: minimum number of array elements.-
Applies to: multi-value attributes (
ARRAY_BOOLEAN,ARRAY_DATE,ARRAY_NUMBER,ARRAY_DECIMAL,ARRAY_ALPHANUMERICAL,ARRAY_UPLOAD_FILE,ARRAY_UPLOAD_URL,MULTI_SELECT,MULTI_SELECT_IMG,MULTI_SELECT_IMG_TXT,MULTI_USERS,MULTI_ORGANIZATIONAL_UNIT,TREE_MULTISELECT).
-
-
NOT_EDITABLE: non-editable.-
Applies to: all attribute types
-
-
RELATIONSHIP_TYPE: relationship subtype that is created-
Applies to: native attributes of type
ENTITY_CONTAINER
-
-
REQUIRED: mandatory attribute-
Applies to: all attribute types
-
-
SUBTYPE_FILTER: allowed entity subtype.-
Applies to: entity-type attributes (
ENTITY_CONTAINER,ENTITY_SEARCH,ARRAY_ENTITY)
-
-
-
params: parameters to be completed according to the following table
|
key |
params |
|
DEPENDS_ON |
The name of the attribute it depends on must be indicated (value of the name field in the |
|
MAX MAX_DECIMAL_PRECISION MAX_LENGHT MAX_LENGHT_ARRAY MIN MIN_DECIMAL_PRECISION MIN_LENGHT MIN_LENGHT_ARRAY |
Require a numeric value that defines the corresponding limit. |
|
REQUIRED NOT_EDITABLE |
Must be configured with the value |
|
HERITABLE |
Accepts two possible values:
|
|
RELATIONSHIP_TYPE |
The name of the relationship subtype must be indicated (name field in the |
|
SUBTYPE_FILTER |
The names of the allowed entity subtypes must be indicated (name field in the |
Notes on attribute validations
When configuring validations in the Template Attribute Validation table, the following considerations must be taken into account:
-
Attributes that form part of the primary key (PK):
The attributesname,source,destination,infrastructure,technology,zone,path,processAriandsolutionArimust always be configured with theREQUIREDandNOT_EDITABLEvalidations to ensure they are complete.-
If this rule is not followed, the configuration validation run from Portuno will result in an error.
Actions button in the Configuration Panel -
Additionally, downloading templates in Excel format from the Data Portal will fail.
-
-
Attribute
physicalName:
In entity subtypes that can be extracted via automatic discovery, this attribute must be validated asNOT_EDITABLE.-
This ensures it always retains the original value from the source.
-
It is not necessary to add the
REQUIREDvalidation.
-
-
Attributes of type
INPUT_RANGE:
They must mandatorily haveMINandMAXvalidations to correctly identify the range of allowed values.-
If not configured, the
MIN_INTEGERandMAX_INTEGERvalues defined in theAppConfigurationstable will be applied by default.
-
-
Numeric attributes (
INPUT_NUMBER,ARRAY_NUMBER,INPUT_DECIMAL,ARRAY_DECIMAL):
If no explicitMINandMAXvalidations are defined, theMIN_INTEGERandMAX_INTEGERvalues from theAppConfigurationstable are also applied. -
Decimal attributes (
INPUT_DECIMAL,ARRAY_DECIMAL):
IfMIN_DECIMAL_PRECISIONandMAX_DECIMAL_PRECISIONvalidations are not configured, theMIN_INTEGERandMAX_INTEGERvalues defined in theAppConfigurationstable are applied. -
Long text attributes (
ENRICHED_TEXT_AREA,INPUT_TEXT_INTERNATIONAL,ENRICHED_TEXT_AREA_INTERNATIONAL,TEXT_AREA_INTERNATIONAL,TEXT_AREA):
IfMIN_LENGTHandMAX_LENGTHvalidations are not configured, theMIN_LENGTH_TEXT_EDITORandMAX_LENGTH_TEXT_EDITORvalues from theAppConfigurationtable are applied by default. -
Short text attributes (
INPUT_TEXT,ARRAY_ALPHANUMERICAL):
IfMIN_LENGTHandMAX_LENGTHvalidations are not configured, theMIN_LENGTH_TEXT_EDITORandMAX_LENGTH_TEXT_BDvalues from theapp_configurationstable are applied. -
Validation
RELATIONSHIP_TYPE:
It is mandatory on all attributes of typeENTITY_CONTAINER.-
It identifies the relationship created in the metamodel (e.g.:
DSA_CONTENT,INSTANCE_DATASET_IN,INSTANCE_DATASET_OUT,SOLUTION_RELATED_INSTANCE). -
It must not be modified once configured.
-
-
Fresh installations (without prior configuration):
After the initial creation of templates, all mandatory validations described above must be registered to ensure system consistency. -
Boolean attributes:
It is not possible to apply aREQUIREDvalidation on boolean-type attributes, since they cannot represent an “undefined” or “empty” state.-
A boolean only distinguishes between true or false.
-
A mandatory validation makes no sense.
-
-
Dependencies between SELECT-type attributes (
DEPENDS_ON):
For this validation to work, the relationships between attributes must be configured in theAttribute Relationshipstable. -
Uniqueness rule:
It is not possible to configure the same validation twice for the same template attribute.
Adding a validation to the Template Attribute Validations table
Adding a new validation to a template involves registering a new record in the Template Attribute Validations table that links a template attribute to a validation rule.
To add the record and register a new validation:
-
Click the New button in the top right corner. This will open a wizard with the fields defined in the Structure of the
Template Attribute Validationssection. -
Fill in the fields according to the structure described:
-
templateAttribute: select the template attribute to which you want to associate the validation (e.g.:10383-destination-GENERA). -
key: select the validation key to be applied (e.g.:SUBTYPE_FILTER). -
params: indicate the necessary parameters for the selected validation.
In this example, the destination of the relationship is limited only to certain entity subtypes, listed in the field separated by_-and without spaces:AI_MODEL_-AGENTE_LLM_-MODELO_MLThis means that the
destinationattribute of theGENERArelationship will only allow entities of type AI_MODEL, AGENTE_LLM or MODELO_ML as the destination.
-
-
Click Save to save the validation or Cancel to discard it.
Note
After adding validations, it is necessary to run the Clear cache action from the Configuration Panel (Actions > Clear cache) so that the changes are applied and visible in the Data Portal.
Modifying a validation on a template attribute in the Template Attribute Validations table
Modifying an existing validation on a template is managed from the Template Attribute Validations table in the Configuration Panel.
Important considerations
-
Only the
paramsfield of an already created validation can be modified. -
The
templateAttributeandkeyfields are not editable. -
If it is necessary to change the associated template attribute (
templateAttribute) or the validation key (key), the existing validation must be deleted and a new one created with the correct values.
Procedure to modify params
-
Locate the validation to be edited in the
Template Attribute Validationstable. -
Click the Edit button (green icon).
-
In the wizard, modify the value of the
paramsfield as appropriate for the selected validation rule.Examples:
-
For a
SUBTYPE_FILTERvalidation, update the list of allowed entity subtypes, separated by_-and without spaces (example:AI_MODEL_-MODELO_ML). -
For a
MAX_LENGTHvalidation, adjust the maximum number of characters (example:300000). -
For a
HERITABLEvalidation, indicate whether inheritance applies with the valueHIGHorLOW.
-
-
Click Save to save the changes or Cancel to discard them.
Note:
After modifying validations, it is necessary to run the Clear cache action from the Configuration Panel (Actions > Clear cache) so that the changes are applied and visible in the Data Portal.
Configuring validations on template attributes via direct database access (Developer view)
The validations of the attributes of each template are stored in the anjana.template_attribute_validation table.
|
Column |
Type |
Constraints / Notes |
|---|---|---|
|
|
|
NOT NULL. FK to |
|
|
|
Validation key (e.g.: |
|
|
|
Validation parameters. E.g.: number, |
Below is a sample script for configuring several validations on the destination attribute of the GENERA relationship:
INSERT INTO anjana.template_attribute_validation
(id_template_attribute, validator_key, validator_params)
VALUES
(10383, 'NOT_EDITABLE', 'true'),
(10383, 'REQUIRED', 'true'),
(10383, 'SUBTYPE_FILTER', 'AI_MODEL_-AGENTE_LLM_-MODELO_ML_DL');
Important:
-
Once the insert is executed, run the sequence update for the table. (From the Configuration Panel under
Actions > Reset DQ sequencesthe sequences of all tables, including this one, can be updated). -
The full weight of the configuration logic falls on the developer who executes the SQL queries directly on the tables. It is recommended to carefully review the Structure section.