Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Define the import process in the imports.xml metadata file.
    1. Define import parameters.
  2. Create the template file defined in the imports.xml metadata file for the import process.
  3. Create a process class extending com.crm.process.CRMImportBean, responsible for parsing the file and processing its records and define this process in modules.xml metadata file.

...

The import process must be defined in the imports.xml metadata file, as shown in the example below. The metadata file can be located under the <custom_project>/src/main/resources/metadatadirectory. Note that all of the information except importdescription and importparameters must be defined in the file. The processes defined in this file will appear in the Imports page, under Foundation > Utilities and you can view and edit their process run definition through this pagethe Imports page, under Foundation > Utilities and you can view and edit their process run definition through this page.

a. Import parameters

The import parameters should be defined in the metadata file to enable the user to give some default values to the respective parameters of the template file. The import parameters are mapped to the template file's parameters through the importparametername, which must be the same as the name of the header of the respective parameter in the template file. So, based on the example below, the template file must have columns with headers custom_parameter1 and custom_parameter2. When defining the import parameters, it is mandatory to define all the information for them. The importparameterkey is the label that will appear for the parameter in the data entry page and the importparametertype is the type of the parameter and it can be one of the following: java.lang.String, text, java.lang.Integer, java.math.BigDecimal, java.util.Date, password, java.lang.Boolean and enum.

Code Block
languagejava
themeEclipse
titleimports.xml
collapsetrue
<importsconfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/imports.xsd">
	<imports>
		...
		
		<import>
			<importname>Custom Import</importname>
			<importdescription>Custom Import in CRM.COM.</importdescription>
			<importprocess>CUSTOM_IMPORT</importprocess>
			<importmodule>CUSTOM</importmodule>
			<importtemplatefilepath>imports/customTemplateFile.csv</importtemplatefilepath>
			<importparameters>
				<importparameter>
					<importparametername>custom_parameter1</importparametername>
					<importparameterkey>key_vouchercustom_value<parameter1</importparameterkey>
					<importparametertype>java.math.BigDecimal</importparametertype>
				</importparameter>
				<importparameter>
					<importparametername>voucher_extra_added_value<<importparametername>custom_parameter2</importparametername>
					<importparameterkey>key_voucher_extra_added_value<custom_parameter2</importparameterkey>
					<importparametertype>java.mathlang.BigDecimal<String</importparametertype>
				</importparameter>
				...
			</importparameters>
		</import>

		...
	</imports>
</importsconfig>

...