KB Article #176420
Pattern definition regex not working properly
Problem
When importing an XML Schema as an XML BDoc in Mapping Services, if there are regex pattern definitions set on the leafs, they are not proerly taken into account.You might see the following error:
[CNV - 9002]: Field too long (8), defined length is 6
[CNV - 9030]: Cannot convert string field (ILTYUS65) (Business-Document Element AnyBIC of Business-Document MAPSERVICE.TEST.Document) from external to internal format
[XOB - 101]: Conversion to internal format has failed: Field too long (8), defined length is 6. Field name is Document[1]\CdtrPmtActvtnReqStsRpt[1]\SEQUENCE[1]\GrpHdr[1]\SEQUENCE[1]\InitgPty[1]\SEQUENCE[1]\Id[1]\CHOICE[1]\OrgId[1]\SEQUENCE[1]\AnyBIC[1]
[XOB - 105]: Facets check failed
[MON - 1043]: Unable to check BusinessDocument instance (MAPSERVICE.TEST.Document)
XML XMP_RejectBDInstance start
[XML - 0]: Conversion to internal format has failed: Field too long (8), defined length is 6. Field name is Document[1]\CdtrPmtActvtnReqStsRpt[1]\SEQUENCE[1]\GrpHdr[1]\SEQUENCE[1]\InitgPty[1]\SEQUENCE[1]\Id[1]\CHOICE[1]\OrgId[1]\SEQUENCE[1]\AnyBIC[1] Document line 23 position 23.
XML XMP_RejectBDInstance done
For an example regex like below:
([A-Z]{6,11}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1})
Resolution
Import the Schema as an XSD BDoc.
When the schema is imported as XSD BDoc the validation of the input will be done against the XML schema. This means the pattern defined in XML schema will be used no matter what definition is displayed in the BDoc editor.
Just make sure "Check input attributes" is checked in Flow properties if the XSD BDoc is used as input or "Check output attributes" for output BDoc.
It is not possible to have regex in pattern definition for XML or other BDoc (except XSD).