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:
-
Expand the entity node, right-click the Validations node and select Add SemQL Validation….
The Create New SemQL Validation wizard opens. -
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 to open the SemQL Editor.
-
-
(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.
-
Validation Scope: select whether the SemQL validation should be checked pre- and/or post-consolidation.
-
Click Finish to close the wizard.
The SemQL Validation editor opens. -
Press Control+S (or Command+S on macOS) to save the editor.
-
Close the editor.
Create a plugin validation
|
To create a plugin validation:
-
Expand the entity node, right-click the Validations node and select Add Plugin Validation.
The Create New Plugin Validation wizard opens. -
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.
-
-
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. -
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:
-
In the Plugin Params table, click the Define Parameters button.
-
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.
-
Click Finish to close the dialog.
-
-
Set the values for the parameters:
-
Click the Value column in the Plugin Params table in front of a parameter. The cell becomes editable.
-
Enter the value of the parameter in the cell, and then press Enter.
-
Repeat the previous steps to set the value for the parameters.
-
-
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:
-
In the Plugin Inputs table, click the Define Inputs button.
-
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.
-
Click Finish to close the dialog.
-
-
Set the values for the inputs:
-
Double-click the Expression column in the Plugin Inputs table in front of an input.
The SemQL editor opens. -
Edit the SemQL expression using the attributes to feed the plugin input and then click OK to close the SemQL Editor.
-
Repeat the previous steps to set an expression for the inputs.
-
-
(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.
-
(Optional) You can use [_advanced_plug_in_configuration] properties to optimize and configure the plugin execution.
-
Press Control+S (or Command+S on macOS) to save the editor.
-
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.