IDoc

Purpose

Transforms a flat IDoc into XML IDoc or vice-versa. The DSL requires a parser definition file for the converted IDoc.

Methods

Binding name: idoc

  • void loadDefinition(String idocDef, boolean isCompiledXml)): Load the IDOC definition given as a String. The String can in a pre-compiled XML format or will be compiled and loaded.
  • String exportDefinitionAsXml(): Exports a previously loaded IDOC definition in compiled Xml format
  • String flatToXml(String flatIDOC): Transform a flat IDOC to XML IDOC
  • String xmlToFlat(String xmlIDOC): Transform an XML IOC to flat IDOC

Examples

def definition = resource.get('ORDERS')

idoc.loadDefinition(definition, false)

def xmlIdoc = idoc.flatToXml( resource.get('FlatOrder') )
println xmlIdoc

def flatIdoc = idoc.xmlToFlat( xmlIdoc )
println flatIdoc

idoc.loadDefinition(resource.get('COMPILEDORDERS'), true)