Implementation
Introduction
The Validation Manager is an actually simple module as the most complex logic is implemented in the Rules Engine. The Validation Manager is just a wrapper to execute the different rules against the current context.
How does it work?
When you add the Validation Manager LWC to a page, or when you invoke the Validation Programatically you will need to provide the Validation Rule Set name to be executed. So the engine will retrieve all the Validation Rules associated to that Validation Rule Set and will execute them one by one returning the result depending on the configuration of the Validation Rule.
Additionally, if in the Validation Rule Set you specify the Status Field the Validation Manager will update that field with the result of the validation.
Validation From User Interface
When you add the Validation Manager LWC to a Lightning Page the component will take care of the validation automatically. You just need to specify the Validation Rule Set name and the component will do the rest.
Validating a Rercord Programatically
To Validate a Record from Apex, Flow, etc you will need to call the validateRecord method from the ValidationEngine class. This method will return a ValidationResult object with the result of the validation.
List<ValidationResult> validateRecord(Id recordId, String ruleSetName)