com.ibm.commerce.marketing.commands.elements

Class MarketingCampaignElementTaskCmdImpl

  • java.lang.Object
    • com.ibm.websphere.command.TargetableCommandImpl
      • com.ibm.websphere.command.CacheableCommandImpl
        • com.ibm.commerce.marketing.commands.elements.MarketingCampaignElementTaskCmdImpl
    • 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.
      static java.lang.String DM_FROM_FORWARD_TRIGGERS_FOR_PROCESSING
      A constant indicating that the dialog activity processing is coming from a batch dialog activity like Customer Abandons Cart, Customer is in Segment, or Customer Birthday.
      static java.lang.String EMLPROMO_NAME_PREFIX
      The prefix used when creating email activities.
      static java.lang.String GENERIC_USER_ID
      Constant for the generic user id.
      • 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
      void addEMarketingSpotDataBean(EMarketingSpotDataBean emsDataBean)
      This method sets an EMarketingSpotDataBean data bean that contains the information of what to display in an e-Marketing Spot.
      void forwardTriggersForProcessing()
      This method finds all the users associated with a Trigger element, and forwards the trigger for each user.
      void forwardTriggersForProcessing(java.util.List userList, java.lang.Integer activityId, java.lang.Integer campaignElementId, java.lang.Integer storeId)
      This method takes a list of users and forwards the trigger for each user.
      Activity getActivity()
      This method gets the activity business object associated with the element.
      java.lang.String getDataFromTriggerParameters(java.lang.String type)
      This method gets the specified information from the trigger parameters.
      java.lang.Integer getElementId()
      This method gets the ID of the element.
      java.util.Map getElementParameters()
      This method gets the parameters to evaluate the target or perform the action.
      java.util.List getEMarketingSpotDataBeans()
      This method returns to the marketing services the list of EMarketingSpotDataBean objects that contain the information of what to display to the customer in the e-Marketing Spot.
      java.util.List getExperimentTestElements()
      This method gets the the set of experiments and test elements that have been passed along the activity flow.
      MarketingContentType getMarketingContent(java.lang.String marketingContentId)
      This method gets the marketing content business object for the input marketing content ID.
      java.lang.String getMarketingSpotBehavior(java.util.Map elementParameters)
      This method gets the caching behavior for the marketing campaign element and how it should affect the e-Marketing Spot caching behavior.
      java.lang.Long getMemberId()
      This method gets the member ID of the current user.
      java.lang.Long getMemberId(boolean excludeGenericUser)
      This method gets the member ID of the current user.
      java.lang.Long[] getMemberIdsForPersonalizationId()
      This method returns the set of member IDs associated with the customer.
      java.lang.Long[] getMemberIdsForPersonalizationId(boolean excludeGenericUser)
      This method returns the set of member IDs associated with the customer.
      java.util.Map getNewElementParameters()
      This method gets the new element parameters that were created in the DMELEMENTNVP table for this element during activation of the activity.
      java.lang.String getPersonalizationId()
      This method gets the personalization ID of the current user.
      java.util.List getPreviewReport()
      This method gets the list of information about the activity evaluation on the e-Marketing Spot.
      java.lang.Long getRegisteredMemberIdForPersonalizationId()
      This method returns the registered member ID associated with the customer.
      boolean getReturnValue()
      This method returns the return value set by the task command implementation.
      java.lang.Integer getStoreId()
      This method gets the ID of the current store.
      java.util.Map getTemporarySharedData()
      This method returns the map used to store temporary data that can be passed between all the campaign elements when evaluating an e-Marketing Spot.
      java.lang.Object getTemporarySharedDataObject(java.lang.String key)
      This method gets the data stored in the temporary data map that is passed between all the campaign elements when evaluating an e-Marketing Spot.
      java.lang.String getTriggerParameters()
      This methods gets the trigger parameters.
      java.util.Map getTriggerParametersMap()
      This methods gets the trigger parameters.
      java.lang.String getUserDataForElement(java.lang.String personalizationId, java.lang.String campaignElementId)
      This method returns the string containing the customer's behavior for the specified campaign element.
      boolean isReadyToCallExecute()
      This method returns true.
      void performExecute()
      This method performs no actions.
      void putTemporarySharedDataObject(java.lang.String key, java.lang.Object obj)
      This method put data into the temporary data map that is passed between all the campaign elements when evaluating an e-Marketing Spot.
      void returnEMarketingSpotDataBeans()
      This method returns to the marketing services the list of EMarketingSpotDataBean objects that contain the information of what to display to the customer in the e-Marketing Spot.
      void setActivity(Activity newActivity)
      This method sets the activity business object associated with the element.
      void setElementId(java.lang.Integer newElementId)
      This method sets the ID of the element.
      void setElementParameters(java.util.Map newParameters)
      This method sets the parameters associated with the element.
      void setExperimentTestElements(java.util.List newExperimentTestElements)
      This method sets the set of experiments and test elements that have been passed along the activity flow.
      void setNewElementParameter(java.lang.String name, java.lang.String value)
      This method sets that a new element parameter has been created in the DMELEMENTNVP table for this element during activation of the activity.
      void setOutputProperties(com.ibm.websphere.command.TargetableCommand fromCommand)
      Sets the output properties by copying them from another instance of this command.
      void setPreviewReport(java.util.List newPreviewReport)
      This method sets the list of information about the activity evaluation on the e-Marketing Spot.
      void setReturnValue(boolean newValue)
      This method sets the return value of the task command.
      void setTemporarySharedData(java.util.Map newTemporarySharedData)
      This method sets the map used to store temporary data that can be passed between all the campaign elements when evaluating an e-Marketing Spot.
      void setTriggerParameters(java.util.Map newTriggerParameters)
      This method sets the trigger parameters.
      void setTriggerParameters(java.lang.String newTriggerParameters)
      This method sets the trigger parameters.
      void validateCategory(java.lang.String categoryId, java.util.List validationErrors)
      This method validates that the specified category exists in the CATGROUP database table.
      void validateCustomerSegment(java.lang.String segmentId, java.util.List validationErrors)
      This method validates that the specified customer segment exists in the MBRGRP database table.
      void validateDates(java.util.Map elementParameters, java.util.List validationErrors)
      This method validates that the specified date parameters are valid.
      void validateElementIsFirstInActivity(java.util.List validationErrors, java.lang.String errorKey)
      This method validates that the element is the first element in the top level path of the activity flow definition.
      void validateEmailTemplate(java.lang.String emailTemplateId, java.util.List validationErrors)
      This method validates that the specified e-mail template exists in the EMLMSG database table.
      void validateMarketingContent(MarketingContentType marketingContent, java.util.List validationErrors)
      This method validates that the specified marketing content exists.
      void validateMarketingContent(java.lang.String marketingContentId, java.util.List validationErrors)
      This method validates that the specified marketing content exists in the COLLATERAL database table.
      void validateMarketingSpot(java.lang.String emsId, java.util.List validationErrors)
      This method validates that the specified eMarketing Spot exists in the EMSPOT database table.
      java.util.List validateParameters(java.util.Map elementParameters)
      This method validates that all the required name value pairs have been set for the campaign element.
      void validateProduct(java.lang.String catalogEntryId, java.util.List validationErrors)
      This method validates that the specified product exists in the CATENTRY database table.
      void validatePromotion(java.lang.String promotionId, java.util.List validationErrors)
      This method validates that the specified promotion exists in the PX_PROMOTION database table.
      void validatePromotionCodes(java.lang.String promotionId, boolean hasExactlyOneCode, java.util.List validationErrors)
      This method validates that the specified promotion exists, and that it is of code type.
      void validatePromotionCodesOrCoupon(java.lang.String promotionId, boolean hasExactlyOneCode, java.util.List validationErrors, boolean allowCouponPromotion)
      This method validates that the specified promotion exists, and that it is of code type.
      void validatePromotionCoupon(java.lang.String promotionId, java.util.List validationErrors)
      This method validates that the specified promotion exists, and that it is of type coupon.
      void validatePromotionDisplay(java.lang.String promotionId, java.util.List validationErrors)
      This method validates that the specified promotion exists, and that if the promotion requires a promotion code, then the promotion specifies one and only one code.
      boolean validateSubscription(java.lang.String catalogEntryId, java.util.List validationErrors)
      This method validates that the specified subscription catentry exists in the CATENTRY database table.
      void validateTimes(java.util.Map elementParameters, java.util.List validationErrors)
      This method validates that the specified number of times parameters are valid.
      • 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, 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.CacheableCommand

        executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
      • Methods inherited from interface com.ibm.websphere.command.TargetableCommand

        getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName
      • Methods inherited from interface com.ibm.websphere.command.Command

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

        unionDependencies
    • 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
      • EMLPROMO_NAME_PREFIX

        public static final java.lang.String EMLPROMO_NAME_PREFIX
        The prefix used when creating email activities.
        See Also:
        Constant Field Values
      • DM_FROM_FORWARD_TRIGGERS_FOR_PROCESSING

        public static final java.lang.String DM_FROM_FORWARD_TRIGGERS_FOR_PROCESSING
        A constant indicating that the dialog activity processing is coming from a batch dialog activity like Customer Abandons Cart, Customer is in Segment, or Customer Birthday.
        See Also:
        Constant Field Values
      • GENERIC_USER_ID

        public static final java.lang.String GENERIC_USER_ID
        Constant for the generic user id.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MarketingCampaignElementTaskCmdImpl

        public MarketingCampaignElementTaskCmdImpl()
    • Method Detail

      • getTriggerParameters

        public java.lang.String getTriggerParameters()
        This methods gets the trigger parameters. These are the trigger parameters associated with the current request. It is preferable to use the Map representation of the trigger parameters than the String representation.
        Returns:
        This methods returns the trigger parameters.
      • getTriggerParametersMap

        public java.util.Map getTriggerParametersMap()
        This methods gets the trigger parameters. These are the trigger parameters associated with the current request. It is preferable to use the Map representation of the trigger parameters than the String representation.
        Returns:
        This methods returns the trigger parameters.
      • getActivity

        public Activity getActivity()
        This method gets the activity business object associated with the element.
        Returns:
        This method returns the activity business object associated with the element.
      • getElementId

        public java.lang.Integer getElementId()
        This method gets the ID of the element.
        Returns:
        This method returns the ID of the element.
      • getElementParameters

        public java.util.Map getElementParameters()
        This method gets the parameters to evaluate the target or perform the action.
        Returns:
        The name value pairs to provide to the task command implementation.
      • getExperimentTestElements

        public java.util.List getExperimentTestElements()
        This method gets the the set of experiments and test elements that have been passed along the activity flow.
        Returns:
        The the set of experiments and test elements that have been passed along the activity flow.
      • setElementParameters

        public void setElementParameters(java.util.Map newParameters)
        This method sets the parameters associated with the element. The parameters are from the element template definition along with the data in the DMELEMENTNVP database table.
        Specified by:
        setElementParameters in interface MarketingCampaignElementTaskCmd
        Parameters:
        newParameters - The name value pairs available to the task command implementation.
      • setExperimentTestElements

        public void setExperimentTestElements(java.util.List newExperimentTestElements)
        This method sets the set of experiments and test elements that have been passed along the activity flow.
        Specified by:
        setExperimentTestElements in interface MarketingCampaignElementTaskCmd
        Parameters:
        newExperimentTestElements - The set of experiments and test elements that have been passed along the activity flow.
      • getReturnValue

        public boolean getReturnValue()
        This method returns the return value set by the task command implementation. For a target element, this means the customer has met or not met the target criteria. For an action, a value of false means the customer should not move past the action in the activity flow.
        Specified by:
        getReturnValue in interface MarketingCampaignElementTaskCmd
        Returns:
        This method returns the return value set by the task command implementation.
      • setReturnValue

        public void setReturnValue(boolean newValue)
        This method sets the return value of the task command. For a target element, this means the customer has met or not met the target criteria. For an action, a value of false means the customer should not move past the action in the activity flow.
        Specified by:
        setReturnValue in interface MarketingCampaignElementTaskCmd
        Parameters:
        newValue - The return value of the task command.
      • setTriggerParameters

        public void setTriggerParameters(java.lang.String newTriggerParameters)
        This method sets the trigger parameters. These are 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 MarketingCampaignElementTaskCmd
        Parameters:
        newTriggerParameters - The trigger parameters from the current request.
      • setTriggerParameters

        public void setTriggerParameters(java.util.Map newTriggerParameters)
        This method sets the trigger parameters. These are 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 MarketingCampaignElementTaskCmd
        Parameters:
        newTriggerParameters - The trigger parameters from the current request.
      • setTemporarySharedData

        public void setTemporarySharedData(java.util.Map newTemporarySharedData)
        This method sets the map used to store temporary data that can be passed between all the campaign elements when evaluating an e-Marketing Spot. The cached data currently stores shopping cart and purchase history queries. This avoids multiple queries to the ORDER and ORDERITEM tables to get the same information. As well, this avoids calls to catalog to get the parent categories of the items in an order. The cached data is available to all campaign elements called in a single e-Marketing Spot evaluation, even if the campaign elements are in different activities. Any data that needs to be passed between elements in an activity evaluation can be set into this map.
        Specified by:
        setTemporarySharedData in interface MarketingCampaignElementTaskCmd
        Parameters:
        newTemporarySharedData - The map of temporary data to share between campaign elements.
      • getTemporarySharedData

        public java.util.Map getTemporarySharedData()
        This method returns the map used to store temporary data that can be passed between all the campaign elements when evaluating an e-Marketing Spot. The cached data currently stores shopping cart and purchase history queries. This avoids multiple queries to the ORDER and ORDERITEM tables to get the same information. As well, this avoids calls to catalog to get the parent categories of the items in an order. The cached data is available to all campaign elements called in a single e-Marketing Spot evaluation, even if the campaign elements are in different activities. Any data that needs to be passed between elements in an activity evaluation can be set into this map.
        Returns:
        The map that stores temporary data.
      • getTemporarySharedDataObject

        public java.lang.Object getTemporarySharedDataObject(java.lang.String key)
        This method gets the data stored in the temporary data map that is passed between all the campaign elements when evaluating an e-Marketing Spot. The cached data currently stores shopping cart and purchase history queries. This avoids multiple queries to the ORDER and ORDERITEM tables to get the same information. As well, this avoids calls to catalog to get the parent categories of the items in an order. The cached data is available to all campaign elements called in a single e-Marketing Spot evaluation, even if the campaign elements are in different activities. Any data that needs to be passed between elements in an activity evaluation can be set into this map.
        Parameters:
        key - The cache key to use when getting and putting data in the temporary shared data map.
        Returns:
        The data stored in the temporary data map under the specified key.
      • putTemporarySharedDataObject

        public void putTemporarySharedDataObject(java.lang.String key,
                                                 java.lang.Object obj)
        This method put data into the temporary data map that is passed between all the campaign elements when evaluating an e-Marketing Spot. The cached data currently stores shopping cart and purchase history queries. This avoids multiple queries to the ORDER and ORDERITEM tables to get the same information. As well, this avoids calls to catalog to get the parent categories of the items in an order. The cached data is available to all campaign elements called in a single e-Marketing Spot evaluation, even if the campaign elements are in different activities. Any data that needs to be passed between elements in an activity evaluation can be set into this map.
        Parameters:
        key - The cache key to use when getting and putting data in the temporary shared data map.
        obj - The data to store in the temporary data map under the specified key.
      • setActivity

        public void setActivity(Activity newActivity)
        This method sets the activity business object associated with the element.
        Specified by:
        setActivity in interface MarketingCampaignElementTaskCmd
        Parameters:
        newActivity - The activity business object associated with the element.
      • setElementId

        public void setElementId(java.lang.Integer newElementId)
        This method sets the ID of the element.
        Specified by:
        setElementId in interface MarketingCampaignElementTaskCmd
        Parameters:
        newElementId - The ID of the element.
      • getStoreId

        public java.lang.Integer getStoreId()
        This method gets the ID of the current store.
        Returns:
        This method returns the ID of the current store.
      • getPersonalizationId

        public java.lang.String getPersonalizationId()
        This method gets the personalization ID of the current user.
        Returns:
        This method returns the personalization ID of the current user.
      • getMemberId

        public java.lang.Long getMemberId()
        This method gets the member ID of the current user.
        Returns:
        This method returns the member ID of the current user.
      • getMemberId

        public java.lang.Long getMemberId(boolean excludeGenericUser)
        This method gets the member ID of the current user. If the parameter excludeGenericUser is true, then this method will not return a value if the current user is the generic user (-1002). If the parameter excludeGenericUser is false, then this method may return the generic user member ID.
        Parameters:
        excludeGenericUser - If this is true, do not return a value if the user is the generic user.
        Returns:
        This method returns the member ID of the current user.
      • getMemberIdsForPersonalizationId

        public java.lang.Long[] getMemberIdsForPersonalizationId()
        This method returns the set of member IDs associated with the customer. The member IDs are retrieved from the member ID in the customer's trigger parameters along with the member IDs associated with the customer's personalization ID.
        Returns:
        This method returns an array of member IDs associated with the a customer.
      • getMemberIdsForPersonalizationId

        public java.lang.Long[] getMemberIdsForPersonalizationId(boolean excludeGenericUser)
        This method returns the set of member IDs associated with the customer. The member IDs are retrieved from the member ID in the customer's trigger parameters along with the member IDs associated with the customer's personalization ID. If the parameter excludeGenericUser is true, then this method will not return the generic user (-1002) in the member ID list. If the parameter excludeGenericUser is false, then this method may return the generic user member ID in the returned member ID list.
        Parameters:
        excludeGenericUser - If this is true, do not include the generic user.
        Returns:
        This method returns an array of member IDs associated with the a customer.
      • getRegisteredMemberIdForPersonalizationId

        public java.lang.Long getRegisteredMemberIdForPersonalizationId()
        This method returns the registered member ID associated with the customer. In the case where there is more than one memberId for this customer, the first registered user is returned. If no registered user is found, this method will return the member ID for the most recent member ID that is associated with the customer.
        Returns:
        This method returns the registered member ID that corresponds to the customer. If the customer is not a registered user, it returns the member ID for the most recent member ID that is associated with the customer.
      • 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
      • validateParameters

        public java.util.List validateParameters(java.util.Map elementParameters)
        This method validates that all the required name value pairs have been set for the campaign element. This default implementation does no checking and should be overridden by any implementations that extend this class that wish to have validation of the element when an activity is activated.
        Specified by:
        validateParameters in interface MarketingCampaignElementTaskCmd
        Parameters:
        elementParameters - The name value pairs for this element.
        Returns:
        This method returns a list of ApplicationError exceptions that contains any validation errors. The list may be empty or be null.
      • 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.
      • getUserDataForElement

        public java.lang.String getUserDataForElement(java.lang.String personalizationId,
                                                      java.lang.String campaignElementId)
        This method returns the string containing the customer's behavior for the specified campaign element. The string is in the format:
        data1,time1,data2,time2,data3,time3
        Parameters:
        personalizationId - The customer's personalization ID.
        campaignElementId - The ID of the flow element for which we want the customer's behavior.
        Returns:
        This method returns the comma delimited string containing the customer's behavior for a single flow element. The string is a comma delimited list of pairs of data,date.
      • validateMarketingSpot

        public void validateMarketingSpot(java.lang.String emsId,
                                          java.util.List validationErrors)
        This method validates that the specified eMarketing Spot exists in the EMSPOT database table.
        Parameters:
        emsId - The ID of the eMarketing Spot to verify.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validateCategory

        public void validateCategory(java.lang.String categoryId,
                                     java.util.List validationErrors)
        This method validates that the specified category exists in the CATGROUP database table.
        Parameters:
        categoryId - The ID of the category to verify.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validateProduct

        public void validateProduct(java.lang.String catalogEntryId,
                                    java.util.List validationErrors)
        This method validates that the specified product exists in the CATENTRY database table.
        Parameters:
        catalogEntryId - The ID of the product to verify.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validateSubscription

        public boolean validateSubscription(java.lang.String catalogEntryId,
                                            java.util.List validationErrors)
        This method validates that the specified subscription catentry exists in the CATENTRY database table.
        Parameters:
        catalogEntryId - The ID of the subscription catentry to verify.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
        Returns:
        Whether or not the catalogEntryId is a valid subscription catentry.
      • getMarketingContent

        public MarketingContentType getMarketingContent(java.lang.String marketingContentId)
        This method gets the marketing content business object for the input marketing content ID.
        Parameters:
        marketingContentId - The ID of the marketing content
        Returns:
        This method returns the marketing content business object for the specified ID.
      • validateMarketingContent

        public void validateMarketingContent(java.lang.String marketingContentId,
                                             java.util.List validationErrors)
        This method validates that the specified marketing content exists in the COLLATERAL database table.
        Parameters:
        marketingContentId - The ID of the marketing content to verify.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validateMarketingContent

        public void validateMarketingContent(MarketingContentType marketingContent,
                                             java.util.List validationErrors)
        This method validates that the specified marketing content exists.
        Parameters:
        marketingContent - The marketing content to verify.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validateEmailTemplate

        public void validateEmailTemplate(java.lang.String emailTemplateId,
                                          java.util.List validationErrors)
        This method validates that the specified e-mail template exists in the EMLMSG database table.
        Parameters:
        emailTemplateId - The ID of the e-mail template to verify.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validateCustomerSegment

        public void validateCustomerSegment(java.lang.String segmentId,
                                            java.util.List validationErrors)
        This method validates that the specified customer segment exists in the MBRGRP database table.
        Parameters:
        segmentId - The ID of the customer segment to verify.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validatePromotion

        public void validatePromotion(java.lang.String promotionId,
                                      java.util.List validationErrors)
        This method validates that the specified promotion exists in the PX_PROMOTION database table.
        Parameters:
        promotionId - The ID of the promotion to verify.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validatePromotionDisplay

        public void validatePromotionDisplay(java.lang.String promotionId,
                                             java.util.List validationErrors)
        This method validates that the specified promotion exists, and that if the promotion requires a promotion code, then the promotion specifies one and only one code.
        Parameters:
        promotionId - The ID of the promotion to verify.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validatePromotionCoupon

        public void validatePromotionCoupon(java.lang.String promotionId,
                                            java.util.List validationErrors)
        This method validates that the specified promotion exists, and that it is of type coupon.
        Parameters:
        promotionId - The ID of the promotion to verify.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validatePromotionCodes

        public void validatePromotionCodes(java.lang.String promotionId,
                                           boolean hasExactlyOneCode,
                                           java.util.List validationErrors)
        This method validates that the specified promotion exists, and that it is of code type.
        Parameters:
        promotionId - The ID of the promotion to verify.
        hasExactlyOneCode - Check that this promotion has exactly one promotion code. This condition is checked only if the promotion is a code promotion.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validatePromotionCodesOrCoupon

        public void validatePromotionCodesOrCoupon(java.lang.String promotionId,
                                                   boolean hasExactlyOneCode,
                                                   java.util.List validationErrors,
                                                   boolean allowCouponPromotion)
        This method validates that the specified promotion exists, and that it is of code type. If allowCouponPromotion is true, then the promotion may also be of coupon type.
        Parameters:
        promotionId - The ID of the promotion to verify.
        hasExactlyOneCode - Check that this promotion has exactly one promotion code. This condition is checked only if the promotion is a code promotion.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
        allowCouponPromotion - Check that this promotion is a coupon promotion.
      • validateDates

        public void validateDates(java.util.Map elementParameters,
                                  java.util.List validationErrors)
        This method validates that the specified date parameters are valid. This methods checks that if any of the following parameters are specified, that the parameters are correct and consistent: daysOperator, days, beforeAfterOnDate, date1, beforeDate, and date2.
        Parameters:
        elementParameters - The name value pairs for this element.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validateTimes

        public void validateTimes(java.util.Map elementParameters,
                                  java.util.List validationErrors)
        This method validates that the specified number of times parameters are valid. This methods checks that if any of the following parameters are specified, that the parameters are correct and consistent: numberOfTimesOperator, and numberOfTimes.
        Parameters:
        elementParameters - The name value pairs for this element.
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
      • validateElementIsFirstInActivity

        public void validateElementIsFirstInActivity(java.util.List validationErrors,
                                                     java.lang.String errorKey)
        This method validates that the element is the first element in the top level path of the activity flow definition.
        Parameters:
        validationErrors - The list of ApplicationError exceptions that contains any validation errors. The list may be empty.
        errorKey - The error key message to use if the element is not the first in the activity
      • addEMarketingSpotDataBean

        public void addEMarketingSpotDataBean(EMarketingSpotDataBean emsDataBean)
        This method sets an EMarketingSpotDataBean data bean that contains the information of what to display in an e-Marketing Spot.

        The following is an example of how to create the EMarketingSpotDataBean to pass to this method.

                                        EMarketingSpotDataBean emsDataBean = new EMarketingSpotDataBean(
                                                        "MyCustomDataType", "dataValue",
                                                        getActivity(), getElementId(), getExperimentTestElements());
                                        addEMarketingSpotDataBean(emsDataBean); 
         

        For example, to return content with a COLLATERAL_ID of 12345:

                                        EMarketingSpotDataBean emsDataBean = new EMarketingSpotDataBean(
                                                        EMarketingSpotDataBean.DISPLAY_TYPE_MARKETING_CONTENT,
                                                        "12345",
                                                        activity, getElementId(), getExperimentTestElements());
                                        addEMarketingSpotDataBean(emsDataBean); 
         
        The information in the EMarketingSpotDataBean data bean is used to populate the BaseMarketingSpotActivityDataType SDO. For the supported out of the box data types (CatalogEntry, CatalogGroup, MarketingContent), then the information is also used to populate the applicable SDO (MarketingSpotActivityCatalogEntryDataType, MarketingSpotActivityCatalogGroupDataType, MarketingSpotActivityMarketingContentDataType that extends from BaseMarketingSpotActivityDataType). If additional data needs to be returned to the e-Marketing Spot, then this method can be extended, and the method EMarketingSpotDataBean.setNVP can be used to set additional data into the data bean. This data will be available from the getProperties method of the SDO returned to the e-Marketing Spot JSP snippet.

        For example, a campaign element extension can implement this method.

        public void addEMarketingSpotDataBean(EMarketingSpotDataBean emsDataBean) {
        emsDataBean.setNVP("abc", "123");
        emsDataBean.setNVP("def", "456");
        super.addEMarketingSpotDataBean(emsDataBean);
        }

        On the e-Marketing Spot JSP snippet, the individual data can be retrieved:

        ${marketingSpotData.properties['abc']}
        ${marketingSpotData.properties['def']}

        or all the data can be retrieved:

        <c:forEach var="nvp" items="${marketingSpotData.properties}" >
        <c:out value="${nvp.key}: ${nvp.value}" escapeXml="false" / >
        </c:forEach >

        Parameters:
        emsDataBean - The EMarketingSpotDataBean object.
      • returnEMarketingSpotDataBeans

        public void returnEMarketingSpotDataBeans()
        This method returns to the marketing services the list of EMarketingSpotDataBean objects that contain the information of what to display to the customer in the e-Marketing Spot. The method addEMarketingSpotDataBean should be called by the campaign element task command with each EMarketingSpotDataBean. This method is no longer used. The marketing services call the method getEMarketingSpotDataBeans.
        Specified by:
        returnEMarketingSpotDataBeans in interface MarketingCampaignElementTaskCmd
      • getEMarketingSpotDataBeans

        public java.util.List getEMarketingSpotDataBeans()
        This method returns to the marketing services the list of EMarketingSpotDataBean objects that contain the information of what to display to the customer in the e-Marketing Spot. The method addEMarketingSpotDataBean should be called by the campaign element task command with each EMarketingSpotDataBean. The marketing services will call this method to process the data beans that have been set by the task command.
        Specified by:
        getEMarketingSpotDataBeans in interface MarketingCampaignElementTaskCmd
        Returns:
        A list of EMarketingSpotDataBean objects.
      • getDataFromTriggerParameters

        public java.lang.String getDataFromTriggerParameters(java.lang.String type)
        This method gets the specified information from the trigger parameters.
        Parameters:
        type - The type of information to retrieve. It can be one of the following:
        • TRIGGER_PARAM_PERSONALIZATION_ID
        • TRIGGER_PARAM_MEMBER_ID
        • TRIGGER_PARAM_STORE_ID
        • TRIGGER_PARAM_EMS_NAME
        • TRIGGER_PARAM_REQUEST_COMMAND
        • TRIGGER_PARAM_REFERRAL_URL
        • TRIGGER_PARAM_NUMBER_CATEGORIES_TO_DISPLAY
        • TRIGGER_PARAM_NUMBER_PRODUCTS_TO_DISPLAY
        • TRIGGER_PARAM_NUMBER_CONTENT_TO_DISPLAY
        • any custom type
        Returns:
        The specified information type from the trigger parameters.
      • forwardTriggersForProcessing

        public void forwardTriggersForProcessing()
        This method finds all the users associated with a Trigger element, and forwards the trigger for each user. This is used for Triggers which are detected once a day, such as Customer Is In Segment, Customer Abandons Shopping Cart, or Customer Celebrates Birthday.
        Specified by:
        forwardTriggersForProcessing in interface MarketingCampaignElementTaskCmd
      • forwardTriggersForProcessing

        public void forwardTriggersForProcessing(java.util.List userList,
                                                 java.lang.Integer activityId,
                                                 java.lang.Integer campaignElementId,
                                                 java.lang.Integer storeId)
        This method takes a list of users and forwards the trigger for each user. Each user will then participate in the associated dialog activity. This is used for Triggers which are detected once a day, such as Customer Is In Segment, or Customer Abandons Shopping Cart.
        Parameters:
        userList - The list with the customer information. Every element in the list is a child-list; In the child-list, the 1st element is the customer's member ID, and the 2nd element is the customer's personalization ID.
        activityId - The activity for which to forward the trigger.
        campaignElementId - The campaign element ID for which to forward the trigger.
        storeId - The store ID associated with the activity.
      • setPreviewReport

        public void setPreviewReport(java.util.List newPreviewReport)
        This method sets the list of information about the activity evaluation on the e-Marketing Spot.
        Specified by:
        setPreviewReport in interface MarketingCampaignElementTaskCmd
        Parameters:
        newPreviewReport - A list of information about the activity evaluation on the e-Marketing Spot..
      • getPreviewReport

        public java.util.List getPreviewReport()
        This method gets the list of information about the activity evaluation on the e-Marketing Spot.
        Returns:
        A list of information about the activity evaluation on the e-Marketing Spot..
      • setOutputProperties

        public void setOutputProperties(com.ibm.websphere.command.TargetableCommand fromCommand)

        Sets the output properties by copying them from another instance of this command.

        This method is intended to be called by the cacheable command framework. Do not call this method directly.

        Specified by:
        setOutputProperties in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        setOutputProperties in class com.ibm.websphere.command.TargetableCommandImpl
        See Also:
        TargetableCommand.setOutputProperties(com.ibm.websphere.command.TargetableCommand)
      • getMarketingSpotBehavior

        public java.lang.String getMarketingSpotBehavior(java.util.Map elementParameters)
        This method gets the caching behavior for the marketing campaign element and how it should affect the e-Marketing Spot caching behavior.
        Specified by:
        getMarketingSpotBehavior in interface MarketingCampaignElementTaskCmd
        Parameters:
        elementParameters - The name value pairs for this element.
        Returns:
        This method returns a default value of 1 that the marketing campaign element is dynamic. Any campaign element that is static must override this method and return a value of 0.
      • getNewElementParameters

        public java.util.Map getNewElementParameters()
        This method gets the new element parameters that were created in the DMELEMENTNVP table for this element during activation of the activity.
        Specified by:
        getNewElementParameters in interface MarketingCampaignElementTaskCmd
        Returns:
        A Map of name-value pairs.
      • setNewElementParameter

        public void setNewElementParameter(java.lang.String name,
                                           java.lang.String value)
        This method sets that a new element parameter has been created in the DMELEMENTNVP table for this element during activation of the activity.
        Specified by:
        setNewElementParameter in interface MarketingCampaignElementTaskCmd
        Parameters:
        name - The name of the name-value pair.
        value - The value of the name-value pair.