sapproductconfigrules Extension

The sapproductconfigrules extension contains all definitions and service layer implementations required for the rule-based adjustment of the product configuration provided by the SAP Product Configuration Runtime Engine on the SAP Commerce Cloud side.

Overview

Generally speaking, a product configuration rule enables you to do certain things (actions) based on predefined criteria (conditions) at a well-defined point in the configuration process (process Step). Actions and conditions can be freely combined. But an action is always associated with at least one process step, and this assignment may not be changed.

Process Steps

There are two process steps in the product configuration process that can be influenced:

  • CREATE_DEFAULT_CONFIGURATION: Only after retrieval of the default configuration, when the configuration is accessed the first time. Allows modification of any default values.

  • RETRIEVE_CONFIGURATION: After retrieval of the actual configuration state on each roundtrip, including the first roundtrip, when default values are fetched. Doesn’t allow modifications of configuration values themselves.

Actions

The following actions are available:

Name

Description

Process Step

DisplayCsticReadonly

y_configurable_product_display_cstic_readonly

Forces a characteristic to be read-only so that it cannot be modified by the user on the UI.

CREATE_DEFAULT_CONFIGURATION

RETRIEVE_CONFIGURATION

DisplayMessage

y_configurable_product_display_message

Shows a message on the UI.

CREATE_DEFAULT_CONFIGURATION

RETRIEVE_CONFIGURATION

HideCstic

y_configurable_product_hide_cstic

Forces a characteristic to be invisible, so that it is not displayed on the UI.

CREATE_DEFAULT_CONFIGURATION

RETRIEVE_CONFIGURATION

RemoveAssignableValue

y_configurable_product_remove_assignable_value

Removes an option for a domain-restricted characteristic so that it is not possible anymore to select this option on the UI.

CREATE_DEFAULT_CONFIGURATION

RETRIEVE_CONFIGURATION

SetCsticValue

y_configurable_product_set_cstic_value

Overwrites the default value of a characteristic. A user may still change the value on the UI.

CREATE_DEFAULT_CONFIGURATION

Conditions

The following conditions are available:

Name

Description

Parameters

ConfigurableProduct

y_configurable_product

Matches the product you are currently configuring on the configuration screen. You have to provide at least the product name, but you can also provide the name of a characteristic or even of a certain characteristic value to make this condition very specific. It is also possible to check that a certain characteristic value is not selected.

PRODUCT_NAME

CSTIC_NAME

VALUE_OPERATOR

CSTIC_VALUE

ConfigurableProductInCart

y_configurable_product_in_cart

Same as ConfigurableProduct, but matches a configurable product that is contained in the current user's shopping cart.

PRODUCT_NAME

CSTIC_NAME

VALUE_OPERATOR

CSTIC_VALUE

ASM

y_configurable_product_customer_support_mode

Checks whether an assisted service session is active.

VALUE

CustomerGroups

y_configurable_product_customer_group

Checks whether the user belongs to a certain customer group.

CUSTOMER_GROUPS

CUSTOMER_GROUPS_OPERATOR

Customers

y_configurable_product_customer

Checks whether the user is one of the specified users.

CUSTOMERS

CUSTOMERS_OPERATOR

Dependencies

This extension depends on the following extensions:

  • sapproductconfigservices

  • ruledefinitions

  • commerceservices

Product Configuration Service ProductConfigurationRuleAwareServiceImpl

This extension redefines the sapProductConfigConfigurationService bean:

<alias name="sapProductConfigDefaultRuleAwareConfigurationService" alias="sapProductConfigConfigurationService" />
<bean id="sapProductConfigDefaultRuleAwareConfigurationService" parent="sapProductConfigDefaultConfigurationService"
 	class="de.hybris.platform.sap.productconfig.rules.service.impl.ProductConfigurationRuleAwareServiceImpl">
  ...
</bean>

The redefined bean now points to the rule-aware ProductConfigurationRuleAwareServiceImpl service class, which extends the standard service class logic to make the functionality of Rule Engine available for product configuration.

Other Objects

The implementation provided with this extension uses the SAP Commerce Cloud Rule Engine framework for definition and execution of the rule-based logic. All implementations and definitions required for using of this engine in the product configuration are part of this extension as well.

Here is a list of the most important implementations and definitions:

Object Type

Implementation / Definition Names

Type

RAO objects

de.hybris.platform.sap.productconfig.rules.rao

java package

RAO providers

de.hybris.platform.sap.productconfig.rules.rao.provider

java package

RAO populators

de.hybris.platform.sap.productconfig.rules.rao.populator

java package

RAO actions

de.hybris.platform.sap.productconfig.rules.rule.evaluation.impl

java package

Action strategies

de.hybris.platform.sap.productconfig.rules.action.strategy.impl

java package

Condition translators

de.hybris.platform.sap.productconfig.rules.conditions

java package

Source rule type definition

ProductConfigSourceRule

item type

Drools Rule Engine context

KIESession

KIEBase

KIEModule

productconfig-context

productconfig-session

productconfig-base

productconfig-module

impex

Rule condition definitions

y_configurable_product

y_configurable_product_in_cart

y_configurable_product_customer

y_configurable_product_customer_group

y_configurable_product_customer_support_mode

impex

Action definitions

y_configurable_product_set_cstic_value

y_configurable_product_remove_assignable_value

y_configurable_product_hide_cstic

y_configurable_product_display_cstic_readonly

y_configurable_product_display_message

impex