How do I use the When Condition mapping function?
i have an xml file with some fields a field TYPE and a field NUMMER
field type can contain the value BURGER or BEDRIJF
if the field type is BURGER then the field NUMMER can contain an value of 8 or 9 numbers.
the value should always be 9 numbers or empty if the value is 8 numbers then we have to add a leading 0.
if the field "type" has an value of BEDRIJF then the value of NUMMER stays as it is
SO in xml
<TYPE>BURGER</TYPE>
<NUMMER>123456789</NUMMER>
should stay unaltered
or
<TYPE>BURGER</TYPE>
<NUMMER>12345678</NUMMER>
should be altered to
<TYPE>BURGER</TYPE>
<NUMMER>012345678</NUMMER>
or
<TYPE>BURGER</TYPE>
<NUMMER></NUMMER>
should stay unaltered
or
<TYPE>BEDRIJF</TYPE>
<NUMMER>789</NUMMER>
should stay unaltered
how can i acomplish this ?
-
Please use below when condition in your data mapping:-
WHEN CONDITION{($Input_XMLSchema/GetOrders/TYPE = 'BURGER' and string-length($Input_XMLSchema/GetOrders/NUMMER ) =9) or ($Input_XMLSchema/GetOrders/TYPE = 'BURGER' and string-length($Input_XMLSchema/GetOrders/NUMMER ) =0) or ($Input_XMLSchema/GetOrders/TYPE = 'BEDRIJF') } VALUE=[$Input_XMLSchema/GetOrders/NUMMER] OTHERWISE VALUE=[ concat( substring( '000000000', 1, 9 - string-length($Input_XMLSchema/GetOrders/NUMMER )) , $Input_XMLSchema/GetOrders/NUMMER) ]
0
Post is closed for comments.
Comments
1 comment