Fluent Commerce Logo
Docs

ForwardIfOnHandChanged

Rule

Changed on:

8 Dec 2025

Overview

Forwards the configured event when the inventory position’s on-hand value changes.

The rule compares the current on-hand value with the newly calculated on-hand value and forwards the event only when these values differ.

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

Forward the event {eventName} if the inventory position onHand value has changed

Accepts

  • INVENTORY_POSITION

Actions

  • This rule produces a SendEventAction that will send an event {eventName} to the given inventory position when the onHand changes

Rule parameters

Name

Type

Description

`eventName`

`String`

The name of event to be triggered

Event attributes

Name

Type

Description

Required?

`inventoryPositionOnHandCalculated`

`Integer`

The newly calculated on-hand value for the inventory position (typically produced by the preceding `CalculateOnHand` rule or equivalent logic)

Yes

`inventoryPositionOnHand`

`Integer`

The current on-hand value of the inventory position before the new calculation is applied

Yes

Exceptions

  • This Rule throws a `PropertyNotFoundException` when the Rule parameter(s) is not provided.
  • This Rule throws an `EventAttributeNotFoundException` when the required Event attribute(s) is not provided.

Configuration example

1{
2  "name": "[[account.id]].globalinventory.ForwardIfOnHandChanged",
3  "props": {
4    "eventName": "UpdateOnHand"
5  }
6}

Detailed Technical Description

The rule execution includes the following steps: 

  • Validate that the `eventName` rule parameter is provided
  • Validate that the incoming event includes both `inventoryPositionOnHand` and `inventoryPositionOnHandCalculated` event attributes
  • Compare `inventoryPositionOnHandCalculated` to `inventoryPositionOnHand`. If the values are different, forward an inline event with the configured `eventName` to the inventory position

Version History

2025-12-11

v25.12.11

This rule now strictly requires both `inventoryPositionOnHand` and `inventoryPositionOnHandCalculated` event attributes and compares their values to determine whether a real on-hand change has occurred.

As a result, the rule forwards the configured event only when both attributes are present and the on-hand values differ, ensuring consistent and predictable change detection across all inventory workflows.

The rule version refers to the product release version.

2023-08-02

v2.0.0

refers to plugin