com.ibm.commerce.marketing.facade.server.commands

Class ProcessMarketingTriggerSendTriggersActionCmdImpl

  • All Implemented Interfaces:
    AbstractProcessNounActionCmd, ProcessMarketingTriggerActionCmd, 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 ProcessMarketingTriggerSendTriggersActionCmdImpl
    extends ProcessMarketingTriggerActionCmdImpl
    implements ProcessMarketingTriggerActionCmd
    This command handles the processing of various marketing triggers. This command is called by the SendMarketingTriggers scheduled job to handle the following triggers:
    • determine the wait timer triggers that are ready to be processed and forward them to the marketing engine.
    • find any e-mail activities that are ready to be sent
    • process any 'users belonging to segment' triggers by finding the users in the segment, and sending that trigger for each user. This processing should only happen once a day at the configured time.
    The frequency for which this command is run is set in the SCHCONFIG table for the SendMarketingTriggers entry.
    See Also:
    Serialized Form
    • Field Detail

      • SCHEDULE_RUN_ONCE

        public static final java.lang.String SCHEDULE_RUN_ONCE
        Constant for setting the repeat schedule to run only once for processing triggers determined by the marketing services.
        See Also:
        Constant Field Values
      • SCHEDULE_RUN_DAILY

        public static final java.lang.String SCHEDULE_RUN_DAILY
        Constant for setting the repeat schedule to run daily for processing triggers determined by the marketing services.
        See Also:
        Constant Field Values
      • PARAM_REPEAT_SCHEUDLE

        public static final java.lang.String PARAM_REPEAT_SCHEUDLE
        Constant for setting the repeat schedule for processing triggers determined by the marketing services.
        See Also:
        Constant Field Values
      • DMTRIGSND_PROCESS_ON_COMMAND_EXIT_WAIT

        public static final java.lang.String DMTRIGSND_PROCESS_ON_COMMAND_EXIT_WAIT
        This string is used when putting entries in DMTRIGSND when the wait timer is from the Process On Command Exit path of detecting a trigger. The personalization ID will have the form pznIdMKTyyyy-mm-dd hh:mm:ss.nnnnnn
        See Also:
        Constant Field Values
    • Constructor Detail

      • ProcessMarketingTriggerSendTriggersActionCmdImpl

        public ProcessMarketingTriggerSendTriggersActionCmdImpl()
    • Method Detail

      • performExecute

        public void performExecute()
                            throws java.lang.Exception
        This method calls the marketing runtime with the wait timer triggers that are ready to be processed and with the bulk email activities that are ready to be processed. It also calls the method processRepeatTriggers once a day at the time configured in wc-admin-component.xml. This allows for handling of triggers that should be determined by the marketing services once a day at the configured time. This handles triggers such as Customers Is In Segment, as well as triggers that can run daily such as Customer Abandons Shopping Cart.
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class ProcessMarketingTriggerActionCmdImpl
        Throws:
        java.lang.Exception
      • processTimeBasedTriggers

        public void processTimeBasedTriggers(java.sql.Timestamp currentTime)
        This method calls the marketing runtime with the wait timer triggers that are ready to be processed. The wait triggers are found in the DMTRIGSND database table. Once a trigger is forwarded to the marketing engine, the database entry is deleted.
        Parameters:
        currentTime - The current time.
      • processBulkEmailActivities

        public void processBulkEmailActivities(java.sql.Timestamp currentTime)
        This method calls the marketing runtime with the bulk email activities that are ready to be processed. An e-mail activity is ready to be processed when it is past the start date, and the e-mail activity has not been sent yet.
        Parameters:
        currentTime - The current time.
      • processExpiredActivities

        public void processExpiredActivities(java.sql.Timestamp currentTime)
        This method finds any expired activities and calls the marketing runtime to deactivate them. An expired activity is one for which the end date is not null and the current time is after the end date.
        Parameters:
        currentTime - The current time.
      • processRepeatTriggers

        public void processRepeatTriggers(java.sql.Timestamp currentTime)
        This method is used to handle the triggers that should be determined and sent once a day. The 'Customer Is In Segment' and 'Customer Abandons Shopping Cart' triggers are processed by this method. This method is called once a day at the time configured in wc-admin-component.xml. For all the elements that have the repeatSchedule name-value pair, the forwardTriggersForProcessing method will be called on the task command defined in the element implementation XML. This is done for all elements associated with active activities within the start and end dates defined in the activity.
        Parameters:
        currentTime - The current time.
      • needToProcessScheduledJob

        public boolean needToProcessScheduledJob(java.sql.Timestamp currentTime,
                                                 java.lang.Integer activityId,
                                                 java.lang.Integer storeId)
        This method checks if the trigger processing needs to happen. It checks the DMACTATTR database table to see if this activity has already been processed within the time defined in the repeat schedule parameter.
        Parameters:
        currentTime - The current time.
        activityId - The activity identifier associated with the trigger.
        storeId - The store identifier associated with the activity.
        Returns:
        This method returns if the trigger should be processed.
      • needToProcessScheduledJobBasedOnRepeatSchedule

        public boolean needToProcessScheduledJobBasedOnRepeatSchedule(java.lang.String repeatSchedule,
                                                                      java.sql.Timestamp currentTime,
                                                                      java.util.Date lastScheduledJobRun)
        This method checks if the trigger processing needs to happen based on the time defined in the repeat schedule parameter. Values for the repeat schedule parameter that are currently handled by this method are : runDaily.
        Parameters:
        repeatSchedule - The repeat schedule set for the trigger campaign element.
        currentTime - The current time.
        lastScheduledJobRun - The last time the trigger was processed.
        Returns:
        This method returns if the trigger should be processed.