Validation Module in MuleSoft
The Validation Component in MuleSoft is used to verify a message in a Mule flow. If a message does not meet the specific criteria, the validation fails and returns a validation error.
Validation Components in Mule are shown below:
Now, I will demonstrate validation using a few of the components from the image above.
All Scope: executes all validators and requires that all validations pass in order for the flow to execute. If one validation fails, the remaining validators are still executed.
Is number: verifies that a string can be parsed as a number of a specified numeric type.
Is empty collection: validates that a value is in collection or not.
Is email: checks if a given email is valid or not.
Is not blank string: validates that the provided value is not a blank string.
Matches regex : validates that a given expression matches a regular expression.
Is null: validates if the provided value is null
.
Here is the expected output: