Altova MapForce 2024 Enterprise Edition

Full Field Validation (Global)

Home Prev Top Next

When the incomplete validation of a field is not acceptable or desirable, it is possible to configure MapForce to perform full field validation. Incomplete validation might lead to invalid data in the output. Therefore, full field validation is recommended instead. This approach requires custom .Codelist files in addition to the default ones.

 

The role of custom .Codelist files is to supply any code values that are not defined in the EDI standard and not present in MapForce configuration files. This usually applies to code values that are defined in external standards and recommendations. A custom .Codelist file must include all code values defined in an external standard.

 

Full field validation of UN/EDIFACT data element 4405

The example below explains how to perform the full field validation of the UN/EDIFACT data element 4405 that can use external code values from UN/ECE Recommendation 24. The process consists of two stages: (i) creating the structure of a custom .Codelist file and (ii) referencing the new .Codelist file in the configuration files. You can use the same approach for other EDI standards.

 

Create a custom .Codelist file

To create the structure of a custom .Codelist file, follow the instructions below:

 

1.Create a custom EDI collection. Although it is possible to define external code lists by editing the .Codelist file supplied with MapForce, this is not recommended. You should always define external code lists in custom files and avoid any changes to the default MapForce configuration files.

2.In your custom EDI collection's directory, find the .Codelist file that will be used as a template. In our example, we are using UNCL.Codelist as a template.

3.Copy UNCL.Codelist and change the name of the copied file. This file will be referenced by other MapForce configuration files. In our example, the copied file is called UNECE24.Codelist.

4.Open UNECE24.Codelist in an editor (e.g., Altova XMLSpy) and delete all the content of the <Codelist> element.

5.Add a new <Field> structure for F4405 (see below). You can find the correct name, length, and type of each field in the default .Codelist file supplied with MapForce (in this example, UNCL.Codelist).

 

<?xml version="1.0" encoding="UTF-8"?>
<Config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="5" xsi:noNamespaceSchemaLocation="../EDIConfig5.xsd">  
  <Codelist>      
     <Field Name="F4405" Length="3" Type="Alphanumeric">
        <Title>Trade and transport status codes</Title>
        <Description>Code specifying a status.</Description>        
        <Values>

 
        <...>

 

        <Values>
     </Field>
  </Codelist>
</Config>

 

6.For each external code, add a new <Value> element as a child of the <Values> element. In this example, we are adding the first two codes defined in UN/ECE Recommendation 24.

 

<?xml version="1.0" encoding="UTF-8"?>
<Config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="5" xsi:noNamespaceSchemaLocation="../EDIConfig5.xsd">  
  <Codelist>      
     <Field Name="F4405" Length="3" Type="Alphanumeric">
        <Title>Trade and transport status codes</Title>
        <Description>Code specifying a status.</Description>        
        <Values>
           <Value Code="1">
              <Title>Arrival, completed</Title>
              <Description>The goods/consignment/equipment/means of transport has arrived.</Description>
           </Value>
           <Value Code="2">
              <Title>Loading, authorized</Title>
              <Description>Authorization to load has been given.</Description>
           </Value>
        <Values>
     </Field>
  </Codelist>
</Config>

 

Reference the custom file

At this stage, the custom UNECE24.Codelist file is ready but not yet bound to MapForce. In order for MapForce to recognize this file, take the steps below.

 

1.Since Data Element 4405 no longer has incomplete validation, MapForce must be instructed to perform full validation: Remove the Incomplete="1" attribute for this field from UNCL.Codelist or set the value of this attribute to 0. The second option is shown below:

 

<Field Name="F4405" Length="3" Type="Alphanumeric" Incomplete="0">
  <Title>Status description code</Title>
  <Description>Code specifying a status.</Description>
  <Note>1 For transport status, use UN/ECE Recommendation 24.</Note>

  <...>

</Field>

 

2.Reference UNECE24.Codelist in UNCL.Codelist (highlighted yellow below). Alternatively, you can reference your custom .Codelist file in the Envelope.Config file.

 

<?xml version="1.0" encoding="UTF-8"?>
<Config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="5" xsi:noNamespaceSchemaLocation="../EDIConfig5.xsd">
  <Include href="UNECE24.Codelist"/>
  <Codelist>

 

     <...>

 

  </Codelist>

 

The instructions above show how to perform global validation for all messages in which Field 4405 is used. In some cases, you may want the custom code lists to apply only to certain messages (i.e., locally). For more information about the local approach, see Message-Level Validation.

 

© 2017-2023 Altova GmbH