com.ibm.commerce.marketing.runtime.engine

Class TriggerHandler

  • java.lang.Object
    • com.ibm.commerce.marketing.runtime.engine.TriggerHandler


  • public class TriggerHandler
    extends java.lang.Object
    This class handles and responds to triggers related to marketing activities.
    • Constructor Summary

      Constructors 
      Constructor and Description
      TriggerHandler()
      This is the default constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void forwardTriggers(java.util.Map triggerParameters, java.lang.String personalizationId, java.lang.Integer storeId, java.util.Map nvpsForSend, java.util.Map nvpsForRecord)
      This method will record user behaviors and forward triggers to the trigger handler.
      void forwardTriggers(java.lang.String triggerParameters, java.lang.String personalizationId, java.lang.Integer storeId, java.util.Map nvpsForSend, java.util.Map nvpsForRecord)
      This method will record user behaviors and forward triggers to the trigger handler.
      java.util.Map getAndResetEmsClicksCounter()
      This method returns the current accumulated statistics for the clicks of EMarketingSpots within an activity flow.
      java.util.Map getAndResetEmsViewsCounter()
      This method returns the current accumulated statistics for the views of EMarketingSpots within an activity flow.
      java.util.Map getAndResetTestElementClicksCounter()
      This method returns the current accumulated statistics for the clicks a test element within an activity experiment.
      java.util.Map getAndResetTestElementViewsCounter()
      This method returns the current accumulated statistics for views of a test element within an activity experiment.
      static java.lang.String getBehaviorSetting(java.lang.String newBehavior, java.lang.String currentBehavior)
      This method returns the appropriate setting for the e-Marketing Spot behavior based on the existing determined value, and the new determined value.
      java.lang.String getEMSBehavior(ActivityTrigger activityTrigger, java.lang.StringBuffer timeLimit)
      This method gets the caching behavior for an e-Marketing Spot.
      void incrementTestElementViewStatistics(java.lang.Integer experimentId, java.lang.Integer testElementId, java.lang.Integer storeId)
      This method increments by one the view statistics for a test element within an activity experiment.
      void incrementViewStatistics(java.lang.Integer activityId, java.lang.Integer emsId, java.lang.Integer storeId)
      This method increments by one the view statistics for an EMarketingSpot within an activity.
      void initialize()
      This method initializes the shared TriggerHandler object.
      static boolean isActivityActive(Activity activity)
      This method returns true if the current activity is active.
      static boolean isActivityActive(java.lang.Integer activityId)
      This method returns true if the current activity is active.
      static boolean isActivityEndDateAfter(Activity activity, java.sql.Timestamp date)
      This method returns true if the activity end date is after the given date.
      static boolean isActivityEndDateAfter(java.lang.Integer activityId, java.sql.Timestamp date)
      This method returns true if the activity end date is after the given date.
      static boolean isActivityEndDateBefore(Activity activity, java.sql.Timestamp date)
      This method returns true if the activity end date is before the given date.
      static boolean isActivityEndDateBefore(java.lang.Integer activityId, java.sql.Timestamp date)
      This method returns true if the activity end date is before the given date.
      static boolean isActivityExpired(Activity activity)
      This method returns true if the current timestamp is after the end date of the activity.
      static boolean isActivityStartDateAfter(Activity activity, java.sql.Timestamp date)
      This method returns true if the activity start date is after the given date.
      static boolean isActivityStartDateAfter(java.lang.Integer activityId, java.sql.Timestamp date)
      This method returns true if the activity start date is after the given date.
      static boolean isActivityStartDateBefore(Activity activity, java.sql.Timestamp date)
      This method returns true if the activity start date is before the given date.
      static boolean isActivityStartDateBefore(java.lang.Integer activityId, java.sql.Timestamp date)
      This method returns true if the activity start date is before the given date.
      static boolean isDateValidForActivity(Activity activity)
      This method returns true if the current timestamp is in the range of valid dates for this activity.
      static boolean isDateValidForActivity(java.lang.Integer activityId)
      This method returns true if the current timestamp is in the range of valid dates for this activity.
      java.util.List raiseEMSTrigger(ActivityTrigger activityTrigger)
      This method handles the display of an EMarketingSpot.
      java.util.List raiseEMSTrigger(ActivityTrigger activityTrigger, java.util.List previewReport, java.util.Map temporarySharedData)
      This method handles the display of an EMarketingSpot.
      boolean raiseTrigger(ActivityTrigger activityTrigger)
      This method handles triggers sent to the trigger handler.
      boolean raiseTrigger(java.lang.String personalizationId, java.util.Map triggerParameters, java.lang.Integer storeId, java.lang.Integer triggerId, Activity activity)
      This method handles timer triggers sent to the trigger handler.
      boolean raiseTrigger(java.lang.String personalizationId, java.util.Map triggerParameters, java.lang.Integer storeId, java.lang.Integer triggerId, Activity activity, java.util.Map temporarySharedData)
      This method handles timer triggers sent to the trigger handler.
      boolean raiseTrigger(java.lang.String personalizationId, java.lang.String triggerParameters, java.lang.Integer storeId, java.lang.Integer triggerId, Activity activity)
      This method handles timer triggers sent to the trigger handler.
      void raiseTrigger(java.lang.String personalizationId, java.lang.String triggerParameters, java.lang.Integer storeId, java.lang.Integer triggerId, java.lang.Integer activityId)
      This method handles timer triggers sent to the trigger handler.
      void recordBehaviorXml(java.lang.String personalizationId, java.util.Map nvps, java.lang.Integer storeId)
      This method records the given values to behavior column in the DMUSERBHVR database table for the specified user.
      void registerTriggerListener(java.lang.String triggerToListenFor, java.util.List nvps, java.lang.Integer activityId, java.lang.Integer storeId, java.lang.Integer triggerId, java.lang.Short allusers)
      This method sets up an activity to start listening for a particular trigger.
      void registerTriggerSender(java.lang.Integer triggerId, java.lang.String personalizationId, java.sql.Timestamp triggerTime, java.lang.String triggerParameters, java.lang.Integer storeId)
      This method sets up a timer trigger to be sent at a particular time in the future.
      void setEMSData(java.lang.String triggerParameters, java.util.List emsDataBeanList)
      This method sets a EMarketingSpotDataBean to be returned to be displayed in an e-Marketing Spot.
      static TriggerHandler singleton()
      This method returns the shared instance of the TriggerHandler object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String TRIGGER_DISPLAYEMS
        Trigger name for DisplayEms.
        See Also:
        Constant Field Values
      • TRIGGER_DISPLAYEMS_PARAMETER_EMS_ID

        public static final java.lang.String TRIGGER_DISPLAYEMS_PARAMETER_EMS_ID
        emsId parameter for DisplayEms.
        See Also:
        Constant Field Values
      • TRIGGER_ACTIVITYACTION

        public static final java.lang.String TRIGGER_ACTIVITYACTION
        Trigger name for ActivityAction.
        See Also:
        Constant Field Values
      • TRIGGER_TIMER

        public static final java.lang.String TRIGGER_TIMER
        Trigger name for Timer.
        See Also:
        Constant Field Values
      • XML_ATTRIBUTE_NAME_ACTIVITY_ID

        public static final java.lang.String XML_ATTRIBUTE_NAME_ACTIVITY_ID
        The activity ID.
        See Also:
        Constant Field Values
      • XML_ATTRIBUTE_ACTION

        public static final java.lang.String XML_ATTRIBUTE_ACTION
        The action to perform.
        See Also:
        Constant Field Values
      • ALL_USERS_TRUE

        public static final java.lang.String ALL_USERS_TRUE
        A constant representing that a trigger handler is for all users.
        See Also:
        Constant Field Values
      • MARKETING_SPOT_BEHAVIOR

        public static final java.lang.String MARKETING_SPOT_BEHAVIOR
        Constant to specify an e-Marketing Spot behavior.
        See Also:
        Constant Field Values
      • MARKETING_SPOT_BEHAVIOR_TIME_LIMIT

        public static final java.lang.String MARKETING_SPOT_BEHAVIOR_TIME_LIMIT
        Constant to specify the time limit when the e-Marketing Spot behavior may change.
        See Also:
        Constant Field Values
      • RETURN_MARKETING_SPOT_BEHAVIOR_TIME_LIMIT

        public static final java.lang.String RETURN_MARKETING_SPOT_BEHAVIOR_TIME_LIMIT
        Constant to specify the service should return the time limit when the e-Marketing Spot behavior may change.
        See Also:
        Constant Field Values
      • MARKETING_SPOT_BEHAVIOR_NO_TIME_LIMIT

        public static final int MARKETING_SPOT_BEHAVIOR_NO_TIME_LIMIT
        Constant to specify the e-Marketing Spot has no specific time limit.
        See Also:
        Constant Field Values
      • MARKETING_SPOT_BEHAVIOR_STATIC

        public static final java.lang.String MARKETING_SPOT_BEHAVIOR_STATIC
        Constant to specify an e-Marketing Spot is static - same results to all customers.
        See Also:
        Constant Field Values
      • MARKETING_SPOT_BEHAVIOR_DYNAMIC

        public static final java.lang.String MARKETING_SPOT_BEHAVIOR_DYNAMIC
        Constant to specify an e-Marketing Spot is dynamic - different results can be displayed.
        See Also:
        Constant Field Values
      • MARKETING_SPOT_BEHAVIOR_DYNAMIC_WITH_REFRESH

        public static final java.lang.String MARKETING_SPOT_BEHAVIOR_DYNAMIC_WITH_REFRESH
        Constant to specify an e-Marketing Spot is dynamic and facet refresh is required. The spot results vary with catalog data, and should be refreshed when catalog facets are selected.
        See Also:
        Constant Field Values
    • Constructor Detail

      • TriggerHandler

        public TriggerHandler()
        This is the default constructor. It currently performs no actions.
    • Method Detail

      • registerTriggerListener

        public void registerTriggerListener(java.lang.String triggerToListenFor,
                                            java.util.List nvps,
                                            java.lang.Integer activityId,
                                            java.lang.Integer storeId,
                                            java.lang.Integer triggerId,
                                            java.lang.Short allusers)
        This method sets up an activity to start listening for a particular trigger.
        Parameters:
        triggerToListenFor - The name of the trigger to listen for.
        nvps - The name value pairs to match in the trigger.
        activityId - The activity ID that should process this trigger.
        storeId - The store ID associated with the activity.
        triggerId - The trigger ID to send to the engine when this trigger is received.
        allusers - Should all users send this trigger to the engine, or only individual users who are specifically waiting for this trigger.
      • registerTriggerSender

        public void registerTriggerSender(java.lang.Integer triggerId,
                                          java.lang.String personalizationId,
                                          java.sql.Timestamp triggerTime,
                                          java.lang.String triggerParameters,
                                          java.lang.Integer storeId)
        This method sets up a timer trigger to be sent at a particular time in the future.
        Parameters:
        triggerId - The trigger ID to send to the engine when this trigger is received.
        personalizationId - The personalization ID associated with the customer.
        triggerTime - The time to raise the timer trigger.
        triggerParameters - The trigger parameters.
        storeId - The ID of the store.
      • isActivityExpired

        public static boolean isActivityExpired(Activity activity)
        This method returns true if the current timestamp is after the end date of the activity.
        Parameters:
        activity - The Activity to check.
        Returns:
        Returns true if the current timestamp is after the end date of the activity, false otherwise.
      • isDateValidForActivity

        public static boolean isDateValidForActivity(java.lang.Integer activityId)
        This method returns true if the current timestamp is in the range of valid dates for this activity. The method also checks if the activity is currently active and returns false if the state of the activity is inactive.
        Parameters:
        activityId - The ID of the activity to check.
        Returns:
        Returns true if the current timestamp is valid for this activity and the activity state is active, false otherwise.
      • isDateValidForActivity

        public static boolean isDateValidForActivity(Activity activity)
        This method returns true if the current timestamp is in the range of valid dates for this activity. The method also checks if the activity is currently active and returns false if the state of the activity is inactive.
        Parameters:
        activity - The Activity to check.
        Returns:
        Returns true if the current timestamp is valid for this activity and the activity state is active, false otherwise.
      • isActivityStartDateBefore

        public static boolean isActivityStartDateBefore(java.lang.Integer activityId,
                                                        java.sql.Timestamp date)
        This method returns true if the activity start date is before the given date.
        Parameters:
        activityId - The ID of the activity to check.
        date - The time to check against.
        Returns:
        Returns true if the activity start date is before the given date (including if the activity start date is null). False otherwise (including if the activity or date are null).
      • isActivityStartDateBefore

        public static boolean isActivityStartDateBefore(Activity activity,
                                                        java.sql.Timestamp date)
        This method returns true if the activity start date is before the given date.
        Parameters:
        activity - The Activity to check.
        date - The time to check against.
        Returns:
        Returns true if the activity start date is before the given date (including if the activity start date is null). False otherwise (including if the activity or date are null).
      • isActivityStartDateAfter

        public static boolean isActivityStartDateAfter(java.lang.Integer activityId,
                                                       java.sql.Timestamp date)
        This method returns true if the activity start date is after the given date.
        Parameters:
        activityId - The ID of the activity to check.
        date - The time to check against.
        Returns:
        Returns true if the activity start date is after the given date. False otherwise (including if the activity start date is null or if the activity or date are null).
      • isActivityStartDateAfter

        public static boolean isActivityStartDateAfter(Activity activity,
                                                       java.sql.Timestamp date)
        This method returns true if the activity start date is after the given date.
        Parameters:
        activity - The Activity to check.
        date - The time to check against.
        Returns:
        Returns true if the activity start date is after the given date. False otherwise (including if the activity start date is null or if the activity or date are null).
      • isActivityEndDateBefore

        public static boolean isActivityEndDateBefore(java.lang.Integer activityId,
                                                      java.sql.Timestamp date)
        This method returns true if the activity end date is before the given date.
        Parameters:
        activityId - The ID of the activity to check.
        date - The time to check against.
        Returns:
        Returns true if the activity end date is before the given date. False otherwise (including if the activity end date is null or if the activity or date are null).
      • isActivityEndDateBefore

        public static boolean isActivityEndDateBefore(Activity activity,
                                                      java.sql.Timestamp date)
        This method returns true if the activity end date is before the given date.
        Parameters:
        activity - The Activity to check.
        date - The time to check against.
        Returns:
        Returns true if the activity end date is before the given date. False otherwise (including if the activity end date is null or if the activity or date are null).
      • isActivityEndDateAfter

        public static boolean isActivityEndDateAfter(java.lang.Integer activityId,
                                                     java.sql.Timestamp date)
        This method returns true if the activity end date is after the given date.
        Parameters:
        activityId - The ID of the activity to check.
        date - The time to check against.
        Returns:
        Returns true if the activity end date is after the given date (including if the activity end date is null). False otherwise (including if the activity or date are null).
      • isActivityEndDateAfter

        public static boolean isActivityEndDateAfter(Activity activity,
                                                     java.sql.Timestamp date)
        This method returns true if the activity end date is after the given date.
        Parameters:
        activity - The Activity to check.
        date - The time to check against.
        Returns:
        Returns true if the activity end date is after the given date (including if the activity end date is null). False otherwise (including if the activity or date are null).
      • isActivityActive

        public static boolean isActivityActive(java.lang.Integer activityId)
        This method returns true if the current activity is active.
        Parameters:
        activityId - The ID of the activity to check.
        Returns:
        Returns true if the current activity is active, false otherwise.
      • isActivityActive

        public static boolean isActivityActive(Activity activity)
        This method returns true if the current activity is active.
        Parameters:
        activity - The Activity to check.
        Returns:
        Returns true if the current activity is active, false otherwise.
      • incrementViewStatistics

        public void incrementViewStatistics(java.lang.Integer activityId,
                                            java.lang.Integer emsId,
                                            java.lang.Integer storeId)
        This method increments by one the view statistics for an EMarketingSpot within an activity.
        Parameters:
        activityId - The activity ID associated with the EMarketingSpot.
        emsId - The ID of the EMarketingSpot which was viewed.
        storeId - The ID of the store.
      • incrementTestElementViewStatistics

        public void incrementTestElementViewStatistics(java.lang.Integer experimentId,
                                                       java.lang.Integer testElementId,
                                                       java.lang.Integer storeId)
        This method increments by one the view statistics for a test element within an activity experiment.
        Parameters:
        experimentId - The ID of the experiment.
        testElementId - The ID of the test element which was viewed.
        storeId - The ID of the store.
      • getAndResetEmsViewsCounter

        public java.util.Map getAndResetEmsViewsCounter()
        This method returns the current accumulated statistics for the views of EMarketingSpots within an activity flow. The statistics are then reset to zero.
        Returns:
        This method returns the current accumulated statistics for views of EMarketingSpots within an activity flow.
      • getAndResetEmsClicksCounter

        public java.util.Map getAndResetEmsClicksCounter()
        This method returns the current accumulated statistics for the clicks of EMarketingSpots within an activity flow. The statistics are then reset to zero.
        Returns:
        This method returns the current accumulated statistics for clicks of EMarketingSpots within an activity flow.
      • getAndResetTestElementViewsCounter

        public java.util.Map getAndResetTestElementViewsCounter()
        This method returns the current accumulated statistics for views of a test element within an activity experiment. The statistics are then reset to zero.
        Returns:
        This method returns the current accumulated statistics for views of a test element within an activity experiment.
      • getAndResetTestElementClicksCounter

        public java.util.Map getAndResetTestElementClicksCounter()
        This method returns the current accumulated statistics for the clicks a test element within an activity experiment. The statistics are then reset to zero.
        Returns:
        This method returns the current accumulated statistics for clicks of a test element within an activity experiment.
      • raiseEMSTrigger

        public java.util.List raiseEMSTrigger(ActivityTrigger activityTrigger)
        This method handles the display of an EMarketingSpot. It will send the trigger to the appropriate activities, and it will return a data bean with the results generated by the activities.
        Parameters:
        activityTrigger - The information related to the trigger that has been received.
        Returns:
        This method returns a List of EMarketingSpotDataBeans which have been populated with the results generated by the activities.
      • getBehaviorSetting

        public static java.lang.String getBehaviorSetting(java.lang.String newBehavior,
                                                          java.lang.String currentBehavior)
        This method returns the appropriate setting for the e-Marketing Spot behavior based on the existing determined value, and the new determined value.
        Parameters:
        newBehavior - The newly determined behavior setting.
        currentBehavior - The existing behavior setting.
        Returns:
        If new setting is the same as the current setting, then return the current setting. If the current setting is static, then return the new setting. If the current setting is dynamic, and the new setting is not static, then return the new setting.
      • getEMSBehavior

        public java.lang.String getEMSBehavior(ActivityTrigger activityTrigger,
                                               java.lang.StringBuffer timeLimit)
        This method gets the caching behavior for an e-Marketing Spot.
        Parameters:
        activityTrigger - The information related to the e-Marketing Spot being displayed.
        timeLimit - The number of seconds from now of the earliest start date or end date of activities scheduled to the e-Marketing Spot. If there are no activities, or no start or end dates, then a value of 0 is set. The value is set by this method. If the time limit is greater than 68 years in the future, it will not be returned.
        Returns:
        This method returns a value of 1 if the e-Marketing Spot is dynamic, and a value of 0 if it is static.
      • raiseEMSTrigger

        public java.util.List raiseEMSTrigger(ActivityTrigger activityTrigger,
                                              java.util.List previewReport,
                                              java.util.Map temporarySharedData)
        This method handles the display of an EMarketingSpot. It will send the trigger to the appropriate activities, and it will return a data bean with the results generated by the activities.
        Parameters:
        activityTrigger - The information related to the trigger that has been received.
        previewReport - A list of information about the activity evaluation on the e-Marketing Spot.
        temporarySharedData - The temporary shared data area is used to share information between campaign elements. This information can be used to identify actions that have been performed, or to reuse information to aid in performance.
        Returns:
        This method returns a List of EMarketingSpotDataBeans which have been populated with the results generated by the activities.
      • raiseTrigger

        public boolean raiseTrigger(ActivityTrigger activityTrigger)
        This method handles triggers sent to the trigger handler. It will send the trigger to the appropriate activities.
        Parameters:
        activityTrigger - The information related to the trigger that has been received.
        Returns:
        This method returns false if an unexpected error occurred, otherwise the method returns true.
      • raiseTrigger

        public void raiseTrigger(java.lang.String personalizationId,
                                 java.lang.String triggerParameters,
                                 java.lang.Integer storeId,
                                 java.lang.Integer triggerId,
                                 java.lang.Integer activityId)
        This method handles timer triggers sent to the trigger handler. It will send the trigger to the specified activity.
        Parameters:
        personalizationId - The personalization ID for the current customer.
        triggerParameters - The trigger parameters.
        storeId - The store ID sent with the trigger.
        triggerId - The trigger ID to send to the engine.
        activityId - The activity ID to which to send the trigger.
      • raiseTrigger

        public boolean raiseTrigger(java.lang.String personalizationId,
                                    java.lang.String triggerParameters,
                                    java.lang.Integer storeId,
                                    java.lang.Integer triggerId,
                                    Activity activity)
        This method handles timer triggers sent to the trigger handler. It will send the trigger to the specified activity. This method calls the method raiseTrigger that has a Map for the triggerParameters.
        Parameters:
        personalizationId - The personalization ID for the current customer.
        triggerParameters - The trigger parameters.
        storeId - The store ID sent with the trigger.
        triggerId - The trigger ID to send to the engine.
        activity - The activity to which to send the trigger.
        Returns:
        This method returns false if an unexpected error occurred, otherwise the method returns true.
      • raiseTrigger

        public boolean raiseTrigger(java.lang.String personalizationId,
                                    java.util.Map triggerParameters,
                                    java.lang.Integer storeId,
                                    java.lang.Integer triggerId,
                                    Activity activity)
        This method handles timer triggers sent to the trigger handler. It will send the trigger to the specified activity.
        Parameters:
        personalizationId - The personalization ID for the current customer.
        triggerParameters - The trigger parameters.
        storeId - The store ID sent with the trigger.
        triggerId - The trigger ID to send to the engine.
        activity - The activity to which to send the trigger.
        Returns:
        This method returns false if an unexpected error occurred, otherwise the method returns true.
      • raiseTrigger

        public boolean raiseTrigger(java.lang.String personalizationId,
                                    java.util.Map triggerParameters,
                                    java.lang.Integer storeId,
                                    java.lang.Integer triggerId,
                                    Activity activity,
                                    java.util.Map temporarySharedData)
        This method handles timer triggers sent to the trigger handler. It will send the trigger to the specified activity.
        Parameters:
        personalizationId - The personalization ID for the current customer.
        triggerParameters - The trigger parameters.
        storeId - The store ID sent with the trigger.
        triggerId - The trigger ID to send to the engine.
        activity - The activity to which to send the trigger.
        temporarySharedData - The temporary shared data area is used to share information between campaign elements. This information can be used to identify actions that have been performed, or to reuse information to aid in performance.
        Returns:
        This method returns false if an unexpected error occurred, otherwise the method returns true.
      • setEMSData

        public void setEMSData(java.lang.String triggerParameters,
                               java.util.List emsDataBeanList)
        This method sets a EMarketingSpotDataBean to be returned to be displayed in an e-Marketing Spot. The information is added to a List of the beans associated with the the user and specific e-Marketing Spot. This method is no longer used. Campaign element task commands need to call the method addEMarketingSpotDataBean with each EMarketingSpotDataBean. The marketing services call the method MarketingCampaignElementTaskCmd.getEMarketingSpotDataBeans to get all the data to return in the e-Marketing Spot.
        Parameters:
        triggerParameters - The trigger parameters.
        emsDataBeanList - The information on what to display in the e-Marketing Spot.
      • recordBehaviorXml

        public void recordBehaviorXml(java.lang.String personalizationId,
                                      java.util.Map nvps,
                                      java.lang.Integer storeId)
        This method records the given values to behavior column in the DMUSERBHVR database table for the specified user.
        Parameters:
        personalizationId - The user's personalization ID.
        nvps - The name-value pairs to record in the user's behavior XML definition.
        storeId - The ID of the store.
      • forwardTriggers

        public void forwardTriggers(java.lang.String triggerParameters,
                                    java.lang.String personalizationId,
                                    java.lang.Integer storeId,
                                    java.util.Map nvpsForSend,
                                    java.util.Map nvpsForRecord)
        This method will record user behaviors and forward triggers to the trigger handler. This method calls the method forwardTriggers that has a Map for the triggerParameters.
        Parameters:
        triggerParameters - The trigger parameters.
        personalizationId - The personalization ID associated with the customer.
        storeId - The store ID of the store in which this trigger took place.
        nvpsForSend - The name-value pairs that are relevant for the triggers that the handler needs to be notified about.
        nvpsForRecord - The name-value pairs that are relevant for the triggers that the handler needs to record.
      • forwardTriggers

        public void forwardTriggers(java.util.Map triggerParameters,
                                    java.lang.String personalizationId,
                                    java.lang.Integer storeId,
                                    java.util.Map nvpsForSend,
                                    java.util.Map nvpsForRecord)
        This method will record user behaviors and forward triggers to the trigger handler.
        Parameters:
        triggerParameters - The trigger parameters.
        personalizationId - The personalization ID associated with the customer.
        storeId - The store ID of the store in which this trigger took place.
        nvpsForSend - The name-value pairs that are relevant for the triggers that the handler needs to be notified about.
        nvpsForRecord - The name-value pairs that are relevant for the triggers that the handler needs to record.
      • initialize

        public void initialize()
                        throws java.lang.Exception
        This method initializes the shared TriggerHandler object. It prepare the configuration of Trace event, that specify the event command directly recorded in the User Behaviour string as trace which only keep the latest value.
        Throws:
        java.lang.Exception
      • singleton

        public static TriggerHandler singleton()
        This method returns the shared instance of the TriggerHandler object.
        Returns:
        The TriggerHandler object to reuse.