Complex validations (custom)

Complex validations that require algorithm implementation are implemented by developers and added to the validator library located in Eximee Validation. If 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 connecting 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 (later used on the application).

Complex validations for components

In addition to requiredness and a mask, specialized external validators can also be added to components.

Attaching a validator

To attach a validator, enter artifact edit mode and select any component that allows attaching a validator. Then click the Data quality section in the component properties menu. After expanding the section we will see the subsection VALIDATORS.

Figure 1. "Data quality" section with the VALIDATORS subsection

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

Illustration 2. Validators window

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 triggering condition (the Add conditionfield). This is a JavaScript condition in which fields or session variables available on the application can be used. The method of creating conditions is described in (to check a component's visibility). More examples are described in.

Illustration 3. Adding a validator

Simulation

Validators, just like external services, support the ability to replace 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.

Illustration 4. Tab for attaching a simulation script

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

Illustration 5. Creating a simulation script

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 that the page listens to changes.

  • If the page does not listen to fields, the validator will be invoked only after clicking the Next/Submit.

Illustration 6. Properties panel with two validators added for page Page1

Adding validators on a composite component

It is possible to add validators on a composite component. They will behave as if they were added to the page on which the composite component is located.

Adding translations of 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.

Illustration 7. Example of translating a validator message that passes parameters

More information in Creating validators.

Last updated

Was this helpful?