Fluent Commerce Logo
Docs
Sign In

ForwardIfProductStatusEquals

Rule

Changed on:

29 Nov 2023

Overview

Send an event {eventName} if the status of the product in the product catalogue with ref {productCatalogueRef} has the current status of {status}.

Plugin NameInventory Reference Module
Namespace{{accountId}}.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 Modules includes the following areas:

  • Inventory Catalogue workflow
  • Virtual Catalogue workflow
  • Control Group workflow
  • Product Catalogue workflow

UI Description

Send an event {eventName} if the status of the product in the product catalogue with ref {productCatalogueRef} has the current status of {status}.

Accepts

  • INVENTORY_POSITION

Actions

  • This rule produces a SendEventAction that forwards the incoming event as an inline event with the given name {eventName} to the inventory position if the status of the product has a different status compared to the inventory position and the product has become {status}.

Rule parameters

Parameter

Description

eventName

The name of event to be triggered

status

Expected location status

productCatalogueRef

The product catalogue ref of the product

Event attributes

Not Applicable for this rule.

Exceptions

  • This rule throws a PropertyNotFoundException when:
  • the 
    `eventName`
     property is not provided in workflow
  • the 
    `status`
     property is not provided in workflow
  • the 
    `productCatalogueRef`
     property is not provided in workflow
  • This rule throws a general RubixException with code 400 when it can not find the corresponding variant product or standard product.

Configuration example

1{
2  "name": "{{accountId}}.globalinventory.ForwardIfProductStatusEquals",
3  "props": {
4    "status": "INACTIVE",
5    "eventName": "DeactivateInventoryPosition",
6    "productCatalogueRef": "DEFAULT:1"
7  }
8}

Language: json

Detailed Technical Description

When the ForwardIfProductStatusEquals rule retrieves the product status, firstly, it retrieves the variant product based on the product ref. If it gets a variant product, it will return and compare its status. Otherwise, then it will use the same product ref to retrieve standard product and return its status.

Version History

2023-08-02

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