Products | Versions |
---|---|
TIBCO MDM Studio | - |
Not Applicable | - |
Description:
While using MDM, it maybe necessary to write a validation to check if the format in the phone number format is correct. This can be done using the rulebase in MDM. The following validation checks if the phone number entered is in format (123-123-1234). (Supplied in the attachment (Filename: phone_format_validation.txt)).
<constraint>
<name>CHECK_phone format</name>
<description>CHECK_phone format</description>
<usefor>
<var>a</var>
</usefor>
<action>
<check>
<explanation>a vaildation.</explanation>
<match>
<var/>
<const type="string">/^[0-9][0-9][0-9][\-][0-9][0-9][0-9][\-][0-9][0-9][0-9][0-9]$/</const>
</match>
</check>
</action>
</constraint>
<constraint>
<name>CHECK_phone format</name>
<description>CHECK_phone format</description>
<usefor>
<var>a</var>
</usefor>
<action>
<check>
<explanation>a vaildation.</explanation>
<match>
<var/>
<const type="string">/^[0-9][0-9][0-9][\-][0-9][0-9][0-9][\-][0-9][0-9][0-9][0-9]$/</const>
</match>
</check>
</action>
</constraint>