SlideShare a Scribd company logo
1 of 33
Download to read offline
UN/EDIFACT Interchange Processing
                                     with Smooks v1.4


                                   Smooks Community Day - 14/Aug/2010
                                             Tom Fennelly




Wednesday 1 September 2010
AGENDA
              •   What is UN/EDIFACT?

              •   EDI Support in Smooks v1.3 (and before)

              •   EDI Conversion Tool (ECT)
              •   <unedifact: reader>

              •   UN/EDIFACT + Java

                        ‣    EDI Java Compiler (EJC)

              •   Distribution

                        ‣    Mapping Models (ECT), Java Bindings (EJC)

              •   Future

              •   Examples & Code Walk-thru...
Wednesday 1 September 2010
WHAT IS UN/EDIFACT?




Wednesday 1 September 2010
WHAT IS UN/EDIFACT?

   • UN/EDIFACT

             ‣   “United Nations/Electronic Data Interchange For Administration, Commerce and Transport”


   • UN/EDIFACT                  & X12

             ‣   Dominant B2B data exchange standards (>>> XML)

             ‣   X12                     North America

             ‣   UN/EDIFACT Everywhere else

Wednesday 1 September 2010
WHAT IS UN/EDIFACT?

   •A        Message Interchange “Protocol"

                             UNB
                                   UNH
                                            <message>
                                   UNT
                                   UNH
                                            <message>
                                   UNT
                                   etc...
                             UNZ


Wednesday 1 September 2010
EDI SUPPORT IN 1.3




Wednesday 1 September 2010
EDI SUPPORT IN 1.3
                       Input <message>
                             HDR*1*0*59.97*64.92*4.95*Wed Nov 15 13:45:28 EST 2006
                             CUS*user1*Harry^Fletcher*SD
                             ORD*1*1*364*The 40-Year-Old Virgin*29.98
                             ORD*2*1*299*Pulp Fiction*29.99


    Smooks
            <edi:reader mappingModel="../edi-mapping-models/order-mapping.xml" />

                         Output
                             <Order>
                                       <header>
                                               <order-id>1</order-id>
                                               <status-code>0</status-code>
                                               <net-amount>59.97</net-amount>
                                               <total-amount>64.92</total-amount>
                                               <tax>4.95</tax>
                                               <date>Wed Nov 15 13:45:28 EST 2006</date>
                                       </header>
                                       <customer-details>
                                               <username>user1</username>


Wednesday 1 September 2010
EDI SUPPORT IN 1.3

   • Single           <message> instance

             ‣   No Interchange Support

   • Generic                 EDI Reader

             ‣   No standards support “out-of-the-box”

             ‣   Hand coded “EDI Mapping Models”

   • Reading                 - YES .... Writing - NO

Wednesday 1 September 2010
EDI SUPPORT IN 1.3
 • Each          <message> defined by an “EDI Mapping Model”

          ‣   Schema for EDI     <?xml version="1.0" encoding="UTF-8"?>
                                 <medi:edimap xmlns:medi="http://www.milyn.org/schema/edi-message-mapping-1.3.xsd">

                                 	   <medi:description name="DVD Order" version="1.0" />

                                 	   <medi:delimiters segment="&#10;" field="*" component="^" sub-component="~" />

                                 	   <medi:segments xmltag="Order">

                                 	   	    <medi:segment segcode="HDR" xmltag="header">
                                 	   	    	    <medi:field xmltag="order-id" />
                                 	   	    	    <medi:field xmltag="status-code" />
                                 	   	    	    <medi:field xmltag="net-amount" />
                                 	   	    	    <medi:field xmltag="total-amount" />
                                 	   	    	    <medi:field xmltag="tax" />
                                 	   	    	    <medi:field xmltag="date" />
                                 	   	    </medi:segment>

                                 	   	    <medi:segment segcode="CUS" xmltag="customer-details">
                                 	   	    	    <medi:field xmltag="username" />
                                 	   	    	    <medi:field xmltag="name">
                                 	   	    	    	    <medi:component xmltag="firstname" />
                                 	   	    	    	    <medi:component xmltag="lastname" />
                                 	   	    	    </medi:field>
                                 	   	    	    <medi:field xmltag="state" />
                                 	   	    </medi:segment>


Wednesday 1 September 2010
UN/EDIFACT SUPPORT IN 1.4




Wednesday 1 September 2010
MORE... WHAT IS UN/EDIFACT?
   •   UN/EDIFACT Standard

             ‣   An Interchange Protocol

             ‣   A Directory of Interchange Message Definitions

                 -   20+ Directory Versions/Releases (d93a, d03b etc)

                 -   ~ 200 Messages/Directory

                 -   Defined in .zip files... downloadable

                 -   Not very user friendly !!!

Wednesday 1 September 2010
EDI CONVERSION TOOL
                         (ECT)


        • Input:             UN/DIFACT Directory .zip

        • Output:              Smooks EDI Mapping Model .jar

                 ‣   “Zip Set”




Wednesday 1 September 2010
EDI CONVERSION TOOL
                         (ECT)
        • Maven              & Ant Plugins

                             <plugins>
                                 <plugin>
                                     <groupId>org.milyn</groupId>
                                     <artifactId>maven-ect-plugin</artifactId>
                 	    	              <version>1.4-SNAPSHOT</version>
                                     <configuration>
                                          <src>d03b.zip</src>
                                          <srcType>UNEDIFACT</srcType>
                                     </configuration>
                                     <executions>
                                          <execution><goals><goal>generate</goal></goals></execution>
                                     </executions>
                                 </plugin>
                             </plugins>


