Contact Us 1-800-596-4880

Validation Module Documentation Reference

Validation Module v2.0

The Validation module can verify that the contents of a message in a Mule flow match specific criteria. The module provides explicit messages about the cause of an exception in a flow. Based on the specific data you are validating, you can customize the exception message that is displayed in the logs.

A module that performs data validations. If the validation fails, an error is thrown. The error type might vary but it will always be a child of VALIDATION:VALIDATION.

If a message does not meet the defined validation criteria, the validation fails and returns a VALIDATION error (such as VALIDATION:INVALID_URL), which is a ValidationException. By default, this message includes a meaningful message that you can customize.

Configurations


Config

Default configuration

Parameters

Name Type Description Default Value Required

Name

String

Name for this configuration. Connectors reference the configuration with this name.

x

I18n

Allows to configure I18n for the standard error messages

Name

String

ID used to reference this configuration.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Operations

Is Allowed Ip

<validation:is-allowed-ip>

Validates that an IP address is present in the IP list.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Ip Address

String

Address to validate.

x

Allow List

List of allowed addresses.

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings..

For Configurations

Throws

  • VALIDATION:INVALID_IP

  • VALIDATION:REJECTED_IP

Is Blank String

<validation:is-blank-string>

Validates that value is a blank String.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Value

String

Value to check.

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:NOT_BLANK_STRING

Is Elapsed

<validation:is-elapsed>

Validates that a given time has elapsed since the specified initial time.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Time

Number

the interval size

x

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

the interval unit (as a TimeUnit)

x

Since

DateTime

the time to validate

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:NOT_ELAPSED_TIME

Is Email

<validation:is-email>

Validates that the email address is valid.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Email

String

an email address

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:INVALID_EMAIL

Is Empty Collection

<validation:is-empty-collection>

Validates that value is an empty collection.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Values

Array of Any

the value to check

#[payload]

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:NOT_EMPTY_COLLECTION

Is False

<validation:is-false>

Validates that the given value is false

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Expression

Boolean

The boolean to test.

false

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:INVALID_BOOLEAN

Is IP

<validation:is-ip>

Validates that an IP address represented as a String is valid.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Ip

String

IP address to validate.

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:INVALID_IP

Is Not Blank String

<validation:is-not-blank-string>

Validates that value is not a blank String.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Value

String

String to check.

#[payload]

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:BLANK_STRING

Is Not Denied Ip

<validation:is-not-denied-ip>

Validates that an IP address is not present in the IP list.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Ip Address

String

Address to validate.

x

Deny List

List of denied addresses.

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:INVALID_IP

  • VALIDATION:REJECTED_IP

Is Not Elapsed

<validation:is-not-elapsed>

Validates that a given time has not elapsed since the specified initial time.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Time

Number

Interval size

x

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Interval unit (as a TimeUnit).

x

Since

DateTime

Time to validate.

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:ELAPSED_TIME

Is Not Empty Collection

<validation:is-not-empty-collection>

Validates that value is not an empty collection.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Values

Array of Any

Value to check.

#[payload]

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:EMPTY_COLLECTION

Is Not Null

<validation:is-not-null>

Validates that the given value is not null. Keep in mind that the definition of null can vary depending on the mimeType value. For example, for an application/java mimeType, null means a blank pointer. However, if the mimeType is application/json then the String null is also a null value.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Value

Any

Value to test.

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:NULL

Is Null

<validation:is-null>

Validates that the given value is null. Keep in mind that the definition of null can vary depending on the mimeType value. For example, for an application/java mimeType, null means a blank pointer. However, if the mimeType is application/json, then the String null is also a null value.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Value

Any

Value to test.

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:NOT_NULL

Is Number

<validation:is-number>

Receives a numeric value as a String and validates that it can be parsed per the rules of a numberType.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Value

String

Value to test.

x

Locale

String

Locale used for the format. If not provided it defaults to the system Locale.

Pattern

String

Pattern used to format the value.

Min Value

String

If provided, check that the parsed value is greater or equal than this valu.e

Max Value

String

If provided, check that the parsed value is less or equal than this value.

Number Type

Enumeration, one of:

  • INTEGER

  • LONG

  • SHORT

  • DOUBLE

  • FLOAT

Type of number to test value against.

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:INVALID_NUMBER

Is Time

<validation:is-time>

Validates that a time in String format is valid for the given pattern and locale. If no pattern is provided, then the locale’s default is used.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Time

String

A date in String format.

x

Locale

String

Locale of the String

Pattern

String

Pattern for the date.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:INVALID_TIME

Is True

<validation:is-true>

Validates that the given value is true.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Expression

Boolean

Boolean to test.

false

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:INVALID_BOOLEAN

Is URL

<validation:is-url>

Validates that url is valid.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

URL

String

URL to validate as a String.

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:INVALID_URL

Matches Regex

<validation:matches-regex>

Validates that the value matches to the regex regular expression.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Value

String

Value to check

x

Regex

String

Regular expression to check against the value.

x

Case Sensitive

Boolean

When true matching is case sensitive, otherwise matching is case in-sensitive

true

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:MISMATCH

Validate Size

<validation:validate-size>

Validates that value has a size between certain inclusive boundaries. This validator is capable of handling instances of String, collection, map and arrays.

Parameters

Name Type Description Default Value Required

Configuration

String

Name of the configuration to use.

x

Value

Any

Value to validate.

x

Min

Number

Minimum expected length (inclusive, defaults to zero)

0

Max

Number

Maximum expected length (inclusive). Leave unspecified or null to allow any max length.

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

Message

String

Specifies the message to notify the user if the validation fails. The message is marked as not dynamic to allow eager evaluation of the expression in case the validation is successful and the message is not required. Components consuming this value check if this is an expression and evaluate it in case the validation failed.

Error Mappings

Array of Error Mapping

Set of error mappings.

For Configurations

Throws

  • VALIDATION:INVALID_SIZE

All

<validation:all>

Perform a list of nested validation operations and informs only one VALIDATION:MULTIPLE error which summarizes all of the found errors (if any).

Parameters

Name Type Description Default Value Required

Error Mappings

Array of Error Mapping

Set of error mappings.

Throws

  • VALIDATION:MULTIPLE

Any

<validation:any>

Perform a list of nested validation operations and informs only one VALIDATION:MULTIPLE error which summarizes all of the found errors (if all failed).

Parameters

Name Type Description Default Value Required

Error Mappings

Array of Error Mapping

Set of error mappings.

Throws

  • VALIDATION:MULTIPLE

Types

I18n

Field Type Description Default Value Required

Bundle Path

String

Path to a bundle file containing the messages. If null then the platform chooses a default one.

x

Locale

String

Locale of the null the platform chooses the system default.

Expiration Policy

Configures an expiration policy strategy.

Field Type Description Default Value Required

Max Idle Time

Number

Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time unit for the Max Idle Time field.

Ip Filter List

Field Type Description Default Value Required

Ips

Array of String

x

Error Mapping

Field Type Description Default Value Required

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

Target

String

x

View on GitHub