@Component(value="blSingleLocationPerGroupReservationStrategy") public class SingleLocationPerGroupReservationStrategy extends AbstractInventoryReservationStrategy
All FulfillmentGroupItems are reserved from a single FulfillmentLocation for the entire FulfillmentGroup.
If enough inventory cannot be found for all of the items within the FulfillmentGroup, an empty list will end up
being returned.
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.
| Modifier and Type | Field and Description |
|---|---|
protected org.broadleafcommerce.common.sandbox.SandBoxHelper |
sandBoxHelper |
entityConfig, inventoryService| Constructor and Description |
|---|
SingleLocationPerGroupReservationStrategy() |
| 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, prioritizeInventoryprotected org.broadleafcommerce.common.sandbox.SandBoxHelper sandBoxHelper
public SingleLocationPerGroupReservationStrategy()
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.