UpdateCategoriesForVariantProduct
Changed on:
13 Nov 2023
Overview
Adds or removes categories from the variant product based on the information provided in the
Plugin Name | Inventory Reference Module |
---|---|
Namespace | [[account.id]].globalinventory |
The is the foundation for related implementations. It provides reference Workflows for inventory ingestion and processing. Extensible by design, use this Module as a base to build a solution to the needs of your customers.
The Module includes the following areas:
- 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 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 `{ref}`
is null or empty, an EventAttributeNotFoundException will be thrown
Configuration example
1{
2 "name": "FLUENTRETAIL.globalinventory.UpdateCategoriesForVariantProduct"
3}
Detailed Technical Description
This queries all the categories linked to this variant product using the `{ref}`
(as product ref) and `{rootEntityRef}`
value (as the product catalogue ref) from the incoming . It then calculates the difference between the categories provided in the incoming `{categoryRefs}`
and the ones already linked to the variant product and updates the variant product only to leave the categories received through the `{categoryRefs}`
linked. This means that some categories that are already linked may be removed and new categories may be linked to the variant product.
Version History
v2.0.0
refers to the