How to create UN EDIFACT EJC classes from scratch to support new messages

324 views
Skip to first unread message

Immo Benjes

unread,
May 9, 2016, 5:58:21 AM5/9/16
to Smooks Users
Hi 

I've been using the 1.4 UN EDIFACT classes for a while now and I am loving how easy it is with smooks to handle EDIFACT. 

Now however I have to support a new EDIFACT message d16a VERMAS. There is no d16a zip file available from the 
(btw. the link on the smooks page is dead)

I have just taken the last __modelset_definitions.xml file (attached) I could find (d09b) and edited the fields to be inline with the D16A spec.
I then configured the new message VERMAS (see attached).

My POM is this:

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>

        <groupId>org.milyn</groupId>

        <artifactId>smooks-examples</artifactId>

        <version>1.4</version> <!-- base pom version - do not remove this comment -->

    </parent>

    <name>Milyn Smooks D16A  - EJC - Model Gen</name>

    <groupId>org.milyn</groupId>

    <artifactId>milyn-smooks-d16a-ejc-model-gen</artifactId>

    <version>1.0</version>


    <build>

        <plugins>

            <plugin>

                <groupId>org.milyn</groupId>

                <artifactId>maven-ejc-plugin</artifactId>

                <version>1.4</version> <!-- base pom version - do not remove this comment -->

                <configuration>

                    <ediMappingFile>VERMAS.xml</ediMappingFile>

                    <packageName>com.locuslive.odyssey.edi.d16a.vermas.model</packageName>

                </configuration>

                <executions>

                    <execution><goals><goal>generate</goal></goals></execution>

                </executions>

            </plugin>

        </plugins>

    </build>


    <dependencies>

        <dependency>

            <groupId>org.milyn</groupId>

            <artifactId>milyn-smooks-ejc</artifactId>

            <version>${milyn.smooks.core.version}</version>

        </dependency>

    </dependencies>


</project>


That does create the EJC classes for VERMAS and a factory but it only does the actual message, not the interchange UNH ... UNT around it as with the other EDIFACT messages. How can I configure it to create a D16AInterchangeFactory?


Regards


Immo



VERMAS.xml
__modelset_definitions.xml

Tom Fennelly

unread,
May 12, 2016, 1:08:13 PM5/12/16
to Smooks Users
Hi Immo.

So I think you need to create a few 2 modules. One for the mappings and one for the Java binding (built from the mappings). E.g. see https://github.com/smooks/unedifact/tree/master/d13a

Is this what you did?

Dr Immo Benjes

unread,
May 12, 2016, 1:24:01 PM5/12/16
to smook...@googlegroups.com
Hi Tom,

no I don’t have the zip file for D16A only a PDF for the VERMAS message.

I’ve taken the __message_definitions.xml file from a D09B version and modified the segments that have changed and created the VERMAS.xml definition by hand.

Regards

Immo
  

Dr. Immo Benjes
Senior Software Architect 


Castle Court
41 London Road
Reigate
Surrey RH2 9RJ
United Kingdom




--
You received this message because you are subscribed to a topic in the Google Groups "Smooks Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/smooks-user/vTwrHyWKZQk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to smooks-user...@googlegroups.com.
To post to this group, send email to smook...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/fc3f3a83-2213-4af0-b7b5-6c224b8d238a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Fennelly

unread,
May 12, 2016, 1:46:07 PM5/12/16
to smook...@googlegroups.com
Ah sorry, you said that.

Hmmm ... kinda scoobied without the .zip file. I think if it were me I'd run the build for one of the other versions that has the zip and see what it generates in terms of mapping files. Then I'd look and see if I could manually manipulate those for work for d16a.

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.

To post to this group, send email to smook...@googlegroups.com.

Tom Fennelly

unread,
May 12, 2016, 1:51:20 PM5/12/16
to smook...@googlegroups.com

Dr Immo Benjes

unread,
May 12, 2016, 3:13:08 PM5/12/16
to smook...@googlegroups.com
Thanks, only checked on the download page

