Search code examples
jaxbsmooksedifact

EDIFACT-to-Java Compiler for Smooks v2


I am trying to create Java bindings for EDIFACT messages using Smooks. In particular, I want to automatically generate Java classes and corresponding mappings using Smooks. To this end, Smooks 1.x provides the EDIFACT-to-Java-Compiler (EJC).

With the upcoming version 2, Smooks relies on schemas written in the Data Format Description Language (DFDL) to specify EDIFACT messages instead of Smooks-specific schemas used in v 1.x. To my understanding, this means that EJC v1.x cannot be used to generate EDIFACT bindings for Smooks v2. Is this correct?

If so, what is the preferred way to generate bindings? Will there be an upcoming EJC v2? Or should I use the XML Schema Compiler (XJC) to generate Java classes and then either map them directly in Smooks, or do a two-step transformation EDIFACT -> (Smooks v2) -> XML -> (JAXB) -> Java?

Thanks for your insights!


Solution

  • Is this correct?

    Yes.

    Or should I use the XML Schema Compiler (XJC) to generate Java classes and then either map them directly in Smooks, or do a two-step transformation EDIFACT -> (Smooks v2) -> XML -> (JAXB) -> Java?

    That's the recommended approach as discussed in the Smooks user forum. The Java bindings for many of the EDIFACT versions have already been generated ahead of time and can be pulled down from the public Maven repository as shown in one of the Smooks examples.