what are anypoint validations with mulesoft

11
What are Anypoint Validations With Mulesoft

Upload: jitendra-bafna

Post on 20-Mar-2017

64 views

Category:

Software


1 download

TRANSCRIPT

Page 1: What are Anypoint Validations With Mulesoft

What are Anypoint Validations With Mulesoft

Page 2: What are Anypoint Validations With Mulesoft

Anypoint ValidationValidations is out-of-box feature available with Mulesoft to verify the content of message in the Mule flow like validating the date format, email address, url, IP etc. The advantage of validations over the filters is traceability. Filter raised the all identical exceptions which is difficult to understand where the exceptions was raised where as validations provide exceptions with some meaningful message and its easy to understand.

• If message doesn't meets a specified criteria, the validation fails and ValidationException will be raised.

• Exception raised have a meaningful message attached. You can optionally customize the message as well as exception raised.

• There is facility to build your own custom validator if out-of-box validations doesn't match your requirements.

Validator can be used as Message Processor as well as MEL (Mule Expression Language).

Page 3: What are Anypoint Validations With Mulesoft

Anypoint ValidationValidate Email Address

It is used to check the email address is valid or not. e.g. [email protected]

Page 4: What are Anypoint Validations With Mulesoft

Anypoint ValidationValidate URL

It is used to check the url is valid or not. e.g. http://www.dzone.com

Page 5: What are Anypoint Validations With Mulesoft

Anypoint ValidationValidate Regular Expression

It is used to check the content of message on defined pattern. e.g. ^[1-9]\d*$

Page 6: What are Anypoint Validations With Mulesoft

Anypoint ValidationValidate Size

It is used validate the input message size between min and max boundaries. It's valid for inputs like Map, Array, String and Collections.

Page 7: What are Anypoint Validations With Mulesoft

Anypoint ValidationValidate IP

It is used to check the IP is valid or not. e.g. 10.10.131.122

Page 8: What are Anypoint Validations With Mulesoft

Anypoint ValidationValidate String, Collection or Map Is Not Empty

In case of String, the definition of not empty is if length of input data is greater than zero and in case of Map and Collection, the definition of not empty, it refers how many items it contains.

Page 9: What are Anypoint Validations With Mulesoft

Anypoint ValidationIs True and Is False Fallback Validators

You have seen many validations above and sometime there might be scenario which cannot be meet from above validations. So you can use two fallback validators, to evaluate the expression is True or is False.

Page 10: What are Anypoint Validations With Mulesoft

Anypoint ValidationValidating Multiple Conditions at Once

There may be scenario where you need to validate the several conditions. If more than one condition fails, it is ideal to generate a single error with all the description.

• Validators are executed sequentially in flow's thread.

• All validations are executed, even all validations fails.

• Unlike the rest of the validators, the all validator does not allow you to directly customize the exception type or the message through validation

• If any of the validators fails, only single error will be thrown.

Page 11: What are Anypoint Validations With Mulesoft

Thank You