Related Documents
Document Properties
Kbid
3002M1
Last Modified
03-Jun-2022
Added to KB
03-Dec-2021
Public Access
Everyone
Status
Online
Doc Type
Guidelines, Concepts & Cookbooks
Product
ICM 7.10

Guide - 7.10.38.9 Rework Job ProcessActivePromotionProducts

Table of Contents


Product Version

7.10.38

Product To Version


Status

1 Introduction

The job ProcessActivePromotionProducts is used to determine which products are affected by which promotions for each channel. It usually runs once per day at 10pm and checks all promotions associated with products via inclusion/exclusion for promotion conditions and promotion discounts, see ICM Online Help | Discount Rules for details. The result is a list of all products to which promotions apply being stored in the ActivePromoProducts table. It is used in the storefront to show the customer which product might be cheaper due to a promotion.

Especially in environments with a lot of products and promotions, the performance of the job sometimes dropped dramatically. To improve the performance and stability of this job the underlying code base has been completely reworked.

1.1 References

1.2 Glossary

TermDescription
ICMIntershop Commerce Management
SMCIntershop System Management
Job

A process in ICM which can be triggered manually or automatically via scheduling in SMC.

It performs tasks that, among other things, improve the performance of the ICM system, see Reference - Intershop 7.10 Jobs for all available ICM 7.10 jobs.

2 Changes

  • Code-base changed from pipelets, BO-Layer to mainly database queries
  • The new implementation does not replace the existing one
  • Both implementations are working independently and could be used alternately
  • The new job has a dry run mode to check possible differences in results

3 Availability

The job ProcessActivePromotionProducts is available for each channel by default. 

The updated jobs ProcessActivePromotionProducts_beta and ProcessActivePromotionProducts_both are new and have to be created manually, either by adjusting an existing ProcessActivePromotionProducts or by creating a new job. They will be described later in detail.

4 Job Pipeline

4.1 Description

The pipeline has three start nodes: Start, Start_Beta and Start_Both. Start_Beta and Start_Both are available from ICM 7.10.38.9.

  • Start is the old known starting point of the job (since ICM 7.0).
  • Start_Beta is the start node for a completely reworked and improved pipeline with a better performance.
  • Start and Start_Beta basically do the same thing and should therefore produce the same results. The new implementation does not replace the existing one. Both implementations work independently of each other and can be used alternately. The new node is named with the suffix "Beta", because it still has to be found out whether the job delivers the same result in all conceivable constellations on customer systems. This is due to the complexity of the promotion engine.
  • Start_Both can be used to determine possible differences for both jobs in an environment with actual customer data.

For further details see the following sections.

4.2 Start Node: Start

Performs basic tasks that lead to the creation and removal of data from the ActivePromoProducts table:

  1. Remove all entries for promotions where the end date has passed or where the promotions have been deleted.
  2. Analyze the database tables that were created when the promotion configuration was saved to find all products that are in some way related to the promotion.
  3. Write newly found relation entries. Occurs when:
    • Promotion rules with product or category inclusions have been added, and/or
    • Discounts have been added.
  4. Remove obsolete relation entries. Happens when promotion rules with product or category exclusions have been added or inclusions removed and/or Discounts have been removed.
  5. Remove obsolete relation entries Occurs when:
    • Promotion rules with product or category exclusions are added, or
    • Inclusions are removed, and/or
    • Discounts are removed.

4.3 Start Node: Start_Beta

Start_Beta basically does the same thing but uses mainly queries, while the Start node uses only a few queries and mainly pipeline logic.

This node is called Beta because it is experimental. It has not yet been tested with real customer data. Therefore, it is hard to make a statement about its accuracy and performance.

A dry run option has been added to test the successful execution of the job before changing the data in the database, which allows comparing the results of both jobs without changing the data.

It is described in detail in the following section.

4.3.1 Manual Configuration of Start_Beta

The updated job has the same configuration, except that it uses the start node Start_Beta. To configure Start_Beta, perform the following steps:

  1. Choose the channel domain:
    1. Open Intershop System Management.
    2. Click Schedules | Scheduling.
    3. Choose the domain, e.g. inSPIRED-inTRONICS
    4. Click Apply.
      The job ProcessActivePromotionProducts should appear in the list.


      Info

      You can either edit the existing jobs or create new ones, see Intershop System Management Online Help | Creating New Scheduled Jobs for details. 

  2. Enter the General tab configuration:
    1. To use to the updated job, enter Start_Beta as Startnode:
  3. Add attributes:
    1. In the Attributes tab add DomainName with type String and the channel name as its value. (e.g.: inSPIRED-inTRONICS)
    2. Optionally: Enable the dry run mode by adding an attribute DryRunMode of type String with value true.
      The attribute ActivePromotionProductsDryRunLog displayed in the screenshot is described in the next section.


