Fluent Commerce Logo
Docs
Sign In

SendEventOnFulfilmentInventoryUpdate

Rule

Changed on:

2 Nov 2023

Overview

Send event {inventoryConfirmationEvent} if inventory is confirmed, or send {inventoryReserveEvent} if inventory is reserved, or {inventoryCancelEvent} if inventory is cancelled, to inventory position and include inventory quantities of type {inventoryQuantityTypes} in event attribute.

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 event {inventoryConfirmationEvent} if inventory is confirmed, or send {inventoryReserveEvent} if inventory is reserved, or {inventoryCancelEvent} if inventory is cancelled, to inventory position and include inventory quantities of type {inventoryQuantityTypes} in event attribute.

Accepts

  • INVENTORY_CATALOGUE

Actions

  • This rule produces multiple SendEventActions that forwards the incoming event as a scheduled event with the given name {inventoryConfirmationEvent}, {inventoryCancelEvent}, {inventoryReserveEvent} and following event attributes to the inventory position. See Detailed Rule Logic to get more information.

Rule parameters

Parameter

Description

inventoryConfirmationEvent

The name of event to be triggered if inventory is confirmed

inventoryCancelEvent

The name of event to be triggered if inventory is cancelled

inventoryReserveEvent

The name of event to be triggered if inventory is reserved

inventoryQuantityTypes

List of inventory quantity types

Event attributes

Parameter

Description

Data Type

Required?

items

The fulfilment information. It includes 

`skuRef`
`locationRef`
`fulfilmentId`
`quantity`
`reserveQty`
`correctionQty`
`saleQty`
 and 
`cancelQty`
.



Attribute Name

Description

ref

Inventory position ref

type

Inventory position type

productRef

Product ref

locationRef

Location ref

inventoryQuantities

RESERVED, SALE or CORRECTION inventory quantities information

Exceptions

This rule throws a PropertyNotFoundException when:

  • the 
    `inventoryConfirmationEvent`
     property is not provided in workflow
  • the 
    `inventoryCancelEvent`
     property is not provided in workflow
  • the 
    `inventoryReserveEvent`
     property is not provided in workflow
  • the 
    `inventoryQuantityTypes`
     property is not provided in workflow

This rule throws a general RubixException with code 500 when the "items" event attribute is empty.

Configuration example

1{
2  "name": "FLUENTRETAIL.globalinventory.SendEventOnFulfilmentInventoryUpdate",
3  "props": {
4    "inventoryConfirmationEvent": "inventoryConfirmationEvent",
5    "inventoryCancelEvent": "inventoryCancelEvent",
6    "inventoryReserveEvent": "inventoryReserveEvent",
7    "inventoryQuantityTypes": ["RESERVED", "SALE"]
8  }
9}

Language: json

Detailed Technical Description

Retrieve inventory position by inventory catalogue 

`ref`
, location 
`ref`
 and product 
`ref`
 for each item from "items" event attribute If inventory position exists

  • Add event attribute for RESERVED quantity:
    • ref: 
      `{inventoryPositionRef}:RESERVED:{fulfilmentId}`
    • type: RESERVED
    • quantity: 
      `item.reserveQty`
  • If 
    `item.reserveQty`
     is not 0 and 
    `inventoryQuantityTypes`
     contains RESERVED type, the rule will produce one SendEventAction with 
    `{inventoryReserveEvent}`
     event name.
  • Else if 
    `item.cancelQty`
     is not 0 and 
    `inventoryQuantityTypes`
     contains RESERVED type, the rule will produce one SendEventAction with 
    `{inventoryCancelEvent}`
     event name.
  • Else
    • if 
      `item.saleQty`
       is not 0 and 
      `inventoryQuantityTypes`
       contains SALE type, the rule will produce one SendEventAction with 
      `{inventoryConfirmationEvent}`
       event name and additional SALE inventory quantity information as event attribute
      • ref: 
        `{inventoryPositionRef}:SALE:{fulfilmentId}`
      • type: SALE
      • quantity: 
        `item.saleQty`
    • If 
      `item.correctionQty`
       is not 0 and 
      `inventoryQuantityTypes`
       contains CORRECTION type, the rule will produce one SendEventAction with 
      `{inventoryConfirmationEvent}`
       event name and additional CORRECTION inventory quantity information as event attribute
      • ref: 
        `{inventoryPositionRef}:CORRECTION:{fulfilmentId}`
      • type: CORRECTION
      • quantity: 
        `item.correctionQty`

Version History

2023-11-02

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