EndMapper (v2) XML document interface

EndMapper (v2) is a complete re-implementation of EndMapper functionality orientated around a single XML document interface. It provides a clean, simple and extensible XML document based interface that should fully support any enterprise standard XML mapping technology. With this approach the mapper provides an XML document that lists the objects that must be persisted as well as column data that the mapper wishes to persist.

The EndMapper (v2) document offers a choice of the elements shown in the following table.
Table 1. EndMapper elements
Element name Description
txn Used for mapping a transmission containing a single transaction.
chunk Used to map transmissions with multiple transactions.
abort Used to abort the mapping due to an unrecoverable problem.
The txn element is of type SingleTransaction the schema model for this type is shown in Figure 1 and an example document is shown in Figure 2. SingleTransaction extends Transaction, which itself is an extension of Object. An Object can contain column information (cols), object values (objVal), counters and errors. The SingleTransaction type also allows the inclusion of a transmission object (pt) where the mapper may put information to update, extend, or both, the transmission record. For performance reasons, it is better to avoid updates of the transmission record by the mapper. If possible, these values should be identified and set when the transmission is logged to avoid the cost of an update statement. Extending the transmission record by adding object values, counters or errors does not carry an additional performance hit, that is to say that if it is required, the cost cannot be avoided in the same way that a transmission record update can.
Figure 1. EndMapper (v2) single transaction model
EndMapper2SingleTransaction.jpg
Figure 2. Example EndMapper (v2) document for single transaction
<em:txn type="TXN_PAYMENT" xmlns:em="http://www.ibm.com/xmlns/prod/ftm/EndMapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <cols>
    <str name="CID">abc123</str>
    <str name="SUBTYPE">sample</str>
    <xml name="ISF_DATA"></xml>
  </cols>
  <objVal cat="category1" key="key1">
    <str>value1</str>
  </objVal>
  <counter name="txnCnt1" >
    <count>0</count>
    <amount>1.23</amount>
  </counter>
  <pt type="TRANSMISSION">
    <cols>
      <str name="CID">abc123</str>
    </cols>
    <objVal cat="category2" key="key2">
      <str>value2</str>
    </objVal>
    <counter name="ptCntr1" type="cntrType1">
      <count>0</count>
      <amount>1.23</amount>
    </counter>
  </pt>
</em:txn>
The chunk element supports including batch information and multiple transactions, as well as transmission updates. The schema model for this type is shown in Figure 3 and an example XML document is shown in Figure 4.
Figure 3. EndMapper (v2) chunk model
EndMapper2Chunk.jpg
Figure 4. Example EndMapper (v2) document for chunk
<em:chunk final="" xmlns:em="http://www.ibm.com/xmlns/prod/ftm/EndMapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <batStart type="BATCH"/>
    <txn type="TXN_PAYMENT">
      <cols>
        <str name="CID">abc123</str>
        <str name="SUBTYPE">sample</str>
        <xml name="ISF_DATA"></xml>
      </cols>
      <objVal cat="category1" key="key1">
        <str>value1</str>
      </objVal>
      <counter name="txnCnt1" type="cntrType1">
        <count>0</count>
        <amount>1.23</amount>
      </counter>
    </txn>
    <txn type="TXN_PAYMENT">
      <cols>
        <str name="CID">abc456</str>
        <str name="SUBTYPE">sample</str>
        <xml name="ISF_DATA"></xml>
      </cols>
      <objVal cat="category1" key="key1">
        <str>value1</str>
      </objVal>
      <counter name="txnCnt1" type="cntrType1">
        <count>0</count>
        <amount>4.56</amount>
      </counter>
    </txn>
  <batEnd type="BATCH">
    <cols>
      <str name="CID">abc789</str>
      <str name="SUBTYPE">sample</str>
    </cols>
    <objVal cat="" key="">
      <str>str</str>
    </objVal>
    <counter name="batCntr" type="cntrTyp2">
      <count>0</count>
      <amount>5.79</amount>
    </counter>
  </batEnd>
</em:chunk>
The abort element supports including exception information as well as transmission updates. The schema model for this type is shown in Figure 5 and an example XML document is shown in Figure 6.
Figure 5. EndMapper (v2) abort model
EndMapper2Abort.jpg
Figure 6. Example EndMapper (v2) document for abort
<em:abort xmlns:em="http://www.ibm.com/xmlns/prod/ftm/EndMapper" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <pt type="TRANSMISSION">
    <error>
      <type>type</type>
      <scheme>scheme</scheme>
      <code>code</code>
      <compType>compType</compType>
      <compName>compName</compName>
      <desc>desc</desc>
      <sev>sev</sev>
    </error>
  </pt>
</em:abort>