com.ibm.commerce.marketing.promotion.runtime

Interface PromotionEngine

  • All Superinterfaces:
    java.io.Serializable, XMLizable
    All Known Implementing Classes:
    DefaultPromotionEngine


    public interface PromotionEngine
    extends XMLizable
    This is the standard interface for promotion engine implementation. It handles the interaction between the order subsystem and the promotion component by calling invoke() method with a pass-in parameter of order id. The promotion engine will decide the applicable promotions to an order based on rules (or policies) defined.
    • Method Detail

      • getEngineName

        java.lang.String getEngineName()
        Returns the name of a named promotion engine
        Returns:
        the name of an engine.
      • isStateless

        boolean isStateless()
        Returns the default configuration for invocation mode
        Returns:
        true if by default all invocations to the engine is stateless, false otherwise
      • isSingleJVMConfiguration

        boolean isSingleJVMConfiguration()
        Is the engine running in a Single JVM environment or not
        Returns:
        true if the engine is running in a single JVM environment, false otherwise.
      • checkTargetingAtRuntime

        boolean checkTargetingAtRuntime()
        By default will targeting conditions be evaluated at runtime or not.
        Returns:
        true if targeting conditions will be evaluated at runtime by default, false otherwise
      • skipTargetingOnCodeEntered

        boolean skipTargetingOnCodeEntered()
        By default, if a correct promotion code is entered will the engine evaluate targeting condition or not.
        Returns:
        true if targeting condition should not be evaluated on a correct promotion code entered, false otherwise.
      • isAdjustmentBasedOnStandardOfferPrice

        boolean isAdjustmentBasedOnStandardOfferPrice()
        By default, if all the adjustments will be based on standard offer price or not.
        Returns:
        true if all adjustments will be based on standard offer price, false otherwise.
      • isInDebugMode

        boolean isInDebugMode()
        Whether or not promotion engine is running in debug mode
        Returns:
        true if the promotion engine is in debug mode, false otherwise.
      • setInDebugMode

        void setInDebugMode(boolean b)
        Sets engine debug mode.
        Parameters:
        b - true if the engine is to be set in debug mode.
      • invoke

        PromotionArgument invoke(java.lang.String template,
                                 java.lang.Long orderId,
                                 boolean discardPreviousResult,
                                 boolean saveCurrentResult,
                                 java.util.Hashtable NVP)
                          throws PromotionRuntimeException
        Invokes the engine. When the promotion engine is called, it processes any promotions for the current order, and returns a PromotionArgument.
        Parameters:
        template - This defines the name of the template used to invoke the engine. Templates are prescribed ways of calling the promotion engine.
        orderId - primary key of the order to which promotions will be applied
        discardPreviousResult - It instructs the promotion engine to eliminate any previous record about how promotions are applied to the current order, that is, the order whose primary key is specified in the call.
        saveCurrentResult - It tells the promotion engine whether the current results should be persisted in the database.
        NVP - name value pair style parameters, if any, null is acceptable.
        Returns:
        PromotionArgument which details the result of this invocation
        Throws:
        PromotionRuntimeException - when an error occurs in the invocation.
      • cleanup

        void cleanup()
        Cleans up after engine is shutdown
      • getPromotionCodeManager

        GenericPromotionCodeManager getPromotionCodeManager()
        Returns configured promotion code manager.
        Returns:
        the configured promotion code manager.
      • getCouponManager

        CouponManager getCouponManager()
        Returns configured coupon manager for this engine.
        Returns:
        the configured coupon manager.
      • getPromotionContextFactory

        PromotionContextFactory getPromotionContextFactory()
        Returns configured promotion context factory
        Returns:
        promotion context factory configured for this engine.
      • getAgendaBuilder

        PromotionExecutionAgendaBuilder getAgendaBuilder()
        Returns configured promotion execution agenda builder
        Returns:
        promotion execution agenda builder configured for this engine.
      • getSequenceBuilder

        PromotionExecutionSequenceBuilder getSequenceBuilder()
        Returns configured promotion execution sequence builder
        Returns:
        promotion execution sequence builder configured for this engine.
      • getExternalEntityRegistry

        com.ibm.commerce.marketing.promotion.dependency.ExternalEntityFactoryRegistry getExternalEntityRegistry()
        Returns configured external entity factory registry for this promotion engine.
        Returns:
        ExternalEntityFactoryRegistry for this promotion engine
      • getPersistenceManagerRegistry

        PersistenceManagerRegistry getPersistenceManagerRegistry()
        Returns configured persistence manager registry for this promotion engine.
        Returns:
        PersistenceMannagerRegistry for this promotion engine.
      • getPromotionEventListenerRegistry

        com.ibm.commerce.marketing.promotion.event.ListenerRegistry getPromotionEventListenerRegistry()
        Returns configured promotion event listener registry for this promotion engine.
        Returns:
        ListenerRegistry configured for this promotion engine