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 theProductConfigurationServiceImpl.
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.sap.productconfig.services.impl.ProductConfigurationServiceImpl
DEBUG_CONFIG_WITH_ID, NOT_ALLOWED_TO_READ_CONFIGURATION, NOT_ALLOWED_TO_RELEASE_CONFIGURATION, NOT_ALLOWED_TO_UPDATE_CONFIGURATION
-
-
Constructor Summary
Constructors Constructor Description ProductConfigurationRuleAwareServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanadjustConfigurationRuleBased(ConfigModel currentConfigModel, ProcessStep processStep, ConfigurationRetrievalOptions retrievalOptions)protected voidadjustVariantConditionsUsingOptions(ConfigModel config)protected ConfigModelafterConfigCreated(ConfigModel config, ConfigurationRetrievalOptions retrievalOptions)protected ConfigModelafterDefaultConfigCreated(ConfigModel config)protected booleanapplyRulesResult(RuleEvaluationResult rulesResult, ConfigModel configModel)ConfigModelcreateConfigurationFromExternalBypassRules(KBKey kbKey, java.lang.String externalConfiguration)Creates theConfigModelfrom the givenexternalConfigurationbypassing rule evaluation.protected FactContextcreateFactContext(CartModel cartModel, ConfigModel currentConfigModel, ProductConfigProcessStepModel processStepModel)protected AbstractRuleEngineContextModeldetermineRuleEngineContext(ConfigModel currentConfigModel)protected java.util.Map<java.lang.String,ProductConfigRuleActionStrategy>getActionStrategiesMapping()protected CartServicegetCartService()protected RuleEngineServicegetCommerceRuleEngineService()protected java.lang.StringgetDefaultRuleEngineContextName()protected FactContextFactorygetFactContextFactory()protected ProductConfigRuleActionStrategygetRuleActionStrategy(java.lang.String strategyKey)returns theProductConfigRuleActionStrategydefined in theactionStrategiesMappingattribute of this service by looking up it's hey.protected RuleEngineContextDaogetRuleEngineContextDao()protected RuleEngineContextFinderStrategygetRuleEngineContextFinderStrategy()protected ProductConfigRulesResultUtilgetRulesResultUtil()protected TimeServicegetTimeService()protected booleanisRuleBasedDiscountExist(ConfigModel config)protected RuleEvaluationContextprepareRuleEvaluationContext(FactContext factContext, AbstractRuleEngineContextModel engineContext)protected ConfigModelprovideConfigurationModel(java.lang.String configId, boolean useRuleEngine, java.lang.String productCode)protected java.util.Set<java.lang.Object>provideRAOs(FactContext factContext)protected booleanremoveMessageBeforeNextStep(ProcessStep nextStep, ProductConfigMessage message)protected voidremoveMessagesRecomputedOnNextStep(java.util.Set<ProductConfigMessage> oldMessages, ProcessStep nextStep)ConfigModelretrieveConfigurationModel(java.lang.String configId)Retrieve the actual configuration model for the requestedconfigIdin theConfigModelformat.protected ConfigModelretrieveConfigurationModelAfterUpdate(java.lang.String configId, java.lang.String productCode)ConfigModelretrieveConfigurationModelBypassRules(java.lang.String configId)Retrieve the actual configuration model for the requestedconfigIdin theConfigModelformat bypassing rule evaluation.voidsetActionStrategiesMapping(java.util.Map<java.lang.String,ProductConfigRuleActionStrategy> actionStrategiesMapping)voidsetCartService(CartService cartService)voidsetCommerceRuleEngineService(RuleEngineService ruleEngineService)voidsetDefaultRuleEngineContextName(java.lang.String defaultRuleEngineContextName)voidsetFactContextFactory(FactContextFactory factContextFactory)voidsetRuleEngineContextDao(RuleEngineContextDao ruleEngineContextDao)voidsetRuleEngineContextFinderStrategy(RuleEngineContextFinderStrategy ruleEngineContextFinderStrategy)voidsetRulesResultUtil(ProductConfigRulesResultUtil rulesResultUtil)voidsetTimeService(TimeService timeService)protected 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, getConfigurationPricingOrderIntegrationService, getConfigurationProductUtil, getConfigurationProvider, getCpqConfigurableChecker, getLock, getMaxLocksPerMap, getProductConfigurationAccessControlService, getProductConfigurationPricingStrategy, getProviderFactory, getRecorder, getTotalNumberOfIssues, hasKbForDate, hasKbForVersion, isChangeableVariant, isKbVersionValid, isRelatedObjectReadOnly, releaseSession, releaseSession, removeConfigAttributesFromCache, removeConfigAttributesSessionFromCache, retrieveConfigurationModelFromConfigurationEngine, retrieveCorrectPricingDate, retrieveExternalConfiguration, retrieveRelatedObjectType, setAbstractOrderEntryLinkStrategy, setAssignmentResolverStrategy, setConfigLifecycleStrategy, setConfigModelCacheStrategy, setConfigurationPricingOrderIntegrationService, setConfigurationProductUtil, setCpqConfigurableChecker, setMaxLocksPerMap, setProductConfigurationAccessControlService, setProductConfigurationPricingStrategy, setProviderFactory, setRecorder, updateConfiguration, updateKbKeyForVariants, updateKbKeyWithProductCode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.sap.productconfig.services.intf.ProductConfigurationService
calculateNumberOfIncompleteCsticsAndSolvableConflicts, createConfigurationForVariant, createConfigurationFromExternal, createConfigurationFromExternal, createConfigurationFromExternal, createConfigurationFromExternalSource, createDefaultConfiguration, extractKbKey, getTotalNumberOfIssues, hasKbForDate, hasKbForVersion, isKbVersionValid, releaseSession, releaseSession, retrieveExternalConfiguration, updateConfiguration
-
-
-
-
Method Detail
-
afterDefaultConfigCreated
protected ConfigModel afterDefaultConfigCreated(ConfigModel config)
- Overrides:
afterDefaultConfigCreatedin classProductConfigurationServiceImpl
-
afterConfigCreated
protected ConfigModel afterConfigCreated(ConfigModel config, ConfigurationRetrievalOptions retrievalOptions)
- Overrides:
afterConfigCreatedin classProductConfigurationServiceImpl
-
removeMessagesRecomputedOnNextStep
protected void removeMessagesRecomputedOnNextStep(java.util.Set<ProductConfigMessage> oldMessages, ProcessStep nextStep)
-
removeMessageBeforeNextStep
protected boolean removeMessageBeforeNextStep(ProcessStep nextStep, ProductConfigMessage message)
-
retrieveConfigurationModel
public ConfigModel retrieveConfigurationModel(java.lang.String configId)
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
protected ConfigModel retrieveConfigurationModelAfterUpdate(java.lang.String configId, java.lang.String productCode)
-
provideConfigurationModel
protected ConfigModel provideConfigurationModel(java.lang.String configId, boolean useRuleEngine, java.lang.String productCode)
-
adjustVariantConditionsUsingOptions
protected void adjustVariantConditionsUsingOptions(ConfigModel config)
-
transferVariantConditions
protected void transferVariantConditions(InstanceModel sourceInstance, InstanceModel targetInstance)
-
retrieveConfigurationModelBypassRules
public ConfigModel retrieveConfigurationModelBypassRules(java.lang.String configId)
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
-
createConfigurationFromExternalBypassRules
public ConfigModel createConfigurationFromExternalBypassRules(KBKey kbKey, java.lang.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)
-
createFactContext
protected FactContext createFactContext(CartModel cartModel, ConfigModel currentConfigModel, ProductConfigProcessStepModel processStepModel)
-
determineRuleEngineContext
protected AbstractRuleEngineContextModel determineRuleEngineContext(ConfigModel currentConfigModel)
-
prepareRuleEvaluationContext
protected RuleEvaluationContext prepareRuleEvaluationContext(FactContext factContext, AbstractRuleEngineContextModel engineContext)
-
provideRAOs
protected java.util.Set<java.lang.Object> provideRAOs(FactContext factContext)
-
getFactContextFactory
protected FactContextFactory getFactContextFactory()
-
setFactContextFactory
public void setFactContextFactory(FactContextFactory factContextFactory)
- Parameters:
factContextFactory- injects the rule engine fact context factory, which is required to trigger the rule engine
-
getCartService
protected CartService getCartService()
-
setCartService
public void setCartService(CartService cartService)
- Parameters:
cartService- the cart service to access the session cart contents, which may influence the rule engine result
-
getDefaultRuleEngineContextName
protected java.lang.String getDefaultRuleEngineContextName()
-
setDefaultRuleEngineContextName
public void setDefaultRuleEngineContextName(java.lang.String defaultRuleEngineContextName)
- Parameters:
defaultRuleEngineContextName- injects the rule engine context, which is required to trigger the rule engine
-
getRuleEngineContextDao
protected RuleEngineContextDao getRuleEngineContextDao()
-
setRuleEngineContextDao
public void setRuleEngineContextDao(RuleEngineContextDao ruleEngineContextDao)
- Parameters:
ruleEngineContextDao- injects the rule engine context DAO, which is required to trigger the rule engine
-
getCommerceRuleEngineService
protected RuleEngineService getCommerceRuleEngineService()
-
setCommerceRuleEngineService
public void setCommerceRuleEngineService(RuleEngineService ruleEngineService)
- Parameters:
ruleEngineService- injects the rule engine service, which is required to trigger the rule engine
-
applyRulesResult
protected boolean applyRulesResult(RuleEvaluationResult rulesResult, ConfigModel configModel)
-
isRuleBasedDiscountExist
protected boolean isRuleBasedDiscountExist(ConfigModel config)
-
getActionStrategiesMapping
protected java.util.Map<java.lang.String,ProductConfigRuleActionStrategy> getActionStrategiesMapping()
-
setActionStrategiesMapping
public void setActionStrategiesMapping(java.util.Map<java.lang.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
protected ProductConfigRuleActionStrategy getRuleActionStrategy(java.lang.String strategyKey)
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:
java.lang.IllegalArgumentException- if the requested strategy cannot be foundjava.lang.IllegalStateException- if this method is called but no strategies are configured
-
getTimeService
protected TimeService getTimeService()
-
setTimeService
public void setTimeService(TimeService timeService)
- Parameters:
timeService- time service
-
getRuleEngineContextFinderStrategy
protected RuleEngineContextFinderStrategy getRuleEngineContextFinderStrategy()
- Returns:
- the ruleEngineContextFinderStrategy
-
setRuleEngineContextFinderStrategy
public void setRuleEngineContextFinderStrategy(RuleEngineContextFinderStrategy ruleEngineContextFinderStrategy)
- Parameters:
ruleEngineContextFinderStrategy- the ruleEngineContextFinderStrategy to set
-
getRulesResultUtil
protected ProductConfigRulesResultUtil getRulesResultUtil()
-
setRulesResultUtil
public void setRulesResultUtil(ProductConfigRulesResultUtil rulesResultUtil)
-
-