To validate Email element, drag If-Then activity into Actions placeholder of Validation stage from Flow Control. In Properties tab, bring up expression editor for Condition property and give the Expression as:
not(fn:matches($body/cus:Customer/Email/text(), ‘[a-zA-Z0-9]+@[a-zA-Z]+\.[a-z A-Z]{2,3}’,’i’))
Alternatively, you can drag fn:matches function from Functions->XQuery 1.0 Functions ->
Strings -> Pattern Matching -> matches as shown below:

Also you can drag Email element from Variables -> body -> CreateCustomer -> $body – request -> Customer -> Email as shown below and modify expression to above condition.

Drag Raise Error activity into If branch from Flow Control, and set properties as shown below.
You can remove Else branch by selecting Delete on right click.

Now your Validation stage should look like below.

Laisser un commentaire