# how to Built code by Using EDI/FlatFile?

**URL:** <https://techcommunity.softwareag.com/t/how-to-built-code-by-using-edi-flatfile/109929>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [October 1, 2009, 1:03pm UTC](https://techcommunity.softwareag.com/t/how-to-built-code-by-using-edi-flatfile/109929 "2009-10-01T13:03:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjambhulkar1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/rjambhulkar1/32/17884_2.png) [@rjambhulkar1](https://techcommunity.softwareag.com/u/rjambhulkar1)\
**Post date:** [October 1, 2009, 1:03pm UTC](https://techcommunity.softwareag.com/t/how-to-built-code-by-using-edi-flatfile/109929/1 "2009-10-01T13:03:11Z")

</div>

Hi Everyone,

I have received one requirement for development of code in between two application by using EDI & FlatFile Insert into Oracle DB  
so i need to know the flow service steps to built a wm code.  
Requirement as follows.  
a EDI doc will publish  
b convert EDI doc to flatfile  
c Map Flatfile into canonical doc  
d publish that canonical  
e subscribe that canonical doc & insert into the Oracle DB

Please correct me if i am wrong  
Find the flow step for above requirement

Need to know the Flow steps for above requirement  
Main :Sequence(Success)  
Try:Sequence(Failure)  
??  
??  
Catch:Sequence(Done)

Pub.flow.getlasterror  
Regd  
RJ

---

<div class="post-metadata">

**Author:** ![shahid2](https://avatars.discourse-cdn.com/v4/letter/s/a8b319/32.png) [@shahid2](https://techcommunity.softwareag.com/u/shahid2)\
**Post date:** [October 1, 2009, 4:31pm UTC](https://techcommunity.softwareag.com/t/how-to-built-code-by-using-edi-flatfile/109929/2 "2009-10-01T16:31:43Z")

</div>

you can use WmEDI package services to process the EDI data. do refer EDI services guide available on advantage…

What is the need to convert EDI to Flatfile and then map to canonical?

cant it be directly mapped to canonical?? ![](http://wmusers.com/forum/images/icons/icon7.gif)

---

<div class="post-metadata">

**Author:** ![rjambhulkar1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/rjambhulkar1/32/17884_2.png) [@rjambhulkar1](https://techcommunity.softwareag.com/u/rjambhulkar1)\
**Post date:** [October 1, 2009, 6:31pm UTC](https://techcommunity.softwareag.com/t/how-to-built-code-by-using-edi-flatfile/109929/3 "2009-10-01T18:31:04Z")

</div>

Shahid,

it’s a big Module so first of all we need to create EDI doc to flat file then  
convert tht flat file to canonical doc then follows with insertion into DB

IS ths code workout?

Main Sequence(Success)  
Try Sequence(Failure)  
wm.b2b.edi.envelopprocess(process all EDI segments)  
wm.b2b.edi.getEDIstring  
wm.flatfile.converttovalue (flat file schema to validate)  
Map (IS doc to canonical)  
Pub.publish (canonical)  
insert adapter service(canonical doc inserted into db)  
Catch sequence(done)  
pub.flow.getlasterror

Regd  
RJ

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [October 1, 2009, 6:45pm UTC](https://techcommunity.softwareag.com/t/how-to-built-code-by-using-edi-flatfile/109929/4 "2009-10-01T18:45:38Z")

</div>

Yes you can eliminate the EDI document to Flatfile step and directly map EDI to Canonical:

Requirement as follows.  
a EDI doc will publish – receiving from TN or using publish here?  
b getEDIString and parse EDI doc using convertToValues…  
c Map EDI doc to canonical doc  
d publish that canonical doc  
e subscribe that canonical doc & insert into the Oracle DB

There are lot of useful threads in the EDISection of this forum,take a look.

HTH,  
RMg

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:05pm UTC](https://techcommunity.softwareag.com/t/how-to-built-code-by-using-edi-flatfile/109929/5 "2021-04-02T15:05:57Z")

</div>


