If we are receiving a part-of relation data from input csv, how the conversion happens using hot folder concept?
For example, if the input is received as two files Customers.csv CustomerAddresses.csv
How do you perform documentID references between customers and customer addresses as they will be converted into two different impex files using converters.
Hi Elango
The Hot folder basically is a folder that have a config properties and this configuration is the one that discard one Impex from another. So basically is a template for an Impex.
The best way to discard which impex are you going to use is to create in the configuration a mapping with the name of your Csv.
Something like this for the "Customer.csv"
First create your Bean that contain the Impex header
<bean id="myTestConverter" class="de.hybris.platform.acceleratorservices.dataimport.batch.converter.impl.DefaultImpexConverter">
<property name="header">
<value> INSERT_UPDATE Customer
</value>
</property>
<property name="impexRow">
<value> "Parameters"</value>
</property>
<property name="type" value="Customer"/>
</bean>
Then Create the Mapping
<bean id="myTestConverterMapping" class="de.hybris.platform.acceleratorservices.dataimport.batch.converter.mapping.impl.DefaultConverterMapping"
p:mapping="Customer"
p:converter-ref="myTestConverter"/>
After you had Imported your Customers, you could add the address (in the same way creating a bean that contain the impex header in the configuration of your hot folder).
Be aware that the Address is a partof Item of Costumer, that means that belongs to the customer and the reference is dynamic and is builded updating the customer (assigning the address to the customer). For that reason you have to make 2 headers in the same bean for the hot folder configuration
Example, assuming that you already have inserted this customer "Elango"
UPDATE customer;uid[unique=true];defaultshipmentAddress( &addrID );defaultpaymentaddress( &addrID )
;Elango;a2;a1
INSERT_UPDATE address;streetname[unique=true];country(isocode);&addrID;owner( Customer.uid )
;payment address ireland;IE;a1;Elango
;shipping address ireland;IE;a2;Elango
I hope that could solve your issue
Best regards
JC
Hi Elango
Well, yes you should extend the "DefaultImpexConverter" in order to process both of the Impex headers in the same of your configuration. The method you should override is the method called convert(...).
Don't worry about the mapping because the mapping only will call the bean you have configured with the double header so that is not going to cause you any problem.
I strongly recommend you to try the impex header in the hAC and optimize it the the best possible for your purpose.
I hope this helps
Best Regards
JC
Add a comment