Wednesday 1 September 2010
EDI CONVERSION TOOL
                         (ECT)
        • d03b-mapping-1.0-SNAPSHOT.jar

                                                org.milyn.edi.unedifact:d03b-mapping:1.0-SNAPSHOT




                             #UN/EDIFACT Interchange Properties
                             #Sun Aug 08 10:41:40 IST 2010
                             interchangeType=UNEDIFACT
                             interchangeBindingConfig=/org/milyn/smooks/edi/unedifact/model/r41/bindings/unedifact-interchange.xml
                             messageBindingConfig=/org/milyn/smooks/edi/unedifact/model/r41/bindings/unedifact-message.xml




Wednesday 1 September 2010
EDI CONVERSION TOOL
                         (ECT)

        • Future Additions

                 ‣   X12

                 ‣   HL7

                 ‣   TRADACOMS

                 ‣   etc...


Wednesday 1 September 2010
UN/EDIFACT READER
                                          Input         UNB
                                                        UNH
                                      Interchange       <message>
                                                        UNT
                                                        UNH
                                                        <message>
                                                        UNT
                                                        etc...
                                                        UNZ

         Smooks
         <unedifact:reader mappingModel="org.milyn.edi.unedifact:d03b-mapping:1.0-SNAPSHOT" />



                             Output   <unEdifact>
                                      	    <UNB>
                                      	    	     <syntaxIdentifier>
                                      	    	     	     <id>UNOA</id>
                                      	    	     	     <versionNum>4</versionNum>
                                      	    	     </syntaxIdentifier>
                                      	    	     <sender>
                                      	    	     	     <id>LOCK</id>
                                      	    	     	     <codeQualifier>02</codeQualifier>
                                      	    	     </sender>
                                      	    </UNB>
                                      	    <interchangeMessage>
                                      	    	     <UNH>
                                      	    	     	     <messageRefNum>PAXLST16</messageRefNum>
                                      	    	     	     	    <messageIdentifier>
                                      	    	     	     	    	     <id>PAXLST</id>
                                      	    	     	     	    	     <versionNum>D</versionNum>
                                      	    	     	     	    	     <releaseNum>03B</releaseNum>


Wednesday 1 September 2010
UN/EDIFACT READER

   • Nested                  Execution of the <edi:reader>

                                         UNB
                                               UNH
                                                        <message>   Two

                                               UNT
                                One            UNH
                                                        <message>   Three

                                               UNT
                                               etc...
                                         UNZ


Wednesday 1 September 2010
UN/EDIFACT + JAVA

   • Read:                   EDI Stream     Java Objects

   • Write:                  Java Objects   EDI Stream




Wednesday 1 September 2010
UN/EDIFACT + JAVA

   • Read:                   EDI Stream     SAX Events   Java Objects

   • Write:                  Java Objects   EDI Stream




Wednesday 1 September 2010
UN/EDIFACT + JAVA

   • EDI         Stream         SAX Events
                                                       ECT
             ‣   EDI Mapping Models

   • SAX           Events      Java Objects
                                                       ?
             ‣   Smooks Java Binding (<jb:bean> etc)




Wednesday 1 September 2010
EDI JAVA COMPILER (EJC)

   • Input:                  EDI Mapping Model “Zip Set” (from ECT)

             ‣   e.g. d03b-mapping-1.0-SNAPSHOT.jar

   • Output:                   Compiled Java Object Model

             ‣   Including <jb:bean> binding configurations

             ‣   Easy to use Factory Class

             ‣   e.g. d03b-binding-1.0-SNAPSHOT.jar

Wednesday 1 September 2010
EDI JAVA COMPILER (EJC)

   • Maven              & Ant Plugins
   <plugins>
       <plugin>
           <groupId>org.milyn</groupId>
           <artifactId>maven-ejc-plugin</artifactId>
           <version>1.4-SNAPSHOT</version>
           <configuration>
                <ediMappingModel>urn:org.milyn.edi.unedifact:d03b-mapping:1.0-SNAPSHOT</ediMappingModel>
           </configuration>
           <executions>
                <execution><goals><goal>generate</goal></goals></execution>
           </executions>
           <dependencies>
                <dependency>
                    <groupId>org.milyn.edi.unedifact</groupId>
                    <artifactId>d03b-mapping</artifactId>
                    <version>1.0-SNAPSHOT</version>
                </dependency>
           </dependencies>
       </plugin>
   </plugins>

Wednesday 1 September 2010
EDI JAVA COMPILER (EJC)

   • Read:                   EDI Stream                         Java Objects
                               // Create an instance of the EJC generated factory class... cache this and reuse !!!
                               D03BInterchangeFactory factory = D03BInterchangeFactory.getInstance();

                               // Deserialize the UN/EDIFACT interchange stream to Java...
                               UNEdifactInterchange interchange = factory.fromUNEdifact(ediInStream);

                               // Need to test which interchange syntax version. Supports v4.1 at the moment...
                               if(interchange instanceof UNEdifactInterchange41) {
                                   UNEdifactInterchange41 interchange41 = (UNEdifactInterchange41) interchange;

                                   for(UNEdifactMessage41 message : interchange41.getMessages()) {
                                       // Process the messages...

                                       Object messageObj = message.getMessage();

                                       if(messageObj instanceof Invoic) {
                                           // It's an INVOIC message....
                                           Invoic invoic = (Invoic) messageObj;
                                           ItemDescription itemDescription = invoic.getItemDescription();
                                           // etc etc....
                                       } else if(messageObj instanceof Cuscar) {
                                           // It's a CUSCAR message...
                                       } else if(etc etc etc...) {
                                           // etc etc etc...
                                       }
                                   }
                               }



