IBM WebSphere Multichannel Bank Transformation Toolkit, Version 7.1

DataMapperConverterFormat definition examples

The following examples demonstrate the DataMapperConverterFormat definitions you would use for specific cases. The definition under "Data" is the definition in toolkit data definition file and the definition under "Format" is the DataMapperConverterFormat definition in the toolkit format definition file.

For single data elements:

Data:

<field id="InAElement" />
<field id="InBElement" />
<field id="OutAElement" />
<field id="OutBElement" /> 

Format:

<mapperConverter>
  <map from="InAElement" to="OutAElement" convType="String" 
      byReference="true" />
  <map from="InBElement" to="OutBElement" convType="String" 
      byReference="true" />
</mapperConverter>

For collections mapping to the same type of collections (indexed or keyed):

Data:

<iColl id="InIColl" size="5">
  <refData refId="InKColl" />
</iColl>
<iColl id="OutIColl" size="0">
  <refData refId="OutKColl" />
</iColl>
<kColl id="InKColl">
  <field id="InElementA" />
  <field id="InElementB" />
  <field id="InElementC" />
  <field id="InElementD" />
</kColl>
<kColl id="OutKColl">
  <field id="OutElementA" />
  <field id="OutElementB" />
  <field id="OutElementC" />
  <field id="OutElementD" />
</kColl>

Format:

<mapperConverter>
  <map from="InIColl" to="OutIColl" convType="String" 
      byReference="true" append="false" /> 
  <map from="InKColl" to="OutKColl" convType="String" 
      byReference="true" />
</mapperConverter>

For mapping elements inside an indexed collection to another indexed collection:

Data:

<iColl id="InIColl" size="3">
  <refData refId="InRecord" />
</iColl>
<iColl id="OutIColl" size="22">
  <refData refId="OutRecord" />
</iColl>
<kColl id="InRecord" dynamic="true">
  <field id="InAccountNumber" />
  <field id="InType" />
  <field id="Name" />
  <field id="Balance" />
</kColl>
<kColl id="OutRecord" dynamic="true">
  <field id="OutAccountNumber" />
  <field id="OutType" />
</kColl>

Format

<mapperConverter>
  <map from="InIColl.*.InAccountNumber"
to="OutIColl.*.OutAccountNumber" 
      convType="String" byReference="true" append="false" />
  <map from="InIColl.*.InType" to="OutIColl.*.OutType"
convType="String" 
      byReference="true" append="ignore" />
</mapperConverter>

For mapping embedded indexed collections to another indexed collection:

Data

<iColl id="InInData" size="3">
  <refData refId="InInRecord" />
</iColl>
<kColl id="InInRecord" dynamic="true">
  <refData refId="InData" />
</kColl>
<iColl id="InData" size="3">
  <refData refId="InRecord" />
</iColl>
<iColl id="OutData" size="22">
  <refData refId="OutRecord" />
</iColl>
<kColl id="InRecord" dynamic="true">
  <field id="InAccountNumber" />
  <field id="InType" />
  <field id="Name" />
  <field id="Balance" />
</kColl>
<kColl id="OutRecord" dynamic="true">
  <field id="OutAccountNumber" />
  <field id="OutType" />
</kColl>

Format:

<mapperConverter>
  <map from="InInData.*.InData.*.InAccountNumber"
to="OutData.*.OutAccountNumber" 
      convType="String" byReference="true" append="false" />
  <map from="InInData.*.InData.*.InType" to="OutData.*.OutType"
convType="String" 
      byReference="true" append="ignore" />
</mapperConverter>

For mapping elements in an indexedCollection to elements in an indexed collection or a keyedCollection embedded in an indexed collection:

Data:

<iColl id="InIColl" size="5">
  <refData refId="InKColl" />
</iColl>
<kColl id="InKColl">
  <field id="InElementA" />
  <field id="InElementB" />
  <field id="InElementC" />
  <field id="InElementD" />
</kColl>
<kColl id="OutKColl">
  <iColl id="OutICollForA" size="0">
    <field id="OutElementA" />
  </iColl>
  <iColl id="AllIColl" size="0">
    <kColl>
      <field id="OutElementB" />
      <field id="OutElementC" />
    </kColl>
  </iColl>
</kColl>

Format:

<mapperConverter >
  <map from="InIColl.*.InElementA" to="OutKColl.OutICollForA.*"
convType="String" 
      byReference="true" append="false" />
</mapperConverter>
<mapperConverter >
  <map from="InIColl.*.InElementB"
to="OutKColl.AllIColl.*.OutElementB" 
      convType="String" byReference="true" append="false" />
  <map from="InIColl.*.InElementC"
to="OutKColl.AllIColl.*.OutElementC" 
      convType="String" byReference="true" append="false" />
</mapperConverter>

For mapping embedded indexed collections to embedded indexed collection:

Data:

<iColl id="accountStatements" size="25">
  <kColl>
    <iColl id="statements" size="4">
      <kColl>
        <field id="amount" />
        <field id="date" />
      </kColl>
    </iColl>
  </kColl>
</iColl>
<iColl id="lastAccountStatements">
  <kColl>
    <iColl id="lastStatements">
      <kColl>
        <field id="amount" />
        <field id="date" />
      </kColl>
    </iColl>
  </kColl>
</iColl>

Format:

<mapperConverter>
  <map from="accountStatements.*.statements.*.amount" 
      to="lastAccountStatements.*.lastStatements.*.amount"
convType="default" 
      byReference="true" append="false" />
</mapperConverter>

When an indexed collection contains a single element the mapping is as follows:

Data:

<iColl id="simpleDataIColl" size="3">
  <field id="dataElement" />
</iColl>
<kColl id="OutKColl">
  <iColl id="OutIColl" size="0">
    <field id="dataElement" />
  </iColl>
</kColl>

Format:

<mapperConverter >  
  <map from="simpleDataIColl.*" to="OutKColl.OutIColl.*"
convType="String" 
      byReference="true" append="false" />
</mapperConverter>
Note: The mapper appends the new elements to the existing elements in the destination collection or clears the collection according to the value set in the append attribute.


Feedback