It is often a non-trivial problem to determine if a promotion can be applied. Besides some general aspects, e.g., is the promotion enabled, has the promotion an adequate start and end date, there are some more aspects to consider which might influence the visibility and validity of a promotion like A/B test, affiliates or customer segmentation. These aspects strongly depend on the currently logged in user (customer) and on the used application (B2C, B2B).
All the mentioned aspects have to be considered for all Business Objects that are related to promotions (PromotionCode, PromotionCodeGroup, Promotion, Campaign).
In order to reduce some complexity and to cluster the related topics, two viewpoints have been introduced: Activation status and Accessibility.
Activation status contains all aspects that determine whether a promotion object is enabled and available in general. This includes:
Accessibility means that a promotion object is accessible for the current user (customer) in the context of the current application. This includes:
The term promotion object is used as a placeholder for all promotion-related business objects: PromotionCode, PromotionCodeGroup, Promotion and Campaign.
Both viewpoints are described in detail in the next paragraphs.
As mentioned above, the activation status describes whether a promotion object is generally available and enabled. Every business object might have different aspects to be considered to determine whether it is active or not. In order to provide an extendable and exchangeable solution the determination of the activation status is computed by external handlers. There are different type of handlers for the different business objects PromotionCode, PromotionCodeGroup, Promotion and, Campaign.
The handlers are wired via Java extension points and can be be extended or exchanged. If there are no handlers available, the promotion object is treated as active by default. If there are multiple handlers, the results are combined by logical AND, which means, that a promotion object is only declared as active, when ALL handlers declare it as active.
The following picture shows the overall workflow containing all relevant promotion business objects. If an object is asked for "isActive()", then it will call its connected "...BOIsActiveHandlers". If the combined result is true, the next higher level object is also asked. If the object on the "next level" does not exist or is not relevant, it will be skipped. E.g., PromotionCodeBO with single code has no promotion code group, or promotions without campaign.
Example: A promotion with a promotion code based on a promotion code group, where the promotion is assigned to campaign:
PromotionCodeBO.isActive() -> calls all PromotionCodeBOIsActiveHandlers -> if result is true -> call PromotionCodeGroupBO.isActive() -> calls all PromotionCodeGroupBOIsActiveHandlers -> if result is true -> call PromotionBO.isActive() -> calls all PromotionBOIsActiveHandlers -> if result is true -> CampaignBO.isActive() -> calls all CampaignBOIsActiveHandlers -> return result
A promotion code group can be assigned to multiple promotions. A promotion can also be assigned to multiple campaigns. If this is the case, then it is sufficient, that at least one of the objects on the next level is active.
The following diagram shows two examples. In the first example the promotion code is active, because there is one path from the root (promotion code) to a leaf (promotion), where all objects are active. In the second example the promotion code and promotion code group are both active, but the assigned promotions or the assigned campaign at the leaf of the tree are not active and as a result the promotion code is not active, too.
As mentioned above, the determination of the activation status is done by external handlers. The following table gives an overview about the handler implementations which are provided as standard.
Handler Interface / Extension point name | Implementation | Extension name | Checks |
---|---|---|---|
PromotionCodeBOIsActiveHandler / | no default implementation | - | no checks - active by default |
PromotionCodeGroupBOIsActiveHandler / com.intershop.component.promotion.capi.PromotionCodeGroupBOAccessibilityHandler-isActive | PromotionCodeGroupBOIsActiveHandlerImpl | PromotionCodeGroupBOIsActiveHandler | Enable flag of the promotion code group Promotion code group start and end date relating to evaluation date (preview time, session start time, current time) |
PromotionBOIsActiveHandler / com.intershop.component.promotion.capi.PromotionBOIsActiveHandler-isActive | PromotionBOIsActiveHandlerImpl | PromotionBOIsActiveHandler | Enable flag of the promotion Promotion start and end date relating to evaluation date (preview time, session start time, current time) all checks if promotion does not belong to a campaign |
CampaignBOIsActiveHandler / com.intershop.component.marketing.capi.campaign.CampaignBOIsActiveHandler-isActive | CampaignBOIsActiveHandlerImpl | CampaignBOIsActiveHandler | Enable flag of the campaign Campaign start and end date relating to evaluation date (preview time, session start time, current time) |
For adding additional handlers or replacing existing ones see Cookbook - Promotion Activation Status and Accessibility.
As mentioned above, the accessibility describes if a promotion object is accessible for the current user (customer) in the context of the current application. Every business object might have different aspects to be considered to determine whether it is accessible or not. In order to provide an extendable and exchangeable solution the determination of the accessibility is computed by external handlers. There are different types of handlers of the different business objects PromotionCode, PromotionCodeGroup, Promotion, and Campaign.
The handlers are wired via Java extension points and can therefore be extended or exchanged. If there are no handlers available, the promotion object is treated as accessible by default. If there are multiple handlers, the results are combined by logical AND, which means that a promotion object is only declared as accessible, when ALL handlers declare it as accessible.
The following picture shows the overall workflow containing all relevant promotion business objects. If an object is asked for "isAccessible()", it will call its connected "...BOAccessibilityHandlers". If the combined result is true, the next higher level object is also asked. If the object on the "next level" does not exist or is not relevant, it will be skipped. E.g., a PromotionCodeBO with single code has no promotion code group, or promotions without a campaign.
Example: A promotion with a promotion code based on a promotion code group, where the promotion is assigned to campaign:
PromotionCodeBO.isAccessible() -> calls all PromotionCodeBOAccessibilityHandlers -> if result is true -> call PromotionCodeGroupBO.isAccessible() -> calls all PromotionCodeGroupBOAccessibilityHandlers -> if result is true -> call PromotionBO.isAccessible() -> calls all PromotionBOAccessibilityHandlers -> if result is true -> CampaignBO.isAccessible() -> calls all CampaignBOAccessibilityHandlers -> return result
A promotion code group can be assigned to multiple promotions. A promotion can also be assigned to multiple campaigns. If this is the case, it is sufficient, that at least one of the objects on the next higher level is accessible.
The following diagram shows two examples. In the first example the promotion code is accessible, because there is one path from the root (promotion code) to a leaf (promotion) where all objects are accessible. In the second example the promotion code and promotion code group are both accessible, but the assigned promotions or the assigned campaign at the leaf of the tree are not accessible and as a result the promotion code is not accessible, too.
As mentioned above, the determination of the accessibility is done by external handlers. The following table gives an overview about the handler implementations which are provided as standard.
Handler Interface / Extension point name | Implementation | Extension name | Checks |
---|---|---|---|
PromotionCodeBOAccessibilityHandler / com.intershop.component.promotion.capi.PromotionCodeBOAccessibilityHandler-isAccessible | no default implementation | - | no checks - accessible by default |
PromotionCodeGroupBOAccessibilityHandler / com.intershop.component.promotion.capi.PromotionCodeGroupBOAccessibilityHandler-isAccessible | PromotionCodeGroupBOAccessibilityHandlerImpl | PromotionCodeGroupBOAccessibilityHandler | Is promotion code group available for the current application (Application assignment)? |
PromotionBOAccessibilityHandler / com.intershop.component.promotion.capi.PromotionBOAccessibilityHandler-isAccessible | PromotionBOAccessibilityHandlerImpl | PromotionBOAccessibilityHandler | Is promotion available for the current application (Application assignment)? |
CampaignBOAccessibilityHandler / com.intershop.component.marketing.capi.campaign.CampaignBOAccessibilityHandler-isAccessible | CampaignBOAccessibilityHandlerImpl | CampaignBOAccessibilityHandler | Is campaign available for the current user (usergroup assignment)? |
For adding additional handlers or replacing existing ones see Cookbook - Promotion Activation Status and Accessibility.