Emixa Validator
Overview
Documentation
Description
This module decouples Validation from Validation Feedback, allowing you to use one validation microflow for both a web form and webservice.
You can validate all the required fields in a dedicated validation flow and you have the option to show the results as feedback items on fields in a screen or as a message in a webservice call.
In addition, you are able to store the validation errors and create valuable insight to improve the User Experience.
Typical usage scenario
- Use one validation flow to check the data entered using a webform and/or webservice
- Capture multiple validations per attribute
- Create not only messages on error events but also for info, warning and danger outcomes
- Insight in knowing what data is entered incorrectly
Features and limitations
- You are not limited to a single Entity; you can add validation messages to any associated object, including associated objects of the same type (ie. home/work phone numbers)
- Return validation messages with or without detailed information
Configuration
In your Saving microflow (triggered by a form or webservice):
- Initialize the Validator:
- ProcessName; optional name for the process you are validating; used for saving log information
- Enum_ValidationSource; The source from where you want to save your data (Form, Webservice, Other)
- Validate the content, passing on the validator (and your objects) as parameters
- Check the validator if any errors are present
- Commit your object
- Return validation feedback (as items on a form or result in webservice call)
- Close the validator
- This saves log entries when configured
In your Validation microflow:
- Check your data input as usual
- Use ‘Add Validation’ to add messages to the Validator
- ValidatorObject; the validator object initialized in your saving microflow
- ValidationType; Error, Info, Warning, Danger
- ObjectToValidate; the object or associated object you are validating
- AttributeToValidate; string with the name of the attribute
- MessageCode; optional code for when you have implemented error tracking
- ValidationMessage; the message that will be returned in the feedback
Configuration:
You can configure for which process you want to store the validation messages. This gives you valuable insight in the data that users are entering so you can act accordingly.Link the page ‘Configuration’ to your navigation to manage the processes you want to monitor.
- Process name; this is the name of the process that you provided when initializing the validator.
- Login is active; enable or disable logging in running configurations
- Log items; per validation type (Error, Info, etc) you can indicate if you want to store these messages
Use the log details to view all the captured logging information.
Constant: SaveValidationLog
This constant will override any saving configuration you might have configured.
False; Logging will always be disabled. No database retrieves will be done.
True; when I process name has been given to a Validation flow, it will do a database retrieve for a configuration with this name.
When you notice performance issues, you could use this Constant to quickly enable or disable logging without having to modify the model. (A restart of the environment is still necessary)
Demo
The project includes the following demo’s to get you started:
- Validating a single entity, saved by a form and/or webservice
- Validating a single entity with associated objects, saved by a form and/or webservice
For more info, support or suggestions, contact support.as.nl@emixa.com