4.3.2 DryRunMode

The configuration DryRunMode has been added to run the job and compare the results of both jobs without breaking anything.

The DryRunMode runs all the logic to analyze the data, but only writes detailed debug log entries and a summary into the attribute field ActivePromotionProductsDryRunLog. This can be accessed from the Attributes tab of the job.

Here is an example that shows what kind of data might appear in the ActivePromotionProductsDryRunLog attribute if there are differences. It contains promotion UUIDs and product UUIDs to make it easier to find the problematic promotion configuration:

Tip

For a clearer presentation, copy the field content into a text editor.

ActivePromotionProductsDryRunLog Example
SetActivePromoProductsV2-Summary - createdCount:4 - removedCount:3 - existingCount:417 - postRemovedCount:2 - RunDate:2021/Nov/23-11:07:17
Removed DtysGwQxfeQAAAF9FRdpuC_3 | ThsKDgAXUfMAAAF9vlZJeAo.
Removed DtysGwQxfeQAAAF9FRdpuC_3 | V7sKDgAXuegAAAF9CklJeAo.
Removed DtysGwQxfeQAAAF9FRdpuC_3 | g2sKDgAXHyQAAAF9CUlJeAo.
Created DtysGwQxfeQAAAF9FRdpuC_3 | 19AKDgAXYb4AAAF9hklJeAo.
Created DtysGwQxfeQAAAF9FRdpuC_3 | ow8KDgAXD20AAAF9gElJeAo.
Created DtysGwQxfeQAAAF9FRdpuC_3 | adMKDgAXOXIAAAF9fElJeAo.
Created DtysGwQxfeQAAAF9FRdpuC_3 | p_UKDgAXmDsAAAF9iklJeAo.
SetActivePromoProductsV2-PromotionUUID:DtysGwQxfeQAAAF9FRdpuC_3-createdCount:4-removedCount:3-existingCount:166
Erased(PostRemoved) 28SsGwQxmzEAAAF9zSppuDLq | tk0KDgAXHA8AAAF9HWBJeAo.
Erased(PostRemoved) 28SsGwQxmzEAAAF9zSppuDLq | viYKDgAX2A4AAAF9NGBJeAo.
RemoveActivePromoProducts-PromotionUUID:28SsGwQxmzEAAAF9zSppuDLq - postRemovedCount:2
RemoveActivePromoProducts-over-all-promotions-PostRemovedCount:2

If it looks as in the snippet above, i.e. createdCount, removedCount and postRemovedCount are larger than 0, the old job should still be used. 

However, if everything works smoothly, createdCount, removedCount and postRemovedCount should be 0. In that case, there are no deviations from the old job and Start_Beta can replace the old start node Start entirely.

To use the new job, do not forget to disable DryRunMode by either removing the attribute or setting its value to something other than true (e.g.: false or not_true).

Note

The ActivePromotionProductsDryRunLog attribute value does not always change and is not automatically removed. Therefore, check RunDate to make sure that the data belongs to the last run.

4.4 Start Node: Start_Both

As the name implies, this node executes both, Start and Start_Beta, one after the other. By using this configuration the start node Start_Beta always runs in DryRunMode.

With mass data, running the job with this start node can take some time to execute, so only run this on test systems and never on live.

Intershop recommends to enable the debug log and select the package com.intershop.component.marketing.pipelet.promotion as category. This provides a lot of data which can be used to analyze if something went wrong or if there are any differences.

4.4.1 Manual Configuration of Start_Both

Start_Both basically uses the same configuration as Start_Beta, except that it uses Start_Both as start node.

To configure the job's attributes, perform the following steps:

  1. In the Attributes tab add DomainName with type String and the channel name as its value, e.g.: inSPIRED-inTRONICS.
  2. Optionally: Enable the dry run mode by adding an attribute DryRunMode of type String with value true.
    The attribute ActivePromotionProductsDryRunLog shown in the screenshot is described in section DryRunMode.

4.5 Run Time Recommendation

If there is more than one channel on which this job must be executed, the start time should be set with a five-minute delay per channel.

Disclaimer

The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.

Customer Support
Knowledge Base
Product Resources
Tickets