com.ibm.commerce.marketing.dialog.util

Class UserBehaviorRuleTaskCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, UserBehaviorRuleTaskCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class UserBehaviorRuleTaskCmdImpl
    extends TaskCommandImpl
    implements UserBehaviorRuleTaskCmd
    This interface should be implemented by a customization that wants to have specific checking of a Behavior Rule to see if the current request matches the definition of the rule. The custom implementation will be called in the following situations:
    • If a Variable has a type which is not one of the supported values (CURRENTDATE, NVP, PARENTCATEGORY, REFERRAL, REFERRALNVP). In this scenario, the method getCustomVariableType() will return the custom defined type. The desired values specified by the Behavior Rule can be retrieved from the method getRuleValues. For the name parameter specified in the Variable, the value from the current URL can be retrieved with the method getCurrentValue.
    • If the comparison value is not one of the supported values (=, any, recordAll, containAll, start, end, contain). In this scenario, the method getCustomVariableType() will return null. The desired values specified by the Behavior Rule can be retrieved from the method getRuleValues and the actual value from the current request can be retrieved from the method getCurrentValue.
    If the custom check determines that the rule criteria has been matched, then the method getReturnValue should return the entry from the behavior rule values that matched against the current request. The complete definition of the Behavior Rule is available from the other methods in this interface. The custom implementation should be registered in the CMDREG database table.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
      • CLASSNAME

        public static final java.lang.String CLASSNAME
        The name of this class.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UserBehaviorRuleTaskCmdImpl

        public UserBehaviorRuleTaskCmdImpl()
    • Method Detail

      • setRuleValues

        public void setRuleValues(java.util.List newRuleValues)
        This method sets the list of strings which are the values defined in the behavior rule for which to check for a match against the current request.
        Specified by:
        setRuleValues in interface UserBehaviorRuleTaskCmd
        Parameters:
        newRuleValues - A list of strings.
      • setCurrentValue

        public void setCurrentValue(java.lang.String newCurrentValue)
        This method sets the value of the parameter in the current request which should be checked against the values defined in the behavior rule.
        Specified by:
        setCurrentValue in interface UserBehaviorRuleTaskCmd
        Parameters:
        newCurrentValue - The value of the applicable parameter.
      • setCaseSensitiveMatch

        public void setCaseSensitiveMatch(boolean newCaseSensitiveMatch)
        This method sets if the rule is configured to perform a case sensitive match.
        Specified by:
        setCaseSensitiveMatch in interface UserBehaviorRuleTaskCmd
        Parameters:
        newCaseSensitiveMatch - The flag if the match should be case sensitive.
      • setComparison

        public void setComparison(java.lang.String newComparison)
        This method sets the comparison method to be used.
        Specified by:
        setComparison in interface UserBehaviorRuleTaskCmd
        Parameters:
        newComparison - The comparison method to be used. This can be any custom string defined in the behavior rule.
      • setCustomVariableType

        public void setCustomVariableType(java.lang.String newCustomVariableType)
        This method sets the custom variable type defined.
        Specified by:
        setCustomVariableType in interface UserBehaviorRuleTaskCmd
        Parameters:
        newCustomVariableType - The custom variable type defined. This can be any custom string defined in the behavior rule.
      • setUserBehaviorRule

        public void setUserBehaviorRule(UserBehaviorRule newUserBehaviorRule)
        This method sets the UserBehaviorRule business object associated with the behavior rule being evaluated.
        Specified by:
        setUserBehaviorRule in interface UserBehaviorRuleTaskCmd
        Parameters:
        newUserBehaviorRule - A UserBehaviorRule business object.
      • setTriggerParameters

        public void setTriggerParameters(java.lang.String newTriggerParameters)
        This method sets the trigger parameters associated with the current request. It is preferable to use the Map representation of the trigger parameters than the String representation.
        Specified by:
        setTriggerParameters in interface UserBehaviorRuleTaskCmd
        Parameters:
        newTriggerParameters - A string representing the trigger parameters.
      • setTriggerParameters

        public void setTriggerParameters(java.util.Map newTriggerParameters)
        This method sets the trigger parameters associated with the current request. It is preferable to use the Map representation of the trigger parameters than the String representation.
        Specified by:
        setTriggerParameters in interface UserBehaviorRuleTaskCmd
        Parameters:
        newTriggerParameters - A map representing the trigger parameters.
      • setReferralUrl

        public void setReferralUrl(java.lang.String newReferralUrl)
        This method sets the referral URL associated with the current request.
        Specified by:
        setReferralUrl in interface UserBehaviorRuleTaskCmd
        Parameters:
        newReferralUrl - A string representing the referral URL.
      • getRuleValues

        public java.util.List getRuleValues()
        This method gets the list of strings which are the values defined in the behavior rule for which to check for a match against the current request.
        Returns:
        A list of strings.
      • getCurrentValue

        public java.lang.String getCurrentValue()
        This method gets the value of the parameter in the current request which should be checked against the values defined in the behavior rule.
        Returns:
        The value of the applicable parameter.
      • getCaseSensitiveMatch

        public boolean getCaseSensitiveMatch()
        This method gets if the rule is configured to perform a case sensitive match.
        Returns:
        The flag if the match should be case sensitive.
      • getComparison

        public java.lang.String getComparison()
        This method gets the comparison method to be used.
        Returns:
        The comparison method to be used. This can be any custom string defined in the behavior rule.
      • getCustomVariableType

        public java.lang.String getCustomVariableType()
        This method gets the custom variable type defined.
        Returns:
        The custom variable type defined. This can be any custom string defined in the behavior rule.
      • getUserBehaviorRule

        public UserBehaviorRule getUserBehaviorRule()
        This method gets the UserBehaviorRule business object associated with the behavior rule being evaluated.
        Returns:
        A UserBehaviorRule business object.
      • getTriggerParameters

        public java.lang.String getTriggerParameters()
        This method gets the trigger parameters associated with the current request.
        Returns:
        A string representing the trigger parameters.
      • getTriggerParametersMap

        public java.util.Map getTriggerParametersMap()
        This method gets the trigger parameters associated with the current request.
        Returns:
        A map representing the trigger parameters.
      • getReferralUrl

        public java.lang.String getReferralUrl()
        This method gets the referral URL associated with the current request.
        Returns:
        A string representing the referral URL.
      • getReturnValue

        public java.lang.String getReturnValue()
        This method gets the value from the rules values that matched. If a match was not made, then null should be returned. If a match is made, then the rule value should be returned, and not the value from the current request that satisfied the rule. The default implementation of this method returns null.
        Specified by:
        getReturnValue in interface UserBehaviorRuleTaskCmd
        Returns:
        The value from the rules that satisfied the rule definition.