cancel
Showing results for 
Search instead for 
Did you mean: 

I want to delete all the data in table before processing new feed in hotfolder

0 Kudos

I have overriden beforeconvert method and deleting all the records,but it is creating a plain impex.csv file in processing folder and then it is taking couple of hours to delete and process the new data.

any suggestions will be highly appreciated

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member704915
Participant
0 Kudos

Add the below lines before your feed impex header

 <bean id="batchEmptyItemDateBeforeFeed"
         class="de.hybris.platform.acceleratorservices.dataimport.batch.converter.impl.DefaultImpexConverter">
         <property name="header">
             <value>
                $targetType=yourItemTypeName
                     REMOVE $targetType[batchmode=true];itemtype(code)[unique=true]
                     ;$targetType
             </value>
         </property>
     </bean>


0 Kudos

Can we remove only staged version details, if yes can you help me how we can achieve that.

0 Kudos

Can we have two headers in one converter

former_member704915
Participant
0 Kudos

You'll have to write two converters and map it to the same processing trigger.The remove conervter should be preceded by your insert update converter.

former_member704915
Participant
0 Kudos

I don't think we have the staged version for items except the catalog aware items. In case you want to remove the catalog aware items, modify header something like below

REMOVE $targetType[batchmode=true];itemtype(code)[unique=true]; catalog [version='staged']

P.S: This is just a rough idea. please prepare the header correctly 🙂

0 Kudos

you can use this header to remove all data from table in bulk

REMOVE MyItem[batchmode=true];itemType(code)[unique=true] ;MyItem

All instances of this type match the criteria, and batchmode=true executes it for all data rows (so unique key has not to be unique)