Mappings

For each context message one Mappings element must be present. A Mappings element has this sub element:

Element Description
Mapping

A Mapping element describes the source which must be used to fill a placeholder in the template.

For the content of the Mapping element, see the example.

Example:
<Mappings">
            <Mapping>
	         <…>
           </Mapping>
             <Mapping>
	         <…>
           </Mapping>
       < /Mappings>

For each mappings element within a context message Mapping elements can be present. A Mapping element has this attribute:

Attribute Description
type

How to process the Source element to fill the Target placeholder:

  1. field – the placeholder will be replaced directly with the value of the field.
  2. domain – the placeholder will be replaced directly with the value of the (first) field that is linked to this domain.
  3. function – the placeholder will be replaced with the return value of the function.
  4. hook – the placeholder will be replaced with the result value of the hook; a function wrapper will be created and this acts the same as a mapping of type “function”.

A Template element has these sub elements:

Element Description
Source

Depending on the “type” attribute, the source is a field, a domain, a function or a hook.Within Source, you can use these placeholders:

  • #table#: this will be replaced by the table code for which the implementation model is generated.
  • #key<nn>#, where <nn> is numbered from 01 to 15: this will be replaced by the nth field of the primary key of the table
  • #instance#: this will be replaced by a fieldname of a field that is named “desc”, “dsca” or “name” or “nama”.
Target The placeholder as used in the Template
Examples:
<Mapping type="field">
<Source>#table#.#key05#</Source>
<Target>ic_key05</Target>
< /Mapping>
<Mapping type="field">
<Source>#table#.#instance#</Source>
<Target>ic_instancename</Target>
< /Mapping>
<Mapping type="domain">
<Source>tcrefa</Source>
<Target>ic_trackingnumber</Target>
< /Mapping>
<Mapping type="function">
<Source>icm.get.screenid()</Source>
<Target>ic_screenid</Target>
< /Mapping>
<Mapping type="hook">
<Source>return(“ERPLN_” & icm.get.screenid())</Source>
<Target>ic_screenid</Target>
< /Mapping>