com.ibm.commerce.marketing.commands.elements

Class BehaviorRuleTaskCmdImpl

  • java.lang.Object
    • com.ibm.websphere.command.TargetableCommandImpl
      • com.ibm.websphere.command.CacheableCommandImpl
        • com.ibm.commerce.marketing.commands.elements.BehaviorRuleTaskCmdImpl
  • All Implemented Interfaces:
    BehaviorRuleTaskCmd, 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
    Direct Known Subclasses:
    RankingBrowsedProductCmdImpl


    public class BehaviorRuleTaskCmdImpl
    extends com.ibm.websphere.command.CacheableCommandImpl
    implements BehaviorRuleTaskCmd
    This command should be implemented by customizations that want to do custom processing when a behavior rule is matched. The task command will be passed the definition of the rule that matched, as well as the current request parameters. A behavior rule can be set to call the custom task command by setting the callCmdOnMatch parameter. If the marketing runtime should also process the event, then the behavior rule action should be record or send. If only the custom command should process the event, then the behavior rule action should be custom.

    For example, if the behavior rule matches when CategoryDisplay is called with a categoryId of 10101, and the behavior rule is configured to call a behavior rule task command, the category ID that matched the rule can be retrieved from the behavior rule (getUserBehaviorRule().getNVPs().get("categoryId")) or from the current request parameters (getTriggerParameters().get("categoryId")). In this scenario, the behavior rule looks like the following:

     
        
     
     

    For example, if the behavior rule matches when ProductDisplay is called for any product in categoryId 10101, and the behavior rule is configured to call a behavior rule task command, the category ID that matched the rule can be retrieved from the behavior rule (getUserBehaviorRule().getParentCategories().get(0)) and the product ID that matched the rule can be retrieved from the current request parameters (getTriggerParameters().get("productId")). In this scenario, the behavior rule looks like the following:

     
        
     
     
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CLASSNAME
      The name of this class.
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
      • Fields inherited from class com.ibm.websphere.command.TargetableCommandImpl

        LOCAL
      • Fields inherited from interface com.ibm.websphere.command.Command

        serialVersionUID
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.List getParentCategoriesOfCategory()
      This method gets the list of parent categories of the current category being viewed.
      java.util.List getParentCategoriesOfProduct()
      This method gets the list of parent categories of the current product being viewed.
      java.lang.String getReferralUrl()
      This method gets referral URL associated with the current request.
      java.util.Map getTriggerParameters()
      This method gets the trigger parameters associated with the current request.
      UserBehaviorRule getUserBehaviorRule()
      This method gets the behavior rule that was matched.
      boolean isReadyToCallExecute()
      This method returns true.
      void performExecute()
      This method performs no actions.
      void setParentCategoriesOfCategory(java.util.List categories)
      This method sets the list of parent categories of the current category being viewed.
      void setParentCategoriesOfProduct(java.util.List categories)
      This method sets the list of parent categories of the current product being viewed.
      void setReferralUrl(java.lang.String newReferralUrl)
      This method sets referral URL associated with the current request.
      void setTriggerParameters(java.util.Map newParameters)
      This method sets the trigger parameters associated with the current request.
      void setUserBehaviorRule(UserBehaviorRule newUserBehaviorRule)
      This method sets the behavior rule that was matched.
      • Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl

        execute, executeFromCache, getCaller, getEntryInfo, getId, getObjectSize, getSharingPolicy, postExecute, preExecute, reset, setCaller, setObjectSize, unionDependencies, updateCache
      • Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl

        getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.ibm.websphere.command.Command

        execute, reset
      • Methods inherited from interface com.ibm.websphere.command.TargetableCommand

        getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
    • 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

      • BehaviorRuleTaskCmdImpl

        public BehaviorRuleTaskCmdImpl()
    • Method Detail

      • setTriggerParameters

        public void setTriggerParameters(java.util.Map newParameters)
        This method sets the trigger parameters associated with the current request.
        Specified by:
        setTriggerParameters in interface BehaviorRuleTaskCmd
        Parameters:
        newParameters - A Map containing the trigger parameters.
      • setUserBehaviorRule

        public void setUserBehaviorRule(UserBehaviorRule newUserBehaviorRule)
        This method sets the behavior rule that was matched.
        Specified by:
        setUserBehaviorRule in interface BehaviorRuleTaskCmd
        Parameters:
        newUserBehaviorRule - The behavior rule business object.
      • setReferralUrl

        public void setReferralUrl(java.lang.String newReferralUrl)
        This method sets referral URL associated with the current request.
        Specified by:
        setReferralUrl in interface BehaviorRuleTaskCmd
        Parameters:
        newReferralUrl - The referral URL associated with the current request.
      • getTriggerParameters

        public java.util.Map getTriggerParameters()
        This method gets the trigger parameters associated with the current request.
        Returns:
        A Map containing the trigger parameters.
      • getUserBehaviorRule

        public UserBehaviorRule getUserBehaviorRule()
        This method gets the behavior rule that was matched.
        Returns:
        The behavior rule business object.
      • getReferralUrl

        public java.lang.String getReferralUrl()
        This method gets referral URL associated with the current request.
        Returns:
        The referral URL associated with the current request.
      • setParentCategoriesOfProduct

        public void setParentCategoriesOfProduct(java.util.List categories)
        This method sets the list of parent categories of the current product being viewed.
        Specified by:
        setParentCategoriesOfProduct in interface BehaviorRuleTaskCmd
        Parameters:
        categories - A List of category IDs as strings.
      • setParentCategoriesOfCategory

        public void setParentCategoriesOfCategory(java.util.List categories)
        This method sets the list of parent categories of the current category being viewed.
        Specified by:
        setParentCategoriesOfCategory in interface BehaviorRuleTaskCmd
        Parameters:
        categories - A List of category IDs as strings.
      • getParentCategoriesOfProduct

        public java.util.List getParentCategoriesOfProduct()
        This method gets the list of parent categories of the current product being viewed.
        Returns:
        A List of category IDs as strings.
      • getParentCategoriesOfCategory

        public java.util.List getParentCategoriesOfCategory()
        This method gets the list of parent categories of the current category being viewed.
        Returns:
        A List of category IDs as strings.
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        This method returns true.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Specified by:
        isReadyToCallExecute in class com.ibm.websphere.command.TargetableCommandImpl
        Returns:
        This method returns true.
      • performExecute

        public void performExecute()
        This method performs no actions. Implementations that extend this class need to implement this method.
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Specified by:
        performExecute in class com.ibm.websphere.command.TargetableCommandImpl