Kourier Integrator Online Help
The service command KMK.IMPORT can be used to import data from either an XML or delimited flat-file. All imports referenced on the command line must be of the same type (XML or DELIMITED). The syntax for this command varies based upon the type of flat-file being processed.
KMK.IMPORT import_id XML-ROOT-TAG “root_element” XML-TRANS-TAG “trans_element” [XML-PARSE-SUB “subroutine_name“]
IMPORT_ID |
One or more import specifications to be processed in the service. Import specifications are processed in the same orders as specified in the command line. |
ROOT_ELEMENT |
Declares the root element of the XML file to import. If the XML file being processed does not contain the root_element an error is generated. All files processed in the service must have the same root element. |
TRANS_ELEMENT |
Declares which element in the XML file segments the XML into logical transactions. If only one transaction is passed in an XML message this tag can be set to "/". |
SUBROUTINE_NAME |
If specified, that subroutine will be called to allow a customer UniBASIC subroutine to format the XML file before it is processed by the Kourier Import processor. |
KMK.IMPORT IMPORT_ID [ XML-PARSE-SUB “subroutine_name“]
IMPORT_ID |
One or more import specifications to be processed in the service. Import specifications are processed in the same orders as specified in the command line. |
SUBROUTINE_NAME |
If specified, that subroutine will be called to allow a customer UniBASIC subroutine to format the DELIMITED file before it is processed by the Kourier Import processor. |
The KMK.IMPORT service command can be used to import data from either an XML or delimited flat-file. All imports referenced on the command line must be of the same type (XML or DELIMITED). The syntax for this command varies based upon the type of flat-file being processed.
The interface for the XML-PARSE-SUBROUTINE is: subroutine_name (MSG, HDRS, ERR, PARAMS)
On Entry:
MSG - Message being converted
HDRS - Message headers
ERR - Undefined
PARAMS - Undefined
On ExitProg:
MSG - Converted message
HDRS - Typically unchanged
ERR - Error message if error occurs, nil otherwise
PARAMS - Parameters for ERR if error occurs, nil otherwise
Each transaction received by Kourier is parsed into one or more transactions by the KMK.IMPORTXML program based upon the tag referenced by the XML-TRANS-TAG keyword. Each transaction is then processed by the KMK.IMPORTXMLTRANS subroutine.
This subroutine MUST be used in a Kourier Service.