# mulesoft Validation Module - Full Documentation --- product: Validation Module version: 1.4 --- # Troubleshooting the Validation Module > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To troubleshoot the Validation module, become familiar with the information about enabling verbose logging and interpreting commonly thrown messages. ## Enable Verbose Logging To get a better understanding of why an application’s interaction with the Validation module is failing, temporarily enable verbose logging for the module. Remember to always disable the enhanced verbosity after troubleshooting, because it affects your Mule application performance. To enable verbose logging in the configuration file: 1. Access Anypoint Studio and navigate to the **Package Explorer** view. 2. Open your application’s project name. 3. Open the `src/main/resources` path folder. 4. Open the `log4j2.xml` file inside the folder. 5. Add an `` tag inside the `` tag: ```xml ... ... ``` 6. Save your application changes. 7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule Application**. ## Understand Common Throws Here is a list of common throw messages and how to interpret them: - VALIDATION:BLANK\_STRING The provided value is an empty string and the expected value is not. - VALIDATION:NOT\_BLANK\_STRING The provided value is not an empty string and the expected value is. - VALIDATION:ELAPSED\_TIME Too much time has elapsed since the specified start time. - VALIDATION:NOT\_ELAPSED\_TIME Not enough time has elapsed since the specified start time. - VALIDATION:INVALID\_EMAIL The provided value is an invalid email address. - VALIDATION:EMPTY\_COLLECTION The provided value is an empty collection and the expected value is not. - VALIDATION:NOT\_EMPTY\_COLLECTION The provided value is an empty collection and the expected value is not. - VALIDATION:INVALID\_BOOLEAN The provided value does not match the expected boolean value. - VALIDATION:INVALID\_IP The provided value is an invalid IP address. - VALIDATION:REJECTED\_IP The provided value is not valid according to the expecting ranges. - VALIDATION:NULL The value provided 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. - VALIDATION:NOT\_NULL The value provided 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. - VALIDATION:INVALID\_NUMBER The provided value does not satisfy either the number type or the minimum or maximum expected values. - VALIDATION:INVALID\_TIME The provided value is an invalid time for the pattern used to parse it. If no pattern is provided, then the locale's default is used. - VALIDATION:INVALID\_URL The provided value is an invalid URL. - VALIDATION:MISMATCH The provided value does not match the regular expression. - VALIDATION:INVALID\_SIZE The provided value is not between the specified inclusive boundaries. - VALIDATION:MULTIPLE Summarizes all the found errors in a list of nested validation operations. ## See Also - [Salesforce Help](https://help.salesforce.com) - [Validation Module Reference](https://docs.mulesoft.com/validation-connector/1.4/validation-documentation) --- product: Validation Module version: 2.0 is-latest-version: true --- # Troubleshooting the Validation Module > For the full documentation index, see: https://docs.mulesoft.com/llms.txt To troubleshoot the Validation module, become familiar with the information about enabling verbose logging and interpreting commonly thrown messages. ## Enable Verbose Logging To get a better understanding of why an application’s interaction with the Validation module is failing, temporarily enable verbose logging for the module. Remember to always disable the enhanced verbosity after troubleshooting, because it affects your Mule application performance. To enable verbose logging in the configuration file: 1. Access Anypoint Studio and navigate to the **Package Explorer** view. 2. Open your application’s project name. 3. Open the `src/main/resources` path folder. 4. Open the `log4j2.xml` file inside the folder. 5. Add an `` tag inside the `` tag: ```xml ... ... ``` 6. Save your application changes. 7. Click the project name in **Package Explorer** and then click **Run** > **Run As** > **Mule Application**. ## Understand Common Throws Here is a list of common throw messages and how to interpret them: - VALIDATION:BLANK\_STRING The provided value is an empty string and the expected value is not. - VALIDATION:NOT\_BLANK\_STRING The provided value is not an empty string and the expected value is. - VALIDATION:ELAPSED\_TIME Too much time has elapsed since the specified start time. - VALIDATION:NOT\_ELAPSED\_TIME Not enough time has elapsed since the specified start time. - VALIDATION:INVALID\_EMAIL The provided value is an invalid email address. - VALIDATION:EMPTY\_COLLECTION The provided value is an empty collection and the expected value is not. - VALIDATION:NOT\_EMPTY\_COLLECTION The provided value is an empty collection and the expected value is not. - VALIDATION:INVALID\_BOOLEAN The provided value does not match the expected boolean value. - VALIDATION:INVALID\_IP The provided value is an invalid IP address. - VALIDATION:REJECTED\_IP The provided value is not valid according to the expecting ranges. - VALIDATION:NULL The value provided 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. - VALIDATION:NOT\_NULL The value provided 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. - VALIDATION:INVALID\_NUMBER The provided value does not satisfy either the number type or the minimum or maximum expected values. - VALIDATION:INVALID\_TIME The provided value is an invalid time for the pattern used to parse it. If no pattern is provided, then the locale's default is used. - VALIDATION:INVALID\_URL The provided value is an invalid URL. - VALIDATION:MISMATCH The provided value does not match the regular expression. - VALIDATION:INVALID\_SIZE The provided value is not between the specified inclusive boundaries. - VALIDATION:MULTIPLE Summarizes all the found errors in a list of nested validation operations. The All and Any scopes return MUTIPLE as long as the nested operations in these secops are also of type VALIDATION. ## See Also - [Validation Module Reference](https://docs.mulesoft.com/validation-connector/latest/validation-documentation) - [Salesforce Help](https://help.salesforce.com) - [Known Issues](https://help.salesforce.com/s/issues) --- product: Validation Module version: 2.0 is-latest-version: true --- # Upgrading Validation Module to Version 2.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Upgrade Validation module to version 2.x. ## Supported Upgrade Paths
From VersionTo Version

1.4.x

2.0.1

## Changes in This Release The following operation names changed:
Previous Operation NameNew Operation Name

Is not blacklisted ip

Is not denied ip

XML is-not-blacklisted-ip

XML is-not-denied-ip

Is whitelisted ip

Is allowed ip

XML is-whitelisted-ip

XML is-allowed-ip

The following parameters names changed:
Previous Parameter NameNew Parameter Name

Black list

Deny list

XML blackList

XML denyList

White list

Allow list

XML whiteList

XML allowList