Wednesday 1 September 2010
EDI JAVA COMPILER (EJC)

   • Write:                  Java Objects          EDI Stream


                                 factory.toUNEdifact(interchange, ediOutStream);




Wednesday 1 September 2010
EDI JAVA COMPILER (EJC)

   • Interchange                Object Model
                        public class UNEdifactInterchange41 implements UNEdifactInterchange {

                        	

   private UNB41 interchangeHeader;
                        	

   private UNZ41 interchangeTrailer;
                        	

   private List<UNEdifactMessage41> messages;
                        }


                                                public class UNEdifactMessage41 implements UNEdifactMessage {

                                                	

   private UNB41 interchangeHeader;
                                                	

   private UNG41 groupHeader;
                                                	

   private UNE41 groupTrailer;
                                                	

   private UNH41 messageHeader;
                                                	

   private UNT41 messageTrailer;
                                                	

   private Object message;
                                                }
Wednesday 1 September 2010
DISTRIBUTION

   • Maven              Central Public Repo

             ‣   EDI Mapping Model “Zip Sets”
                                              <dependency>
                                                <groupId>org.milyn.edi.unedifact</groupId>
                                                <artifactId>d03b-mapping</artifactId>
                                                <version>1.0-SNAPSHOT</version>
                                              </dependency>
             ‣   Java Binding Models
                                              <dependency>
                                                <groupId>org.milyn.edi.unedifact</groupId>
                                                <artifactId>d03b-binding</artifactId>
                                                <version>1.0-SNAPSHOT</version>
                                              </dependency>



Wednesday 1 September 2010
DISTRIBUTION

   • Build          and distribute as many as possible

             ‣   Users avoid ECT and EJC steps

             ‣   Consume/Produce UN/EDIFACT in minutes !!!

             ‣   SVN Repo (edi/gen)




Wednesday 1 September 2010
FUTURE...




Wednesday 1 September 2010
WHAT’S NEXT?
   • UN/EDIFACT

             ‣   Support for v3, v4 Interchange Syntax (currently v4.1)

   • Make            Interchange Splitting & Routing Easy

             ‣   Output: Java, XML, EDI Fragments

             ‣   Tight/Simple JBoss ESB, Camel etc Integration

             ‣   (Currently possible but requires know-how)

   • XSD            Support
Wednesday 1 September 2010
WHAT’S NEXT?

   • Bean Validation Annotations           on EJC generated Models?

   • WS, REST                Support?

             ‣   XSD Support provides framework

   • Extend              Support to X12, HL7 etc

             ‣   UN/EDIFACT provides framework



Wednesday 1 September 2010
EXAMPLES & CODE
                               WALK-THRU



Wednesday 1 September 2010
UN/EDIFACT TO XML
                                 EXAMPLE


   1. Add Mapping Model Dependencies (Zip Sets)

   2. Create Smooks Configuration With <unedifact:reader>

   3. Execute Smooks runtime on Smooks configuration




Wednesday 1 September 2010
UN/EDIFACT - READING &
                WRITING EXAMPLE


   1. Add Mapping Model Dependencies (Java Bindings)

   2. Read using Interchange Factory class

   3. Write using Interchange Factory class




Wednesday 1 September 2010

More Related Content

What's hot

Oracle R12 Apps - Order Management Tables & Descriptions
Oracle R12 Apps - Order Management Tables & DescriptionsOracle R12 Apps - Order Management Tables & Descriptions
Oracle R12 Apps - Order Management Tables & DescriptionsBoopathy CS
 
Oracle fusion financial p2p cycle
Oracle fusion financial  p2p cycleOracle fusion financial  p2p cycle
Oracle fusion financial p2p cyclemohamed mahmoud
 
How to build a data dictionary
How to build a data dictionaryHow to build a data dictionary
How to build a data dictionaryPiotr Kononow
 
hospital management system
hospital management systemhospital management system
hospital management systemshivangi singh
 
Oracle Advanced Pricing (Creating a discount modifier using qualifiers)
Oracle Advanced Pricing (Creating a discount modifier using qualifiers)Oracle Advanced Pricing (Creating a discount modifier using qualifiers)
Oracle Advanced Pricing (Creating a discount modifier using qualifiers)Ahmed Elshayeb
 
Oracle EBS R 12 Core hr user manual
Oracle EBS R 12 Core hr user manualOracle EBS R 12 Core hr user manual
Oracle EBS R 12 Core hr user manualFeras Ahmad
 
Understanding Multi-Org Structure in Oracle Apps
Understanding Multi-Org Structure in Oracle AppsUnderstanding Multi-Org Structure in Oracle Apps
Understanding Multi-Org Structure in Oracle AppsBaker Khader Abdallah, PMP
 
Oracle r12 multi org
Oracle r12 multi orgOracle r12 multi org
Oracle r12 multi orggbalagee
 
Oracle Fusion HCM vs E-Business Suite HRMS
Oracle Fusion HCM vs E-Business Suite HRMSOracle Fusion HCM vs E-Business Suite HRMS
Oracle Fusion HCM vs E-Business Suite HRMSFeras Ahmad
 
How to downscope your EBS upgrade project
How to downscope your EBS upgrade projectHow to downscope your EBS upgrade project
How to downscope your EBS upgrade projectpanayaofficial
 
