Class AbstractRuleExecutableSupport

    • Constructor Detail

      • AbstractRuleExecutableSupport

        public AbstractRuleExecutableSupport()
    • Method Detail

      • performAction

        public void performAction​(RuleActionContext context)
        Description copied from interface: RAOAction
        perform action on RAO objects
        Specified by:
        performAction in interface RAOAction
        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 of performAction(RuleActionContext)
        Parameters:
        context - the context
        Returns:
        true if the action was performed successfully, otherwise false
      • trackActionExecution

        protected void trackActionExecution​(RuleActionContext context)
      • checkAndGetRuleContext

        protected org.drools.core.spi.KnowledgeHelper checkAndGetRuleContext​(RuleActionContext context)
        Checks that the given ruleContext is of type KnowledgeHelper (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 property droolsruleengineservices.validate.droolsrule.rulecode to false.
        Parameters:
        context - instance of RuleActionContext
      • 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)
      • getRuleGroupCode

        protected java.lang.String getRuleGroupCode​(RuleActionContext context)
        Returns the rule's rule group code meta data.
        Parameters:
        context - the context
        Returns:
        the rule's rule code (or null, if none is found)
      • isRuleGroupExclusive

        protected boolean isRuleGroupExclusive​(RuleActionContext context)
      • getMetaDataFromRule

        protected java.lang.String getMetaDataFromRule​(RuleActionContext context,
                                                       java.lang.String key)
        Returns the rule's meta-data for the given key (or null). Calls toString() on the meta-data object.
        Parameters:
        context - the RuleActionContext instance
        key - the key of the meta-data
        Returns:
        the string representation of the meta-data (or null)
      • getMetaDataFromRule

        protected java.util.Map<java.lang.String,​java.lang.String> getMetaDataFromRule​(RuleActionContext context)
      • validateSelectionStrategy

        protected void validateSelectionStrategy​(java.util.Collection<EntriesSelectionStrategyRPD> strategies,
                                                 RuleActionContext context)
        Validates entriesSelectionStrategyRPDs 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 of EntriesSelectionStrategyRPD to check.
        context - the RuleActionContext instance
      • 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 interface org.springframework.beans.factory.BeanNameAware
      • setConfigurationService

        public void setConfigurationService​(ConfigurationService configurationService)
      • setRuleEngineCalculationService

        public void setRuleEngineCalculationService​(RuleEngineCalculationService ruleEngineCalculationService)
      • setCurrencyUtils

        public void setCurrencyUtils​(CurrencyUtils currencyUtils)
      • setActionSupplementStrategies

        public void setActionSupplementStrategies​(java.util.List<ActionSupplementStrategy> actionSupplementStrategies)
      • getRaoUtils

        protected RaoUtils getRaoUtils()
      • setRaoUtils

        public void setRaoUtils​(RaoUtils raoUtils)
      • setConsumptionSupport

        public void setConsumptionSupport​(RAOConsumptionSupport consumptionSupport)
      • setRaoLookupService

        public void setRaoLookupService​(RAOLookupService raoLookupService)