Fluent Commerce Logo
Docs
Sign In

ValidateProductCategoriesExist

Rule

Changed on:

18 Oct 2024

Overview

Validate the incoming Product event to confirm that the given Categories already exist.

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

Validates the incoming product event to confirm the given categories already exist.

Accepts

  • PRODUCT_CATALOGUE

Actions

  • This Rule does not produce any Actions

Rule parameters

This Rule has no Input Parameters.

Event attributes

Name

Type

Description

Required

`categoryRefs`

[String]

A list of categories this product belongs to

No

Exceptions

  • This Rule throws an
    `IllegalArgumentException`
    if any of the specified Categories do not exist.

Configuration example

1{
2  "name": "[[account.id]].globalinventory.ValidateProductCategoriesExist"
3}

Language: json

Detailed Technical Description

This Rule parses / deserializes

`categoryRefs`
event attribute. If there is at least one Category Reference provided in the incoming event attributes, it:

  • Checks if that Category(ies) exists in the Product Catalog, using the 
    `entityRef`
     field value of the incoming event as the Product Catalog Reference. 
  • An 
    `IllegalArgumentException`
     will be thrown if at least one Category does not exist in the Product Catalog. 
  • Otherwise, the Rule does not have any output Actions.

Version History

2024-10-28

v.24.10.28

This Rule has been extended with a pagination logic to ensure correct execution when a given Product is associated with more than 100 Categories.

The Rule Version refers to the Product Release Version.

2023-08-03

v2.0.0

refers to 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