Configuration

Versioning Rules

In Anjana Data it is possible to configure which changes generate a versioning of objects through versioning rules. These rules allow identifying the attributes of objects that, when edited, are considered relevant enough to generate a new version of the object and set the original version to Deprecated status.

image-20250910-153242.png
Example of versioning of a DATASET when changing the precision of a decimal-type DATASET FIELD

Edition Configuration Table in the Configuration Panel (Administrator View)

Rules are defined in the Edition Configuration table. They can only be configured for changes in boolean-type attributes or reference metadata belonging to the templates of the native entities DATASET, DATASET_FIELD, DSA, PROCESS, INSTANCE and SOLUTION.

image-20250910-153518.png
Edition Configuration table where versioning rules are configured


Structure of the Edition Configuration table

Each registered versioning rule is characterized by the following fields:

  • Id: unique identifier of the versioning rule. It is automatically assigned from the Configuration Panel.

  • currentValue: original value of the attribute (prior to modification). If the value indicated in this field changes to the one indicated in newValue, the object will be versioned.

    • If versioning should occur regardless of the initial value, enter null.

    • This value (except null) must already exist in the Attribute Definition Value table.

  • newValue: new value of the attribute (with which the modification flow is launched). If the value indicated in this newValue field changes to the one indicated in this field, the object will be versioned.

    • If versioning should occur regardless of the new value, enter null.

    • In the case of reference metadata, this value (except null) must already exist in the Attribute Definition Value table.

  • templateAttribute: attribute of a specific template to which the rule applies.

    • It is selected from among the attributes defined in the Template Attributes table.

Important:

  • For a DATASET to be versioned when one or more DATASET FIELDs are added or removed, a record must be included for the templateAttribute of the datasetFields attribute. The latter must be in the DATASET template with active set to false.

  • For an INSTANCE to be versioned when one or more input or output DATASETs are added or removed, a record must be included for the templateAttribute of the datasetsinputininstance attribute and another for datasetsinputininstance. These must be declared in the INSTANCE template via the Template Attributes table.

  • For a DSA to be versioned when adding or removing entities to which it grants access, a record must be included for the templateAttribute of the dsaContent attribute.

Creating a versioning rule for a template attribute in the Edition Configuration table

Creating a new rule involves adding a new record to the Edition Configuration table that defines the change condition to be monitored.

image-20250910-154406.png
Example of creating a versioning rule on the Precision attribute of a DATASET FIELD
  1. Click the New button in the upper right corner. This will open a wizard with the fields defined in the previous section.

  2. Fill in the fields according to the structure:

    • currentValue: initial value prior to the change (e.g.: leave it empty so that it versions regardless of the initial value).

    • newValue: final value that must trigger versioning (e.g.: null).

    • templateAttribute: select the attribute from among the template's attributes (e.g.: precision of the DATASET_FIELD entity).

  3. Click Save to save the rule or Cancel to discard it.

Note: After creating versioning rules, it is necessary to run the Clear Cache action from the new Configuration Panel (Home > Reset Operations > Clear Cache) for the changes to be applied and visible in the Data Portal.

Modifying a versioning rule for a template attribute in the Edition Configuration table

The versioning rules defined in the Edition Configuration table can be modified at any time, regardless of whether governed objects exist in the Data Portal or not.

The modification consists of adjusting the values of the currentValue, newValue or the templateAttribute fields associated with the rule. These modifications will affect future versioning processes, but do not retroactively alter those already executed.

It is important to take the following into account:

  • Versioning flows that are already in progress are not affected by the modification.

  • If such flows are approved, they will still result in a new version of the object, following the conditions of the rule that was configured at the time the process was launched.

  • The changes made will only apply to versioning events triggered after the modification.

Note: After modifying versioning rules, it is necessary to run the Clear Cache action from the new Configuration Panel (Home > Reset Operations > Clear Cache) for the changes to be applied and visible in the Data Portal.

Configuring versioning rules through direct database access (Developer View)

The configuration of versioning rules is stored in the anjana.edition_configuration table, which allows defining which changes in the attributes of governed objects generate a new version.

Column

Type

Constraints / Notes

id_edition_conf

int4

PRIMARY KEY. Unique identifier of the rule. Managed through sequences.

current_value

varchar

Original value of the attribute. Can be NULL to indicate that it applies to any initial value.

new_value

varchar

New value of the attribute. Can be NULL to indicate that it applies to any final value.

id_template_attribute

int4

NOT NULL. FK to anjana.template_attribute(id_template_attribute). Indicates the template attribute to which the versioning rule applies.

In this example, a versioning rule is created for the precision attribute of the DATASET_FIELD entity, so that versioning occurs regardless of the initial and final values:

SQL
INSERT INTO anjana.edition_configuration
(id_edition_conf, current_value, new_value, id_template_attribute)
VALUES(12, NULL, NULL, 112);

Important:

  • Once the insert has been executed, run the sequence update for the table. (From the new Configuration Panel under Home > Reset Operations > Reset database sequences, the sequences of all tables, including this one, can be updated).

  • The entire responsibility for 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.