on 2023 Feb 02 2:03 AM
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
Request clarification before answering.
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);
}));
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.