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 boolean
adjustConfigurationRuleBased(ConfigModel currentConfigModel, ProcessStep processStep, ConfigurationRetrievalOptions retrievalOptions)
protected void
adjustVariantConditionsUsingOptions(ConfigModel config)
protected ConfigModel
afterConfigCreated(ConfigModel config, ConfigurationRetrievalOptions retrievalOptions)
protected ConfigModel
afterDefaultConfigCreated(ConfigModel config)
protected boolean
applyRulesResult(RuleEvaluationResult rulesResult, ConfigModel configModel)
ConfigModel
createConfigurationFromExternalBypassRules(KBKey kbKey, java.lang.String externalConfiguration)
Creates theConfigModel
from the givenexternalConfiguration
bypassing rule evaluation.protected FactContext
createFactContext(CartModel cartModel, ConfigModel currentConfigModel, ProductConfigProcessStepModel processStepModel)
protected AbstractRuleEngineContextModel
determineRuleEngineContext(ConfigModel currentConfigModel)
protected java.util.Map<java.lang.String,ProductConfigRuleActionStrategy>
getActionStrategiesMapping()
protected CartService
getCartService()
protected RuleEngineService
getCommerceRuleEngineService()
protected java.lang.String
getDefaultRuleEngineContextName()
protected FactContextFactory
getFactContextFactory()
protected ProductConfigRuleActionStrategy
getRuleActionStrategy(java.lang.String strategyKey)
returns theProductConfigRuleActionStrategy
defined in theactionStrategiesMapping
attribute of this service by looking up it's hey.protected RuleEngineContextDao
getRuleEngineContextDao()
protected RuleEngineContextFinderStrategy
getRuleEngineContextFinderStrategy()
protected ProductConfigRulesResultUtil
getRulesResultUtil()
protected TimeService
getTimeService()
protected boolean
isRuleBasedDiscountExist(ConfigModel config)
protected RuleEvaluationContext
prepareRuleEvaluationContext(FactContext factContext, AbstractRuleEngineContextModel engineContext)
protected ConfigModel
provideConfigurationModel(java.lang.String configId, boolean useRuleEngine, java.lang.String productCode)
protected java.util.Set<java.lang.Object>
provideRAOs(FactContext factContext)
protected boolean
removeMessageBeforeNextStep(ProcessStep nextStep, ProductConfigMessage message)
protected void
removeMessagesRecomputedOnNextStep(java.util.Set<ProductConfigMessage> oldMessages, ProcessStep nextStep)
ConfigModel
retrieveConfigurationModel(java.lang.String configId)
Retrieve the actual configuration model for the requestedconfigId
in theConfigModel
format.protected ConfigModel
retrieveConfigurationModelAfterUpdate(java.lang.String configId, java.lang.String productCode)
ConfigModel
retrieveConfigurationModelBypassRules(java.lang.String configId)
Retrieve the actual configuration model for the requestedconfigId
in theConfigModel
format bypassing rule evaluation.void
setActionStrategiesMapping(java.util.Map<java.lang.String,ProductConfigRuleActionStrategy> actionStrategiesMapping)
void
setCartService(CartService cartService)
void
setCommerceRuleEngineService(RuleEngineService ruleEngineService)
void
setDefaultRuleEngineContextName(java.lang.String defaultRuleEngineContextName)
void
setFactContextFactory(FactContextFactory factContextFactory)
void
setRuleEngineContextDao(RuleEngineContextDao ruleEngineContextDao)
void
setRuleEngineContextFinderStrategy(RuleEngineContextFinderStrategy ruleEngineContextFinderStrategy)
void
setRulesResultUtil(ProductConfigRulesResultUtil rulesResultUtil)
void
setTimeService(TimeService timeService)
protected void
transferVariantConditions(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:
afterDefaultConfigCreated
in classProductConfigurationServiceImpl
-
afterConfigCreated
protected ConfigModel afterConfigCreated(ConfigModel config, ConfigurationRetrievalOptions retrievalOptions)
- Overrides:
afterConfigCreated
in 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:ProductConfigurationService
Retrieve the actual configuration model for the requestedconfigId
in theConfigModel
format.- Specified by:
retrieveConfigurationModel
in interfaceProductConfigurationService
- Overrides:
retrieveConfigurationModel
in 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:ProductConfigurationRuleAwareService
Retrieve the actual configuration model for the requestedconfigId
in theConfigModel
format bypassing rule evaluation.- Specified by:
retrieveConfigurationModelBypassRules
in interfaceProductConfigurationRuleAwareService
- Parameters:
configId
- Unique configuration ID- Returns:
- The actual configuration
-
createConfigurationFromExternalBypassRules
public ConfigModel createConfigurationFromExternalBypassRules(KBKey kbKey, java.lang.String externalConfiguration)
Description copied from interface:ProductConfigurationRuleAwareService
Creates theConfigModel
from the givenexternalConfiguration
bypassing rule evaluation.- Specified by:
createConfigurationFromExternalBypassRules
in 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 theProductConfigRuleActionStrategy
defined in theactionStrategiesMapping
attribute 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)
-
-