CreateAggregateVirtualPosition
Changed on:
24 Oct 2024
Overview
Create an Aggregate Virtual Position, calculate its Available-to-Sell (ATS) quantity, and send an event.
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
Creates an aggregate virtual position including inventory positions in statuses {statuses}. Sends event {eventName}.
Accepts
- VIRTUAL_CATALOGUE
Actions
- This Rule produces a MutateAction that creates a new Aggregate Virtual Position.
- This Rule produces a SendEventAction that sends an inline event to the created Aggregate Virtual Position.
Rule parameters
Name | Type | Description |
|
| The name of the event to be triggered |
|
| Statuses of the Inventory Positions to be used for Aggregate Virtual Position ATS calculation |
Event attributes
Name | Type | Description | Required |
|
| Product Reference to load Inventory Positions | Required |
|
| Virtual Position Reference to be created | Required |
|
| Reference of the Virtual Catalog | Required |
|
| Reference of the Inventory Catalog associated with the Virtual Catalog | Required |
|
| Reference of the Product Catalog associated with the Virtual Catalog | Required |
|
| Reference of the Control Group associated with the Virtual Catalog | Required |
|
| Network IDs of the Virtual Catalog | 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.CreateAggregateVirtualPosition",
3 "props": {
4 "eventName": "CREATE",
5 "statuses": [
6 "ACTIVE",
7 "AT_RISK",
8 "OUT_OF_STOCK"
9 ]
10 }
11}
Language: json
Detailed Technical Description
This Rule execution includes the following steps:
- The Rule determines the Inventory Positions associated with the Aggregate Virtual Position (to be created):
- Load the list of Location References from the Network assigned to the given Virtual Catalog.
Only the first Network from theEvent attribute is considered.`virtualCatalogueNetworkIds`
- Query Inventory Positions by:
- The given Inventory Catalog Reference (Event attribute)
`virtualCatalogueInventoryCatalogueRef`
- The given Product Reference (Event attribute)
`productRef`
- The loaded (in the previous step) list of Location References
- The specified Inventory Position Statuses (Rule parameter)
`statuses`
- The given Inventory Catalog Reference (
- Load the list of Location References from the Network assigned to the given Virtual Catalog.
- The Rule calculates the Aggregate Virtual Position ATS quantity based on the determined Inventory Positions SOH quantities and the relevant Controls to be applied.
The ATS calculation algorithm is described below. - The Rule produces a MutateAction that creates a new Aggregate Virtual Position with the calculated (point 2) ATS quantity.
- The Rule produces a SendEventAction that sends an inline event with the specified name (Rule parameter) to the created Aggregate Virtual Position.
`eventName`
Version History
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 plugin