UpdateCategoriesForVariantProduct
Rule
Changed on:
12 Aug 2025
Overview
Adds or removes categories from the variant product based on the information provided in the event| Plugin Name | Inventory Reference Module |
|---|---|
| Namespace | [[account.id]].globalinventory |
- Product Catalogue workflow
- Inventory Catalogue workflow
- Control Group workflow
- Virtual Catalogue workflow
UI Description
Adds or removes categories from the variant product based on the information provided in the event
Accepts
- PRODUCT
Actions
- This rule produces a MutationAction that will remove all the categories from the variant product except categories provided as part of the event attribute {categoryRef}. If one or more of the categories provided in the event attributes are not already linked to this variant product they will be added to this product. This number of MutationActions produced in this rule depends on the categories in the event attributes. There will be a MutationAction if one or more categories are to be added and another MutationAction if there are one or more categories to be removed from product
Rule parameters
This rule has no Input Parameters.
Event attributes
| Parameter | Description | Data Type | Required? |
| ref | The ref of the product | String | Required |
| categoryRefs | The list of categories that will be linked to this variant product | [String] | Optional |
Exceptions
If the event attribute
`{ref}` is null or empty, an EventAttributeNotFoundException will be thrownConfiguration example
1{
2 "name": "FLUENTRETAIL.globalinventory.UpdateCategoriesForVariantProduct"
3}Detailed Technical Description
This rule queries all the categories linked to this variant product using the`{ref}` event attribute (as product ref) and `{rootEntityRef}` value (as the product catalogue ref) from the incoming event. It then calculates the difference between the categories provided in the incoming event attribute `{categoryRefs}` and the ones already linked to the variant product and updates the variant product only to leave the categories received through the event attribute `{categoryRefs}` linked. This means that some categories that are already linked may be removed and new categories may be linked to the variant product.