Configuration

Template validations

In Anjana Data there is the possibility of defining 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

Template Attribute Validations table in the Configuration Panel (Administrator view)

These validations are recorded in the Template Attribute Validations table and allow rules to be applied to the attributes assigned to a specific template.

image-20250909-170008.png
Template Attribute Validations table for creating validations on template attributes

Supported validation types

Validations can cover different functional needs:

  • Mandatory attributes (REQUIRED)
    Identify the attributes that must mandatorily be filled in on a template.

  • Non-editable attributes (NOT_EDITABLE)
    Restrict the editing of an attribute, blocking its modification in the templates.

  • Dependency between values (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 that indicates it has personal data if any of its dataset fields has it set to true). Inheritance can only occur between entities that have a relationship according to the Anjana Data native metamodel, 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 restrictions on the number of characters in short/long text attributes.

  • Decimal precision (MIN_DECIMAL_PRECISION / MAX_DECIMAL_PRECISION)
    Define the minimum or maximum number of decimals in decimal attributes.

  • Array restrictions (MIN_LENGTH_ARRAY / MAX_LENGTH_ARRAY)
    Control the minimum or maximum number of values in multivalued attributes.

  • Subtype filter (SUBTYPE_FILTER)
    Limits the entity subtypes 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 the entities of 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

INPUT TEXT INTERNATIONAL

x

x



x

x

ENRICHED TEXT AREA INTERNATIONAL

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 registered 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: Keep in mind that an attribute can have different validations in each template (e.g. the attribute that indicates Sensitivity may 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 of 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 it depends on.

      • 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 the case that its value is inherited from another metadata field.

      • 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 precision for decimal values.

      • Applies to: decimal attributes (INPUT_DECIMAL, ARRAY_DECIMAL).

    • MIN_DECIMAL_PRECISION: minimum 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, INPUT_TEXT_INTERNATIONAL, TEXT_AREA_INTERNATIONAL, ENRICHED_TEXT_AREA_INTERNATIONAL, ARRAY_ALPHANUMERICAL).

      • Should not be applied to: ENRICHED_TEXT_AREA, ENRICHED_TEXT_AREA_INTERNATIONAL due to html tags.

    • MAX_LENGTH_ARRAY: maximum number of array elements.

      • Applies to: multivalued 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: multivalued 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: not modifiable.

      • 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 fill in 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 of 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 are 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 met, the configuration validation executed from Portuno will fail.

    • Additionally, downloading templates in Excel format from the Data Portal will fail.

  • Attribute physicalName:
    In entity-type subtypes that can be extracted through 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:
    Must mandatorily have MIN and MAX validations to correctly identify the allowed range of 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 explicit MIN and MAX validations are not defined, the MIN_INTEGER and MAX_INTEGER values from the AppConfigurations table are applied as well.

  • 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 ( INPUT_TEXT_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. Note: default MIN_LENGTH validations are not applied to ENRICHED_TEXT_AREA ENRICHED_TEXT_INTERNATIONAL

  • 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 that is 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 (with no prior configuration):
    After the initial creation of templates, it is necessary to register all the mandatory validations described above to guarantee the system's consistency.

  • Boolean attributes:
    It is not recommended to apply REQUIRED validation on boolean-type attributes, since they cannot represent an “undefined” or “empty” state.

    • A boolean only distinguishes between true or false.

    • Mandatory validation implies the obligation to always set it to true.

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

Creating a validation in the Template Attribute Validations table

Creating a new validation on a template involves registering a new record in the Template Attribute Validations table that links a template attribute with a validation rule.

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

To add the record and create a new validation:

  1. Click the New button in the top right corner. This will open a wizard with the fields defined in the section Structure of the table Template Attribute Validations.

  2. Fill in the fields according to the structure described:

    • templateAttribute: select the template attribute to which the validation is to be associated (e.g.: 10383-destination-GENERA).

    • key: select the validation key that will be applied (e.g.: SUBTYPE_FILTER).

    • params: indicate the parameters required for the selected validation.
      In this example, the destination of the relationship is limited to certain entity subtypes only, 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 creating validations, it is necessary to execute the Clear cache action from the new Configuration Panel (Home > Reset operations > 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

  • It is only possible to modify the params field of an already created validation.

  • 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 according to the selected validation rule.

    Examples:

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

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

    • For a HERITABLE type 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 execute the Clear cache action from the new Configuration Panel (Home > Reset operations > Clear cache) so that the changes are applied and visible in the Data Portal.


Configuring attribute validations on templates via direct database access (Developer view)

The attribute validations for each template are stored in the anjana.template_attribute_validation table.

Column

Type

Restrictions / 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 to configure 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 has been executed, run the table's sequence update. (From the new Configuration Panel under Home > Reset operations > Reset database sequences, the sequences of all tables, including this one, can be updated).

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