Validation logic
The validation logic of a validation rule expresses the condition that is checked by the validation rule. In a basic validation script, it is contained directly in the rule. In an advanced validation script, it is contained in the then-section. More information: Validation scripts.
Structure
Each line typically consists of:
- A validation function. More info: Validation functions.
- An attribute from the given-section, an asset property or a constant value.
- A message for when assets do not meet the condition of the validation function.
- Other syntactic elements:
What's next?
If an asset does not meet the validation logic, the outcome of the rule is invalid.
If the asset meets the validation logic, the outcome of the rule is valid.
then {
isNotEmpty(attributes['Definition'], message: "The asset ${name} in domain ${vocabulary.name} \ must have at least one definition")
}