105322956 advance-pricing-total-oracle-apps
105322956 advance-pricing-total-oracle-apps105322956 advance-pricing-total-oracle-apps
105322956 advance-pricing-total-oracle-appsShivakumar Karajagi
 

What's hot (20)

Oracle R12 Apps - Order Management Tables & Descriptions
Oracle R12 Apps - Order Management Tables & DescriptionsOracle R12 Apps - Order Management Tables & Descriptions
Oracle R12 Apps - Order Management Tables & Descriptions
 
TE40-Template
TE40-TemplateTE40-Template
TE40-Template
 
R12 Tax GST slides
R12 Tax GST slidesR12 Tax GST slides
R12 Tax GST slides
 
Oracle fusion financial p2p cycle
Oracle fusion financial  p2p cycleOracle fusion financial  p2p cycle
Oracle fusion financial p2p cycle
 
SAP IS-U
SAP IS-USAP IS-U
SAP IS-U
 
How to build a data dictionary
How to build a data dictionaryHow to build a data dictionary
How to build a data dictionary
 
hospital management system
hospital management systemhospital management system
hospital management system
 
Oracle Advanced Pricing (Creating a discount modifier using qualifiers)
Oracle Advanced Pricing (Creating a discount modifier using qualifiers)Oracle Advanced Pricing (Creating a discount modifier using qualifiers)
Oracle Advanced Pricing (Creating a discount modifier using qualifiers)
 
Oracle EBS R 12 Core hr user manual
Oracle EBS R 12 Core hr user manualOracle EBS R 12 Core hr user manual
Oracle EBS R 12 Core hr user manual
 
Understanding Multi-Org Structure in Oracle Apps
Understanding Multi-Org Structure in Oracle AppsUnderstanding Multi-Org Structure in Oracle Apps
Understanding Multi-Org Structure in Oracle Apps
 
Cancellations in Order Management
Cancellations in Order ManagementCancellations in Order Management
Cancellations in Order Management
 
Oracle r12 multi org
Oracle r12 multi orgOracle r12 multi org
Oracle r12 multi org
 
Oracle Fusion HCM vs E-Business Suite HRMS
Oracle Fusion HCM vs E-Business Suite HRMSOracle Fusion HCM vs E-Business Suite HRMS
Oracle Fusion HCM vs E-Business Suite HRMS
 
Install base
Install baseInstall base
Install base
 
How to downscope your EBS upgrade project
How to downscope your EBS upgrade projectHow to downscope your EBS upgrade project
How to downscope your EBS upgrade project
 
Move order types
Move order typesMove order types
Move order types
 
Basics of oracle service contracts
Basics of oracle service contractsBasics of oracle service contracts
Basics of oracle service contracts
 
105322956 advance-pricing-total-oracle-apps
105322956 advance-pricing-total-oracle-apps105322956 advance-pricing-total-oracle-apps
105322956 advance-pricing-total-oracle-apps
 
Oracle fixed assets
Oracle fixed assetsOracle fixed assets
Oracle fixed assets
 
BR100 Oracle AP Setup
BR100 Oracle AP SetupBR100 Oracle AP Setup
BR100 Oracle AP Setup
 

Viewers also liked

ELECTRONIC DATA INTERCHANGE
ELECTRONIC DATA INTERCHANGE ELECTRONIC DATA INTERCHANGE
ELECTRONIC DATA INTERCHANGE alraee
 
Introduction to EDI Basics
Introduction to EDI BasicsIntroduction to EDI Basics
Introduction to EDI BasicsGXS
 
Sap tm enhancement guide
Sap tm enhancement guideSap tm enhancement guide
Sap tm enhancement guidezhijian yu
 
Medicaid: An Edge of Your Seat View of Medicaid Risk Adjustment by Bonnie Burke
Medicaid: An Edge of Your Seat View of Medicaid Risk Adjustment by Bonnie BurkeMedicaid: An Edge of Your Seat View of Medicaid Risk Adjustment by Bonnie Burke
Medicaid: An Edge of Your Seat View of Medicaid Risk Adjustment by Bonnie BurkeAltegra Health
 
What's New in 5010 - Version III
What's New in 5010 - Version IIIWhat's New in 5010 - Version III
What's New in 5010 - Version IIIArthur Rubin
 
Provider Payment Reforms
Provider Payment ReformsProvider Payment Reforms
Provider Payment Reformsrongyi
 
Analyzing Files
Analyzing FilesAnalyzing Files
Analyzing Filesguest7c8b8
 
1487976446_INV_AVALERE_RAPS_EDS_Final_Report_
1487976446_INV_AVALERE_RAPS_EDS_Final_Report_1487976446_INV_AVALERE_RAPS_EDS_Final_Report_
1487976446_INV_AVALERE_RAPS_EDS_Final_Report_Edward Charlesworth
 
2014 Altegra Health Partners Summit Welcome
2014 Altegra Health Partners Summit Welcome2014 Altegra Health Partners Summit Welcome
2014 Altegra Health Partners Summit WelcomeAltegra Health
 
ADD: New itil implementation approach
ADD: New itil implementation approachADD: New itil implementation approach
ADD: New itil implementation approachMohamed Zohair
 
World Health Congress 2009 Europe Market Insight
World Health Congress 2009 Europe Market InsightWorld Health Congress 2009 Europe Market Insight
World Health Congress 2009 Europe Market Insightrongyi
 
RAPS/EDPS in Review, Prepare for 2017
RAPS/EDPS in Review, Prepare for 2017RAPS/EDPS in Review, Prepare for 2017
RAPS/EDPS in Review, Prepare for 2017Episource_Healthcare
 
