Class CampaignSourceRulesTranslator


  • public class CampaignSourceRulesTranslator
    extends SingleValueTranslator
    The translator that updates source rules against Campaign using the source rule with provided code and version resolved by one of the available strategies
    • ruleSelection=earliest - selects source rule with minimum version
    • ruleSelection=latest - select source rule with maximum version
    The default ruleSelection\ is configured to latest. It can do processing using one of two modes:
    • mode=append - appends rule to the end of the list
    • mode=replace - replaces the list
    The default mode is configured to replace. Whenever it's desired to pass more than one rule you must separate it using either DEFAULT_SEPARATOR or define your own separator by adding extra meta data separator=[char]. eg. INSERT_UPDATE Campaign[disable.interceptor.types=validate];code[unique=true];sourceRules[translator=de.hybris.platform. ruleengineservices.impex.impl.CampaignSourceRulesTranslator,mode=append,ruleSelection=latest,separator=","]; ;campaign-name;ruleA,ruleB;
    • Constructor Detail

      • CampaignSourceRulesTranslator

        public CampaignSourceRulesTranslator()
    • Method Detail

      • convertToJalo

        protected java.lang.Object convertToJalo​(java.lang.String expression,
                                                 Item item)
        Description copied from class: SingleValueTranslator
        Converts a non-null and non-empty string into a jalo attribute value.
        Specified by:
        convertToJalo in class SingleValueTranslator
        Parameters:
        expression - string to translate
        item - item instance the translated value will be set to as attribute
        Returns:
        Object translated value
      • findSourceRules

        protected java.util.Set<SourceRule> findSourceRules​(java.lang.String expression)
      • findSourceRulesHavingLatestVersion

        protected java.util.Set<SourceRule> findSourceRulesHavingLatestVersion​(java.lang.String[] codes)
      • isRuleSelectionEarliest

        protected boolean isRuleSelectionEarliest()
      • convertToString

        protected java.lang.String convertToString​(java.lang.Object o)
        Description copied from class: SingleValueTranslator
        Converts a non-null jalo attribute value into its string representation.
        Specified by:
        convertToString in class SingleValueTranslator
        Parameters:
        o - value to translate
        Returns:
        translated value
      • getRuleDao

        protected RuleDao getRuleDao()
      • getModelService

        protected ModelService getModelService()
      • isAppendMode

        protected boolean isAppendMode()