Complex validations (custom)
Complex validations that require algorithm implementation are implemented by developers and included in the validator library located in Eximee Validation. If the validation is to be performed via external services (e.g., an ESB bus), it is necessary to use Service Proxy to expose the given service.
If validations do not require connection to external services, lightweight script validators can be used (more in: Script validators (validationScript)). Complex validators can be applied to application fields, pages or composite components (used later on the application).
Complex validations for components
In addition to requiredness and mask, specialized external validators can also be added to components.
Attaching a validator
To attach a validator, enter the artifact edit mode and select any component that can have a validator attached. Then click the Data quality section in the component properties menu. After expanding the section we will see the subsection VALIDATORS.

After clicking on VALIDATORS or the pencil icon, the validators window will slide out.

After selecting the option Choose validator we will be able to search for and select a given validator. The list contains standard validators and script validators. For a validator you can define a call condition (the field Add condition). This is a JavaScript condition in which you can use fields or session variables available on the application. The method of creating conditions is described in The condition editor suggests available syntaxes, field identifiers and variable names. A sample condition for a page that should appear only if a select field has a specific value:.

Simulation
Validators, just like external services, support the possibility of replacing their operation with a simulation script. Attaching such a script requires selecting the Simulation tab in the validators window and choosing an available simulation script from the list.

From this level we can also decide to create a new script by clicking the Generate new script. The newly created script will have automatically generated content consistent with the validator and with dedicated code sections documented.

Keep in mind that such scripts will be executed only when entering the application with the application logic simulation mode enabled!
Complex validations on the page
Adding validators on the page
Validators can also be added on the page:
If the page listens to fields that we pass to the validator, the validator is called when the field the page is listening to changes.
If the page does not listen to fields, the validator will be invoked only after clicking the Next/Submit.

Adding validators on a composite component
It is possible to add validators to a composite component. They will work as if they were added to the page where the composite component is located.
Adding translations for validation messages
Each validator returns a validation message. The message content may already be translated into Polish or may be in another language. After attaching the validator you should go to the Translations tab and search for the appropriate error key to change the translation.
If the validator message contains parameters, they should also be placed in the appropriate positions in the translation.

Last updated
Was this helpful?