Claims Data Architecture
Claims Data Architecture Claims Data Architecture
Claims Data Architecture locell1
 
Edifecs- How to ensure RAPS and EDPS submissions equal revenue success
Edifecs- How to ensure RAPS and EDPS submissions equal revenue successEdifecs- How to ensure RAPS and EDPS submissions equal revenue success
Edifecs- How to ensure RAPS and EDPS submissions equal revenue successEdifecs Inc
 
Electronic Data Interchange (EDI) - A review of possibilities
Electronic Data Interchange (EDI) - A review of possibilitiesElectronic Data Interchange (EDI) - A review of possibilities
Electronic Data Interchange (EDI) - A review of possibilitiesNicolasCasa
 
The Calm Before the Storm: Enforcement Trends in Risk Adjustment: DOJ and the...
The Calm Before the Storm: Enforcement Trends in Risk Adjustment: DOJ and the...The Calm Before the Storm: Enforcement Trends in Risk Adjustment: DOJ and the...
The Calm Before the Storm: Enforcement Trends in Risk Adjustment: DOJ and the...Mary Inman
 
837 preparation for testing
837 preparation for testing837 preparation for testing
837 preparation for testinghaigvk
 

Viewers also liked (20)

Edifact
EdifactEdifact
Edifact
 
Edi ppt
Edi pptEdi ppt
Edi ppt
 
ELECTRONIC DATA INTERCHANGE
ELECTRONIC DATA INTERCHANGE ELECTRONIC DATA INTERCHANGE
ELECTRONIC DATA INTERCHANGE
 
Introduction to EDI Basics
Introduction to EDI BasicsIntroduction to EDI Basics
Introduction to EDI Basics
 
Sap tm enhancement guide
Sap tm enhancement guideSap tm enhancement guide
Sap tm enhancement guide
 
Medicaid: An Edge of Your Seat View of Medicaid Risk Adjustment by Bonnie Burke
Medicaid: An Edge of Your Seat View of Medicaid Risk Adjustment by Bonnie BurkeMedicaid: An Edge of Your Seat View of Medicaid Risk Adjustment by Bonnie Burke
Medicaid: An Edge of Your Seat View of Medicaid Risk Adjustment by Bonnie Burke
 
What's New in 5010 - Version III
What's New in 5010 - Version IIIWhat's New in 5010 - Version III
What's New in 5010 - Version III
 
Provider Payment Reforms
Provider Payment ReformsProvider Payment Reforms
Provider Payment Reforms
 
Analyzing Files
Analyzing FilesAnalyzing Files
Analyzing Files
 
1487976446_INV_AVALERE_RAPS_EDS_Final_Report_
1487976446_INV_AVALERE_RAPS_EDS_Final_Report_1487976446_INV_AVALERE_RAPS_EDS_Final_Report_
1487976446_INV_AVALERE_RAPS_EDS_Final_Report_
 
2014 Altegra Health Partners Summit Welcome
2014 Altegra Health Partners Summit Welcome2014 Altegra Health Partners Summit Welcome
2014 Altegra Health Partners Summit Welcome
 
ADD: New itil implementation approach
ADD: New itil implementation approachADD: New itil implementation approach
ADD: New itil implementation approach
 
World Health Congress 2009 Europe Market Insight
World Health Congress 2009 Europe Market InsightWorld Health Congress 2009 Europe Market Insight
World Health Congress 2009 Europe Market Insight
 
EDI -basic
EDI -basicEDI -basic
EDI -basic
 
RAPS/EDPS in Review, Prepare for 2017
RAPS/EDPS in Review, Prepare for 2017RAPS/EDPS in Review, Prepare for 2017
RAPS/EDPS in Review, Prepare for 2017
 
Claims Data Architecture
Claims Data Architecture Claims Data Architecture
Claims Data Architecture
 
Edifecs- How to ensure RAPS and EDPS submissions equal revenue success
Edifecs- How to ensure RAPS and EDPS submissions equal revenue successEdifecs- How to ensure RAPS and EDPS submissions equal revenue success
Edifecs- How to ensure RAPS and EDPS submissions equal revenue success
 
Electronic Data Interchange (EDI) - A review of possibilities
Electronic Data Interchange (EDI) - A review of possibilitiesElectronic Data Interchange (EDI) - A review of possibilities
Electronic Data Interchange (EDI) - A review of possibilities
 
The Calm Before the Storm: Enforcement Trends in Risk Adjustment: DOJ and the...
The Calm Before the Storm: Enforcement Trends in Risk Adjustment: DOJ and the...The Calm Before the Storm: Enforcement Trends in Risk Adjustment: DOJ and the...
The Calm Before the Storm: Enforcement Trends in Risk Adjustment: DOJ and the...
 
837 preparation for testing
837 preparation for testing837 preparation for testing
837 preparation for testing
 

Similar to UN/EDIFACT Interchange Processing with Smooks v1.4

Building Windows 8 Apps with Windows Azure
Building Windows 8 Apps with Windows AzureBuilding Windows 8 Apps with Windows Azure
Building Windows 8 Apps with Windows AzureSupote Phunsakul
 
web performance explained to network and infrastructure experts
web performance explained to network and infrastructure expertsweb performance explained to network and infrastructure experts
web performance explained to network and infrastructure expertsBernard Paques
 
Batch Processing - Processamento em Lotes no Mundo Corporativo
Batch Processing - Processamento em Lotes no Mundo CorporativoBatch Processing - Processamento em Lotes no Mundo Corporativo
Batch Processing - Processamento em Lotes no Mundo CorporativoRodrigo Cândido da Silva
 
