UpdateAggregateVirtualPosition
Changed on:
8 Apr 2025
Overview
Update an Aggregate Virtual Position and calculate its Available-to-Sell (ATS) quantity.
Aggregate Virtual Position ATS calculation is based on the associated Inventory Positions Stock on Hand (SOH) quantities and the applied Controls.
The associated Inventory Positions are defined with:
- The given Product Reference
- The list of Locations for the given Network (the first Network assigned to the Virtual Catalog)
- The specified Inventory Position Statuses
Plugin Name | Inventory 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
Updates an aggregate virtual position including inventory positions in the given {statuses}.
Accepts
- VIRTUAL_POSITION
Actions
- This Rule produces a MutateAction that updates the target Aggregate Virtual Position ATS quantity.
Rule parameters
Name | Data Type | Description |
statuses | List<String> | Statuses of the Inventory Positions to be used for Aggregate Virtual Position ATS calculation |
Event attributes
Parameter | Description | Data Type | Required? |
virtualPositionRef | Virtual Position Reference | String | Required |
virtualPositionProductRef | Product Reference of the Virtual Position | String | Required |
virtualPositionGroupRef | Group Reference of the Virtual Position | String | Required |
virtualCatalogueRef | Reference of the Virtual Catalog | String | Required |
virtualCatalogueInventoryCatalogueRef | Reference of the Inventory Catalog associated with the Virtual Catalog | String | Required |
virtualCatalogueProductCatalogueRef | Reference of the Product Catalog associated with the Virtual Catalog | String | Required |
virtualCatalogueControlGroupRef | Reference of the Control Group associated with the Virtual Catalog | String | Optional |
virtualCatalogueNetworkIds | Network IDs of the Virtual Catalog | List<String> | Required |
Exceptions
- This Rule throws a when the Rule parameter(s) is not provided.
`PropertyNotFoundException`
- This Rule throws an when the required Event attribute(s) is not provided.
`EventAttributeNotFoundException`
Configuration example
1{
2 "name": "[[account.id]].globalinventory.UpdateAggregateVirtualPosition",
3 "props": {
4 "statuses": [
5 "ACTIVE",
6 "AT_RISK",
7 "OUT_OF_STOCK"
8 ]
9 }
10}
Language: json
Detailed Technical Description
This Rule performs the following steps during execution:
- Retrieve Contextual Data
- The Rule extracts the Aggregate Virtual Position and associated Catalog data from the Event attributes.
- Determine Relevant Inventory Positions
- The Rule identifies Inventory Positions that contribute to the Aggregate Virtual Position being updated.
- It loads a list of Location References from the Network linked to the specified Virtual Catalog. Only the first Network from the event attribute is considered.
`virtualCatalogueNetworkIds`
- It queries Inventory Positions using the following criteria:
- The Inventory Catalog Reference from the Event Attribute
`virtualCatalogueInventoryCatalogueRef`
- The Product Reference from the Event Attribute
`virtualPositionProductRef`
- The list of Location References obtained in the previous step
- The Inventory Position Statuses specified by the Rule's parameter
`statuses`
- The Inventory Catalog Reference from the
- Recalculate ATS Quantity
- The Rule calculates the updated ATS (Available to Sell) quantity for the Aggregate Virtual Position.
- This is based on the total SOH (Stock on Hand) from the matched Inventory Positions, applying any relevant Controls.
- If no Controls are present, the ATS is simply the total on-hand quantity.
- The calculation logic is identical to that used in the CreateAggregateVirtualPosition Rule and is described in the section below.
- Update the Aggregate Virtual Position
- The Rule produces a MutateAction to update the existing Aggregate Virtual Position with the newly calculated ATS quantity.
Version History
v2.2.1
Rule changes:
- Now apply control-specific logic only if the event includes a Control Group reference.
- Skip all control-related validation and logic if no such reference is present in the event payload.
v.24.10.28
This Rule has been optimized to load all the related Controls (by Product, its Categories, and list of Locations) at once for efficient Aggregate Virtual Position Available-to-Sell (ATS) calculations.
The Rule Version refers to the Product Release Version.
v2.0.0
refers to the plguin