Fluent Commerce Logo
Docs
Sign In

SplitDeltasAndDownToInventoryPosition

Rule

Changed on:

11 Sept 2024

Overview

Notifies the inventory positions of the incoming deltas with event

`{eventName}`

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

Notifies the inventory positions of the incoming deltas with event {eventName}

Accepts

  • INVENTORY_CATALOGUE

Actions

  • This rule produces a SentEventAction with name
    `{eventName}`
    for each delta record.

Rule parameters

Parameter

Type

Description

`eventName`

String

The name of the event to be triggered

Event attributes

Parameter

Description

Data Type

Required?

`deltas`

A list of delta inventory quantities to be created

[InventoryDelta]

Yes

InventoryDelta sub-attribute

Parameter

Description

Data Type

Required?

`deltaId`

The Id of the delta that uniquely identifies this delta element

String

No

`type`

The inventory position type

String

No

`productRef`

The ref of the variant product associated to the inventory position

String

No

`locationRef`

The location ref associated to the inventory position

String

No

`qty`

The quantity

Integer

No

Exceptions

If there is no inventory position found for any of the delta records, a

`RubixException`
will be thrown and the entire execution of this rule will be halted.

Configuration example

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

Language: json

Detailed Technical Description

This rule parses/deserializes the 

`deltas`
 event attribute into a list of 
`InventoryDelta`
 objects outlined above. For each 
`deltas`
 element, it constructs the inventory position reference by concatenating the
`productRef`
,
`locationRef`
and 
`entitySubtype`
string literal with a colon (
`:`
). 

If

`entitySubtype`
is defined, it will be used as the type. Otherwise it will default to
`DEFAULT`
.


For example, for

`"productRef":"PRD"`
,
`"locationRef":"LOC"`
and
`"entitySubtype":"DEFAULT"`
the targeted inventory position reference is
`PRD:LOC:DEFAULT`
.

Please note that the generated inventory position reference is used to group all the 

`InventoryDelta`
 elements. A single inventory position may have more than one 
`InventoryDelta`
 object in the incoming event. Finally, the rule sends an external event event for each unique inventory position if the inventory position exists. The generated event will have an event attribute called 
`deltas`
 that holds an array of InventoryDelta objects. If more than one 
`InventoryDelta`
 object is found for a single inventory position in the incoming event all the 
`InventoryDelta`
 objects will be included in this array.

InventoryDelta DTO Definition
1    public class InventoryDelta {
2        private String productRef;
3        private String locationRef;
4        private Integer qty;
5        private String type;
6        private String deltaId;
7    }

Language: java

Name: InventoryDelta

Description:

[Warning: empty required content area]

Version History

2023-08-03

v2.0.0

Refers to the Product Release Version

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