To create or edit a validation rule:
Log into EnterWorks Classic and navigate to the profile for the repository where you wish to establish the validation rule.
The Profile Editor will appear. Click Next to move to the next page of the profile editor.
Click the Rule List tab. This will take you to a list of existing validation rules:
Create a new rule by selecting Action > New or edit an existing rule by selecting it and selecting Action > Edit.
The Define Rule Details (New) window opens. Edit the following fields as desired.
Configuration Option | Required or Optional | Definition | For Rule Type(s) |
---|---|---|---|
Name | Required | This is the text that will appear on the record if it fails the validation rule. | All |
Type | Required | Type of validation rule. (See Validation Rule Types.) | All |
Severity | Required | Specifies the severity of the validation error assigned to the attribute If the value of the assigned attribute violates this rule.
|
All |
Level | If not specified will default to highest Validation Level. | The validation level this attribute is assigned to. Note that if the Level is not specified, it will default to the highest level. | All |
Operator | Required | The operator compared with the assigned attribute. | Simple |
Value | Required | The value the assigned attribute is compared to. | Simple |
Formula | Required | How the assigned attributes will be altered. | Calculate VTL-like |
Call Out | Required | The JAVA class process that will alter the assigned attribute. (See Callout and Pre-Save Callout.) | Call Out Pre-save Call Out |
Class Path | Required | Specifies the class path for the JAVA class process that will alter the assigned attribute. (See Callout and Pre-Save Callout.) | Call Out Pre-save Call Out |
Bulk Rule Text | Required | The text of the SQL query performed on the set of records being validated. | Bulk Callout |
If you are creating or editing a Simple or Calculation rule, you can use the values of the record’s other attributes in your Value or Formula setting. To do so, enter the character [. The names of the record’s other attributes will be displayed in a dropdown. If you start to type the desired attribute’s name, the list of attributes will be filtered accordingly.
Condition(s): Adding conditions provides you the ability to make the rule ‘applicable’ to the attribute based on values of another attribute. In the example below, we are setting up a rule that applies only to SKUs where Legacy SKU = No:
Click the Add button.
Select the attribute from the drop-down list, choose the appropriate operator and value, and then click the OK button.
If you have multiple criteria, specify whether ALL conditions must be true in order for this rule to be applicable or whether only one condition is necessary to be true.
Define Rule Attributes: Use the Action dropdown menu to assign or unassign the rule to attributes. Rules assigned to an attribute are available to enabled on the attribute.
Assign: Selecting this opens a list of attributes. Select one or more attributes you want the rule to be available for. Click OK to save your selections.
Once a rule is assigned to an attribute, if the attribute is multi-language, you can click the Language button to assign the rule to specific language versions of the attribute. If no languages are selected, the rule is assigned to the default language of the attribute.
Detach: To remove the rule from the list of rules that can be enabled for an attribute, select the attribute in the list, then select Detach from the Action menu.
Click the OK button to close the Rule Definition editor and return to the Profile editor.
Click the Save button.
If this is a new rule, we now need to assign it to (or “enable it for”) the desired repositories. Typically, validation rules are not enabled on production repositories. To do so, navigate to the Rule Properties page for the desired repository.
Select your new rule and use the down-arrow icon to assign the rule to the repository.
If this is a new validation rule it has now been successfully created, however, no attributes have yet been assigned to it. To assign attributes to the new rule, see Assign/Unassign Existing Validation Rule to an Existing Attribute.