Calculation Actions and Configuration
You can define the calculation process and schedule when it is called.
The way of calculating personalization is crucial, because executing calculations per each user for each request may lead to performance issues. Performing the recalculation not often enough does not ensure relevant customer experience.
Calculation Actions
The following recalculation actions are defined in the RecalculateAction enum:
- RECALCULATE: recalculates customization results and stores them in the session.
- UPDATE: updates information about the user segments.
- ASYNC_PROCESS: starts an asynchronous process to update user segments and calculate customization results to be stored in the database. For more information on the process, see Asynchronous Process.
- LOAD: loads customization results stored in database as a result of asynchronous calculation process.
Calculation Configuration
The CxConfigurationModel stores the configuration in the database. You can apply such a configuration to one or many base sites. If a current base site does not have configuration defined, the default values are used. For settings configuration, see Set Up a Personalization Configuration. The CxConfigurationModel contains:
| Element | Description |
|---|---|
| userChangedActions | Defines what set of RecalculateAction should be executed when the user changes in session. These actions are executed after user the logs in. A user changed event is handled by CxAfterUserChangedListener. |
| anonymousUserDefaultActions | A set of actions executed only once when a session is created. It is handled by the NewSessionVoter. |
| urlVoterConfigurations | A list of CxUrlVoterConfigModel. This configuration is used by ConfigurableUrlVoter. |
| periodicVoterConfigs | A list of CxPeriodicVoterConfigModel, which describes actions executed periodically (for example after 3 requests or after 20 seconds). This configuration is used by the PeriodicVoter. |
Use the following properties to add default values for base sites without configurations:
- defining which actions are called on user changed event. Use the personalizationservices.after.user.changed.actions property to define which actions should be called.
personalizationservices.after.user.changed.actions=RECALCULATE,ASYNC_PROCESS
- actions called on storefront page requests. Example configuration:
personalizationservices.calculate.default.load.url=.* personalizationservices.calculate.default.load.actions=LOAD