EndMapper (v2) ESQL API
EndMapper (v2) provides a set of helper functions that can be used to accelerate the implementation effort
for construction of mapping document:
API function | Description |
---|---|
|
Creates the XMLNSC child of output root and initializes the XML attributes (version and encoding). |
|
Creates an 'em:txn' element on output root of type <cObjType>. Moves <rTxn> to point to this element. |
|
Creates an 'em:chunk' element on output root of type <cObjType>. Moves <rChunk> to point to this element. |
|
Batch version of InitTxnMapping function. |
|
Create an ISFMessage element in an 'ISF_DATA' column definition under <rTxn>. Move <rCols> and <rIsf> to point to the cols and ISFMessage elements respectively. |
|
Create an 'em:abort' element under an XMLNSC child of output root of type <cObjType>. |
|
Create a 'str' column element under <rCols> using the values from <cColName> and <cColValue>. |
|
Create a 'int' column element under <rCols> using the values from <cColName> and <cColValue>. |
|
Create a 'dec' column element under <rCols> using the values from <cColName> and <cColValue>. |
|
Create a 'boolean' column element under <rCols> using the values from <cColName> and <cColValue>. |
|
Create a 'date' column element under <rCols> using the values from <cColName> and <cColValue>. |
|
Create a 'time' column element under <rCols> using the values from <cColName> and <cColValue>. |
|
Create a 'datetime' column element under <rCols> using the values from <cColName> and <cColValue>. |
|
Create a 'xml' column element under <rCols> using the values from <cColName> and <cColValue>. |
|
Create a 'hex' column element under <rCols> using the values from <cColName> and <cColValue>. |
|
Create a 'batStart' element under <rObject> with type of <cObjType>. |
|
Create a 'batEnd' element under <rObject> with type of <cObjType>. |
|
Create a 'objVal' element as a sibling of <rCols> using the other parameter
values. Note: Please review usage notes at the end of the table
|
|
Create a 'objVal' element as a sibling of <rCols> using the other parameter
values. The reference <ref> must be a reference to a BLOB value. Note: Please review usage notes at the
end of the table
|
|
Create a 'objVal' element as a sibling of <rCols> using the other parameter
values. The reference <ref> must be a reference to an XMLNSC tree. Note: Please review usage notes at the
end of the table
|
|
Create a 'counter' element as a sibling of <rCols> using the other parameter
values. Note: Please review usage notes at the end of the table
|
|
Create an 'error' element as a sibling of <rCols> using the other parameter
values. Note: Please review usage notes at the end of the table
|
|
Create an 'error' element under <rInRef> and copy error structure from <rError>. |
|
Create a 'pt' element under <rObject> with type of <cObjType>. |
Usage Notes
A number of procedures accept an rCols reference that is defined as INOUT:
- ObjValueString
- ObjValueHex
- ObjValueXml
- Counter
- Error
- Cols
- ObjValue
- Counter
- Error
CALL PhysicalTransmissionFlow.InitTxnIsf(rTxn, rIsf, isfNS, 'isf', rCols);
CALL MapTransactionISF(rIsf);
CALL PhysicalTransmissionFlow.NewStrCol(rCols, 'CID', rISFPaymInstr.Identification);
CALL PhysicalTransmissionFlow.NewStrCol(rCols, 'UID', rInPmtInf.*:PmtInfId);
CALL PhysicalTransmissionFlow.ObjValueString(rCols, 'cat', 'key1', rIsf.StringData);
CALL PhysicalTransmissionFlow.ObjValueString(rCols, 'cat', 'key2', rIsf.StringData);
CALL PhysicalTransmissionFlow.Counter(rCols, 'name1', 'type', nCount, dAmount);
CALL PhysicalTransmissionFlow.Counter(rCols, 'name2', 'type', nCount, dAmount);
CALL PhysicalTransmissionFlow.Error(rCols, 'cType', 'cScheme', 'cCode', 'cCompType', 'cCompName','cDesc', 'cSev');
CALL PhysicalTransmissionFlow.Error(rCols, 'cType', 'cScheme', 'cCode', 'cCompType', 'cCompName','cDesc', 'cSev');
It
is recommended that application code follows this pattern as far as possible.If the application code wishes to execute these calls in a different order it must be done carefully such
that the move of the INOUT reference does not cause breakage. A typical scenario might be the application
wishing to create error records during or just after ISF mapping. The below example shows error records
created before the column values. This is facilitated by declaring a new reference rErrors and passing that
into the Error() function call so as not to move the original
reference.
CALL PhysicalTransmissionFlow.InitTxnIsf(rTxn, rIsf, isfNS, 'isf', rCols);
CALL MapTransactionISF(rIsf);
DECLARE rErrors REFERENCE TO rCols; -- create a second reference so as not to move the original rCols
CALL PhysicalTransmissionFlow.Error(rErrors, 'cType', 'cScheme', 'cCode', 'cCompType', 'cCompName','cDesc', 'cSev');
CALL PhysicalTransmissionFlow.Error(rErrors, 'cType', 'cScheme', 'cCode', 'cCompType', 'cCompName','cDesc', 'cSev');
CALL PhysicalTransmissionFlow.NewStrCol(rCols, 'CID', rISFPaymInstr.Identification);
CALL PhysicalTransmissionFlow.NewStrCol(rCols, 'UID', rInPmtInf.*:PmtInfId);
CALL PhysicalTransmissionFlow.ObjValueString(rCols, 'cat', 'key1', rIsf.StringData);
CALL PhysicalTransmissionFlow.ObjValueString(rCols, 'cat', 'key2', rIsf.StringData);
CALL PhysicalTransmissionFlow.Counter(rCols, 'name1', 'type', nCount, dAmount);
CALL PhysicalTransmissionFlow.Counter(rCols, 'name2', 'type', nCount, dAmount);
It is important to note that these helper functions are not the only way to create the document structure. If the application code is structured in a manner that causes these functions to produce an invalid document, it is possible to use basic ESQL statements to supplement or alter the document structure.