How the Dwl code be altered to manipulate with empty spaces to match desired length?

84 views Asked by At

Our requirement is to convert XML to fixed length (Cobol Copy Book). I am using dataweave for transformation.

enter image description here

As per the copy book schema, maximum occurrence of “EmpNumArray” is 2. The transformation working fine if the corresponding repeated element(EmpNumArray) in the input xml occurs 2 times.

But most of the time we only get one occurrence of “EmpNumArray”, in this scenario – transformation failed with the error “”.

Question: How the Dwl code be altered to manipulate with empty spaces to match desired length?

1

There are 1 answers

0
Abani Patra On

If your requirement does not meet using Dwl you can create your custom transformer and use that to achieve the required result.