Mapping Types

<< Click to Display Table of Contents >>

Navigation:  EDP > Customizability >

Mapping Types

There are several different mapping types that can be used to map from an EDD to the EDP package:

lookup = See Mapping Types - Lookup Mappings.

parent = Creates a new row in the package.  If the row already exists in the package (based on the database primary key/unique key values) then the new row will be ignored.

create = Creates a new row in the package.  If the row already exists in the package then a duplicate row error will show in the create phase status form.

create-update = Creates a new row in the package.  If the row already exists in the package then the package row will be updated with the new row values.

 

Lookup Mappings

Lookup mappings are used for looking up valid values in the EQuIS database (Professional EDP) or a reference value file (EDP Standalone). Fields with a lookup mapping will be a drop-down list with the valid values from the EQuIS database or reference value file. Lookup mappings are typically used with reference tables (RT_*), but can also be used with data tables (DT_*). Below is an excerpt from an EQuIS Format Definition (EFD) file that illustrates a lookup mapping with both a reference table and a data table.

 

<edd:table mode="lookup" target="rt_sample_type" >

           <edd:lookup source="sample_type_code" target="sample_type_code" />

           <edd:field source="sample_type_code" target="sample_type_desc" />

</edd:table>

 

 

<edd:table mode="lookup" target="dt_equipment">

           <edd:lookup source="equipment_code" target="equipment_code" />

           <edd:field source="equipment_type" target="equipment_type" />

</edd:table>

 

The first line (that targets RT_SAMPLE_TYPE) defines in which table to look. The second line defines which column in the EQuIS database table contains the valid values (target = ”SAMPLE_TYPE_CODE”) and which field in EDP (source = ”SAMPLE_TYPE_CODE”) will display them. The third line is used only when adding a new valid value. The word "field" (in edd:field) declares the mapping to be used only when adding a valid value, whereas the word “lookup” (in edd:lookup) declares the mapping be able to get and add valid values. The attribute source defines what field contains the valid value, and the attribute target defines which column in the table to add the valid value. There can be several field mappings as well as several lookup mappings within a table lookup mapping. All table lookups do not need to contain any field mappings or lookup mappings as shown below.

 

<edd:table mode="lookup" target="rt_company_type" />

 

This type of table mapping is used for placing the table into the reference value file reflected in the Reference Values tab of EDP. Adding a table in the reference value file so that the format custom handler can use those values, may be desired. A single line table lookup may also be inserted exclusively for IDEF, which uses the reference value file.

 

 

Mappings with Defaults

Defaults within table mappings are used when user input is not required in order to add a record. A default is declared by the default attribute in the field tag. Below is an excerpt from an EQuIS Format Definition (EFD) file that illustrates the use of default within a table mapping.

 

<edd:table mode="create" target="dt_location">

<edd:field source="sys_loc_code" target="sys_loc_code" />

           <edd:field default="m" target="units" />

... other fields omitted ...

</edd:table>

 

 

<edd:table mode="lookup" target="dt_equipment">

           <edd:lookup source="equipment_code" target="equipment_code" />

           <edd:field default="SG" target="equipment_type" />

</edd:table>