Will try to compile it tomorrow.

Regards

Immo
  

Dr. Immo Benjes
Senior Software Architect 


Castle Court
41 London Road
Reigate
Surrey RH2 9RJ
United Kingdom




On 12 May 2016, at 18:51, Tom Fennelly <tom.fe...@gmail.com> wrote:

On 12 May 2016 at 18:46, Tom Fennelly <tom.fe...@gmail.com> wrote:
Ah sorry, you said that.

Hmmm ... kinda scoobied without the .zip file. I think if it were me I'd run the build for one of the other versions that has the zip and see what it generates in terms of mapping files. Then I'd look and see if I could manually manipulate those for work for d16a.
On 12 May 2016 at 18:23, Dr Immo Benjes <immob...@locussoftware.com> wrote:
Hi Tom,

no I don’t have the zip file for D16A only a PDF for the VERMAS message.

I’ve taken the __message_definitions.xml file from a D09B version and modified the segments that have changed and created the VERMAS.xml definition by hand.
Regards

Immo
  

Dr. Immo Benjes
Senior Software Architect 

<PastedGraphic-2.tiff>

Dr Immo Benjes

unread,
May 13, 2016, 6:17:53 AM5/13/16
to smook...@googlegroups.com
Hi Tom,

I’ve tried to create the same structure as for the other EDIFACT releases (see attached zip) but smooks seems to have a problem parsing the D16A.zip file:

Caused by: org.milyn.ect.EdiParseException: Error parsing the Un/Edifact specification '/Users/immo/Documents/development/workspaces/git_rep/Odyssey_svn/datamodel/edi/unedifact-master/d16a/mapping/D16A.zip'.
at org.milyn.ect.ECTUnEdifactExecutor.execute(ECTUnEdifactExecutor.java:55)
at org.milyn.ect.maven.ECTMojo.execute(ECTMojo.java:68)
... 22 more
Caused by: org.milyn.ect.EdiParseException: Seems that we have a directory containing 0 parseable version inside: [].
 All messages:
[]
at org.milyn.ect.formats.unedifact.UnEdifactSpecificationReader.<init>(UnEdifactSpecificationReader.java:84)
at org.milyn.ect.EdiConvertionTool.fromUnEdifactSpec(EdiConvertionTool.java:150)
at org.milyn.ect.ECTUnEdifactExecutor.execute(ECTUnEdifactExecutor.java:52)
... 23 more

I’ve tried to compile  D13A and that worked fine (but only when set to version 1.6).

Have you come across this problem before?


We are currently running version 1.4 as the rebuild EDIFACT files where only available for 1.4. 
What are the risks of upgrading to 1.6? 

d16a.zip
PastedGraphic-2.tiff

Tom Fennelly

unread,
May 13, 2016, 9:50:00 AM5/13/16
to smook...@googlegroups.com, Bård Langöy
Ooops ... they must have changed the format of the zip. I think you'll need the help of Bard Langoy.

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To post to this group, send email to smook...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Regards

Immo
  

Dr. Immo Benjes
Senior Software Architect 

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To post to this group, send email to smook...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


Castle Court
41 London Road
Reigate
Surrey RH2 9RJ
United Kingdom
On 12 May 2016, at 20:13, Dr Immo Benjes <immob...@locussoftware.com> wrote:

Thanks, only checked on the download page

Will try to compile it tomorrow.
Regards

Immo
  

Dr. Immo Benjes
Senior Software Architect 

Dr Immo Benjes

unread,
May 13, 2016, 10:52:33 AM5/13/16
to smook...@googlegroups.com, Bård Langöy
Hi Tom

somehow I have the feeling the d16a.zip file found here:
is not the version you normally use. It says Schema library version. http://www.unece.org/cefact/xml_schemas/index.html

On the normal download page there is no d16a:

Regards

Immo
  

Dr. Immo Benjes
Senior Software Architect 


Castle Court
41 London Road
Reigate
Surrey RH2 9RJ
United Kingdom



Reply all
Reply to author
Forward
Message has been deleted
0 new messages