Finding out the place where an attribute of a model changes in Hybris

╄→尐↘猪︶ㄣ 提交于 2019-12-13 00:19:44

问题


I have a custom attribute called visibility in CategoryModel and it can be changed both from backoffice manually and from a cronjob which checks whether there is at least one product under the category. If it is changed from backoffice, cronjob should not change the visibility even if any product is found under it. When an attribute is changed from backoffice, section called Last Changes in Backoffice registers changes related to attribute but I could not find how or where it is done.

How can I find out the place where an attribute of a model changes? From Backoffice or Cronjob or something like that?


回答1:


SavedValues - Keeping Track of Attribute Value Modification

If you modify the value of an attribute in Backoffice then the original value of the attribute (before modification) and the new value (after modification) stores in SavedValues. Early v6.7 there was HMC API to deal with SavedValues, but now you have to write the flexible query to get the entries from the service layer.

Find more detail here


Edit: Answer to your question

How can I find out the place where an attribute of a model changes? From Backoffice or Cronjob or something like that?

Find the attribute entry into the SavedValueEntry, if the current attribute value matches the newValue, then it was modified from the backoffice otherwise from the cronjob.


Other references
savedvalues-in-hybris
how-to-access-savedvalues-and-savedvalue-entries



来源:https://stackoverflow.com/questions/52060379/finding-out-the-place-where-an-attribute-of-a-model-changes-in-hybris

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!