Scrapping Your Inefficient Engine
Scrapping Your Inefficient EngineScrapping Your Inefficient Engine
Scrapping Your Inefficient EngineEdwin Brady
 
Nyss Open legislation
Nyss Open legislationNyss Open legislation
Nyss Open legislationGraylinKim
 
Internal training - Eda
Internal training - EdaInternal training - Eda
Internal training - EdaTony Vo
 
8 soa technisch perspectief
8 soa technisch perspectief8 soa technisch perspectief
8 soa technisch perspectiefDan Kamminga
 
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложенияCodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложенияCodeFest
 
Fact or not: Is EDI here to stay? (Glenn Colpaert @ Integration Monday)
Fact or not: Is EDI here to stay? (Glenn Colpaert @ Integration Monday)Fact or not: Is EDI here to stay? (Glenn Colpaert @ Integration Monday)
Fact or not: Is EDI here to stay? (Glenn Colpaert @ Integration Monday)Fien Amez
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the CloudJames Thomas
 
How to deploy & optimize eZ Publish (2014)
How to deploy & optimize eZ Publish (2014)How to deploy & optimize eZ Publish (2014)
How to deploy & optimize eZ Publish (2014)Kaliop-slide
 
Android training in mumbai
Android training in mumbaiAndroid training in mumbai
Android training in mumbaiCIBIL
 
Movable Type Seminar 2011
Movable Type Seminar 2011Movable Type Seminar 2011
Movable Type Seminar 2011Six Apart KK
 
Exposing Business Value
Exposing Business ValueExposing Business Value
Exposing Business ValueESUG
 

Similar to UN/EDIFACT Interchange Processing with Smooks v1.4 (20)

The ROP Pack
The ROP PackThe ROP Pack
The ROP Pack
 
NLP Project Full Circle
NLP Project Full CircleNLP Project Full Circle
NLP Project Full Circle
 
Building Windows 8 Apps with Windows Azure
Building Windows 8 Apps with Windows AzureBuilding Windows 8 Apps with Windows Azure
Building Windows 8 Apps with Windows Azure
 
web performance explained to network and infrastructure experts
web performance explained to network and infrastructure expertsweb performance explained to network and infrastructure experts
web performance explained to network and infrastructure experts
 
Trimming The Cruft
Trimming The CruftTrimming The Cruft
Trimming The Cruft
 
Batch Processing - Processamento em Lotes no Mundo Corporativo
Batch Processing - Processamento em Lotes no Mundo CorporativoBatch Processing - Processamento em Lotes no Mundo Corporativo
Batch Processing - Processamento em Lotes no Mundo Corporativo
 
Scrapping Your Inefficient Engine
Scrapping Your Inefficient EngineScrapping Your Inefficient Engine
Scrapping Your Inefficient Engine
 
Nyss Open legislation
Nyss Open legislationNyss Open legislation
Nyss Open legislation
 
Nick harris-sic-2011
Nick harris-sic-2011Nick harris-sic-2011
Nick harris-sic-2011
 
Internal training - Eda
Internal training - EdaInternal training - Eda
Internal training - Eda
 
8 soa technisch perspectief
8 soa technisch perspectief8 soa technisch perspectief
8 soa technisch perspectief
 
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложенияCodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
CodeFest 2014. Пухальский И. — Отзывчивые кроссплатформенные веб-приложения
 
Fact or not: Is EDI here to stay? (Glenn Colpaert @ Integration Monday)
Fact or not: Is EDI here to stay? (Glenn Colpaert @ Integration Monday)Fact or not: Is EDI here to stay? (Glenn Colpaert @ Integration Monday)
Fact or not: Is EDI here to stay? (Glenn Colpaert @ Integration Monday)
 
DIADEM WWW 2012
DIADEM WWW 2012DIADEM WWW 2012
DIADEM WWW 2012
 
Android - Anatomy of android elements & layouts
Android - Anatomy of android elements & layoutsAndroid - Anatomy of android elements & layouts
Android - Anatomy of android elements & layouts
 
Building Dojo in the Cloud
Building Dojo in the CloudBuilding Dojo in the Cloud
Building Dojo in the Cloud
 
How to deploy & optimize eZ Publish (2014)
How to deploy & optimize eZ Publish (2014)How to deploy & optimize eZ Publish (2014)
How to deploy & optimize eZ Publish (2014)
 
Android training in mumbai
Android training in mumbaiAndroid training in mumbai
Android training in mumbai
 
Movable Type Seminar 2011
Movable Type Seminar 2011Movable Type Seminar 2011
Movable Type Seminar 2011
 
Exposing Business Value
Exposing Business ValueExposing Business Value
Exposing Business Value
 

