on 06-27-2019 12:08 PM
Hi All,
We have below category hierarchy structure. A -> B - >C -> D1, D2, D3, D4, D5
When I am running below impex to create entire category hierarchy, it is working fine.
INSERT_UPDATE Category;;catalogVersion(Catalog(id),version)[unique=true];name;description;supercategories(code,catalogVersion(catalog(id),version));code[unique=true]
;22;ProductCatalog:Staged;category D1;category D1;C:ProductCatalog:Staged;D1
;23;ProductCatalog:Staged;category A;category A;<ignore>;A
;18;ProductCatalog:Staged;category D2;category D2;C:ProductCatalog:Staged;D2
;19;ProductCatalog:Staged;category D3;category D3;C:ProductCatalog:Staged;D3
;20;ProductCatalog:Staged;category D4;category D4;C:ProductCatalog:Staged;D4
;17;ProductCatalog:Staged;category B;category B;A:ProductCatalog:Staged;B
;24;ProductCatalog:Staged;category C;category C;B:ProductCatalog:Staged;C
;21;ProductCatalog:Staged;category D5;category D5;C:ProductCatalog:Staged;D5
Here categories are not mentioned in hierarchical order. But categories are created with correct hierarchy.
But when I am removing entire category hierarchy with below impex with same order as INSERT.
REMOVE Category;;catalogVersion(Catalog(id),version)[unique=true];name;description;supercategories(code,catalogVersion(catalog(id),version));code[unique=true]
;22;ProductCatalog:Staged;category D1;category D1;C:ProductCatalog:Staged;D1
;23;ProductCatalog:Staged;category A;category A;<ignore>;A
;18;ProductCatalog:Staged;category D2;category D2;C:ProductCatalog:Staged;D2
;19;ProductCatalog:Staged;category D3;category D3;C:ProductCatalog:Staged;D3
;20;ProductCatalog:Staged;category D4;category D4;C:ProductCatalog:Staged;D4
;17;ProductCatalog:Staged;category B;category B;A:ProductCatalog:Staged;B
;24;ProductCatalog:Staged;category C;category C;B:ProductCatalog:Staged;C
;21;ProductCatalog:Staged;category D5;category D5;C:ProductCatalog:Staged;D5
All categories are removed successfully, but I am seeing below errors in hybris console.
WARN [impex result worker [cj:00000BLQ]] [ImpExImportReader] line 5 at main script: dumped unresolved line ValueLine[unresolvable:could not remove item 8797045948558 due to [de.hybris.platform.category.interceptors.CategoryRemovalValidator@36860221]:cannot remove [A], since this category still has sub-categories,line 5 at main script,null,HeaderDescriptor[line 2 at main script, remove,
WARN [impex result worker [cj:00000BLQ]] [ImpExImportReader] line 4 at main script: dumped unresolved line ValueLine[unresolvable:could not remove item 8797046145166 due to [de.hybris.platform.category.interceptors.CategoryRemovalValidator@36860221]:cannot remove [B], since this category still has sub-categories,line 4 at main script,null,HeaderDescriptor[line 2 at main script, remove,
I have two questions here :
how category A and B removed even though we got errors for category A and B.
Why didn't we get error for category C as category D5 is on last line of remove impex statement ?
Could anyone please help on this issue ?
Hi - This is the expected behaviour. As you already know ImpEx is executed in multiple passes. In the first pass, A
and B
had sub-categories and therefore you got the warning. But once C
is removed, there will be no warning for B
and when B
is removed, there will be no warning for A
.
If you want to execute your ImpEx without any warning at all, you need to put value lines of REMOVE
ImpEx in the reverse order of the category structure (bottom to upwards).
I hope it is clear.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi - from a quick search, I can find https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/1905/en-US/2fb5a2a780c94325b4a48ff62b36... but certainly there are more pages talking about it at the help site. Please feel free to ask again if there is any further doubt.
Before you remove the categories using impex or deleting it from backoffice. we need to detach the super and subcategories associated to it. As per above warning it has the associated subcategories. So you are not able to remove them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.