Configuration
Breadcrumbs

Template Validations

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.

image-20250909-160607.png
Example of an attribute configured as Required in the AI Model template

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.

image-20250909-170008.png
Table Template Attribute Validations for adding validations on template attributes

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 dsaContent attribute.

    • INSTANCE attributes inherit boolean values from attributes of the entities contained in the datasetsinputininstance and datasetsoutputininstance attributes.

  • 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 type ENTITY_CONTAINER, ENTITY_SEARCH or ARRAY_ENTITY.

  • Relationship type (RELATIONSHIP_TYPE)
    Determines the native relationship that is automatically created from an ENTITY_CONTAINER attribute.

Note: When using entities from the native metamodel, the following RELATIONSHIP_TYPE validations must exist:

  • On the dsaContent attribute of DSA, this validation must be entered with DSA_CONTENT as the parameter.

  • On the instanceInDataset attribute of INSTANCE, this validation must be entered with INSTANCE_DATASET_IN as the parameter.

  • On the instanceoUTDataset attribute of INSTANCE, this validation must be entered with INSTANCE_DATASET_OUT as the parameter.

  • On the solutionRelatedInstance attribute of SOLUTION, this validation must be entered with SOLUTION_RELATED_INSTANCE as 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 Attribute Definitions table)

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 true.

HERITABLE

Accepts two possible values:

  • HIGH: the inherited value will be true if at least one of the elements it inherits from has true.

  • LOW: the inherited value will be false if at least one of the elements it inherits from has false.

RELATIONSHIP_TYPE

The name of the relationship subtype must be indicated (name field in the Object Sub-Types table).

SUBTYPE_FILTER

The names of the allowed entity subtypes must be indicated (name field in the object_subtype table), separated by _- and without spaces.

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 attributes name, source, destination, infrastructure, technology, zone, path, processAri and solutionAri must always be configured with the REQUIRED and NOT_EDITABLE validations to ensure they are complete.

    • If this rule is not followed, the configuration validation run from Portuno will result in an error.

      att_11_for_162037761.png
      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 as NOT_EDITABLE.

    • This ensures it always retains the original value from the source.

    • It is not necessary to add the REQUIRED validation.

  • Attributes of type INPUT_RANGE:
    They must mandatorily have MIN and MAX validations to correctly identify the range of allowed values.

    • If not configured, the MIN_INTEGER and MAX_INTEGER values defined in the AppConfigurations table will be applied by default.

  • Numeric attributes (INPUT_NUMBER, ARRAY_NUMBER, INPUT_DECIMAL, ARRAY_DECIMAL):
    If no explicit MIN and MAX validations are defined, the MIN_INTEGER and MAX_INTEGER values from the AppConfigurations table are also applied.

  • Decimal attributes (INPUT_DECIMAL, ARRAY_DECIMAL):
    If MIN_DECIMAL_PRECISION and MAX_DECIMAL_PRECISION validations are not configured, the MIN_INTEGER and MAX_INTEGER values defined in the AppConfigurations table are applied.

  • Long text attributes (ENRICHED_TEXT_AREA, INPUT_TEXT_INTERNATIONAL, ENRICHED_TEXT_AREA_INTERNATIONAL, TEXT_AREA_INTERNATIONAL, TEXT_AREA):
    If MIN_LENGTH and MAX_LENGTH validations are not configured, the MIN_LENGTH_TEXT_EDITOR and MAX_LENGTH_TEXT_EDITOR values from the AppConfiguration table are applied by default.

  • Short text attributes (INPUT_TEXT, ARRAY_ALPHANUMERICAL):
    If MIN_LENGTH and MAX_LENGTH validations are not configured, the MIN_LENGTH_TEXT_EDITOR and MAX_LENGTH_TEXT_BD values from the app_configurations table are applied.

  • Validation RELATIONSHIP_TYPE:
    It is mandatory on all attributes of type ENTITY_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 a REQUIRED validation 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 the Attribute Relationships table.

  • 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.

image-20250909-170811.png
Example of adding a new validation on the destination attribute of the GENERA template

To add the record and register a new validation:

  1. 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 Validations section.

  2. 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_ML
      

      This means that the destination attribute of the GENERA relationship will only allow entities of type AI_MODEL, AGENTE_LLM or MODELO_ML as the destination.

  3. 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 params field of an already created validation can be modified.

  • The templateAttribute and key fields 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

  1. Locate the validation to be edited in the Template Attribute Validations table.

  2. Click the Edit button (green icon).

  3. In the wizard, modify the value of the params field as appropriate for the selected validation rule.

    Examples:

    • For a SUBTYPE_FILTER validation, update the list of allowed entity subtypes, separated by _- and without spaces (example: AI_MODEL_-MODELO_ML).

    • For a MAX_LENGTH validation, adjust the maximum number of characters (example: 300000).

    • For a HERITABLE validation, indicate whether inheritance applies with the value HIGH or LOW.

  4. 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

id_template_attribute

int4

NOT NULL. FK to anjana.template_attribute(id_template_attribute). Identifies the attribute within the template.

validator_key

varchar(255)

Validation key (e.g.: REQUIRED, NOT_EDITABLE, MIN, MAX, MAX_LENGTH, SUBTYPE_FILTER, …).

validator_params

varchar(255)

Validation parameters. E.g.: number, true, HIGH/LOW, list of subtypes AI_MODEL_-..., etc.

Below is a sample script for configuring several validations on the destination attribute of the GENERA relationship:

SQL
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 sequences the 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.