如何同步产品的在线日期,而不同步变体的在线日期?

时间:2018-08-21 12:28:38

标签: hybris

如何同步产品的在线日期,而不同步变体的在线日期?我有一个MyProduct,它是Product的子类。我还有MyVariant,它是VariantProduct的具体子类。

注意:onlineDate是产品的OOTB属性

我正在做这样的事情:

INSERT_UPDATE SyncAttributeDescriptorConfig;syncJob(code)[unique=true][path-delimiter=!];attributeDescriptor(enclosingType(code), qualifier)[unique=true];includedInSync;copyByValue
# Sync Product's Online Date
;MySyncJob;MyProduct:onlineDate;true;true
# DO NOT sync variant's Online Date
;MySyncJob;MyVariant:onlineDate;false;false

不幸的是,我收到这样的警告:

INFO   | jvm 1    | main    | 2018/08/21 19:43:29.731 | [m[1;33m0821_19:43:29,647 WARN  [ImpExResultProcessWorker] (00000000-ImpEx-Import)  [de.hybris.platform.impex.jalo.imp.ImpExImportReader.dumpUnresolvedLine:811] line 3 at main script: dumped unresolved line ValueLine[unresolvable:line 3: cannot create SyncAttributeDescriptorConfig with values ItemAttributeMap[ registry:  null, type: <null>, data: {syncjob=MySyncJob(8796095414772), copybyvalue=true, includedinsync=true, attributedescriptor=MyProduct.onlineDate:java.util.Date[/rwoSRp]} ] due to [de.hybris.platform.catalog.impl.SyncAttributeDescriptorConfigValidator@139e7948]:Attribute AttributeDescriptorModel (8796237725783) is inherited - use the declared one.,line 3 at main script,null,HeaderDescriptor[line 2 at main script, insert_update, SyncAttributeDescriptorConfig, {}, [syncJob, attributeDescriptor, includedInSync, copyByValue] ],{1=ValueEntry('MySyncJob'=MySyncJob(8796095414772),unresolved=false,ignore=false), 2=ValueEntry('MyProduct:onlineDate'=MyProduct.onlineDate:java.util.Date[/rwoSRp],unresolved=false,ignore=false), 3=ValueEntry('true'=true,unresolved=false,ignore=false), 4=ValueEntry('true'=true,unresolved=false,ignore=false)}]
INFO   | jvm 1    | main    | 2018/08/21 19:43:29.731 | [m[1;33m0821_19:43:29,647 WARN  [ImpExResultProcessWorker] (00000000-ImpEx-Import)  [de.hybris.platform.impex.jalo.imp.ImpExImportReader.dumpUnresolvedLine:811] line 4 at main script: dumped unresolved line ValueLine[unresolvable:line 4: cannot create SyncAttributeDescriptorConfig with values ItemAttributeMap[ registry:  null, type: <null>, data: {syncjob=MySyncJob(8796095414772), copybyvalue=false, includedinsync=false, attributedescriptor=MyVariant.onlineDate:java.util.Date[/rwoSRp]} ] due to [de.hybris.platform.catalog.impl.SyncAttributeDescriptorConfigValidator@139e7948]:Attribute AttributeDescriptorModel (8796267872343) is inherited - use the declared one.,line 4 at main script,null,HeaderDescriptor[line 2 at main script, insert_update, SyncAttributeDescriptorConfig, {}, [syncJob, attributeDescriptor, includedInSync, copyByValue] ],{1=ValueEntry('MySyncJob'=MySyncJob(8796095414772),unresolved=false,ignore=false), 2=ValueEntry('MyVariant:onlineDate'=MyVariant.onlineDate:java.util.Date[/rwoSRp],unresolved=false,ignore=false), 3=ValueEntry('false'=false,unresolved=false,ignore=false), 4=ValueEntry('false'=false,unresolved=false,ignore=false)}]

我想用Hybris OOTB实现什么?

1 个答案:

答案 0 :(得分:0)

对此进行相应更改,然后尝试:

$syncJobCode = sync xxxProductCatalog\:Staged->xxxProductCatalog\:Online
INSERT_UPDATE SyncAttributeDescriptorConfig; attributeDescriptor(enclosingType(code), qualifier)[unique = true]; includedInSync; syncJob(code)[unique = true]; copyByValue
                                           ; Product:onlineDate                                                ; false         ; $syncJobCode                ; false
                                           ; GenericVariantProduct:onlineDate                                  ; false         ; $syncJobCode                ; false