<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Tirgger sync on single item programatically. in CRM and CX Q&amp;A</title>
    <link>https://community.sap.com/t5/crm-and-cx-q-a/tirgger-sync-on-single-item-programatically/qaa-p/12013030#M376714</link>
    <description>&lt;P&gt;OK I came with the following code which uses a bit of a Jalo layer.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; String catalogId = product.getCatalogVersion().getCatalog().getId();
 
          final Catalog catalog = CatalogManager.getInstance().getCatalog(catalogId);
          if (catalog != null) {
             final CatalogVersion source = catalog.getCatalogVersion(CatalogManager.OFFLINE_VERSION);
             final CatalogVersion target = catalog.getCatalogVersion(CatalogManager.ONLINE_VERSION);
 
             if (source != null &amp;amp;&amp;amp; target != null) {
                SyncItemJob syncJob = CatalogManager.getInstance().getSyncJob(source, target);
                //Convert Jalo to Model so we can use the CatalogSynchronizationService
                SyncItemJobModel syncJobModel = modelService.get(syncJob);
                catalogSynchronizationService.performSynchronization(Collections.singletonList(product), syncJobModel, getSyncConfig());
             }
          }
 
 the syncConfig is created as fallows:
 
 private SyncConfig getSyncConfig() {
       final SyncConfig syncConfig = new SyncConfig();
       syncConfig.setCreateSavedValues(Boolean.TRUE);
       syncConfig.setForceUpdate(Boolean.TRUE);
       syncConfig.setLogLevelDatabase(JobLogLevel.WARNING);
       syncConfig.setLogLevelFile(JobLogLevel.WARNING);
       syncConfig.setLogToFile(Boolean.TRUE);
       syncConfig.setLogToDatabase(Boolean.FALSE);
       syncConfig.setSynchronous(Boolean.FALSE);
       return syncConfig;
    }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 20 Mar 2018 08:26:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2018-03-20T08:26:09Z</dc:date>
    <item>
      <title>Tirgger sync on single item programatically.</title>
      <link>https://community.sap.com/t5/crm-and-cx-q-a/tirgger-sync-on-single-item-programatically/qaq-p/12013029</link>
      <description>&lt;P&gt;I find the CatalogSynchronizationService really developer unfriendly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Is there an example how to performSynchronization a single item synchronization ?&lt;/P&gt;
&lt;P&gt;Most of the code I find even in the current Hybris services uses CatalogManager (from hybris 3) and JALO layer stuff.&lt;/P&gt;
&lt;P&gt;it should be easy but it is more like an impossible task ;)
&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 11:25:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/crm-and-cx-q-a/tirgger-sync-on-single-item-programatically/qaq-p/12013029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-03-19T11:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Tirgger sync on single item programatically.</title>
      <link>https://community.sap.com/t5/crm-and-cx-q-a/tirgger-sync-on-single-item-programatically/qaa-p/12013030#M376714</link>
      <description>&lt;P&gt;OK I came with the following code which uses a bit of a Jalo layer.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; String catalogId = product.getCatalogVersion().getCatalog().getId();
 
          final Catalog catalog = CatalogManager.getInstance().getCatalog(catalogId);
          if (catalog != null) {
             final CatalogVersion source = catalog.getCatalogVersion(CatalogManager.OFFLINE_VERSION);
             final CatalogVersion target = catalog.getCatalogVersion(CatalogManager.ONLINE_VERSION);
 
             if (source != null &amp;amp;&amp;amp; target != null) {
                SyncItemJob syncJob = CatalogManager.getInstance().getSyncJob(source, target);
                //Convert Jalo to Model so we can use the CatalogSynchronizationService
                SyncItemJobModel syncJobModel = modelService.get(syncJob);
                catalogSynchronizationService.performSynchronization(Collections.singletonList(product), syncJobModel, getSyncConfig());
             }
          }
 
 the syncConfig is created as fallows:
 
 private SyncConfig getSyncConfig() {
       final SyncConfig syncConfig = new SyncConfig();
       syncConfig.setCreateSavedValues(Boolean.TRUE);
       syncConfig.setForceUpdate(Boolean.TRUE);
       syncConfig.setLogLevelDatabase(JobLogLevel.WARNING);
       syncConfig.setLogLevelFile(JobLogLevel.WARNING);
       syncConfig.setLogToFile(Boolean.TRUE);
       syncConfig.setLogToDatabase(Boolean.FALSE);
       syncConfig.setSynchronous(Boolean.FALSE);
       return syncConfig;
    }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Mar 2018 08:26:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/crm-and-cx-q-a/tirgger-sync-on-single-item-programatically/qaa-p/12013030#M376714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-03-20T08:26:09Z</dc:date>
    </item>
  </channel>
</rss>

