Field Mapping Examples

Some scenarios where you are required to create a mapping definition are described below (followed by XML mapping examples):

The external system field does not map directly to the relevant field and a one-to-one mapping is required.

For example, if external shift pattern, A, is mapped to a defined shift pattern, ALL DAYS, and external shift pattern, B, is mapped to the defined shift pattern, ROTATING NIGHTS, this code block is the XML mapping:

<mapping>
<!-If factor 1 is A, maps to ALL DAYS -->
   <row-match> 
      <field-match fieldname="1" matchvalue="A"/> 
      <output-row> 
          <output-field name="1" value="ALL DAYS"/> 
      </output-row> 
  </row-match>
<!-If factor 1 is B, maps to ROTATING NIGHTS -->
   <row-match> 
      <field-match fieldname="1" matchvalue="B"/> 
      <output-row> 
          <output-field name="1" value="ROTATING NIGHTS"/> 
      </output-row> 
  </row-match>
</mapping>

The mapping definition must have all possible values that are in the CSV external file to be imported. If the HR Refresh comes across a new value but does not have a mapping, this occurs:

If the field is defined in the HR Refresh Reference Settings page, the appropriate action is implemented (either insert the record as new, or reject the record).

If the field is not defined in the HR Refresh Reference Settings page, an error is generated for that record.

The external system might have many fields (that is, many factors) that map to one field.

For example, if an external system has two factors that describe the Pay Group field, this code block is the XML mapping:

<mapping>
<!-If field 1 is HOURLY_FULLTIME and field 2 is A , then the record maps to P1. 
Note that fieldName corresponds to the index in the factor value. So for a value of 
"HOURLY_FULLTIME~A" in the PAYGRP_NAME field, fieldName 1 is HOURLY_FULLTIME and fieldName 2 is A -->
   <row-match> 
      <field-match fieldname="1" matchvalue="HOURLY_FULLTIME"/> 
      <field-match fieldname="2" matchvalue="A"/> 
      <output-row> 
          <output-field name="1" value="P1"/> 
      </output-row> 
  </row-match>
<!-If field 1 is HOURLY_PARTTIME, then the record maps to P2 -->
   <row-match> 
      <field-match fieldname="1" matchvalue="HOURLY_PARTTIME"/> 
      <output-row> 
          <output-field name="1" value="P2"/> 
      </output-row> 
  </row-match>
<!--A row-match element without field-match elements matches all rows, this is used when there is no match. 
Do not use this method if there are possible records that needs to be rejected -->	
   <row-match> 
      <output-row> 
          <output-field name="1" copyfield="1"/> 
      </output-row> 
  </row-match>
	</mapping>