Class AbstractRuleExecutableSupport
- java.lang.Object
-
- de.hybris.platform.ruleengineservices.rule.evaluation.actions.AbstractRuleExecutableSupport
-
- All Implemented Interfaces:
RAOAction
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
AbstractRulePartnerProductAction
,ProductConfigAbstractRAOAction
,RuleAddCouponRAOAction
,RuleAddFreeProductDiscountRAOAction
,RuleAddProductPercentageDiscountRAOAction
,RuleChangeDeliveryModeRAOAction
,RuleFreeGiftToBundleRAOAction
,RuleHaltRAOAction
,RuleOrderEntryFixedDiscountRAOAction
,RuleOrderEntryFixedPriceRAOAction
,RuleOrderEntryPercentageDiscountRAOAction
,RuleOrderFixedDiscountRAOAction
,RuleOrderPercentageDiscountExcludedProductsRAOAction
,RuleOrderPercentageDiscountRAOAction
,RuleTriggerMessageRAOAction
public class AbstractRuleExecutableSupport extends java.lang.Object implements org.springframework.beans.factory.BeanNameAware, RAOAction
-
-
Constructor Summary
Constructors Constructor Description AbstractRuleExecutableSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addMetadataToRao(AbstractRuleActionRAO rao, RuleActionContext context)
protected int
adjustStrategyQuantity(java.util.Collection<EntriesSelectionStrategyRPD> selectionStrategyRPDs, int maxCount)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.adjustStrategyQuantity(Collection, int)
protected java.math.BigDecimal
adjustUnitPrice(OrderEntryRAO orderEntryRao)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905protected java.math.BigDecimal
adjustUnitPrice(OrderEntryRAO orderEntryRao, int quantity)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905 .protected boolean
allowedByRuntimeConfiguration(RuleActionContext context)
query method to allow for rule execution byRuleConfigurationRRD
protected org.drools.core.spi.KnowledgeHelper
checkAndGetRuleContext(RuleActionContext context)
Checks that the givenruleContext
is of typeKnowledgeHelper
(i.e.protected <T extends AbstractRuleActionRAO>
voidconsumeOrderEntries(RuleActionContext context, java.util.Collection<EntriesSelectionStrategyRPD> strategies, T actionRAO)
Deprecated, for removal: This API element is subject to removal in a future version.protected java.util.Set<OrderEntryConsumedRAO>
consumeOrderEntries(java.util.Set<OrderEntryRAO> selectedEntries, java.util.Map<java.lang.Integer,java.lang.Integer> selectedEntriesMap, AbstractRuleActionRAO actionRAO)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.consumeOrderEntries(Set, Map, AbstractRuleActionRAO)
protected OrderEntryConsumedRAO
consumeOrderEntry(OrderEntryRAO orderEntryRAO, int quantity, AbstractRuleActionRAO actionRAO)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.consumeOrderEntry(OrderEntryRAO, AbstractRuleActionRAO)
protected OrderEntryConsumedRAO
consumeOrderEntry(OrderEntryRAO orderEntryRAO, int quantity, java.math.BigDecimal discountValue, AbstractRuleActionRAO actionRAO)
Deprecated, for removal: This API element is subject to removal in a future version.protected OrderEntryConsumedRAO
consumeOrderEntry(OrderEntryRAO orderEntryRAO, AbstractRuleActionRAO actionRAO)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.consumeOrderEntry(OrderEntryRAO, AbstractRuleActionRAO)
protected OrderEntryConsumedRAO
createOrderEntryConsumedRAO(OrderEntryRAO orderEntryRAO, int quantity, java.math.BigDecimal discountValue)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.createOrderEntryConsumedRAO(OrderEntryRAO, int, BigDecimal)
protected java.util.Optional<java.math.BigDecimal>
extractAmountForCurrency(RuleActionContext context, java.lang.Object currencyAmount)
protected java.util.function.Predicate<RuleGroupExecutionRRD>
filterByRuleGroup(RuleConfigurationRRD config)
protected java.util.List<ActionSupplementStrategy>
getActionSupplementStrategies()
java.lang.String
getBeanName()
protected ConfigurationService
getConfigurationService()
protected int
getConsumableQuantity(OrderEntryRAO orderEntryRao)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.getConsumableQuantity(OrderEntryRAO)
protected RAOConsumptionSupport
getConsumptionSupport()
protected CurrencyUtils
getCurrencyUtils()
protected java.util.Map<java.lang.Integer,java.lang.Integer>
getEligibleEntryQuantities(java.util.Collection<EntriesSelectionStrategyRPD> selectionStrategyRPDs)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.getEligibleEntryQuantities(Collection)
protected java.util.Map<OrderEntrySelectionStrategy,EntriesSelectionStrategy>
getEntriesSelectionStrategies()
Deprecated, for removal: This API element is subject to removal in a future version.since 1905protected java.util.Map<java.lang.String,java.lang.String>
getMetaDataFromRule(RuleActionContext context)
protected java.lang.String
getMetaDataFromRule(RuleActionContext context, java.lang.String key)
Returns the rule's meta-data for the given key (ornull
).protected PriceAdjustmentStrategy<OrderEntryRAO>
getPriceAdjustmentStrategy()
protected RAOLookupService
getRaoLookupService()
protected RaoUtils
getRaoUtils()
protected java.lang.String
getRuleCode(RuleActionContext context)
Returns the rule's rule code meta data.protected RuleConfigurationRRD
getRuleConfigurationRRD(java.lang.String ruleCode, RuleActionContext context)
retrieves the RuleConfigurationRRD for the given ruleCode from the given context.protected java.util.function.Predicate<RuleConfigurationRRD>
getRuleConfigurationRRDFilter(java.lang.String ruleCode)
protected RuleEngineCalculationService
getRuleEngineCalculationService()
protected RuleGroupExecutionRRD
getRuleGroupExecutionRRD(java.lang.String ruleGroupCode, RuleActionContext context)
retrieves the RuleGroupExecutionRRD for the given ruleGroupCode from the given context.protected java.util.function.Predicate<RuleGroupExecutionRRD>
getRuleGroupExecutionRRDFilter(java.lang.String ruleGroupCode)
protected java.util.Map<java.lang.Integer,java.lang.Integer>
getSelectedOrderEntryQuantities(RuleActionContext context, java.util.Collection<EntriesSelectionStrategyRPD> strategies)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.getSelectedOrderEntryQuantities(RuleActionContext, Collection)
protected java.util.Set<OrderEntryRAO>
getSelectedOrderEntryRaos(java.util.Collection<EntriesSelectionStrategyRPD> selectionStrategyRPDs, java.util.Map<java.lang.Integer,java.lang.Integer> selectedOrderEntryMap)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.getSelectedOrderEntryRaos(Collection, Map)
protected boolean
hasEnoughQuantity(RuleActionContext context, java.util.Collection<EntriesSelectionStrategyRPD> selectionStrategyRPDs)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.hasEnoughQuantity(RuleActionContext, Collection)
protected boolean
isConsumptionEnabled()
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.isConsumptionEnabled()
protected <T> java.util.Optional<T>
lookupRAOByType(java.lang.Class<T> raoType, RuleActionContext context, java.util.function.Predicate<T>... raoFilters)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOLookupService.lookupRAOByType(Class, RuleActionContext, Predicate[])
protected <T> java.util.List<T>
lookupRAOObjectsByType(java.lang.Class<T> raoType, RuleActionContext context, java.util.function.Predicate<T>... raoFilters)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOLookupService.lookupRAOObjectsByType(Class, RuleActionContext, Predicate[])
protected boolean
mergeDiscounts(RuleActionContext context, DiscountRAO discountRao, OrderEntryRAO entry)
protected void
mergeOrderEntryConsumed(OrderEntryConsumedRAO consumedTarget, OrderEntryConsumedRAO consumedSource)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.mergeOrderEntryConsumed(OrderEntryConsumedRAO, OrderEntryConsumedRAO)
void
performAction(RuleActionContext context)
perform action on RAO objectsprotected boolean
performActionInternal(RuleActionContext context)
template method called inside ofperformAction(RuleActionContext)
protected void
postProcessAction(AbstractRuleActionRAO actionRao, RuleActionContext context)
void
setActionSupplementStrategies(java.util.List<ActionSupplementStrategy> actionSupplementStrategies)
void
setBeanName(java.lang.String beanName)
void
setConfigurationService(ConfigurationService configurationService)
void
setConsumptionEnabled(boolean consumptionEnabled)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905void
setConsumptionSupport(RAOConsumptionSupport consumptionSupport)
void
setCurrencyUtils(CurrencyUtils currencyUtils)
void
setEntriesSelectionStrategies(java.util.Map<OrderEntrySelectionStrategy,EntriesSelectionStrategy> entriesSelectionStrategies)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905void
setPriceAdjustmentStrategy(PriceAdjustmentStrategy<OrderEntryRAO> priceAdjustmentStrategy)
void
setRaoLookupService(RAOLookupService raoLookupService)
void
setRAOMetaData(RuleActionContext context, AbstractRuleActionRAO... raos)
void
setRaoUtils(RaoUtils raoUtils)
void
setRuleEngineCalculationService(RuleEngineCalculationService ruleEngineCalculationService)
protected boolean
shouldPerformAction(AbstractRuleActionRAO actionRao, RuleActionContext context)
protected <T> boolean
skipErrorLogging(java.lang.Class<T> raoType)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905protected void
splitEntriesSelectionStrategies(java.util.List<EntriesSelectionStrategyRPD> entriesSelectionStrategyRPDs, java.util.List<EntriesSelectionStrategyRPD> selectionStrategyRPDsForAction, java.util.List<EntriesSelectionStrategyRPD> selectionStrategyRPDsForTriggering)
protected void
trackActionExecution(RuleActionContext context)
protected void
trackConsumedProducts(RuleActionContext context)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.trackConsumedProducts(RuleActionContext)
protected void
trackRuleExecution(RuleActionContext context)
Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 no longer usedprotected void
trackRuleGroupCode(java.lang.String ruleGroupCode, RuleActionContext context, RuleConfigurationRRD config)
Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 no longer usedprotected void
trackRuleGroupExecution(RuleGroupExecutionRRD execution, RuleConfigurationRRD config)
Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 no longer usedprotected void
trackRuleGroupExecutions(RuleActionContext context)
Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 no longer usedprotected void
updateActionRAOWithConsumed(AbstractRuleActionRAO actionRAO, OrderEntryConsumedRAO orderEntryConsumedRAO)
Deprecated, for removal: This API element is subject to removal in a future version.since 19.05, please useRAOConsumptionSupport.updateActionRAOWithConsumed(AbstractRuleActionRAO, OrderEntryConsumedRAO)
protected void
validateCurrencyIsoCode(boolean absolute, java.lang.String currencyIsoCode)
protected void
validateParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
protected void
validateRule(RuleActionContext context)
Validates that the required meta-data is available.protected void
validateSelectionStrategy(java.util.Collection<EntriesSelectionStrategyRPD> strategies, RuleActionContext context)
ValidatesentriesSelectionStrategyRPDs
checking if the collection is not empty, if orderEntries list of each entry of entriesSelectionStrategyRPDs is not empty and all the orderEntries are from the same Order.
-
-
-
Method Detail
-
performAction
public void performAction(RuleActionContext context)
Description copied from interface:RAOAction
perform action on RAO objects- Specified by:
performAction
in interfaceRAOAction
- Parameters:
context
- - instance of RuleActionContext
-
validateParameters
protected void validateParameters(java.util.Map<java.lang.String,java.lang.Object> parameters)
-
performActionInternal
protected boolean performActionInternal(RuleActionContext context)
template method called inside ofperformAction(RuleActionContext)
- Parameters:
context
- the context- Returns:
- true if the action was performed successfully, otherwise false
-
postProcessAction
protected void postProcessAction(AbstractRuleActionRAO actionRao, RuleActionContext context)
-
shouldPerformAction
protected boolean shouldPerformAction(AbstractRuleActionRAO actionRao, RuleActionContext context)
-
trackActionExecution
protected void trackActionExecution(RuleActionContext context)
-
trackConsumedProducts
@Deprecated(since="1905", forRemoval=true) protected void trackConsumedProducts(RuleActionContext context)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.trackConsumedProducts(RuleActionContext)
-
checkAndGetRuleContext
protected org.drools.core.spi.KnowledgeHelper checkAndGetRuleContext(RuleActionContext context)
Checks that the givenruleContext
is of typeKnowledgeHelper
(i.e. drools-specific)- Parameters:
context
- the RuleActionContext instance- Returns:
- the
KnowledgeHelper
-
validateRule
protected void validateRule(RuleActionContext context)
Validates that the required meta-data is available. Validation can be disabled by setting the propertydroolsruleengineservices.validate.droolsrule.rulecode
to false.- Parameters:
context
- instance ofRuleActionContext
-
getRuleCode
protected java.lang.String getRuleCode(RuleActionContext context)
Returns the rule's rule code meta data.- Parameters:
context
- the context- Returns:
- the rule's rule code (or null, if none is found)
-
getMetaDataFromRule
protected java.lang.String getMetaDataFromRule(RuleActionContext context, java.lang.String key)
Returns the rule's meta-data for the given key (ornull
). CallstoString()
on the meta-data object.- Parameters:
context
- the RuleActionContext instancekey
- the key of the meta-data- Returns:
- the string representation of the meta-data (or null)
-
allowedByRuntimeConfiguration
protected boolean allowedByRuntimeConfiguration(RuleActionContext context)
query method to allow for rule execution byRuleConfigurationRRD
- Parameters:
context
- instance ofRuleActionContext
- Returns:
- true if the execution is allowed
-
filterByRuleGroup
protected java.util.function.Predicate<RuleGroupExecutionRRD> filterByRuleGroup(RuleConfigurationRRD config)
-
getMetaDataFromRule
protected java.util.Map<java.lang.String,java.lang.String> getMetaDataFromRule(RuleActionContext context)
-
setRAOMetaData
public void setRAOMetaData(RuleActionContext context, AbstractRuleActionRAO... raos)
-
addMetadataToRao
protected void addMetadataToRao(AbstractRuleActionRAO rao, RuleActionContext context)
-
trackRuleExecution
@Deprecated(since="1808", forRemoval=true) protected void trackRuleExecution(RuleActionContext context)
Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 no longer used
-
trackRuleGroupExecutions
@Deprecated(since="1808", forRemoval=true) protected void trackRuleGroupExecutions(RuleActionContext context)
Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 no longer used
-
trackRuleGroupCode
@Deprecated(since="1808", forRemoval=true) protected void trackRuleGroupCode(java.lang.String ruleGroupCode, RuleActionContext context, RuleConfigurationRRD config)
Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 no longer used
-
trackRuleGroupExecution
@Deprecated(since="1808", forRemoval=true) protected void trackRuleGroupExecution(RuleGroupExecutionRRD execution, RuleConfigurationRRD config)
Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 no longer used
-
getRuleGroupExecutionRRD
protected RuleGroupExecutionRRD getRuleGroupExecutionRRD(java.lang.String ruleGroupCode, RuleActionContext context)
retrieves the RuleGroupExecutionRRD for the given ruleGroupCode from the given context.- Parameters:
ruleGroupCode
- the rule group codecontext
- the drools rule context- Returns:
- the matching RuleGroupExecutionRRD or null if none can be found
-
getRuleGroupExecutionRRDFilter
protected java.util.function.Predicate<RuleGroupExecutionRRD> getRuleGroupExecutionRRDFilter(java.lang.String ruleGroupCode)
-
lookupRAOByType
@Deprecated(since="1905", forRemoval=true) protected <T> java.util.Optional<T> lookupRAOByType(java.lang.Class<T> raoType, RuleActionContext context, java.util.function.Predicate<T>... raoFilters)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOLookupService.lookupRAOByType(Class, RuleActionContext, Predicate[])
-
lookupRAOObjectsByType
@Deprecated(since="1905", forRemoval=true) protected <T> java.util.List<T> lookupRAOObjectsByType(java.lang.Class<T> raoType, RuleActionContext context, java.util.function.Predicate<T>... raoFilters)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOLookupService.lookupRAOObjectsByType(Class, RuleActionContext, Predicate[])
-
getRuleConfigurationRRD
protected RuleConfigurationRRD getRuleConfigurationRRD(java.lang.String ruleCode, RuleActionContext context)
retrieves the RuleConfigurationRRD for the given ruleCode from the given context.- Parameters:
ruleCode
- the rule codecontext
- the drools rule context- Returns:
- the RuleConfigurationRRD or null if none (or more than one) are found
-
getRuleConfigurationRRDFilter
protected java.util.function.Predicate<RuleConfigurationRRD> getRuleConfigurationRRDFilter(java.lang.String ruleCode)
-
skipErrorLogging
@Deprecated(since="1905", forRemoval=true) protected <T> boolean skipErrorLogging(java.lang.Class<T> raoType)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905
-
consumeOrderEntry
@Deprecated(since="1905", forRemoval=true) protected OrderEntryConsumedRAO consumeOrderEntry(OrderEntryRAO orderEntryRAO, int quantity, java.math.BigDecimal discountValue, AbstractRuleActionRAO actionRAO)
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
orderEntryRAO
- the order entry to consumeactionRAO
- the action rao to add the consumed entry toquantity
- the quantity to consumediscountValue
- the discount this order entry consumption gave- Returns:
- the newly created consumed entry
-
consumeOrderEntry
@Deprecated(since="1905", forRemoval=true) protected OrderEntryConsumedRAO consumeOrderEntry(OrderEntryRAO orderEntryRAO, AbstractRuleActionRAO actionRAO)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.consumeOrderEntry(OrderEntryRAO, AbstractRuleActionRAO)
Creates a newOrderEntryConusmedRAO
that consumes the given orderEntryRAO and adds the consumed entry to the given actionRAO- Parameters:
orderEntryRAO
- the order entry to consumeactionRAO
- the action rao to add the consumed entry to- Returns:
- the newly created consumed entry
-
consumeOrderEntry
@Deprecated(since="1905", forRemoval=true) protected OrderEntryConsumedRAO consumeOrderEntry(OrderEntryRAO orderEntryRAO, int quantity, AbstractRuleActionRAO actionRAO)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.consumeOrderEntry(OrderEntryRAO, AbstractRuleActionRAO)
Creates a newOrderEntryConusmedRAO
that consumes the given orderEntryRAO with the given quantity and adds the consumed entry to the given actionRAO- Parameters:
orderEntryRAO
- the order entry to consumequantity
- the quantity to consumeactionRAO
- the action rao to add the consumed entry to- Returns:
- the newly created consumed entry
-
consumeOrderEntries
@Deprecated(since="1905", forRemoval=true) protected <T extends AbstractRuleActionRAO> void consumeOrderEntries(RuleActionContext context, java.util.Collection<EntriesSelectionStrategyRPD> strategies, T actionRAO)
Deprecated, for removal: This API element is subject to removal in a future version.Creates newOrderEntryConusmedRAO
s for the given strategies, links them to the givenactionRAO
and reduces available quantity of order entry by given quantity for every Order Entry from the set and using quantity fromdiscountedOrderEntryMap
.- Parameters:
context
- instance ofRuleActionContext
strategies
- the selection strategiesactionRAO
- theAbstractRuleActionRAO
to add the newly created consumed entries to
-
consumeOrderEntries
@Deprecated(since="1905", forRemoval=true) protected java.util.Set<OrderEntryConsumedRAO> consumeOrderEntries(java.util.Set<OrderEntryRAO> selectedEntries, java.util.Map<java.lang.Integer,java.lang.Integer> selectedEntriesMap, AbstractRuleActionRAO actionRAO)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.consumeOrderEntries(Set, Map, AbstractRuleActionRAO)
Creates newOrderEntryConusmedRAO
s with the given quantity, links it to the givenactionRAO
and reduces available quantity of order entry by given quantity for every Order Entry from the set and using quantity fromdiscountedOrderEntryMap
.- Parameters:
selectedEntries
- Order Entries to be consumedselectedEntriesMap
- Map having orderEntry.entryNumber as keys and Unit Quantity To Be Consumed as valuesactionRAO
- theAbstractRuleActionRAO
to add the newly created consumed entries to
-
getSelectedOrderEntryQuantities
@Deprecated(since="1905", forRemoval=true) protected java.util.Map<java.lang.Integer,java.lang.Integer> getSelectedOrderEntryQuantities(RuleActionContext context, java.util.Collection<EntriesSelectionStrategyRPD> strategies)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.getSelectedOrderEntryQuantities(RuleActionContext, Collection)
Gets Order Entry identifiers (orderEntry.entryNumber) and Unit Quantity To Be Consumed for the Order Entries.- Parameters:
strategies
- list ofEntriesSelectionStrategyRPD
to pickup units according to the strategies- Returns:
- Map having orderEntry.entryNumber as keys and Unit Quantity To Be Consumed as values
-
getSelectedOrderEntryRaos
@Deprecated(since="1905", forRemoval=true) protected java.util.Set<OrderEntryRAO> getSelectedOrderEntryRaos(java.util.Collection<EntriesSelectionStrategyRPD> selectionStrategyRPDs, java.util.Map<java.lang.Integer,java.lang.Integer> selectedOrderEntryMap)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.getSelectedOrderEntryRaos(Collection, Map)
Gets Order Entry set to be discounted as a result of bundle processing.- Parameters:
selectionStrategyRPDs
- list ofEntriesSelectionStrategyRPD
to pickup units according to the strategiesselectedOrderEntryMap
- Map having orderEntry.entryNumber as keys and Unit Quantity To Be Consumed as values
-
createOrderEntryConsumedRAO
@Deprecated(since="1905", forRemoval=true) protected OrderEntryConsumedRAO createOrderEntryConsumedRAO(OrderEntryRAO orderEntryRAO, int quantity, java.math.BigDecimal discountValue)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.createOrderEntryConsumedRAO(OrderEntryRAO, int, BigDecimal)
Creates new OrderEntryConsumedRAO for given OrderEntryRAO and with given quantity.- Parameters:
orderEntryRAO
- OrderEntryRAO to create consumed entry forquantity
- Consumed quantitydiscountValue
- the discount this order entry consumption gave- Returns:
- created OrderEntryConsumedRAO
-
updateActionRAOWithConsumed
@Deprecated(since="1905", forRemoval=true) protected void updateActionRAOWithConsumed(AbstractRuleActionRAO actionRAO, OrderEntryConsumedRAO orderEntryConsumedRAO)
Deprecated, for removal: This API element is subject to removal in a future version.since 19.05, please useRAOConsumptionSupport.updateActionRAOWithConsumed(AbstractRuleActionRAO, OrderEntryConsumedRAO)
Adds given OrderEntryConsumedRAO to the AbstractRuleActionRAO.consumedEntries.- Parameters:
actionRAO
- AbstractRuleActionRAO to be updatedorderEntryConsumedRAO
- to be added to the AbstractRuleActionRAO
-
mergeOrderEntryConsumed
@Deprecated(since="1905", forRemoval=true) protected void mergeOrderEntryConsumed(OrderEntryConsumedRAO consumedTarget, OrderEntryConsumedRAO consumedSource)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.mergeOrderEntryConsumed(OrderEntryConsumedRAO, OrderEntryConsumedRAO)
Method merges the properties of two instances ofOrderEntryConsumedRAO
if the objects refer to the same order entry number and same rule- Parameters:
consumedTarget
- where to merge the data toconsumedSource
- where to merge the data from
-
adjustUnitPrice
@Deprecated(since="1905", forRemoval=true) protected java.math.BigDecimal adjustUnitPrice(OrderEntryRAO orderEntryRao)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905
-
adjustUnitPrice
@Deprecated(since="1905", forRemoval=true) protected java.math.BigDecimal adjustUnitPrice(OrderEntryRAO orderEntryRao, int quantity)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905 . Please usePriceAdjustmentStrategy.get(Object, int)
-
hasEnoughQuantity
@Deprecated(since="1905", forRemoval=true) protected boolean hasEnoughQuantity(RuleActionContext context, java.util.Collection<EntriesSelectionStrategyRPD> selectionStrategyRPDs)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.hasEnoughQuantity(RuleActionContext, Collection)
Checks if allentriesSelectionStrategyRPDs
have enough quantity.- Parameters:
selectionStrategyRPDs
- List of EntriesSelectionStrategyRPD to check- Returns:
- true if all entries selection strategies have enough quantity. false if at least one doesn't have.
-
getEligibleEntryQuantities
@Deprecated(since="1905", forRemoval=true) protected java.util.Map<java.lang.Integer,java.lang.Integer> getEligibleEntryQuantities(java.util.Collection<EntriesSelectionStrategyRPD> selectionStrategyRPDs)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.getEligibleEntryQuantities(Collection)
-
getConsumableQuantity
@Deprecated(since="1905", forRemoval=true) protected int getConsumableQuantity(OrderEntryRAO orderEntryRao)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.getConsumableQuantity(OrderEntryRAO)
Calculate the order entry consumable quantity- Parameters:
orderEntryRao
- instance ofOrderEntryRAO
- Returns:
- number of units available for consumption
-
adjustStrategyQuantity
@Deprecated(since="1905", forRemoval=true) protected int adjustStrategyQuantity(java.util.Collection<EntriesSelectionStrategyRPD> selectionStrategyRPDs, int maxCount)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.adjustStrategyQuantity(Collection, int)
Adjusts the quantity fields of EntriesSelectionStrategyRPD such that the maximum possible number of entries will be consumed by the action. This is done by finding the highest integer multiple that the strategy.quantity can be multiplied by that there is sufficient quantity in the associated OrderEntryRAO object. This figure is then multiplied by the original quantity of the selection strategy.- Parameters:
selectionStrategyRPDs
- list of EntriesSelectionStrategyRPD to be updatedmaxCount
- when maxCount is greater than 0, this parameter acts as an absolute maximum for the multiple.- Returns:
- The multiple count used to scale the quantity fields of the strategy objects
-
validateSelectionStrategy
protected void validateSelectionStrategy(java.util.Collection<EntriesSelectionStrategyRPD> strategies, RuleActionContext context)
ValidatesentriesSelectionStrategyRPDs
checking if the collection is not empty, if orderEntries list of each entry of entriesSelectionStrategyRPDs is not empty and all the orderEntries are from the same Order.- Parameters:
strategies
- collection ofEntriesSelectionStrategyRPD
to check.context
- the RuleActionContext instance
-
splitEntriesSelectionStrategies
protected void splitEntriesSelectionStrategies(java.util.List<EntriesSelectionStrategyRPD> entriesSelectionStrategyRPDs, java.util.List<EntriesSelectionStrategyRPD> selectionStrategyRPDsForAction, java.util.List<EntriesSelectionStrategyRPD> selectionStrategyRPDsForTriggering)
-
mergeDiscounts
protected boolean mergeDiscounts(RuleActionContext context, DiscountRAO discountRao, OrderEntryRAO entry)
-
validateCurrencyIsoCode
protected void validateCurrencyIsoCode(boolean absolute, java.lang.String currencyIsoCode)
-
extractAmountForCurrency
protected java.util.Optional<java.math.BigDecimal> extractAmountForCurrency(RuleActionContext context, java.lang.Object currencyAmount)
-
getBeanName
public java.lang.String getBeanName()
-
setBeanName
public void setBeanName(java.lang.String beanName)
- Specified by:
setBeanName
in interfaceorg.springframework.beans.factory.BeanNameAware
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
-
getConfigurationService
protected ConfigurationService getConfigurationService()
-
setRuleEngineCalculationService
public void setRuleEngineCalculationService(RuleEngineCalculationService ruleEngineCalculationService)
-
getRuleEngineCalculationService
protected RuleEngineCalculationService getRuleEngineCalculationService()
-
getCurrencyUtils
protected CurrencyUtils getCurrencyUtils()
-
setCurrencyUtils
public void setCurrencyUtils(CurrencyUtils currencyUtils)
-
getActionSupplementStrategies
protected java.util.List<ActionSupplementStrategy> getActionSupplementStrategies()
-
setActionSupplementStrategies
public void setActionSupplementStrategies(java.util.List<ActionSupplementStrategy> actionSupplementStrategies)
-
getRaoUtils
protected RaoUtils getRaoUtils()
-
setRaoUtils
public void setRaoUtils(RaoUtils raoUtils)
-
getConsumptionSupport
protected RAOConsumptionSupport getConsumptionSupport()
-
setConsumptionSupport
public void setConsumptionSupport(RAOConsumptionSupport consumptionSupport)
-
getRaoLookupService
protected RAOLookupService getRaoLookupService()
-
setRaoLookupService
public void setRaoLookupService(RAOLookupService raoLookupService)
-
isConsumptionEnabled
@Deprecated(since="1905", forRemoval=true) protected boolean isConsumptionEnabled()
Deprecated, for removal: This API element is subject to removal in a future version.since 1905, please useRAOConsumptionSupport.isConsumptionEnabled()
-
setConsumptionEnabled
@Deprecated(since="1905", forRemoval=true) public void setConsumptionEnabled(boolean consumptionEnabled)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905
-
getPriceAdjustmentStrategy
protected PriceAdjustmentStrategy<OrderEntryRAO> getPriceAdjustmentStrategy()
-
setPriceAdjustmentStrategy
public void setPriceAdjustmentStrategy(PriceAdjustmentStrategy<OrderEntryRAO> priceAdjustmentStrategy)
-
getEntriesSelectionStrategies
@Deprecated(since="1905", forRemoval=true) protected java.util.Map<OrderEntrySelectionStrategy,EntriesSelectionStrategy> getEntriesSelectionStrategies()
Deprecated, for removal: This API element is subject to removal in a future version.since 1905
-
setEntriesSelectionStrategies
@Deprecated(since="1905", forRemoval=true) public void setEntriesSelectionStrategies(java.util.Map<OrderEntrySelectionStrategy,EntriesSelectionStrategy> entriesSelectionStrategies)
Deprecated, for removal: This API element is subject to removal in a future version.since 1905
-
-