IBM Support

JR51839: The method AdvancedPromotionEngine.createPromotionContext needs to support setting the active date for evaluation

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • A customization is creating a simulated order and calling the
    promotion engine to evaluate the order. The method
    AdvancedPromotionEngine.createPromotionContext(Order, CommandCon
    text  String, List, boolean) is used to set up the context to be
     passed to the promotion engine. The customization wants to
    determine if the promotion applies at a future date. However,
    the method createPromotionContext does not support setting a
    specific evaluation date.
    

Local fix

Problem summary

  • USERS AFFECTED:
    WebSphere Commerce users on v7.0 doing a customization with
    simulated orders for promotion evaluation
    
    PROBLEM ABSTRACT:
    The method AdvancedPromotionEngine.createPromotionContext needs
    to support setting the active date for evaluation
    
    BUSINESS IMPACT:
    Customization cannot be completed to evaluate promotion at a
    future date.
    
    RECOMMENDATION:
    

Problem conclusion

  • A new API method is provided that allows the evaluation date to
    be set in additional parameters passed in the method.
    
    public PromotionContext createPromotionContext(
    Order aOrder,
    CommandContext aCommandContext,
    String aTemplateName,
    List promotionKeys,
    boolean bSimulationMode,
    Map additionalParameters);
    
    For example, to evaluate the promotion one day in the future,
    the following can be implemented:
    
    Calendar cal = Calendar.getInstance();
    cal.add(Calendar.DATE, 1);
    Date nextDay = cal.getTime();
    
    Map additionalParameters = new HashMap();
    additionalParameters.put("ACTIVE_DATE", nextDay);
    
    PromotionContext promotionContext =
    advancedPromotionEngine.createPromotionContext(getOrder(), ctx,
    getPromotionTemplateName(), aPromotionKeys, true,
    additionalParameters);
    

Temporary fix

Comments

APAR Information

  • APAR number

    JR51839

  • Reported component name

    WC BUS EDITION

  • Reported component ID

    5724I3800

  • Reported release

    700

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2014-11-19

  • Closed date

    2014-12-12

  • Last modified date

    2014-12-12

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WC BUS EDITION

  • Fixed component ID

    5724I3800

Applicable component levels

  • R700 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSYSYL","label":"WebSphere Commerce Enterprise"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0","Line of Business":{"code":"LOB31","label":"WCE Watson Marketing and Commerce"}}]

Document Information

Modified date:
11 December 2021