Import multiple data sources

Multiple data sources can be imported simultaneously by means of the -datasourcelist <file> argument (see chapter runxmlimport command line program). To import multiple data sources a configuration file is available in which you can specify a list of data sources. During an XML import, the data of the data sources specified in the configuration file are imported consecutively, just as if the XML import was called consecutively multiple times using the ‑datasource <file> argument. The sequence of the data source import is specified in the configuration file.

The configuration file must match the datasourcelist.dtd DTD, which looks as follows.

<!ELEMENT datasourcelist (datasource*)>

<!ELEMENT datasource (#PCDATA)>

<!ATTLIST datasource

name ID #REQUIRED

type (EVENT | MYSAP | JDBC | CSV | NIRVANA ) #REQUIRED

>

You need to specify an ID for each data source, i.e., the name of the data source also used in CTK, the data source type, and the path to the data source file.

An XML file can look as follows.

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE datasourcelist SYSTEM "datasourcelist.dtd">

<datasourcelist>

<datasource name="CLEARING" type="EVENT">M:/SoftwareAG/ppmmashzone/server/bin/work/data_ppm/custom/umg_en/xml/CLEARING/CLEARING.xml</datasource>

<datasource name="BILLING" type="MYSAP"> M:/SoftwareAG/ppmmashzone/server/bin/work/data_ppm/custom/umg_en/xml/BILLING/BILLING.xml</datasource>

<datasource name="SHIPMENT" type="JDBC"> M:/SoftwareAG/ppmmashzone/server/bin/work/data_ppm/custom/umg_en/xml/SHIPMENT/SHIPMENT.xml</datasource>

<datasource name="MATERIAL_DOCUMENT" type="CSV">M:/SoftwareAG/ppmmashzone/server/bin/work/data_ppm/custom/umg_en/xml/MATERIAL_DOCUMENT/MATERIAL_DOCUMENT.xml</datasource>

<datasource name="PURCHASE_PROCESS" type="NIRVANA"> M:/SoftwareAG/ppmmashzone/server/bin/work/data_ppm/custom/umg_en/xml/PURCHASE_PROCESS/PURCHASE_PROCESS.xml</datasource>

</datasourcelist>

Error behavior

If the XML import is called via a valid configuration file that does not contain any data sources the import ends without outputting an error message.

If the XML import is called via a configuration file containing multiple data sources, and if an error occurs during the import of a data source that leads to cancelation of this import, the import continues with the next data source file. This means that the cancelation of the import of one data source does not result in the cancelation of the overall import.

If an error occurs during the import of at least one data source from a configuration file, which has so far lead to an exit error status (i.e., "-1") during the import of individual data sources, the import using that configuration file will also return this exit error state.