## Changed Operations ### Is Not Denied Ip `` Validates that an IP address is not present in the IP list. ### Is Allowed Ip `` Validates that an IP address is present in the IP list. ## Upgrade Prerequisites Before you perform the upgrade, you must: - Create a backup of your files, data, and configurations in case you need to restore to them. ## Upgrade Steps Follow these steps to perform the upgrade: 1. In Anypoint Studio, create a Mule project. 2. In **Mule Palette**, click **Search in Exchange**. 3. In **Add Dependencies to Project**, enter `validation module` in the search field. 4. In **Available modules**, select **Validation module** and click **Add**. 5. Click **Finish**. 6. Verify that the `mule-validation-module` dependency version is `2.0.1` in the `pom.xml` file in the Mule project. Studio upgrades the connector automatically. ## Post-Upgrade Steps After you install the latest version of the connector, and if you have Mule apps that use the previous operations and parameters, manually change them to the new operations and parameters: 1. In Studio, drag the new operation to your flow. 2. Configure the new operation with the same settings as the previous operation. 3. Remove the previous operation. You can also update the Mule app XML configuration file to the new names and parameters: 1. In Studio, navigate to the **Configuration XML** window. 2. Update the previous operations and parameters names with the new names. ### Verify the Upgrade After you install the latest version of the connector, follow these steps to verify the upgrade: 1. In Studio, verify that there are no errors in the **Problems** or **Console** views. 2. Verify that there are no problems in the project `pom.xml` file. 3. Test the connection to verify that the operations work. ### Revert the Upgrade If it is necessary to revert to the previous version of Validation module, change the `mule-validation-module` dependency version in the project’s `pom.xml` file to the previous version. You must update the project’s `pom.xml` file in Anypoint Studio. ## See Also - [Validation Module Overview](https://docs.mulesoft.com/validation-connector/latest/) - [Validation Module Reference](https://docs.mulesoft.com/validation-connector/latest/validation-documentation) --- product: Validation Module version: 2.0 is-latest-version: true --- # Use Studio to Configure Validation Module 2.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files. To add and configure a connector in Studio: 1. [Create a Mule project](#create-mule-project). 2. [Add the connector to your Mule project](#add-connector-to-project). 3. [Configure a source for the connector’s flow](#configure-input-source). 4. [Add a connector operation to the flow](#add-connector-operation). 5. [Configure a global element for the connector](#configure-global-element). When you run the connector, you can view the app log to check for problems, as described in [View the App Log](#view-app-log). If you are new to configuring connectors in Studio, see [Use Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio). If, after reading this topic, you need additional information about the connector fields, see the [Validation Module Reference](https://docs.mulesoft.com/validation-connector/latest/validation-documentation). ## Create a Mule Project In Studio, create a new Mule project in which to add and configure the connector: 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. ## Add the Connector to Your Mule Project Add Validation module to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and to add the required dependencies to the project’s `pom.xml` file: 1. In the **Mule Palette** view, click **(X) Search in Exchange**. 2. In the **Add Dependencies to Project** window, type `validation` in the search field. 3. Click **Validation Module** in **Available modules**. 4. Click **Add**. 5. Click **Finish**. Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace. ## Configure a Source A source initiates a flow when a specified condition is met. You can configure one of these input sources to use with Validation Module: - **HTTP > Listener** Initiates a flow each time it receives a request on the configured host and port - **Scheduler** Initiates a flow when a time-based condition is met For example, to configure an HTTP listener, follow these steps: 1. In the **Mule Palette** view, select **HTTP > Listener**. 2. Drag **Listener** to the Studio canvas. 3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field. 4. Specify a value for the **Path** field. 5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global element that can be used by all instances of **HTTP Listener** in the app. 6. On the **General** tab, specify the connection information for the connector. 7. On the **TLS** tab, optionally specify the TLS information for the connector. 8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 9. Click **Test Connection** to confirm that Mule can connect with the specified server. 10. Click **OK**. ## Add a Connector Operation to the Flow When you add a connector operation to your flow, you immediately define a specific operation for that connector to perform. To add an operation for Validation module, follow these steps: 1. In the **Mule Palette** view, select **Validation** and then select the desired operation. 2. Drag the operation onto the Studio canvas and to the right of the source. ![Validation module Operations Operations](/mulesoft/current/en-us/validation-connector/latest/_images/validation-module-operations.png) Figure 1. Validation module Operations ## Configure a Global Element for the Connector When you configure a connector, it’s best to configure a global element that all instances of that connector in the app can use. Configuring a global element requires you to provide the authentication credentials that the connector requires to configure I18n for the standard error messages. To configure the global element for Validation module, follow these steps: 1. Select the name of the module in the Studio canvas. 2. Select the operation in the Studio canvas. 3. In the configuration screen for the operation, click the plus sign (**+**) next to the **Module configuration** field to access the global element configuration fields. 4. On the **General** tab, for **I18n**, select one of the following options: - **None** - **Expression** - **Edit inline** - **Global reference** If you select **Edit Inline**, set the following parameters: - **Bundle path** The path to a bundle file containing the messages. If null, then Anypoint Platform chooses a default one. - **Locale** If null, Anypoint Platform chooses the system default. 5. On the **Advanced** tab, optionally specify expiration policy configuration. 6. Click **OK**. ![Validation Module Global Element Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-global-configurations.png) Figure 2. Validation Module Global Element Configuration ## View the App Log To check for problems, you can view the app log as follows: - If you’re running the app from Anypoint Platform, the output is visible in the Anypoint Studio console window. - If you’re running the app using Mule from the command line, the app log is visible in your OS console. Unless the log file path is customized in the app’s log file (`log4j2.xml`), you can also view the app log in the default location `MULE_HOME/logs/.log`. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [Validation Module Reference](https://docs.mulesoft.com/validation-connector/latest/validation-documentation) - [Salesforce Help](https://help.salesforce.com) --- product: Validation Module version: 1.4 --- # Using Anypoint Studio to Configure Validation Module 1.4 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files. To add and configure a connector in Studio: 1. [Create a Mule project](#create-mule-project). 2. [Add the connector to your Mule project](#add-connector-to-project). 3. [Configure a source for the connector’s flow](#configure-input-source). 4. [Add a connector operation to the flow](#add-connector-operation). 5. [Configure a global element for the connector](#configure-global-element). When you run the connector, you can view the app log to check for problems, as described in [View the App Log](#view-app-log). If you are new to configuring connectors in Studio, see [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio). If, after reading this topic, you need additional information about the connector fields, see the [Validation Module Reference](https://docs.mulesoft.com/validation-connector/1.4/validation-documentation). ## Create a Mule Project In Studio, create a new Mule project in which to add and configure the connector: 1. In Studio, select **File > New > Mule Project**. 2. Enter a name for your Mule project and click **Finish**. ## Add the Connector to Your Mule Project Add Validation module to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and to add the required dependencies to the project’s `pom.xml` file: 1. In the **Mule Palette** view, click **(X) Search in Exchange**. 2. In the **Add Dependencies to Project** window, type `validation` in the search field. 3. Click **Validation Module** in **Available modules**. 4. Click **Add**. 5. Click **Finish**. Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace. ## Configure a Source A source initiates a flow when a specified condition is met. You can configure one of these input sources to use with Validation Module: - **HTTP > Listener** Initiates a flow each time it receives a request on the configured host and port - **Scheduler** Initiates a flow when a time-based condition is met For example, to configure an HTTP listener, follow these steps: 1. In the **Mule Palette** view, select **HTTP > Listener**. 2. Drag **Listener** to the Studio canvas. 3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field. 4. Specify a value for the **Path** field. 5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global element that can be used by all instances of **HTTP Listener** in the app. 6. On the **General** tab, specify the connection information for the connector. 7. On the **TLS** tab, optionally specify the TLS information for the connector. 8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy. 9. Click **Test Connection** to confirm that Mule can connect with the specified server. 10. Click **OK**. ## Add a Connector Operation to the Flow When you add a connector operation to your flow, you immediately define a specific operation for that connector to perform. To add an operation for Validation module, follow these steps: 1. In the **Mule Palette** view, select **Validation** and then select the desired operation. 2. Drag the operation onto the Studio canvas and to the right of the source. ![Validation module Operations Operations](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-module-operations.png) Figure 1. Validation module Operations ## Configure a Global Element for the Connector When you configure a connector, it’s best to configure a global element that all instances of that connector in the app can use. Configuring a global element requires you to provide the authentication credentials that the connector requires to configure I18n for the standard error messages. To configure the global element for Validation module, follow these steps: 1. Select the name of the module in the Studio canvas. 2. Select the operation in the Studio canvas. 3. In the configuration screen for the operation, click the plus sign (**+**) next to the **Module configuration** field to access the global element configuration fields. 4. On the **General** tab, for **I18n**, select one of the following options: - **None** - **Expression** - **Edit inline** - **Global reference** If you select **Edit Inline**, set the following parameters: - **Bundle path** The path to a bundle file containing the messages. If null, then Anypoint Platform chooses a default one. - **Locale** If null, Anypoint Platform chooses the system default. 5. On the **Advanced** tab, optionally specify expiration policy configuration. 6. Click **OK**. ![Validation Module Global Element Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-global-configurations.png) Figure 2. Validation Module Global Element Configuration ## View the App Log To check for problems, you can view the app log as follows: - If you’re running the app from Anypoint Platform, the output is visible in the Anypoint Studio console window. - If you’re running the app using Mule from the command line, the app log is visible in your OS console. Unless the log file path is customized in the app’s log file (`log4j2.xml`), you can also view the app log in the default location `MULE_HOME/logs/.log`. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Using Anypoint Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio) - [Validation Module Reference](https://docs.mulesoft.com/validation-connector/1.4/validation-documentation) - [Salesforce Help](https://help.salesforce.com) --- product: Validation Module version: 1.4 --- # Validation Module 1.4 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The Validation module verifies that the content of a message in a Mule flow matches specific criteria. 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`. Based on the specific data you are validating, you can customize the exception message that is displayed in the logs. ## Before You Begin To use this module, you must be familiar with: - Anypoint Connectors - Mule runtime engine (Mule) - Elements and global elements in a Mule flow - Creating a Mule app using Anypoint Studio or Anypoint Code Builder Before creating an app, you must have access to Anypoint Platform and Anypoint Studio. ## Audience - New users, read: - [Using Anypoint Studio to Configure the Validation Module](https://docs.mulesoft.com/validation-connector/1.4/validation-studio-config) to create your Mule app - [Examples](https://docs.mulesoft.com/validation-connector/1.4/validation-examples), which provide one or more use cases for the connector - Advanced users, read: - [XML and Maven Support](https://docs.mulesoft.com/validation-connector/1.4/validation-xml-maven) - [Examples](https://docs.mulesoft.com/validation-connector/1.4/validation-examples), which provides one or more use cases for the connector ## Next Step After you complete the prerequisites and try the examples, you are ready to create your own app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/validation-connector/1.4/validation-studio-config). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [Salesforce Help](https://help.salesforce.com) --- product: Validation Module version: 2.0 is-latest-version: true --- # Validation Module 2.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The Validation module verifies that the content of a message in a Mule flow matches specific criteria. 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`. Based on the specific data you are validating, you can customize the exception message that is displayed in the logs. ## Prerequisites To use this module, you must be familiar with: - Anypoint Connectors - Mule runtime engine (Mule) - Elements and global elements in a Mule flow - Creating a Mule app using Anypoint Studio or Anypoint Code Builder Before creating an app, you must have access to Anypoint Platform and Anypoint Studio. ## Next Step After you complete the prerequisites and try the examples, you are ready to create your own app and configure the connector using [Anypoint Studio](https://docs.mulesoft.com/validation-connector/latest/validation-studio-config). ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [Salesforce Help](https://help.salesforce.com) --- product: Validation Module version: 1.4 --- # Validation Module Documentation Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Validation Module v1.4 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. Release Notes: [Validation Module Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/module-validation) ## Configurations --- ### Default Configuration Default configuration #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

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

