Define Validation Function
Data validation function can be defined on single or nested attributes only.
Create Data Validation Functions (DVFs) for entity and relationship type attributes. Each DVF can contain these attributes: name
, expression
, action
, and message
.
Defining Validation Functions in Reltio UI
Manage validation functions for your tenant in the Console Data Validation Functions Editor, which provides a function builder to transform business requirements into data validation functions. For more information about defining validation functions using the Reltio UI, see topics Create DVFs in the Data Modeler and Create a revalidate job.
Defining Validation Functions using APIs
This table describes validation function attributes you specify in APIs. For more information on using the Data Validation Function APIs to create, update, retrieve, and delete validation functions, see the Developer portal.
Attributes | Required/Optional | Description |
---|---|---|
uri | Optional | This is a unique identifier that is automatically generated by the system. If a particular URI is provided then that validation function is updated. |
name | Required | This is the name of the validation function. |
label | Optional | If the label is not provided, then the value provided for the name attribute is considered for the label attribute. |
description | Optional | This indicates the brief description of the validation function. If the description is not provided, then the value provided for the label attribute is considered for the description attribute. |
expression | Required | This indicates the actual expression of the validation function containing the operation or condition name, and the validation input parameters. It can contain one or more operations or conditions with one or more logical operators (AND /OR ). For more information, see Understanding the Expression Attribute. |
action | Optional | This indicates the next course of action when the data validation function is violated, either ERROR or WARNING (the default). Note: If parent entity, child entity, or relationship attributes encounter an error, the entire profile won't load. |
validationEvent | Optional | This indicates the value of the Validation event field in the Create new validation function page:
For more information, see topic Create DVFs in the Data Modeler. |
message | Required | This indicates the message that is displayed when a validation warning is reported. |
attribute | Required | In case of multiple attribute expression, this indicates the attribute to which the warning message must be added. |
createdBy | System generated response field | This indicates the user who created the validation function and is automatically picked up while creating the function. |
createdTime | System generated response field | This indicates the time at which the validation function was created. |
updatedBy | System generated response field | This indicates that the user updated the function and is automatically picked up while updating the function. |
updateTime | System generated response field | This indicates the time at which the validation function was updated. |
status | System generated response field | This indicates the status of the validation function:
|
Sample Validation Function
[
{
"name": "HCP.FirstName.01",
"expression": "regexp(attributes.FirstName.value, '[a-zA-Z0-9]+')",
"message": "FirstName cannot have special characters.",
"attribute": "configuration/entityTypes/HCP/attributes/FirstName"
},
{
"name": "HCP.CreditScore.01",
"expression": "(equals(attributes.Status.value, 'Active') AND gte(attributes.CreditScore.value, '150') ) OR Not equals(attributes.Status.value, 'Active')",
"message": "HCP credit score should be greater than 150 for active profiles.",
"attribute": "configuration/entityTypes/HCP/attributes/CreditScore"
}
]
DVF responses
{
"index": 0,
"successful": true, //successful=true means the profile is saved successfully.
"object": {
"uri": "entities/09Owxbk",
"type": "configuration/entityTypes/HCP",
"createdBy": "thirupathi.reddy@reltio.com",
"createdTime": 1574831965997,
"updatedBy": "thirupathi.reddy@reltio.com",
"updatedTime": 1574831965997,
"attributes": {
"FirstName": [
{
"type": "configuration/entityTypes/HCP/attributes/FirstName",
"ov": true,
"value": "AAA2",
"uri": "entities/09Owxbk/attributes/FirstName/1BkE09Cq"
}
],
. . .
},
"isFavorite": false,
"crosswalks": [
{
"uri": "entities/09Owxbk/crosswalks/1BkE0ppQ",
"type": "configuration/sources/Reltio",
"value": "09Owxbk",
. . .
}
],
"analyticsAttributes": {},
"label": "AAA2 BBB2",
"secondaryLabel": ""
}
}
When a record is rejected, the value of the successful field is set to false in the response, which contains one or more validation errors or warnings.{
"index": 0,
"successful": false, //successful=false means the profile is not saved due to some errors.
"errors": {
"severity": "Error",
"errorMessage": "The profile has failed against one or more DVF Functions.",
"errorCode": 31010,
"errorDetailMessage": "The profile has failed with 1 DVF error(s) and 6 DVF warning(s). Please review the
below validation errors and correct the data accordingly.",
"foundErrors": [
{
"severity": "ERROR",
"errorMessage": "Identifier is required one",
"errorCode": 31010,
"errorDetailMessage": "Identifier missing description", //3. Description from validation function
"exception": "Identifier missing" //4. Validation function name
},
{
"severity": "WARNING",
"errorMessage": "desc missing",
"errorCode": 31010,
"errorDetailMessage": "",
"exception": "desc"
}
],
"innerErrorData": {..}
},
}
The value in the following fields depend on values in the in the Edit validation function page:-
severity: Depends on the value in the Validation level field.
-
errorMessage: Depends on the value in the Display error with message field.
-
errorDetailMessage: Depends on the value in the Description field.
-
exception: Depends on the value in the Name field.