Recent project required to use groovy scripted mapping, using StreamingMarkupBuilder to produce output XML, then post to Odata services.

Below is the skeleton content in groovy script. With this script, can act as alternative to graphical mapping, and use groovy/java language to read source xml, extract value, put in variable, and output to target xml using template, in a very clean, easy readable, procedural programming way.

This is comparable to SAX parsing method in Java Mapping, but in a cleaner syntax, concise, not so verbose like pure Java XML manipulation.

You can run the script in any external java/groovy editor. Example IntelliJ IDEA. The function TestRun() act as a mock test receive input from file, and output to file.

 

Groovy Scripted Mapping using StreamingMarkupBuilder
Tagged on:     

One thought on “Groovy Scripted Mapping using StreamingMarkupBuilder

  • September 24, 2018 at 9:46 pm
    Permalink

    to try, idoc sample is needed (Z_IDOC.txt)
    could you post it?
    Thanks
    Rudi

    Reply

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.