public class ProductConfigurationRuleAwareServiceImpl extends ProductConfigurationServiceImpl implements ProductConfigurationRuleAwareService
DEBUG_CONFIG_WITH_ID| Constructor and Description |
|---|
ProductConfigurationRuleAwareServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
adjustConfigurationRuleBased(ConfigModel currentConfigModel,
ProcessStep processStep) |
protected boolean |
applyRulesResult(RuleEvaluationResult rulesResult,
ConfigModel configModel) |
protected ConfigModel |
checkRulesAndCacheConfig(ConfigModel config) |
ConfigModel |
createConfigurationForVariant(String baseProductCode,
String variantProductCode)
Based on the hybris product code, the configuration engine will provide a configuration for the requested product
variant.
|
ConfigModel |
createDefaultConfiguration(KBKey kbKey)
Based on the hybris product code, provided via the
KBKey.productCode, the configuration engine will
provide a default configuration for the requested product. |
protected FactContext |
createFactContext(CartModel cartModel,
ConfigModel currentConfigModel,
ProductConfigProcessStepModel processStepModel) |
protected Map<String,ProductConfigRuleActionStrategy> |
getActionStrategiesMapping() |
protected CartService |
getCartService() |
protected RuleEngineService |
getCommerceRuleEngineService() |
protected String |
getDefaultRuleEngineContextName() |
protected FactContextFactory |
getFactContextFactory() |
protected ProductConfigRuleActionStrategy |
getRuleActionStrategy(String strategyKey)
returns the
ProductConfigRuleActionStrategy defined in the actionStrategiesMapping attribute of
this service by looking up it's hey. |
protected RuleEngineContextDao |
getRuleEngineContextDao() |
protected RuleEvaluationContext |
prepareRuleEvaluationContext(FactContext factContext) |
protected ConfigModel |
provideConfigurationModel(String configId,
boolean useRuleEngine) |
protected Set<Object> |
provideRAOs(FactContext factContext) |
ConfigModel |
retrieveConfigurationModel(String configId)
Retrieve the actual configuration model for the requested
configId in the ConfigModel
format. |
ConfigModel |
retrieveConfigurationModelBypassRules(String configId)
Retrieve the actual configuration model for the requested
configId in the ConfigModel
format bypassing rule evaluation. |
void |
setActionStrategiesMapping(Map<String,ProductConfigRuleActionStrategy> actionStrategiesMapping) |
void |
setCartService(CartService cartService) |
void |
setCommerceRuleEngineService(RuleEngineService ruleEngineService) |
void |
setDefaultRuleEngineContextName(String defaultRuleEngineContextName) |
void |
setFactContextFactory(FactContextFactory factContextFactory) |
void |
setRuleEngineContextDao(RuleEngineContextDao ruleEngineContextDao) |
cacheConfig, cacheConfig, calculateCartEntryConfigurationAttributes, calculateCartEntryConfigurationAttributes, calculateNumberOfIncompleteCsticsAndSolvableConflicts, countNumberOfIncompleteCstics, countNumberOfSolvableConflicts, createConfigurationFromExternal, createConfigurationFromExternalSource, ensureThatLockMapIsNotTooBig, ensureThatNotToManyConfigsAreCachedInSession, getConfigurationProvider, getConfigurationProviderFactory, getLock, getMaxCachedConfigsInSession, getMaxLocksPerMap, getRecorder, getSessionAccessService, hasProductChangedForCartItem, releaseSession, removeConfigFromCache, removeConfigFromSessionCache, retrieveConfigurationModelFromConfigurationEngine, retrieveExternalConfiguration, setConfigurationProviderFactory, setMaxCachedConfigsInSession, setMaxLocksPerMap, setRecorder, setSessionAccessService, updateCartEntryBasePrice, updateCartEntryExternalConfiguration, updateCartEntryExternalConfiguration, updateCartEntryProduct, updateConfigurationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcalculateCartEntryConfigurationAttributes, calculateCartEntryConfigurationAttributes, calculateNumberOfIncompleteCsticsAndSolvableConflicts, createConfigurationFromExternal, createConfigurationFromExternalSource, releaseSession, retrieveExternalConfiguration, updateCartEntryBasePrice, updateCartEntryExternalConfiguration, updateCartEntryExternalConfiguration, updateCartEntryProduct, updateConfigurationpublic ProductConfigurationRuleAwareServiceImpl()
public ConfigModel createDefaultConfiguration(KBKey kbKey)
ProductConfigurationServiceKBKey.productCode, the configuration engine will
provide a default configuration for the requested product.createDefaultConfiguration in interface ProductConfigurationServicecreateDefaultConfiguration in class ProductConfigurationServiceImplkbKey - The product code for the configurable productpublic ConfigModel createConfigurationForVariant(String baseProductCode, String variantProductCode)
ProductConfigurationServicecreateConfigurationForVariant in interface ProductConfigurationServicecreateConfigurationForVariant in class ProductConfigurationServiceImplbaseProductCode - The product code for the configurable base productvariantProductCode - The product code for the specific product variantprotected ConfigModel checkRulesAndCacheConfig(ConfigModel config)
public ConfigModel retrieveConfigurationModel(String configId)
ProductConfigurationServiceconfigId in the ConfigModel
format.retrieveConfigurationModel in interface ProductConfigurationServiceretrieveConfigurationModel in class ProductConfigurationServiceImplconfigId - Unique configuration IDprotected ConfigModel provideConfigurationModel(String configId, boolean useRuleEngine)
public ConfigModel retrieveConfigurationModelBypassRules(String configId)
ProductConfigurationRuleAwareServiceconfigId in the ConfigModel
format bypassing rule evaluation.retrieveConfigurationModelBypassRules in interface ProductConfigurationRuleAwareServiceconfigId - Unique configuration IDprotected boolean adjustConfigurationRuleBased(ConfigModel currentConfigModel, ProcessStep processStep)
protected FactContext createFactContext(CartModel cartModel, ConfigModel currentConfigModel, ProductConfigProcessStepModel processStepModel)
protected RuleEvaluationContext prepareRuleEvaluationContext(FactContext factContext)
protected Set<Object> provideRAOs(FactContext factContext)
protected FactContextFactory getFactContextFactory()
public void setFactContextFactory(FactContextFactory factContextFactory)
factContextFactory - injects the rule engine fact context factory, which is required to trigger the rule engineprotected CartService getCartService()
public void setCartService(CartService cartService)
cartService - the cart service to access the session cart contents, which may influence the rule engine resultprotected String getDefaultRuleEngineContextName()
public void setDefaultRuleEngineContextName(String defaultRuleEngineContextName)
defaultRuleEngineContextName - injects the rule engine context, which is required to trigger the rule engineprotected RuleEngineContextDao getRuleEngineContextDao()
public void setRuleEngineContextDao(RuleEngineContextDao ruleEngineContextDao)
ruleEngineContextDao - injects the rule engine context DAO, which is required to trigger the rule engineprotected RuleEngineService getCommerceRuleEngineService()
public void setCommerceRuleEngineService(RuleEngineService ruleEngineService)
ruleEngineService - injects the rule engine service, which is required to trigger the rule engineprotected boolean applyRulesResult(RuleEvaluationResult rulesResult, ConfigModel configModel)
protected Map<String,ProductConfigRuleActionStrategy> getActionStrategiesMapping()
public void setActionStrategiesMapping(Map<String,ProductConfigRuleActionStrategy> actionStrategiesMapping)
actionStrategiesMapping - injects the mapping between actionStrategyKey, which is defined by the rule action and a concreate
actionStrategy class, which will apply the defined actionprotected ProductConfigRuleActionStrategy getRuleActionStrategy(String strategyKey)
ProductConfigRuleActionStrategy defined in the actionStrategiesMapping attribute of
this service by looking up it's hey.strategyKey - the key of the RuleActionStrategy to look upIllegalArgumentException - if the requested strategy cannot be foundIllegalStateException - if this method is called but no strategies are configuredCopyright © 2017 SAP SE. All Rights Reserved.