x

I18n

Allows to configure I18n for the standard error messages

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before the runtime considers it eligible for expiration. This does not mean that the platform will expire the instance at the exact moment that it becomes eligible. The runtime actually purge the instances as it sees fit.

## Operations - [Is Blank String](#isBlankString) - [Is Elapsed](#isElapsed) - [Is Email](#isEmail) - [Is Empty Collection](#isEmptyCollection) - [Is False](#isFalse) - [Is IP](#isIp) - [Is Not Blacklisted Ip](#isNotBlacklistedIp) - [Is Not Blank String](#isNotBlankString) - [Is Not Elapsed](#isNotElapsed) - [Is Not Empty Collection](#isNotEmptyCollection) - [Is Not Null](#isNotNull) - [Is Null](#isNull) - [Is Number](#isNumber) - [Is Time](#isTime) - [Is True](#isTrue) - [Is URL](#isUrl) - [Is Whitelisted Ip](#isWhitelistedIp) - [Matches Regex](#matchesRegex) - [Validate Size](#validateSize) ### Is Blank String `` Validates that value is a blank String. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Value

String

the value to check

x

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:NOT\_BLANK\_STRING ### Is Elapsed `` Validates the amount of time that has elapsed since the moment in the since parameter is greater than an specified amount of time. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The 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

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:NOT\_ELAPSED\_TIME ### Is Email `` Validates that the email address is valid #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Email

