Associating the EDI Format Services with EDI Data Types
When you create a flat file schema from a SEF file, you can have the
wm.b2b.edi:SEFParse service automatically assign format services to the fields in the flat file schema. For this service to be able to assign the format services, you must associate EDI format services with EDI data types. The
wm.b2b.edi:SEFParse service assigns the format services to fields based on the fields' data types. For example, if a field has a data type of “DT”, the
wm.b2b.edi:SEFParse service assigns the format service that you associate with the DT data type to that field. For more information about how to create flat files from SEF files, see
Creating a Flat File Schema from a SEF
File.
To determine the data type of a field, the wm.b2b.edi:SEFParse service uses the element definition contained within the SEF file. The element definition has the following structure:
<element name>=<data type>,<min length>,<max length>
To determine the format service to associate with a specific data type, the wm.b2b.edi:SEFParse service uses information that you configure in the following configuration file:
Integration Server_directory \instances\$instance_name\packages\WmEDI\config\format.xml
In the format.xml configuration file, you configure the format service you want the wm.b2b.edi:SEFParse service to use for each EDI data type.
To associate EDI format services with EDI data types, perform the following procedure to update the configuration in memory (so the changes take effect immediately) and in the format.xml file.
To associate EDI format services with EDI data types
1. In My webMethods: Administration > Integration > B2B Settings > Configure Properties.
2. In the Module for EDI Format Settings panel, update each entry in the format.xml configuration file as needed. Each entry has the following format structure:
<DatatypeFormat
datatype="data_type"
service="format_service_to_associate_with_datatype"/>
For more information about the format services provided with Module for EDI, see the description of the wm.b2b.edi.util.formatServices folder in webMethods Module for EDI Built-In Services Reference .
Examples:
The following entry associates the data type
N1 with the
formatN1 format service. This entry matches all elements with data type
N1, regardless of their length.
<DatatypeFormat
datatype="N1"
service="wm.b2b.edi.util.formatServices:formatN1"/>
The following entry associates the data type
TM with a minimum length of 4 and a maximum length of 8 with the
formatTime4_8 format service:
<DatatypeFormat
datatype="TM,4,8"
service="wm.b2b.edi.util.formatServices:formatTime4_8"/>
3. Resequence the DatatypeFormat entries, if necessary.
The wm.b2b.edi:SEFParse service searches the DatatypeFormat entries sequentially in the format.xml configuration file and uses the first match. As a result, ensure your entries are listed from more specific to less specific.
Example:
To use format service “example:service1" for data type N1 where the minimum length is 1 and maximum length is 5 and to use format service "example:service2" for all other N1 data types, the format.xml file would contain DatatypeFormat entries in the following order:
<DatatypeFormat
datatype="N1,1,5"
service="example:service1"/>
<DatatypeFormat
datatype="N1"
service="example:service2"/>
4. Click Save.