Class ProductConfigurationRuleAwareServiceImpl
java.lang.Object
de.hybris.platform.sap.productconfig.services.impl.ProductConfigurationServiceImpl
de.hybris.platform.sap.productconfig.rules.service.impl.ProductConfigurationRuleAwareServiceImpl
- All Implemented Interfaces:
ProductConfigurationRuleAwareService,ProductConfigurationService
public class ProductConfigurationRuleAwareServiceImpl
extends ProductConfigurationServiceImpl
implements ProductConfigurationRuleAwareService
Default implementation of the
ProductConfigurationServiceImpl.-
Field Summary
Fields inherited from class de.hybris.platform.sap.productconfig.services.impl.ProductConfigurationServiceImpl
DEBUG_CONFIG_WITH_ID, DEFAULT_MAX_LOCKS_PER_MAP, MAP_INITIAL_CAPACITY_CALCULATE_DIVISOR, NOT_ALLOWED_TO_READ_CONFIGURATION, NOT_ALLOWED_TO_RELEASE_CONFIGURATION, NOT_ALLOWED_TO_UPDATE_CONFIGURATION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanadjustConfigurationRuleBased(ConfigModel currentConfigModel, ProcessStep processStep, ConfigurationRetrievalOptions retrievalOptions) protected voidprotected ConfigModelafterConfigCreated(ConfigModel config, ConfigurationRetrievalOptions retrievalOptions) protected ConfigModelafterDefaultConfigCreated(ConfigModel config) protected booleanapplyRulesResult(RuleEvaluationResult rulesResult, ConfigModel configModel) createConfigurationFromExternalBypassRules(KBKey kbKey, String externalConfiguration) Creates theConfigModelfrom the givenexternalConfigurationbypassing rule evaluation.protected CartModelprotected FactContextcreateFactContext(CartModel cartModel, ConfigModel currentConfigModel, ProductConfigProcessStepModel processStepModel) protected AbstractRuleEngineContextModeldetermineRuleEngineContext(ConfigModel currentConfigModel) protected Map<String,ProductConfigRuleActionStrategy> protected CartServiceprotected RuleEngineServiceprotected Stringprotected FactContextFactoryprotected ReentrantLockgetLockInternal(String configId) protected CartModelgetRelatedCart(String configId) protected CartModelprotected CartModelgetRelatedCartStateless(String configId) protected ProductConfigRuleActionStrategygetRuleActionStrategy(String strategyKey) returns theProductConfigRuleActionStrategydefined in theactionStrategiesMappingattribute of this service by looking up it's hey.protected RuleEngineContextDaoprotected RuleEngineContextFinderStrategyprotected ProductConfigRulesResultUtilprotected SessionServiceprotected TimeServiceprotected UserServiceprotected booleanisRuleBasedDiscountExist(ConfigModel config) protected booleanThis will return true if either we are in the accelerator context, _or_ if this is an OCC call that touches this bean before our OCC servlet filter has been activated.protected RuleEvaluationContextprepareRuleEvaluationContext(FactContext factContext, AbstractRuleEngineContextModel engineContext) protected ConfigModelprovideConfigurationModel(String configId, boolean useRuleEngine, String productCode) provideRAOs(FactContext factContext) protected booleanremoveMessageBeforeNextStep(ProcessStep nextStep, ProductConfigMessage message) protected voidremoveMessagesRecomputedOnNextStep(Set<ProductConfigMessage> oldMessages, ProcessStep nextStep) retrieveConfigurationModel(String configId) Retrieve the actual configuration model for the requestedconfigIdin theConfigModelformat.protected ConfigModelretrieveConfigurationModelAfterUpdate(String configId, String productCode) retrieveConfigurationModelBypassRules(String configId) Retrieve the actual configuration model for the requestedconfigIdin theConfigModelformat bypassing rule evaluation.voidsetActionStrategiesMapping(Map<String, ProductConfigRuleActionStrategy> actionStrategiesMapping) voidsetCartService(CartService cartService) voidsetCommerceRuleEngineService(RuleEngineService ruleEngineService) voidsetDefaultRuleEngineContextName(String defaultRuleEngineContextName) voidsetFactContextFactory(FactContextFactory factContextFactory) voidsetRuleEngineContextDao(RuleEngineContextDao ruleEngineContextDao) voidsetRuleEngineContextFinderStrategy(RuleEngineContextFinderStrategy ruleEngineContextFinderStrategy) voidsetRulesResultUtil(ProductConfigRulesResultUtil rulesResultUtil) voidsetSessionService(SessionService sessionService) Sets session service, used for determining whether we run in a stateless scenariovoidsetTimeService(TimeService timeService) voidsetUserService(UserService userService) Sets user serviceprotected voidtransferVariantConditions(InstanceModel sourceInstance, InstanceModel targetInstance) Methods inherited from class de.hybris.platform.sap.productconfig.services.impl.ProductConfigurationServiceImpl
cacheConfig, calculateNumberOfIncompleteCsticsAndSolvableConflicts, checkReadAllowed, checkReleaseAllowed, checkUpdateAllowed, cleanUpAfterEngineError, countNumberOfIncompleteCstics, countNumberOfIncompleteVisibleCstics, countNumberOfNotConsistentCstics, countNumberOfSolvableConflicts, createConfigurationForVariant, createConfigurationFromExternal, createConfigurationFromExternal, createConfigurationFromExternal, createConfigurationFromExternalSource, createDefaultConfiguration, ensureThatLockMapIsNotTooBig, extractKbKey, getAbstractOrderEntryLinkStrategy, getAssignmentResolverStrategy, getConfigLifecycleStrategy, getConfigModelCacheStrategy, getConfigurationProductUtil, getConfigurationProvider, getCpqConfigurableChecker, getLock, getMaxLocksPerMap, getProductConfigurationAccessControlService, getProviderFactory, getRecorder, getTotalNumberOfIssues, hasKbForDate, isChangeableVariant, isKbVersionValid, isRelatedObjectReadOnly, releaseSession, releaseSession, removeConfigAttributesFromCache, retrieveConfigurationModelFromConfigurationEngine, retrieveCorrectPricingDate, retrieveExternalConfiguration, retrieveRelatedObjectType, setAbstractOrderEntryLinkStrategy, setAssignmentResolverStrategy, setConfigLifecycleStrategy, setConfigModelCacheStrategy, setConfigurationProductUtil, setCpqConfigurableChecker, setMaxLocksPerMap, setProductConfigurationAccessControlService, setProviderFactory, setRecorder, updateConfiguration, updateKbKeyForVariants, updateKbKeyWithProductCodeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.sap.productconfig.services.intf.ProductConfigurationService
calculateNumberOfIncompleteCsticsAndSolvableConflicts, countNumberOfIncompleteCstics, countNumberOfSolvableConflicts, createConfigurationForVariant, createConfigurationFromExternal, createConfigurationFromExternal, createConfigurationFromExternal, createConfigurationFromExternalSource, createDefaultConfiguration, extractKbKey, getTotalNumberOfIssues, hasKbForDate, isKbVersionValid, releaseSession, releaseSession, retrieveExternalConfiguration, updateConfiguration
-
Constructor Details
-
ProductConfigurationRuleAwareServiceImpl
public ProductConfigurationRuleAwareServiceImpl()
-
-
Method Details
-
afterDefaultConfigCreated
- Overrides:
afterDefaultConfigCreatedin classProductConfigurationServiceImpl
-
afterConfigCreated
protected ConfigModel afterConfigCreated(ConfigModel config, ConfigurationRetrievalOptions retrievalOptions) - Overrides:
afterConfigCreatedin classProductConfigurationServiceImpl
-
removeMessagesRecomputedOnNextStep
protected void removeMessagesRecomputedOnNextStep(Set<ProductConfigMessage> oldMessages, ProcessStep nextStep) -
removeMessageBeforeNextStep
-
retrieveConfigurationModel
Description copied from interface:ProductConfigurationServiceRetrieve the actual configuration model for the requestedconfigIdin theConfigModelformat.- Specified by:
retrieveConfigurationModelin interfaceProductConfigurationService- Overrides:
retrieveConfigurationModelin classProductConfigurationServiceImpl- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration
-
retrieveConfigurationModelAfterUpdate
-
provideConfigurationModel
protected ConfigModel provideConfigurationModel(String configId, boolean useRuleEngine, String productCode) -
adjustVariantConditionsUsingOptions
-
transferVariantConditions
protected void transferVariantConditions(InstanceModel sourceInstance, InstanceModel targetInstance) -
retrieveConfigurationModelBypassRules
Description copied from interface:ProductConfigurationRuleAwareServiceRetrieve the actual configuration model for the requestedconfigIdin theConfigModelformat bypassing rule evaluation.- Specified by:
retrieveConfigurationModelBypassRulesin interfaceProductConfigurationRuleAwareService- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration
-
getLockInternal
-
createConfigurationFromExternalBypassRules
public ConfigModel createConfigurationFromExternalBypassRules(KBKey kbKey, String externalConfiguration) Description copied from interface:ProductConfigurationRuleAwareServiceCreates theConfigModelfrom the givenexternalConfigurationbypassing rule evaluation.- Specified by:
createConfigurationFromExternalBypassRulesin interfaceProductConfigurationRuleAwareService- Parameters:
kbKey- Key attributes needed to create a modelexternalConfiguration- Configuration as XML string- Returns:
- The actual configuration
-
adjustConfigurationRuleBased
protected boolean adjustConfigurationRuleBased(ConfigModel currentConfigModel, ProcessStep processStep, ConfigurationRetrievalOptions retrievalOptions) -
createEmptyCart
-
getRelatedCart
-
getRelatedCartStateful
-
getRelatedCartStateless
-
isStatefulCall
protected boolean isStatefulCall()This will return true if either we are in the accelerator context, _or_ if this is an OCC call that touches this bean before our OCC servlet filter has been activated.- Returns:
- stateful?
-
createFactContext
protected FactContext createFactContext(CartModel cartModel, ConfigModel currentConfigModel, ProductConfigProcessStepModel processStepModel) -
determineRuleEngineContext
-
prepareRuleEvaluationContext
protected RuleEvaluationContext prepareRuleEvaluationContext(FactContext factContext, AbstractRuleEngineContextModel engineContext) -
provideRAOs
-
getFactContextFactory
-
setFactContextFactory
- Parameters:
factContextFactory- injects the rule engine fact context factory, which is required to trigger the rule engine
-
getCartService
-
setCartService
- Parameters:
cartService- the cart service to access the session cart contents, which may influence the rule engine result
-
getDefaultRuleEngineContextName
-
setDefaultRuleEngineContextName
- Parameters:
defaultRuleEngineContextName- injects the rule engine context, which is required to trigger the rule engine
-
getRuleEngineContextDao
-
setRuleEngineContextDao
- Parameters:
ruleEngineContextDao- injects the rule engine context DAO, which is required to trigger the rule engine
-
getCommerceRuleEngineService
-
setCommerceRuleEngineService
- Parameters:
ruleEngineService- injects the rule engine service, which is required to trigger the rule engine
-
applyRulesResult
-
isRuleBasedDiscountExist
-
getActionStrategiesMapping
-
setActionStrategiesMapping
public void setActionStrategiesMapping(Map<String, ProductConfigRuleActionStrategy> actionStrategiesMapping) - Parameters:
actionStrategiesMapping- injects the mapping between actionStrategyKey, which is defined by the rule action and a concreate actionStrategy class, which will apply the defined action
-
getRuleActionStrategy
returns theProductConfigRuleActionStrategydefined in theactionStrategiesMappingattribute of this service by looking up it's hey.- Parameters:
strategyKey- the key of the RuleActionStrategy to look up- Returns:
- the found bean id
- Throws:
IllegalArgumentException- if the requested strategy cannot be foundIllegalStateException- if this method is called but no strategies are configured
-
getTimeService
-
setTimeService
- Parameters:
timeService- time service
-
getRuleEngineContextFinderStrategy
- Returns:
- the ruleEngineContextFinderStrategy
-
setRuleEngineContextFinderStrategy
public void setRuleEngineContextFinderStrategy(RuleEngineContextFinderStrategy ruleEngineContextFinderStrategy) - Parameters:
ruleEngineContextFinderStrategy- the ruleEngineContextFinderStrategy to set
-
getRulesResultUtil
-
setRulesResultUtil
-
setSessionService
Sets session service, used for determining whether we run in a stateless scenario- Parameters:
sessionService-
-
getSessionService
-
setUserService
Sets user service- Parameters:
userService-
-
getUserService
-