Fluent Commerce Logo
Docs
Sign In

LoadInventoryPositionData

Rule

Changed on:

17 Feb 2025

Overview

Send an including the `inventoryPositionExists` flag indicating whether the corresponding Position exists or not.

This is a simplified version of the `LoadInventoryPosition` , excluding the logic for:

  • Retrieving Inventory Quantity data of type `LAST_ON_HAND` in status `ACTIVE` or `CREATED`
  • Setting and forwarding the `inventoryQuantityExists` flag (true or false)
Plugin NameInventory Reference Module
Namespace[[account.id]].globalinventory

The is the foundation for 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 Module includes the following areas:

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

UI Description

Forward event {eventName} (inline event) with the attribute `inventoryPositionExists` set to true or false if the inventory position exists or not respectively.

Accepts

  • INVENTORY_CATALOGUE

Actions

Rule parameters

Name

Type

Description

`eventName`

`String`

The name of the to be triggered

Event attributes

Name

Type

Description

Required?

`inventoryPosition`

`InventoryUpdate`

A single item of the Batch request.

This Object contains the Position specific data. 

See the Sub-attributes below.

Yes

InventoryUpdate Object Sub-attributes

Name

Type

Description

Required

`ref`

`String`

The Reference of the Position

No

`type`

`String`

The Type of the Position.

No

Unused because the Position Type is inherited from the Catalog Sub Type.

`productRef`

`String`

The Reference of the Variant Product associated to the Position

Yes

`locationRef`

`String`

The Reference of the   associated to the Position

Yes

`qty`

`Integer`

The quantity

Yes

`correctedQty`

`Integer`

The quantity value of the Quantity of the `CORRECTED` Type

No, unused

`inventoryQuantity`

`InventoryQuantityUpdate`

The Object that contains the Quantity specific data. 

See the Sub-attributes below.

No

InventoryQuantityUpdate Object Sub-attributes

Name

Type

Description

Required

`ref`

`String`

The Reference of the Quantity

No

`qty`

`Integer`

The quantity value of the Quantity

No

`type`

`String`

The Type of the Quantity

No

`status`

`String`

The Status of the Quantity

No

`attributes`

`Map<String, Object>`

The following attributes are supported:

  • `condition`
  • `expectedOn`
  • `storageAreaRef`

No

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.LoadInventoryPosition",
3  "props": {
4    "eventName": "CheckInventoryPositionExists"
5  }
6}

Detailed Technical Description

This execution includes the following steps:

1. Validate that:

  • The `eventName` Rule parameter has been provided
  • The mandatory Event attributes have been provided:
    • `inventoryPosition` and its Sub-attributes:
      • `productRef`
      • `locationRef`
      • `qty`

2. Load the Position in one GraphQL API request based on the following:

  • Inventory Position Reference
    The value is taken from the `inventoryPosition.ref` Sub-attribute.
  • Inventory Catalog Reference
    The value is taken from the incoming event `rootEntityRef`

3. Add the retrieved information into the attributes and produce a `SendEventAction` with the  `{eventName}`:

Event Attribute Key

Event Attribute Value

`type`

  • `entitySubtype` (from the incoming event attributes)
  • If undefined (null), the value is set to `DEFAULT`

`ref`

`inventoryPosition.ref` (from the incoming attributes)

`qty`

`inventoryPosition.qty` (from the incoming attributes)

`productRef`

`inventoryPosition.productRef` (from the incoming attributes)

`locationRef`

`inventoryPosition.locationRef` (from the incoming attributes)

`correctedQty`

`inventoryPosition.correctedQty` (from the incoming attributes) - UNUSED

`inventoryPositionStatus`

  • `inventoryPosition.status` from the GraphQL query*
  • Otherwise, the value is set to `CREATED`

`inventoryPositionRef`

  • `inventoryPosition.ref` from the GraphQL query*
  • Otherwise, the value is generated based on the following pattern: `<productRef>:<locationRef>:<type>`.
    For example:
    • If the `productRef` (Event attribute) is `PRDREF`
    • And the `locationRef` (Event attribute) is `LOCREF`
    • And the Inventory Position Type is `DEFAULT`:
      • The value is taken from the incoming event `entitySubtype`
      • If the `entitySubtype` is undefined (null), the value is set to `DEFAULT`
    • The generated Inventory Position Reference will be `PRDREF:LOCREF:DEFAULT`

`inventoryPositionOnHand`

  • `inventoryPosition.onHand` from the GraphQL query*
  • Otherwise, the value is set to 0

`inventoryPositionExists`

  • TRUE if the Inventory Position exists 
  • FALSE if the Inventory Position doesn't exist

*The first option will occur when the Position already exists; otherwise, the second option will occur.

Version History

2025-02-18

v25.2.18

Refers to the Product Release Version.