cancel
Showing results for 
Search instead for 
Did you mean: 

ODATA Multiple Integration Object Items referring same Item Type

former_member839844
Discoverer
0 Kudos

Hi All,

I am creating an Integration Object Items as part of an implementation and i am getting an issue when accessing the items via backoffice. The issue occurs when i use the same type in my Integration Object Item. I looked at the code and it seems Hybris is literally looking to have an Unique item -

public static Map<ComposedTypeModel, List<AbstractListItemDTO>> convertIntegrationObjectToDTOMap(ReadService readService, IntegrationObjectModel integrationObject) {<br>    return (Map)integrationObject.getItems().stream().collect(Collectors.toMap(IntegrationObjectItemModel::getType, (item) -> {<br>        return getItemDTOS(readService, item);<br>    }));<br>}

Example :

INSERT_UPDATE IntegrationObjectItem; integrationObject(code)[unique = true]; code[unique = true]   ; type(code)            ; root[default = false]
; Inbound ; TestIO; TestIO;
; Inbound ; Address ; Address ; true
; Inbound ; ResAddress ; Address

Accepted Solutions (1)

Accepted Solutions (1)

former_member839844
Discoverer
0 Kudos

Adding an update: -

The issue is only with viewing the Item in Backoffice Integration UI. As we are using same type for 2 different attributes, when it creates the Map Objects it is failing to merge, as there is no logic to look up duplicate item type code as Key.

The ODATA object persistence is working as expected.

Solution to Fix the Backoffice:-

When collecting to Map - we need to look up for Duplicate Items as Key. The actual call for this is from

"IntegrationObjectEditorTreeController". we will need to fix this to solve the BO issue.

de.hybris.platform.integrationbackoffice.widgets.editor.utility.EditorUtils
public static Map<ComposedTypeModel, List<AbstractListItemDTO>> convertIntegrationObjectToDTOMap(ReadService readService, IntegrationObjectModel integrationObject) {
return (Map)integrationObject.getItems().stream().collect(Collectors.toMap(IntegrationObjectItemModel::getType, (item) -> {
return getItemDTOS(readService, item);
}));
}

Answers (0)