cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

What is the Default Composition Handler Name for Collection type Attributes in Datahub?

rahulverma94
Active Participant
613

Hi Experts,

I understand that there is a default composition handler in datahub with following functionality: When the attribute is a collection, the two collections merge into one collection, and any duplicates that might occur in the combined collection are removed. If the new raw item has an empty collection for its value, the resulting merged canonical item also contains an empty collection value. The empty collection value is created by a raw item with an empty string set for its corresponding raw attribute.

I wanted to understand the name of the default handler which implements the above functionality. Also, do i need to write a new composition handler or override the existing in order to tweak the logic on how a collection attribute is handled by datahub?

Thanks in advance.

Regards Rahul

Accepted Solutions (1)

Accepted Solutions (1)

rahulverma94
Active Participant
0 Likes

I could not find any such class in datahub 6.7. Could you plz let me know the jar in which the class is present?

Slava
Product and Topic Expert
Product and Topic Expert
0 Likes

CollectionCompositionRuleHandler is in datahub-service.d it's not included in the datahub-sdk, however it's present in DataHub runtime. CompositionRuleHandler interface is in the datahub-api jar, which is included in the sdk

Answers (1)

Answers (1)

Slava
Product and Topic Expert
Product and Topic Expert

If I'm not mistaken it's com.hybris.datahub.composition.impl.CollectionCompositionRuleHandler, which implements CompositionRuleHandler. You can develop your custom implementation and register it in the *spring.xml with collectionCompositionRuleHandler name.