String

an email address

x

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:INVALID\_EMAIL ### Is Empty Collection `` Validates that value is an empty collection. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Values

Array of Any

the value to check

#[payload]

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:NOT\_EMPTY\_COLLECTION ### Is False `` Validates that the given value is false #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Expression

Boolean

the boolean to test

false

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:INVALID\_BOOLEAN ### Is IP `` Validates that an ip address represented as a String is valid #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Ip

String

the ip address to validate

x

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:INVALID\_IP ### Is Not Blacklisted Ip `` Validates that a ipAddress is not present in the ipList. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Ip Address

String

the address to validate

x

Black List

the list of disallowed addresses

x

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:INVALID\_IP - VALIDATION:REJECTED\_IP ### Is Not Blank String `` Validates that value is not a blank String. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Value

String

the String to check

#[payload]

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:BLANK\_STRING ### Is Not Elapsed `` Validates the amount of time that has elapsed since the moment in the since parameter is greater than an specified amount of time. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The 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

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:ELAPSED\_TIME ### Is Not Empty Collection `` Validates that value is not an empty collection. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Values

Array of Any

the value to check

#[payload]

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:EMPTY\_COLLECTION ### Is Not Null `` Validates that the given value is not null. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Value

Any

the value to test

x

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:NULL ### Is Null `` Validates that the given value is null. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Value

Any

the value to test

x

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:NOT\_NULL ### Is Number `` Receives a numeric value as a String and validates that it can be parsed per the rules of a numberType #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Value

String

the value to be tested

x

Locale

String

The locale to use for the format. If not provided it defaults to the system Locale

Pattern

String

The pattern used to format the value

Min Value

String

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

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

the type of number to test value against

x

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:INVALID\_NUMBER ### 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 will be used #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Time

String

A date in String format

x

Locale

String

the locale of the String

Pattern

String

the pattern for the date

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:INVALID\_TIME ### Is True `` Validates that the given value is true #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Expression

Boolean

the boolean to test

false

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:INVALID\_BOOLEAN ### Is URL `` Validates that url is a valid one #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

URL

String

the URL to validate as a String

x

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:INVALID\_URL ### Is Whitelisted Ip `` Validates that a ipAddress is present in the ipList. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Ip Address

String

the address to validate

x

White List

the list of allowed addresses

x

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:INVALID\_IP - VALIDATION:REJECTED\_IP ### Matches Regex `` Validates that value matches the regex regular expression #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Value

String

the value to check

x

Regex

String

the regular expression to check against

x

Case Sensitive

Boolean

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

true

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:MISMATCH ### 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
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Value

Any

the value to validate

x

Min

Number

the minimum expected length (inclusive, defaults to zero)

0

Max

Number

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

Message

String

Specifies the message that is to be notified to the user if the validation fails. It’s marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed

#### For Configurations. - [Default Configuration](#config) #### Throws - VALIDATION:INVALID\_SIZE ### All `` Perform a list of nested validation operations and informs only one VALIDATION:MULTIPLE error which summarizes all of the found errors (if any). #### Throws - VALIDATION:MULTIPLE ### Any **Available since version 1.3** `` Perform a list of nested validation operations and informs one VALIDATION:MULTIPLE error which summarizes all of the found errors if none of the inner validations were successful. #### Throws - VALIDATION:MULTIPLE ## Types ### I18n
FieldTypeDescriptionDefault ValueRequired

Bundle Path

String

The path to a bundle file containing the messages. If null then the platform will choose a default one

x

Locale

String

The locale of the null the platform will choose the system default

### Expiration Policy
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A time unit that qualifies the maxIdleTime attribute

### IP Filter List
FieldTypeDescriptionDefault ValueRequired

Ips

Array of String

x

## See Also [Salesforce Help](https://help.salesforce.com) --- product: Validation Module version: 2.0 is-latest-version: true --- # Validation Module Documentation Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt 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. Release Notes: [Validation Module Release Notes](https://docs.mulesoft.com/release-notes/mule-runtime/module-validation) ## Configurations --- ### Config Default configuration #### Parameters
NameTypeDescriptionDefault ValueRequired

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.

