Emixa Validator

Content Type: Module
Categories: Utility,User Interface,Authentication

Overview

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.

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

 

Releases

Version: 3.2.1
Framework Version: 9.18.0
Release Notes: Minor fixes to ensure the java actions compile properly in Mendix 9/10. Upgrade to use com.fasterxml.jackson library to generate JSON output. Renamed the module to Emixa Validator Breaking Changes Due to the name change of the module, please follow these steps below. 1. Rename the current version of the module “ApprontoValidato” to “EmixaValidator”. 2. Import the new module ”EmixaValidator” from Marketplace.
Version: 3.1.0
Framework Version: 8.12.0
Release Notes: Some minor updates: - Upgrade to 8.10; the module can now be used in Mendix 9 projects. - Attribute Message increase to 2000 characters. Extra check and ellipsis added when trying to add more than 2000 characters in this field. - In the logging feature, Account/Full name is replaces with User/Name to accommodate anonymous users. Breaking changes: When handling validations through a webservice, we pass on the unique identifier of the remote object that needs validation. As many use a 'GUID' attribute, there could be some confusion what field to used. UUID (the Mendix unique identifier) is what's used render feedback. Renaming a JAVA attribute requires you to reset this value. - Renamed CustomGUID to RemoteGUID to better fit the purpose of this field - Renamed _ObjectToValidateGUID to _ObjectToValidateUUID to better indicate what value should be used
Version: 3.0.0
Framework Version: 8.4.4
Release Notes: Mendix 8 Upgrade Fixes in this version: - ResultMessageSnippet has been excluded from the project as the session object is no longer accessible for a user. - Object ‘Violations’ has been renamed to ‘Violation’ - Attribute RemoteGUID has been renamed to CustomGUID - MessageType was not properly added with the AddCustomValidation Java action
Version: 2.2.4
Framework Version: 7.2.0
Release Notes: Again a few minor updates to accommodate some requirements in existing projects: - Some extra custom fields have been added to the Violations entity. These fields can be set using the new action AddCustomValidation. You can use them if you want to capture more details about an error, or leave them empty as you please. - New custom fields are not used to display feedback on screen. Use case for these fields would be mainly to enhance error messaging in webservice calls. Of course you can use them as you please. - RemoteGUID field has been added. This is helpful when you want to validate content in different application but display the error messages on the screens. The GUID van be used to pass along an identifier of the original object (mxid) and replace the _ObjectToValidateGUID filed with this value. A redesigned MX8 version is coming soon!
Version: 2.2.3
Framework Version: 7.2.0
Release Notes: Minor update. When adding a Validation, you can now set the 'Attribute to validate' to empty. This can be helpful when you cannot access an association but still want to generate an error. For example when a list of associated objects is empty, you could still create a validation on the parent object. The feedback will be displayed as a popup message, as the object/attribute is not present in the client. Or, when using a webservice call, the error will be available when returning a list of messages.
Version: 2.2.2
Framework Version: 7.2.0
Release Notes: A minor addition; converting a list of validations to a JSON string. This is helpful when you would like to return the validation messages in a REST response result. Note: json-simple.jar has been added
Version: 2.2.1
Framework Version: 7.2.0
Release Notes: New version of CustomString included.
Version: 2.2.0
Framework Version: 7.2.0
Release Notes: Some minor changes: - Example content (entities, webservices, etc) have been removed from the core functionality - Warnings removed and Omnext ISO scoring improvements
Version: 2.1.1
Framework Version: 7.2.0
Release Notes: Fix when using the validator snippet in your forms.