Join wMUsers | Blog at wMUsers | User Control Panel | Site Map | webMethods Jobs |For Employers

Ray Moser -- webMethods Ezine Columnist

Create Positional Flat File Templates for the WmEDI Parser



By Ray Moser

 


Introduction

One of the more difficult WmEDI Module tasks is creating parsing templates. This article provides a way for you to generate positional ("POS") parsing templates quickly and easily.

I developed this code sometime ago to speed up the development process without cutting corners. On the last project, I saved several hours that I would have normally spent creating the templates. With the data file definitions available, you, too, will be able to save a significant amount of time.

NOTE: This article assumes you are using Integration Server v4.6, and WmEDI Module v4.6 with all fixes and patches applied.


Flat File Prerequisites

Before I delve into the meat of this article, you must have the following elements present to parse a flat file:

  1. Flat File Data
  2. Template describing the flat file contents

When you have both elements, call the WmEDI package's Flow wm.b2b.edi.convertToValues. It will return an EDIValues object. This EDIValues object will be used to map the flat file data to your IData record.


RmUtils Package

The package provides the "Template Designer" interface that contains all of the code required to generate POS templates for your project.

The package RmUtils contains two interfaces:

  1. TemplateDesigner.Positional
  2. TemplateDesigner.Utils

The package code is well-commented, but all of the Flows, Records and utilities are detailed in PDF-format. See the /pub directory of the package.


Introduction to Positional "POS" flat files

For the uninitiated, EDI files are often positional flat files. For the purpose of our project, we will use a positional contact record. This record can be found in the package /pub directory and is named SamplePositionalRecord.pdf.

HDR001
REC001Contact Record
NAM001Ray                 Moser
DAT001Zettaworks LLC                Principal Consultant
ADD0012 Park Street                 Level 38
ADD002Sydney              NSW        2000     AU
EMAIL1rmoser@zettaworks.com
NTE001I lead the webMethods discipline for Zettaworks.
REC001Contact Record
NAM001Robert              Moser
DAT001Zettaworks LLC                Sr. EAI Architect
ADD0015295 Hollister                2nd Floor
ADD002Houston             Texas      77040    US
EMAIL1robert@zettaworks.com
NTE001Robert is a genius and is adapt at webMethods.
TRL001

The file at first glance looks difficult and unappealing. You’re probably thinking: "XML never looked so good!" Let’s examine the ADD002 line:

ADD002Sydney              NSW        2000     AU

To fully understand this line, you will need the data mapping for this segment:

ADD002
Field NameStartLengthData TypePurpose
SegmentID06VarcharIdentify segment
City620VarcharCity
State3610VarcharState
PostalCode469VarcharPostal Code
CN552VarcharCountry Name Code

 

The first field in this segment is the SegmentID. This is the unique identifier for the address2 segment. The value is ADD002. It starts at position 0 and has a length of 6.

The second field in segment ADD002 is City. It starts at position 6 and has a length of 20. The index is base zero. The information in the ADD002 chart is required by the WmEDI parser and is contained in the segment ID descriptions in the template.

Each segment in this file is fully explained in file PositionalDataDictionaryChart.pdf.

A Positional Flat File is a data structure that is defined by segments. Each segment is generally a record or a set of fields. More complex POS files may contain multiple segments within a record. Segments are separated by a segment delimiter and contain n number of characters. Segments usually will not contain identical number of characters since the data contained in each is different.

Now, with the understanding of the positional file, we will carefully examine the positional template.



[1]  2  Next>>

Go Deeper on the Subject: The wMUsers Discussion Forums


Ray Moser is a a Principal Consultant with Zettaworks LLC, Houston, Texas and is working in Sydney, Australia on various webMethods projects. He has over 10 years experience in application architecture and development. He has architected and built several successful integration projects using the webMethods Integration server, Trading Networks and Enterprise Broker.

Ray can be reached at


Advertise at wMUsers






  Home | Join wMUsers | Discussion Forums | Knowledge Center | Jobs | Shareware | User Groups | Links |
Contact Us | Terms of Service | Privacy Policy

wMUsers is an independent organization and is not sponsored in any manner by Software AG.


© All Rights Reserved, 2001-2008.