Validations

A record-level validation validates the values of a given entity record against a rule. Several validations may exist on a single entity.

There are two types of validation:

  • SemQL validations express the validation rule in the SemQL language. These validations are executed in the hub’s database.

  • Plugin validations use a plugin developed in Java. These validations are executed by Semarchy xDM. Controls that cannot be achieved within the database (e.g., those involving calling an external API) can be created using plugin validations.

Create a SemQL validation

To create a SemQL validation:

  1. Expand the entity node, right-click the Validations node and select Add SemQL Validation….
    The Create New SemQL Validation wizard opens.

  2. In the wizard, select the Auto Fill option and then enter the following values:

    • Name: name of the object. During browsing, this name is used to designate errors on business views showing Source Authoring With Errors data.

    • Label: user-friendly label for this object. Since the Auto Fill checkbox is selected, the Label field is automatically filled in. Modifying this label is optional.

    • (Optional) Description: enter a description for the SemQL validation.

    • Condition: enter the SemQL condition that must be true for a valid record. You can use the edit expression button Edit Expression button to open the SemQL Editor.

  3. (Optional) Error Message: define a custom error message to replace the default one if the validation criteria are not met. The custom or default error message is displayed on forms during authoring operations, in business views when browsing records with errors, and in API responses when querying error records using the REST API.

  4. Validation Scope: select whether the SemQL validation should be checked pre- and/or post-consolidation.

  5. Click Finish to close the wizard.
    The SemQL Validation editor opens.

  6. Press Control+S (or Command+S on macOS) to save the editor.

  7. Close the editor.

Create a plugin validation

  • Semarchy xDM has a large set of built-in plugins. For the complete list of built-in plugins, see Plugins reference.

  • You can also develop your own plugins, as described in Plugin development.

  • Before creating validation based on a plugin not built-into Semarchy xDM, make sure that this plugin was added to the platform by the administrator as explained in Manage plugins.

To create a plugin validation:

  1. Expand the entity node, right-click the Validations node and select Add Plugin Validation.
    The Create New Plugin Validation wizard opens.

  2. In the wizard, select the Auto Fill option and then enter the following values:

    • Name: name of the object. During browsing, this name is used to designate errors on business views showing Source Authoring With Errors data.

    • Label: user-friendly label for this object. Since the Auto Fill checkbox is selected, the Label field is automatically filled in. Modifying this label is optional.

    • Plugin ID: select the plugin from the list of plugins installed in the platform.

    • Validation Scope: select whether the validation should be checked pre- and/or post-consolidation.

  3. Click Finish to close the wizard.
    The Plugin Validation editor opens. The Plugin Params and Plugin Inputs tables show the parameters and inputs for this plugin.

  4. Only the parameters that are mandatory for the plugin to work are listed in the Plugin Params. You can add the parameters you need to set to the list:

    1. In the Plugin Params table, click the Define Parameters button.

    2. In the Parameters dialog, select the desired items from the Available Parameters column and click the Add >> button to add them to the Used Parameters column.

    3. Click Finish to close the dialog.

  5. Set the values for the parameters:

    1. Click the Value column in the Plugin Params table in front of a parameter. The cell becomes editable.

    2. Enter the value of the parameter in the cell, and then press Enter.

    3. Repeat the previous steps to set the value for the parameters.

  6. Only the inputs that are mandatory for the plugin to work are listed in the Plugin Inputs. You can add the inputs you need to set to the list:

    1. In the Plugin Inputs table, click the Define Inputs button.

    2. In the Input Bindings dialog, select the desired items from the Available Inputs column and click the Add >> button to add them to the Used Inputs columns.

    3. Click Finish to close the dialog.

  7. Set the values for the inputs:

    1. Double-click the Expression column in the Plugin Inputs table in front of an input.
      The SemQL editor opens.

    2. Edit the SemQL expression using the attributes to feed the plugin input and then click OK to close the SemQL Editor.

    3. Repeat the previous steps to set an expression for the inputs.

  8. (Optional) Define a custom Error Message. This message is displayed on forms during authoring if the validation criteria are not met, replacing the default message.

  9. (Optional) You can use [_advanced_plug_in_configuration] properties to optimize and configure the plugin execution.

  10. Press Control+S (or Command+S on macOS) to save the editor.

  11. Close the editor.

Advanced plugin configuration

The validations using plugins provide options for optimizing and configuring their execution.
The following properties appear in the Advanced Configuration section of the editor:

  • Max Retries: if the execution of the plugin fails, retries will be executed up to this specified number of times.

  • Behavior on Error: if the execution still fails after the Max Retries have been attempted, the plugin either skips the current record, skips the entire task, or stops the whole job, depending on this property.

  • Thread Pool Size: this property defines the number of parallel threads used when running the plugin. This option is taken into account only if the plugin used is thread-safe and declared as such.