## Supported Operations - [Is Allowed Ip](#IsAllowedIp) - [Is Blank String](#IsBlankString) - [Is Elapsed](#IsElapsed) - [Is Email](#IsEmail) - [Is Empty Collection](#IsEmptyCollection) - [Is False](#IsFalse) - [Is IP](#IsIp) - [Is Not Blank String](#IsNotBlankString) - [Is Not Denied Ip](#IsNotDeniedIp) - [Is Not Elapsed](#IsNotElapsed) - [Is Not Empty Collection](#IsNotEmptyCollection) - [Is Not Null](#IsNotNull) - [Is Null](#IsNull) - [Is Number](#IsNumber) - [Is Time](#IsTime) - [Is True](#IsTrue) - [Is URL](#IsUrl) - [Matches Regex](#MatchesRegex) - [Validate Size](#ValidateSize) ## Operations ## Is Allowed Ip `` Validates that an IP address is present in the IP list. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:INVALID\_IP - VALIDATION:REJECTED\_IP ## Is Blank String `` Validates that value is a blank String. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:NOT\_BLANK\_STRING ## Is Elapsed `` Validates that a given time has elapsed since the specified initial time. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:NOT\_ELAPSED\_TIME ## Is Email `` Validates that the email address is valid. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:INVALID\_EMAIL ## Is Empty Collection `` Validates that value is an empty collection. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:NOT\_EMPTY\_COLLECTION ## Is False `` Validates that the given value is false ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:INVALID\_BOOLEAN ## Is IP `` Validates that an IP address represented as a String is valid. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:INVALID\_IP ## Is Not Blank String `` Validates that value is not a blank String. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:BLANK\_STRING ## Is Not Denied Ip `` Validates that an IP address is not present in the IP list. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:INVALID\_IP - VALIDATION:REJECTED\_IP ## Is Not Elapsed `` Validates that a given time has not elapsed since the specified initial time. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:ELAPSED\_TIME ## Is Not Empty Collection `` Validates that value is not an empty collection. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:EMPTY\_COLLECTION ## 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
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:NULL ## 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
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:NOT\_NULL ## Is Number `` Receives a numeric value as a String and validates that it can be parsed per the rules of a numberType. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:INVALID\_NUMBER ## 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
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:INVALID\_TIME ## Is True `` Validates that the given value is `true`. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:INVALID\_BOOLEAN ## Is URL `` Validates that url is valid. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:INVALID\_URL ## Matches Regex `` Validates that the value matches to the regex regular expression. ### Parameters
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:MISMATCH ## 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
NameTypeDescriptionDefault ValueRequired

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 - [Config](#Config) ### Throws - VALIDATION:INVALID\_SIZE ## 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
NameTypeDescriptionDefault ValueRequired

Error Mappings

Array of Error Mapping

Set of error mappings.

### Throws - VALIDATION:MULTIPLE ## 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
NameTypeDescriptionDefault ValueRequired

Error Mappings

Array of Error Mapping

Set of error mappings.

### Throws - VALIDATION:MULTIPLE ## Types ### I18n
FieldTypeDescriptionDefault ValueRequired

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.
FieldTypeDescriptionDefault ValueRequired

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
FieldTypeDescriptionDefault ValueRequired

Ips

Array of String

x

### Error Mapping
FieldTypeDescriptionDefault ValueRequired

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

Target

String

x

## See Also [Salesforce Help](https://help.salesforce.com) --- product: Validation Module version: 1.4 --- # Validation Module Examples 1.4 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following examples illustrate how to configure Validation module-supported operations both in Anypoint Studio and the XML editor. ## Configure the Is IP Operation The **Is IP** operation checks that a given IP address is valid. It supports both IPV4 and IPV6 addresses. In the case of IPV6, the operation supports both full and collapsed addresses, but not addresses containing ports. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is IP**. 2. Drag **Is IP** onto the Studio canvas. 3. In the **Is IP** configuration screen, provide the following parameters: - **Ip**: `payload` - **Message**: `The value provided is not a valid IP address.` ![Is IP Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isip.png) Figure 1. Is IP Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is URL Operation The **Is URL** operation validates that a given string can be interpreted as a URL. This is done by invoking the URL (string) constructor in the `java.net.URL` class. If this constructor throws an exception, then the validation fails. Any string that this constructor accepts is considered valid. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is URL**. 2. Drag **Is URL** onto the Studio canvas. 3. In the **Is URL** configuration screen, set the **URL** field to `vars.callbackUrl`: ![Is URL Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isurl.png) Figure 2. Is URL Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Blank String Operation The **Is blank string** operation validates that the provided value is a blank string. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is blank string**. 2. Drag **Is blank string** to the Studio canvas. 3. In the **Is blank string** configuration screen, set the **Value** field to `payload`: ![Is blank string Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isblankstring.png) Figure 3. Is blank string Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Elapsed Operation The **Is elapsed** operation validates that a given time has elapsed since the specified initial time. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is elapsed**. 2. Drag **Is elapsed** onto the Studio canvas. 3. In the **Is elapsed** configuration screen, provide the following parameters: - **Time**: `20` - **Time unit**: `SECONDS` - **Since**: `vars.initialTime` ![Is elapsed Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-iselapsed.png) Figure 4. Is elapsed Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Email Operation The **Is email** operation checks that a given email is valid. The value defaults to the email payload. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is email**. 2. Drag **Is email** onto the Studio canvas. 3. In the **Is email** configuration screen, provide the following parameters: - **Email**: `vars.email` - **Message**: `The value is not a valid email.` ![Is email Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isemail.png) Figure 5. Is email Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Empty Collection Operation The **Is empty collection** operation validates that the provided value is an empty collection. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is empty collection**. 2. Drag **Is empty collection** onto the Studio canvas. 3. In the **Is empty collection** configuration screen, set the **Value** field to `payload`: ![Is empty collection Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isemptycollection.png) Figure 6. Is empty collection Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is False Operation The **Is false** operation validates that an expression evaluates to `false`. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is false**. 2. Drag **Is false** onto the Studio canvas. 3. In the **Is false** configuration screen, for the **Expression** field, select `Expression`, and in the empty field add `#[vars.withFailures]`: ![Is false collection Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isfalse.png) Figure 7. Is false Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Not Blacklisted IP Operation The **Is not blacklisted IP** operation validates that a given IP is not in the blacklisted IP list. You can define the IP filter list either globally in the app or inline for each validator. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is not blacklisted IP**. 2. Drag **Is not blacklisted IP** onto the Studio canvas. 3. In the **Is not blacklisted IP** configuration screen, provide the following parameters: - **Ip address**: `vars.ip` - **Black list**: `Edit inline` - **Ips**: `Edit inline` 4. Click the plus sign (**+**) to open the IP value window. 5. Set the **Value** field to `2001:db8::/48`: ![Is not blacklisted IP collection Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isnotblacklisted.png) Figure 8. Is not blacklisted IP Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Not Blank String Operation The **Is not blank string** validates that the provided value is not a blank string. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is not blank string**. 2. Drag **Is not blank string** onto the Studio canvas. 3. In the **Is not blank string** configuration screen, provide the following parameters: - **Value**: `payload` - **Message**: `The username cannot be blank` ![Is not blank string Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isnotblankstring.png) Figure 9. Is not blank string Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Not Elapsed Time Operation The **Is not elapsed** operation validates that a given time has not elapsed since the specified initial time. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is not elapsed**. 2. Drag **Is not elapsed** onto the Studio canvas. 3. In the **Is not elapsed** configuration screen, provide the following parameters: - **Time**: `20` - **Time unit**: `SECONDS` - **Since**: `vars.time` ![.Is not elapsed time Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isnotelapsed.png) Figure 10. Is not elapsed time Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Not Empty Collection Operation The **Is not empty collection** parameter validates that a value is not an empty collection. This value defaults to the payload. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is not empty collection**. 2. Drag **Is not empty collection** onto the Studio canvas. 3. In the **Is not empty collection** configuration screen, set the **Value** field to `payload`: ![Is not empty collection Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isnotemptycollection.png) Figure 11. Is not empty collection Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Not Null Operation The **Is not null** operation validates that the given value is not `null`. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is not null**. 2. Drag **Is not null** onto the Studio canvas. 3. In the **Is not null** configuration screen, provide the following parameters: - **Value**: `payload` - **Message**: `Null is not a valid value`. ![Is not null Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isnotnull.png) Figure 12. Is not null Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Null Operation The **Is Null** operation validates if the provided value is `null`. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is null**. 2. Drag **Is null** onto the Studio canvas. 3. In the **Is null** configuration screen, set the **Value** field to `payload`: ![Is null Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isnull.png) Figure 13. Is null Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Number Operation The **Is number** operation verifies that a string can be parsed as a number of a specified numeric type, using the given locale (which defaults to the system locale) and pattern (which defaults to the locale pattern). This validation can include a range in which the number is validated using the **Min value** and **Max Value** parameters. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is number**. 2. Drag **Is number** onto the Studio canvas. 3. In the **Is number** configuration screen, provide the following parameters: - **Value**: `payload` - **Locale**: `US` - **Min value**: `vars.minValue` - **Max value**: `vars.maxValue` - **Number type**: `INTEGER` ![Is number Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-isnumber.png) Figure 14. Is number Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Time Operation The **Is time** operation verifies that a time is valid for the given pattern and locale. If no pattern is provided, then the locale default is used. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is time**. 2. Drag **Is time** onto the Studio canvas. 3. In the **Is time** configuration screen, provide the following parameters: - **Time**: `payload` - **Locale**: `h:mm a` - **Pattern**: `UK` ![Is time Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-istime.png) Figure 15. Is time Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is True Operation The **Is true** operation verifies that an expression evaluates to `true`. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is true**. 2. Drag **Is true** onto the Studio canvas. 3. In the **Is true** configuration screen, for the **Expression** field select `Expression`, and in the empty field add `#[vars.doReply]`. ![Is true Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-istrue.png) Figure 16. Is true Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Is Whitelisted IP Operation The **Is whitelisted ip** operation validates that a given IP is in the whitelisted IP list. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is whitelisted ip**. 2. Drag **Is whitelisted ip** onto the Studio canvas. 3. In the **Is whitelisted ip** configuration screen, provide the following parameters: - **Ip address**: `#[payload]` - **White list**: `Edit inline` - **Ips**: `Edit inline` 4. Click the plus sign (**+**) to open the IP value window. 5. Set **Value** to `192.168.1.0/24`. 6. Repeat the previous two steps and add the IP addresses `127.0.0.1` and `193.1`: ![Is whitelisted ip Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-iswhitelistedip.png) Figure 17. Is whitelisted ip Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Matches Regex Operation The **Matches regex** operation validates that a given expression matches a Java regular expression. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Matches regex**. 2. Drag **Matches regex** onto the Studio canvas. 3. In the **Expression** field of the **Matches regex** configuration screen, select `Expression`, and in the empty field add `#[vars.doReply]`: ![Matches regex Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-matchesregex.png) Figure 18. Matches regex Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the Validate Size Operation The **Validate size** operation validates that the input size is between the given minimum and maximum boundaries. This is valid for inputs of type string, Collection, Map, and Array. In the case of a string, the size refers to the length in characters. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Validate size**. 2. Drag **Validate size** onto the Studio canvas. 3. In the **Validate size** configuration screen, provide the following parameters: - **Value**: `payload` - **Min**: `vars.minLength` - **Max**: `vars.maxLength` ![Validate size Configuration](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-validatesize.png) Figure 19. Validate size Configuration In the XML editor, the configuration looks like this: ```xml ``` ## Configure the All Scope The **All** scope evaluates a list of nested validation operations and can return only one `VALIDATION:MULTIPLE` error which summarizes all of the found errors. Sometimes you want to evaluate several conditions, and some might fail simultaneously. In these cases, generate a single error that contains all of the descriptions. About the **All** scope validator: - All validations are executed even if all of them fail. - If any of the validations fail, a single exception is thrown. The exception contains a multiline message in which each line corresponds to a failing validation. - Validators are executed sequentially using the flow’s thread, but the order doesn’t matter because validators don’t cause any side effects. - Unlike the rest of the validation operations, the **All** scope validator does not enable you to customize the exception type or the message through `validation:exception` or exception factory elements. However, you can customize the message of the inner validation operations. The following example shows how to configure the **All** scope validator in Anypoint Studio that simultaneously validates that: - The first and last name are not empty strings. - The age is a valid integer above 18. - The email address is valid. - The social security number is the correct length and matches a regular expression. To configure the **All** scope in Studio: 1. In the **Mule Palette** view, select **Validation > All**. 2. Drag **All** onto the Studio canvas. 3. Drag the **Is not empty collection** operation into the **All** scope in the flow. 4. In the **Is not empty collection** configuration screen, set the **Values** field to `#[payload.firstName]` and the `Message` field to `First name cannot be empty`. 5. Drag another **Is not empty collection** operation to the right of the first **Is not empty collection** operation. 6. In the **Is not empty collection** configuration screen, set the **Values** field to `#[payload.lastName]` and the `Message` field to `Last name cannot be empty`. 7. Drag the **Is number** operation to the right of the second **Is not empty collection** operation. 8. In the **Is number** configuration screen, provide the following parameters: - **Value**: `payload.age` - **Min value**: `18` - **Number type**: `INTEGER` 9. Set the **Message** field to `Not an adult`. 10. Drag the **Is email** operation to the right of the **Is number** operation. 11. In the **Is email** configuration screen, set the **Email** field to `payload.email`. 12. Drag the **Matches regex** operation to the right of the **Is email** operation. 13. In the **Matches regex** configuration screen, provide the following parameters: - **Value** `payload.ssn` - **Regex** `^(?!000|666)[0-8][0-9]{2}-(?!00)[0-9]{2}-(?!0000)[0-9]{4}$` 14. Set the **Message** field to `Invalid SSN`. 15. Drag the **Validate size** operation to the right of the **Matches regex** operation. 16. In the **Validate size** configuration screen, provide the following parameters: - **Value**: `payload.ssn` - **Min**: `11` - **Max**: `11` 17. Set the **Message** field to `SSN too short`: ![All scope flow](/mulesoft/current/en-us/validation-connector/1.4/_images/validation-allscope.png) Figure 20. All scope Flow In the XML editor, the configuration looks like this: ```xml ``` ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Validation Module version: 2.0 is-latest-version: true --- # Validation Module Examples 2.0 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt The following examples illustrate how to configure Validation module-supported operations both in Anypoint Studio and the XML editor. ## Configure the Is IP Operation The **Is IP** operation checks that a given IP address is valid. It supports both IPV4 and IPV6 addresses. In the case of IPV6, the operation supports both full and collapsed addresses, but not addresses containing ports. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is IP**. 2. Drag **Is IP** onto the Studio canvas. 3. In the **Is IP** configuration screen, provide the following parameters: - **Ip**: `payload` - **Message**: `The value provided is not a valid IP address.` ![Is IP Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isip.png) Figure 1. Is IP Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is URL Operation The **Is URL** operation validates that a given string can be interpreted as a URL. This is done by invoking the URL (string) constructor in the `java.net.URL` class. If this constructor throws an exception, then the validation fails. Any string that this constructor accepts is considered valid. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is URL**. 2. Drag **Is URL** onto the Studio canvas. 3. In the **Is URL** configuration screen, set the **URL** field to `vars.callbackUrl`: ![Is URL Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isurl.png) Figure 2. Is URL Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Blank String Operation The **Is blank string** operation validates that the provided value is a blank string. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is blank string**. 2. Drag **Is blank string** to the Studio canvas. 3. In the **Is blank string** configuration screen, set the **Value** field to `payload`: ![Is blank string Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isblankstring.png) Figure 3. Is blank string Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Elapsed Operation The **Is elapsed** operation validates that a given time has elapsed since the specified initial time. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is elapsed**. 2. Drag **Is elapsed** onto the Studio canvas. 3. In the **Is elapsed** configuration screen, provide the following parameters: - **Time**: `20` - **Time unit**: `SECONDS` - **Since**: `vars.initialTime` ![Is elapsed Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-iselapsed.png) Figure 4. Is elapsed Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Email Operation The **Is email** operation checks that a given email is valid. The value defaults to the email payload. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is email**. 2. Drag **Is email** onto the Studio canvas. 3. In the **Is email** configuration screen, provide the following parameters: - **Email**: `vars.email` - **Message**: `The value is not a valid email.` ![Is email Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isemail.png) Figure 5. Is email Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Empty Collection Operation The **Is empty collection** operation validates that the provided value is an empty collection. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is empty collection**. 2. Drag **Is empty collection** onto the Studio canvas. 3. In the **Is empty collection** configuration screen, set the **Value** field to `payload`: ![Is empty collection Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isemptycollection.png) Figure 6. Is empty collection Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is False Operation The **Is false** operation validates that an expression evaluates to `false`. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is false**. 2. Drag **Is false** onto the Studio canvas. 3. In the **Is false** configuration screen, for the **Expression** field, select `Expression`, and in the empty field add `#[vars.withFailures]`: ![Is false collection Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isfalse.png) Figure 7. Is false Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Not Denied IP Operation The **Is not denied ip** operation validates that a given IP is not in the denied IP list. You can define the IP filter list either globally in the app or inline for each validator. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is not denied ip**. 2. Drag **Is not denied ip** onto the Studio canvas. 3. In the **Is not denied ip** configuration screen, provide the following parameters: - **Ip address**: `vars.ip` - **Deny list**: `Edit inline` - **Ips**: `Edit inline` 4. Click the plus sign (**+**) to open the IP value window. 5. Set the **Value** field to `Valid IP`: In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Not Blank String Operation The **Is not blank string** validates that the provided value is not a blank string. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is not blank string**. 2. Drag **Is not blank string** onto the Studio canvas. 3. In the **Is not blank string** configuration screen, provide the following parameters: - **Value**: `payload` - **Message**: `The username cannot be blank` ![Is not blank string Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isnotblankstring.png) Figure 8. Is not blank string Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Not Elapsed Time Operation The **Is not elapsed** operation validates that a given time has not elapsed since the specified initial time. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is not elapsed**. 2. Drag **Is not elapsed** onto the Studio canvas. 3. In the **Is not elapsed** configuration screen, provide the following parameters: - **Time**: `20` - **Time unit**: `SECONDS` - **Since**: `vars.time` ![.Is not elapsed time Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isnotelapsed.png) Figure 9. Is not elapsed time Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Not Empty Collection Operation The **Is not empty collection** parameter validates that a value is not an empty collection. This value defaults to the payload. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is not empty collection**. 2. Drag **Is not empty collection** onto the Studio canvas. 3. In the **Is not empty collection** configuration screen, set the **Value** field to `payload`: ![Is not empty collection Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isnotemptycollection.png) Figure 10. Is not empty collection Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Not Null Operation The **Is not null** operation validates that the given value is not `null`. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is not null**. 2. Drag **Is not null** onto the Studio canvas. 3. In the **Is not null** configuration screen, provide the following parameters: - **Value**: `payload` - **Message**: `Null is not a valid value`. ![Is not null Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isnotnull.png) Figure 11. Is not null Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Null Operation The **Is Null** operation validates if the provided value is `null`. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is null**. 2. Drag **Is null** onto the Studio canvas. 3. In the **Is null** configuration screen, set the **Value** field to `payload`: ![Is null Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isnull.png) Figure 12. Is null Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Number Operation The **Is number** operation verifies that a string can be parsed as a number of a specified numeric type, using the given locale (which defaults to the system locale) and pattern (which defaults to the locale pattern). This validation can include a range in which the number is validated using the **Min value** and **Max Value** parameters. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is number**. 2. Drag **Is number** onto the Studio canvas. 3. In the **Is number** configuration screen, provide the following parameters: - **Value**: `payload` - **Locale**: `US` - **Min value**: `vars.minValue` - **Max value**: `vars.maxValue` - **Number type**: `INTEGER` ![Is number Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-isnumber.png) Figure 13. Is number Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Time Operation The **Is time** operation verifies that a time is valid for the given pattern and locale. If no pattern is provided, then the locale default is used. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is time**. 2. Drag **Is time** onto the Studio canvas. 3. In the **Is time** configuration screen, provide the following parameters: - **Time**: `payload` - **Locale**: `h:mm a` - **Pattern**: `UK` ![Is time Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-istime.png) Figure 14. Is time Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is True Operation The **Is true** operation verifies that an expression evaluates to `true`. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is true**. 2. Drag **Is true** onto the Studio canvas. 3. In the **Is true** configuration screen, for the **Expression** field select `Expression`, and in the empty field add `#[vars.doReply]`. ![Is true Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-istrue.png) Figure 15. Is true Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Is Allowed IP Operation The **Is allowed ip** operation validates that a given IP is in the allowlisted IP list. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Is allowed ip**. 2. Drag **Is allowed ip** onto the Studio canvas. 3. In the **Is allowed ip** configuration screen, provide the following parameters: - **Ip address**: `#[payload]` - **Allow list**: `Edit inline` - **Ips**: `Edit inline` 4. Click the plus sign (**+**) to open the IP value window. 5. Set **Value** to `Valid IP`. In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Matches Regex Operation The **Matches regex** operation validates that a given expression matches a Java regular expression. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Matches regex**. 2. Drag **Matches regex** onto the Studio canvas. 3. In the **Expression** field of the **Matches regex** configuration screen, select `Expression`, and in the empty field add `#[vars.doReply]`: ![Matches regex Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-matchesregex.png) Figure 16. Matches regex Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the Validate Size Operation The **Validate size** operation validates that the input size is between the given minimum and maximum boundaries. This is valid for inputs of type string, Collection, Map, and Array. In the case of a string, the size refers to the length in characters. The following example shows how to configure the operation in Anypoint Studio: 1. In the **Mule Palette** view, select **Validation > Validate size**. 2. Drag **Validate size** onto the Studio canvas. 3. In the **Validate size** configuration screen, provide the following parameters: - **Value**: `payload` - **Min**: `vars.minLength` - **Max**: `vars.maxLength` ![Validate size Configuration](/mulesoft/current/en-us/validation-connector/latest/_images/validation-validatesize.png) Figure 17. Validate size Configuration In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## Configure the All Scope The **All** scope evaluates a list of nested validation operations and can return only one `VALIDATION:MULTIPLE` error which summarizes all of the found errors. Sometimes you want to evaluate several conditions, and some might fail simultaneously. In these cases, generate a single error that contains all of the descriptions. About the **All** scope validator: - All validations are executed even if all of them fail. - If any of the validations fail, a single exception is thrown. The exception contains a multiline message in which each line corresponds to a failing validation. - Validators are executed sequentially using the flow’s thread, but the order doesn’t matter because validators don’t cause any side effects. - Unlike the rest of the validation operations, the **All** scope validator does not enable you to customize the exception type or the message through `validation:exception` or exception factory elements. However, you can customize the message of the inner validation operations. > [!NOTE] **All** and **Any** scopes return the `VALIDATION:MULTIPLE` error when evaluating nested > validation operations, unless a nested operation is not a `VALIDATION` type operation. When you > use nested operations inside an **All** or **Any** scopes, you can modify the **Error Mapping** > configuration of the scope to not return `VALIDATION:MULTIPLE` error and instead map the error to > a different one. The following example shows how to configure the **All** scope validator in Anypoint Studio that simultaneously validates that: - The first and last name are not empty strings. - The age is a valid integer above 18. - The email address is valid. - The social security number is the correct length and matches a regular expression. To configure the **All** scope in Studio: 1. In the **Mule Palette** view, select **Validation > All**. 2. Drag **All** onto the Studio canvas. 3. Drag the **Is not empty collection** operation into the **All** scope in the flow. 4. In the **Is not empty collection** configuration screen, set the **Values** field to `#[payload.firstName]` and the `Message` field to `First name cannot be empty`. 5. Drag another **Is not empty collection** operation to the right of the first **Is not empty collection** operation. 6. In the **Is not empty collection** configuration screen, set the **Values** field to `#[payload.lastName]` and the `Message` field to `Last name cannot be empty`. 7. Drag the **Is number** operation to the right of the second **Is not empty collection** operation. 8. In the **Is number** configuration screen, provide the following parameters: - **Value**: `payload.age` - **Min value**: `18` - **Number type**: `INTEGER` 9. Set the **Message** field to `Not an adult`. 10. Drag the **Is email** operation to the right of the **Is number** operation. 11. In the **Is email** configuration screen, set the **Email** field to `payload.email`. 12. Drag the **Matches regex** operation to the right of the **Is email** operation. 13. In the **Matches regex** configuration screen, provide the following parameters: - **Value** `payload.ssn` - **Regex** `^(?!000|666)[0-8][0-9]{2}-(?!00)[0-9]{2}-(?!0000)[0-9]{4}$` 14. Set the **Message** field to `Invalid SSN`. 15. Drag the **Validate size** operation to the right of the **Matches regex** operation. 16. In the **Validate size** configuration screen, provide the following parameters: - **Value**: `payload.ssn` - **Min**: `11` - **Max**: `11` 17. Set the **Message** field to `SSN too short`: ![All scope flow](/mulesoft/current/en-us/validation-connector/latest/_images/validation-allscope.png) Figure 18. All scope Flow In the **Configuration XML** editor, the configuration looks like this: ```xml ``` ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Validation Module version: 1.4 --- # Validation Module XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio. If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. When you add the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/validation http://www.mulesoft.org/schema/mule/validation/current/mule-validation.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml org.mule.modules mule-validation-module x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `validation module`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com) --- product: Validation Module version: 2.0 is-latest-version: true --- # Validation Module XML and Maven Support > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Although you can manually code a Mule app in XML, it is more efficient to use Anypoint Studio. If you manually code a Mule runtime engine (Mule) app in XML, either from the Anypoint Studio XML editor or from a text editor, you can get access to the connector in your app by adding reference statements to both your XML Mule flow and the Apache Maven `pom.xml` file. When you add the connector in Studio, Studio automatically populates the XML code with the connector’s namespace and schema location. It also adds a dependency to the `pom.xml` file. ## Add a Namespace for the Connector Paste the following code inside the `` tag of the header of your configuration XML: ```xml http://www.mulesoft.org/schema/mule/validation http://www.mulesoft.org/schema/mule/validation/current/mule-validation.xsd ``` This example shows how the namespace statements are placed in the `` XML block: ```xml ``` ## Add a POM File Dependency The Apache Maven `pom.xml` file generated by Anypoint Studio contains dependencies for a Mule app. If you code a Mule app manually, include this XML snippet in your `pom.xml` file to enable access to this connector: ```xml org.mule.modules mule-validation-module x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `validation module`. 4. Select the connector. 5. Click **Dependency Snippets** near the upper right of the screen. ## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Salesforce Help](https://help.salesforce.com)