Esta página no está disponible actualmente en Español. Si lo necesita, póngase en contacto con el servicio de asistencia de Icon (correo electrónico)

Creating a Validation

The following how-to guide will walk through the steps required to create a validation using the Rules Designer in the Simple Language. The example shown is fairly trivial; however, far more complicated validations can be defined in much the same way.

Prerequisites

  • MPS (version 2022.3.1)

  • A model using the com.iconsolutions.simple.devkit, or a devkit that uses it (e.g. v2Flo.devkit)

Steps

1. Create Validation Node

To add a function into a model, go to the Logical View window on the left-hand side of MPS and right-click on the model where the validation is required. Then navigate to New > com.iconsolutions.simple > Validation.

create a validation step 1

2. Name Validation

An unimplemented validation should have been created now. All validations need a name so that they can be referenced elsewhere. Place the cursor on the red cell that says <no name> to the right of Name: and enter the validation’s name.

In the example below, the name is set to ExampleValidation:

create a validation step 2

3. Define Input

Validations require a single input. Enter the input’s name and select a Java class type for it.

In the example below, an input pacs008 of type FIToFICustomerCreditTransferV08 has been defined:

create a validation step 3

4. Choose Input Context

For each block of rules an input context should be chosen. This determines which component of the input the validation rules apply to. The options are the root by default or any direct fields of the input. If a field is a list, the validations will be applied to each instance within the list

In the example below, three blocks are created with contexts of, the root, the group header and the credit transfer transaction:

create a validation step 4

5. Add Rules

Rules make up the individual checks on the input to determine if it is valid or not. They are each consist of; a condition, an expression, an error code and an error description.

To add a new rule, place the cursor on a row of the table and press enter.

The conditional field is an expression that evaluates to a boolean value. If false, the given rule will be skipped. By default, rules will always be used. Rules can also be conditional on previous rules

The main body of the rule is an expression that returns a boolean. For each rule the final result of the validation will include if the rule passed, failed or was skipped, alongside the error code and description in the event of failure.

To set the error code and error description of a rule can be edited from the inspector.

To open the inspector, either right-click and choose Inspect Node or use the shortcut alt+2

In the example below, three rules are defined. One without a condition, the second with a condition on the first and a third with an expression as the condition.

create a validation step 5

6. Add Rulesets

Rulesets allow validations to call other validation nodes for reuse.

Each ruleset has a conditional field to determine if it should be run or skipped. By default, the validation is always run, but any expression can be used here.

The input to this validation can be any expression, although generally this will be a field of the initial input.

In the example below a separate AddressValidation node was created and is called on the creditor and debtor’s addresses, with an example condition for the debtor’s:

create a validation step 6 1
create a validation step 6

Additional Resources