In previous versions of Intershop 7 promotions could be assigned to consumer groups. Since Intershop 7.5 this is extended with a more general notion of customer segment. Technically the CustomerSegmentBO was introduced in Intershop 7.4 but the actual implementation was based only on underlying ConsumerGroupPO objects, there was no possibility to provide customer segments from external sources.
Concept - Customer Segmentation Managed Service
Due to the introduction of Customer Segmentation Services in Intershop 7.5 (see the link above) it is possible to get customer segments from external systems. The internally managed Intershop customer segments (based on ConsumerGroupPO objects) are provided by the Standard Customer Segmentation Service. Other CustomerSegmentBO instances can be obtained by other implementations of CustomerSegmentationService which give access to some external segmentation sources like shown in the following picture:
Typically, when it is necessary to know which customer segments are applicable in a certain context (Catalog Views, Promotions, Price Lists, AB Tests - assignment, usage in storefront, etc), CustomerSegmentBOProvider has to be used as entry point. It checks for all activated segmentation services in the channel/application and retrieves the CustomerSegmentBOs they provide in a combined result.
Here is a class diagram of the classes involved in Promotion - Customer Segments interaction:
In the Commerce Management application segments can be assigned in Target Group tab of Promotion Details. Which customer segments are available for an assignment to the promotion depends on which applications are directly assigned to it (see the image below). Only segments which come from segmentation services enabled in the assigned applications will appear (regardless of which services are activated in the channel).
When processing the checkout, during the basket calculation step - when applying basket calculation rules - the customer segments of the current customer has to be retrieved (this can be achieved by using CustomerSegmentBOProvider). Then it can be checked which promotions are applicable for these segments. Because of the external Customer Segmentation Services, it is possible that for a promotion assignment exist segments which are no longer available (e.g., due to a stopped segmentation service or deleted segments in an external system). This means, to ensure to apply valid segments, each time the segments assigned to a promotion and segments returned by CustomerSegmentBOProvider must be compared.
The customer segments has to be applied also in ProcessPromotion-GetApplicablePromotions pipeline where the promotions for a product are retrieved.