use of org.eevolution.model.MWMStrategyDetail in project adempiere by adempiere.
the class WMRuleEngine method getStorage.
/**
* Get Storage list based on strategy , product id , attribute set instance id , area type , section type
* @param strategy
* @param productId
* @param attributeSetInstanceId
* @param qtyToDeliver
* @param warehouseAreaTypeId
* @param warehouseSectionTypeId @return List of Storage
*/
public static List<MStorage> getStorage(MWMStrategy strategy, int productId, int attributeSetInstanceId, BigDecimal qtyToDeliver, int warehouseAreaTypeId, int warehouseSectionTypeId) {
ArrayList<MStorage> targetStorages = new ArrayList();
WMRuleEngine engine = WMRuleEngine.get();
for (MWMStrategyDetail detail : strategy.getStrategyDetail()) {
MWMRule rule = (MWMRule) detail.getWM_Rule();
WMRuleInterface implementation = engine.getWMRuleFactory(engine.getClassName(rule));
List<MStorage> storages = implementation.getStorage(strategy.getCtx(), strategy.getM_Warehouse_ID(), productId, attributeSetInstanceId, qtyToDeliver, warehouseAreaTypeId, warehouseSectionTypeId, strategy.get_TrxName());
for (MStorage storage : storages) {
targetStorages.add(storage);
}
}
return targetStorages;
}
use of org.eevolution.model.MWMStrategyDetail in project adempiere by adempiere.
the class WMRuleEngine method getLocator.
/**
* Get Locator based on strategy and product id , area type id , section id
* @param strategy strategy
* @param productId Product
* @param warehouseAreaTypeId Area Type
* @param warehouseSectionTypeId Section Type
* @return List of Locators
*/
public static List<MLocator> getLocator(MWMStrategy strategy, int productId, int warehouseAreaTypeId, int warehouseSectionTypeId) {
ArrayList<MLocator> targetLocators = new ArrayList();
WMRuleEngine engine = WMRuleEngine.get();
for (MWMStrategyDetail detail : strategy.getStrategyDetail()) {
MWMRule rule = (MWMRule) detail.getWM_Rule();
WMRuleInterface implementation = engine.getWMRuleFactory(engine.getClassName(rule));
List<MLocator> locators = implementation.getLocator(strategy.getCtx(), productId, strategy.getM_Warehouse_ID(), warehouseAreaTypeId, warehouseSectionTypeId, strategy.get_TrxName());
for (MLocator locator : locators) {
targetLocators.add(locator);
}
}
return targetLocators;
}
Aggregations