Configuration
Breadcrumbs

Versioning Rules

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

image-20250910-153242.png
Example of versioning a DATASET when changing the precision of a decimal 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 to boolean-type attributes or reference metadata attributes 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. Assigned automatically from the Configuration Panel.

  • currentValue: original value of the attribute (prior to modification). If the value indicated in this field changes to the value 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 (which triggers the modification flow). If the value indicated in the newValue field changes to the value 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.

    • Selected from among the attributes defined in the Template Attributes table.

Important:

  • For a DATASET to be versioned when adding or removing one or more DATASET FIELDs, a record must be included for the templateAttribute of the datasetFields attribute. This must be in the DATASET template with active set to false.

  • For an INSTANCE to be versioned when adding or removing one or more input or output DATASETs, 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 for 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 before the change (e.g.: Left empty so versioning occurs regardless of the initial value).

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

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

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

Note: After creating versioning rules, it is necessary to run the Clear cache action from the Configuration Panel (Actions > 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

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

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

It is important to keep in mind the following:

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

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

  • Changes made will only apply to versioning processes triggered after the modification.

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

Configuring versioning rules via direct database access (Developer view)

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

Column

Type

Constraints / Notes

id_edition_conf

int4

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

current_value

varchar

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

new_value

varchar

New value of the attribute. Can be NULL to indicate 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 Configuration Panel under Actions > Reset DQ sequences, you can update the sequences of all tables, including this one).

  • The full responsibility for the configuration logic lies with the developer executing the SQL queries directly on the tables. It is recommended to carefully review the Structure section.