Skip to Content
0
Former Member
Aug 04, 2014 at 09:23 AM

Synchronization not Overwriting Target Catalog Changes

788 Views

We have a business requirement where we need to customize the synchronization process. We followed the procedure mentioned at : **https://wiki.hybris.com/display/forum/Customize+sync+process+to+modify+attribute+copy+processing**.

Everything works fine if we make changes to the Source catalog. But whenever there are changes in the target catalog and we run a sync, the target catalog is not overwritten by the source catalog.

The steps we followed while customizing the sync are :

  1. Created a CustomSyncJob item extending 'CatalogVersionSyncJob'

  2. Extended the generated Jalo of CustomSyncJob i.e. GeneratedCustomSyncJob.

  3. Overriding the createCopyContext() method to call our own copy context called 'MyCopyContext'.

  4. 'MyCopyContext' class has a constructor calling super() and a logic to get the country from the SyncJob.

  5. In the same class 'MyCopyContext' we are overriding finishedCopying() method which has our custom logic to modify the target item depending upon the country fetched in step 4.

While debugging through the OOTB Hybris sync we analyzed that there are schedule medias created each time we do a sync and on the basis of this 'CatalogVersionSyncScheduleMedia' the sync knows what to update/delete in the target catalog.

The issue is when there are only target catalog changes the schedule medias do not have entry for these changes which they should have and thus nothing is changed in the target catalog.

I don't know if this is a limitation if we customize the sync process or there is any other method we need to override in order to get this working.

Also we are running our SyncJobs through normal CronJobs which are fetching our SyncJobs and initiating them. But before initiating we set the schedule media of our SyncJob to 'null' so that it creates a new schedule media every time it runs.