Fluent Commerce Logo
Docs
Sign In

UpdateCategoriesForStandardProduct

Rule

Changed on:

2 Nov 2023

Overview

Adds or removes categories from the standard product based on the information provided in the event

Plugin NameInventory Reference Module
Namespace[[account.id]].globalinventory

The Inventory Reference Module is the foundation for inventory 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 Inventory 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 standard 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 standard product expect the 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 standard product they will be added to this product. The 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 the 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 standard product

[String]

Optional

Exceptions

If the event attribute 

`{ref}`
 is null or empty, an EventAttributeNotFoundException will be thrown.

Configuration example

1{
2  "name": "FLUENTRETAIL.globalinventory.UpdateCategoriesForStandardProduct"
3}

Language: json

Detailed Technical Description

This rule queries all the categories linked to this standard 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 standard product and updates the standard 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 standard product.

Version History

2023-08-03

v2.0.0

refers to the plugin

Copyright © 2024 Fluent Retail Pty Ltd (trading as Fluent Commerce). All rights reserved. No materials on this docs.fluentcommerce.com site may be used in any way and/or for any purpose without prior written authorisation from Fluent Commerce. Current customers and partners shall use these materials strictly in accordance with the terms and conditions of their written agreements with Fluent Commerce or its affiliates.

Fluent Logo