UN/EDIFACT Interchange Processing with Smooks v1.4

  • 1. UN/EDIFACT Interchange Processing with Smooks v1.4 Smooks Community Day - 14/Aug/2010 Tom Fennelly Wednesday 1 September 2010
  • 2. AGENDA • What is UN/EDIFACT? • EDI Support in Smooks v1.3 (and before) • EDI Conversion Tool (ECT) • <unedifact: reader> • UN/EDIFACT + Java ‣ EDI Java Compiler (EJC) • Distribution ‣ Mapping Models (ECT), Java Bindings (EJC) • Future • Examples & Code Walk-thru... Wednesday 1 September 2010
  • 3. WHAT IS UN/EDIFACT? Wednesday 1 September 2010
  • 4. WHAT IS UN/EDIFACT? • UN/EDIFACT ‣ “United Nations/Electronic Data Interchange For Administration, Commerce and Transport” • UN/EDIFACT & X12 ‣ Dominant B2B data exchange standards (>>> XML) ‣ X12 North America ‣ UN/EDIFACT Everywhere else Wednesday 1 September 2010
  • 5. WHAT IS UN/EDIFACT? •A Message Interchange “Protocol" UNB UNH <message> UNT UNH <message> UNT etc... UNZ Wednesday 1 September 2010
  • 6. EDI SUPPORT IN 1.3 Wednesday 1 September 2010
  • 7. EDI SUPPORT IN 1.3 Input <message> HDR*1*0*59.97*64.92*4.95*Wed Nov 15 13:45:28 EST 2006 CUS*user1*Harry^Fletcher*SD ORD*1*1*364*The 40-Year-Old Virgin*29.98 ORD*2*1*299*Pulp Fiction*29.99 Smooks <edi:reader mappingModel="../edi-mapping-models/order-mapping.xml" /> Output <Order> <header> <order-id>1</order-id> <status-code>0</status-code> <net-amount>59.97</net-amount> <total-amount>64.92</total-amount> <tax>4.95</tax> <date>Wed Nov 15 13:45:28 EST 2006</date> </header> <customer-details> <username>user1</username> Wednesday 1 September 2010
  • 8. EDI SUPPORT IN 1.3 • Single <message> instance ‣ No Interchange Support • Generic EDI Reader ‣ No standards support “out-of-the-box” ‣ Hand coded “EDI Mapping Models” • Reading - YES .... Writing - NO Wednesday 1 September 2010
  • 9. EDI SUPPORT IN 1.3 • Each <message> defined by an “EDI Mapping Model” ‣ Schema for EDI <?xml version="1.0" encoding="UTF-8"?> <medi:edimap xmlns:medi="http://www.milyn.org/schema/edi-message-mapping-1.3.xsd"> <medi:description name="DVD Order" version="1.0" /> <medi:delimiters segment="&#10;" field="*" component="^" sub-component="~" /> <medi:segments xmltag="Order"> <medi:segment segcode="HDR" xmltag="header"> <medi:field xmltag="order-id" /> <medi:field xmltag="status-code" /> <medi:field xmltag="net-amount" /> <medi:field xmltag="total-amount" /> <medi:field xmltag="tax" /> <medi:field xmltag="date" /> </medi:segment> <medi:segment segcode="CUS" xmltag="customer-details"> <medi:field xmltag="username" /> <medi:field xmltag="name"> <medi:component xmltag="firstname" /> <medi:component xmltag="lastname" /> </medi:field> <medi:field xmltag="state" /> </medi:segment> Wednesday 1 September 2010
  • 10. UN/EDIFACT SUPPORT IN 1.4 Wednesday 1 September 2010
  • 11. MORE... WHAT IS UN/EDIFACT? • UN/EDIFACT Standard ‣ An Interchange Protocol ‣ A Directory of Interchange Message Definitions - 20+ Directory Versions/Releases (d93a, d03b etc) - ~ 200 Messages/Directory - Defined in .zip files... downloadable - Not very user friendly !!! Wednesday 1 September 2010
  • 12. EDI CONVERSION TOOL (ECT) • Input: UN/DIFACT Directory .zip • Output: Smooks EDI Mapping Model .jar ‣ “Zip Set” Wednesday 1 September 2010
  • 13. EDI CONVERSION TOOL (ECT) • Maven & Ant Plugins <plugins> <plugin> <groupId>org.milyn</groupId> <artifactId>maven-ect-plugin</artifactId> <version>1.4-SNAPSHOT</version> <configuration> <src>d03b.zip</src> <srcType>UNEDIFACT</srcType> </configuration> <executions> <execution><goals><goal>generate</goal></goals></execution> </executions> </plugin> </plugins> Wednesday 1 September 2010
  • 14. EDI CONVERSION TOOL (ECT) • d03b-mapping-1.0-SNAPSHOT.jar org.milyn.edi.unedifact:d03b-mapping:1.0-SNAPSHOT #UN/EDIFACT Interchange Properties #Sun Aug 08 10:41:40 IST 2010 interchangeType=UNEDIFACT interchangeBindingConfig=/org/milyn/smooks/edi/unedifact/model/r41/bindings/unedifact-interchange.xml messageBindingConfig=/org/milyn/smooks/edi/unedifact/model/r41/bindings/unedifact-message.xml Wednesday 1 September 2010
  • 15. EDI CONVERSION TOOL (ECT) • Future Additions ‣ X12 ‣ HL7 ‣ TRADACOMS ‣ etc... Wednesday 1 September 2010
  • 16. UN/EDIFACT READER Input UNB UNH Interchange <message> UNT UNH <message> UNT etc... UNZ Smooks <unedifact:reader mappingModel="org.milyn.edi.unedifact:d03b-mapping:1.0-SNAPSHOT" /> Output <unEdifact> <UNB> <syntaxIdentifier> <id>UNOA</id> <versionNum>4</versionNum> </syntaxIdentifier> <sender> <id>LOCK</id> <codeQualifier>02</codeQualifier> </sender> </UNB> <interchangeMessage> <UNH> <messageRefNum>PAXLST16</messageRefNum> <messageIdentifier> <id>PAXLST</id> <versionNum>D</versionNum> <releaseNum>03B</releaseNum> Wednesday 1 September 2010
  • 17. UN/EDIFACT READER • Nested Execution of the <edi:reader> UNB UNH <message> Two UNT One UNH <message> Three UNT etc... UNZ Wednesday 1 September 2010
  • 18. UN/EDIFACT + JAVA • Read: EDI Stream Java Objects • Write: Java Objects EDI Stream Wednesday 1 September 2010
  • 19. UN/EDIFACT + JAVA • Read: EDI Stream SAX Events Java Objects • Write: Java Objects EDI Stream Wednesday 1 September 2010
  • 20. UN/EDIFACT + JAVA • EDI Stream SAX Events ECT ‣ EDI Mapping Models • SAX Events Java Objects ? ‣ Smooks Java Binding (<jb:bean> etc) Wednesday 1 September 2010
  • 21. EDI JAVA COMPILER (EJC) • Input: EDI Mapping Model “Zip Set” (from ECT) ‣ e.g. d03b-mapping-1.0-SNAPSHOT.jar • Output: Compiled Java Object Model ‣ Including <jb:bean> binding configurations ‣ Easy to use Factory Class ‣ e.g. d03b-binding-1.0-SNAPSHOT.jar Wednesday 1 September 2010
  • 22. EDI JAVA COMPILER (EJC) • Maven & Ant Plugins <plugins> <plugin> <groupId>org.milyn</groupId> <artifactId>maven-ejc-plugin</artifactId> <version>1.4-SNAPSHOT</version> <configuration> <ediMappingModel>urn:org.milyn.edi.unedifact:d03b-mapping:1.0-SNAPSHOT</ediMappingModel> </configuration> <executions> <execution><goals><goal>generate</goal></goals></execution> </executions> <dependencies> <dependency> <groupId>org.milyn.edi.unedifact</groupId> <artifactId>d03b-mapping</artifactId> <version>1.0-SNAPSHOT</version> </dependency> </dependencies> </plugin> </plugins> Wednesday 1 September 2010
  • 23. EDI JAVA COMPILER (EJC) • Read: EDI Stream Java Objects // Create an instance of the EJC generated factory class... cache this and reuse !!! D03BInterchangeFactory factory = D03BInterchangeFactory.getInstance(); // Deserialize the UN/EDIFACT interchange stream to Java... UNEdifactInterchange interchange = factory.fromUNEdifact(ediInStream); // Need to test which interchange syntax version. Supports v4.1 at the moment... if(interchange instanceof UNEdifactInterchange41) { UNEdifactInterchange41 interchange41 = (UNEdifactInterchange41) interchange; for(UNEdifactMessage41 message : interchange41.getMessages()) { // Process the messages... Object messageObj = message.getMessage(); if(messageObj instanceof Invoic) { // It's an INVOIC message.... Invoic invoic = (Invoic) messageObj; ItemDescription itemDescription = invoic.getItemDescription(); // etc etc.... } else if(messageObj instanceof Cuscar) { // It's a CUSCAR message... } else if(etc etc etc...) { // etc etc etc... } } } Wednesday 1 September 2010
  • 24. EDI JAVA COMPILER (EJC) • Write: Java Objects EDI Stream factory.toUNEdifact(interchange, ediOutStream); Wednesday 1 September 2010
  • 25. EDI JAVA COMPILER (EJC) • Interchange Object Model public class UNEdifactInterchange41 implements UNEdifactInterchange { private UNB41 interchangeHeader; private UNZ41 interchangeTrailer; private List<UNEdifactMessage41> messages; } public class UNEdifactMessage41 implements UNEdifactMessage { private UNB41 interchangeHeader; private UNG41 groupHeader; private UNE41 groupTrailer; private UNH41 messageHeader; private UNT41 messageTrailer; private Object message; } Wednesday 1 September 2010
  • 26. DISTRIBUTION • Maven Central Public Repo ‣ EDI Mapping Model “Zip Sets” <dependency> <groupId>org.milyn.edi.unedifact</groupId> <artifactId>d03b-mapping</artifactId> <version>1.0-SNAPSHOT</version> </dependency> ‣ Java Binding Models <dependency> <groupId>org.milyn.edi.unedifact</groupId> <artifactId>d03b-binding</artifactId> <version>1.0-SNAPSHOT</version> </dependency> Wednesday 1 September 2010
  • 27. DISTRIBUTION • Build and distribute as many as possible ‣ Users avoid ECT and EJC steps ‣ Consume/Produce UN/EDIFACT in minutes !!! ‣ SVN Repo (edi/gen) Wednesday 1 September 2010
  • 29. WHAT’S NEXT? • UN/EDIFACT ‣ Support for v3, v4 Interchange Syntax (currently v4.1) • Make Interchange Splitting & Routing Easy ‣ Output: Java, XML, EDI Fragments ‣ Tight/Simple JBoss ESB, Camel etc Integration ‣ (Currently possible but requires know-how) • XSD Support Wednesday 1 September 2010
  • 30. WHAT’S NEXT? • Bean Validation Annotations on EJC generated Models? • WS, REST Support? ‣ XSD Support provides framework • Extend Support to X12, HL7 etc ‣ UN/EDIFACT provides framework Wednesday 1 September 2010
  • 31. EXAMPLES & CODE WALK-THRU Wednesday 1 September 2010
  • 32. UN/EDIFACT TO XML EXAMPLE 1. Add Mapping Model Dependencies (Zip Sets) 2. Create Smooks Configuration With <unedifact:reader> 3. Execute Smooks runtime on Smooks configuration Wednesday 1 September 2010
  • 33. UN/EDIFACT - READING & WRITING EXAMPLE 1. Add Mapping Model Dependencies (Java Bindings) 2. Read using Interchange Factory class 3. Write using Interchange Factory class Wednesday 1 September 2010