@Component(value="blSingleLocationPerItemReservationStrategy") public class SingleLocationPerItemReservationStrategy extends AbstractInventoryReservationStrategy
Each FulfillmentGroupItem within a FulfillmentGroup must have the entire item fulfilled from a single
FulfillmentLocation.
Inventory is prioritized according to the quantity available at each location. This can be prioritized to use the maximum
quantity or the minimum quantity first, and is customized using the advanced-inventory.prioritize.higher.quantity or
advanced-inventory.prioritize.lower.quantity system properties.
If you are using this strategy, there is logic within
AdvancedInventoryServiceExtensionHandler.retrieveQuantitiesAvailable(Collection, Map, org.broadleafcommerce.common.extension.ExtensionResultHolder).
That method will invoke AdvancedInventoryService.findMaxInventoryAcrossFulfillmentLocations(Sku) since the quantity
available for a FulfillmentGroupItem will have to come from a single FulfillmentLocation.
entityConfig, inventoryService| Constructor and Description |
|---|
SingleLocationPerItemReservationStrategy() |
| Modifier and Type | Method and Description |
|---|---|
List<InventoryReservation> |
getReservations(org.broadleafcommerce.core.order.domain.FulfillmentGroup fg)
This attempts to resolve a fulfillment (inventory) location for a particular fulfillment group for the given Sku
and quantity.
|
InventoryReservationStrategyType |
getType()
The type of this strategy, used for configuring the active strategy for selecting between.
|
createInventoryReservation, favorHigherQuantityDecrement, favorLowerQuantityDecrement, getSkuForItem, prioritizeInventorypublic SingleLocationPerItemReservationStrategy()
public InventoryReservationStrategyType getType()
InventoryReservationStrategypublic List<InventoryReservation> getReservations(org.broadleafcommerce.core.order.domain.FulfillmentGroup fg)
InventoryReservationStrategy
This attempts to resolve a fulfillment (inventory) location for a particular fulfillment group for the given Sku
and quantity. This is used within the AdvancedInventoryWorkflowExtensionHandler to determine the corresponding
InventoryReservations to create when checking out an Order and decrementing Inventory.
Persisting the list of InventoryReservations that is returned should occur within the same transaction that
actually decrements the quantity available for an Inventory record within a FulfillmentLocation.
fg - the FulfillmentGroup being used to get reservations forInventoryReservations for the given fg. If no suitable reservations could be made,
this should return an empty listAdvancedInventoryServiceExtensionHandler#decrementInventory(java.util.Map, java.util.Map)},
AdvancedInventoryService#decrementInventoryFromLocations(java.util.Map, List)}Copyright © 2020. All rights reserved.