Creating the rule-based sales category evaluation scheduled job
You can create the EvaluateRuleBasedCategories job command to reapply the rules for rule-based sales categories on a configured time interval. The evaluation time interval for each category begins from the last time that the rule was applied to that category. When the scheduled job runs, the existing catalog entry assignments for the category are replaced with the catalog entries that currently best match the rule.
After the UpdateSearchIndex job or di-buildindex utility runs successfully, an event listener triggers a call to the EvaluateRuleBasedCategories job to evaluate all rule-based sales categories. This event listener call ensures that rule-based sales categories include the latest search index contents.
If you do want to create and run a scheduled job to call the
EvaluateRuleBasedCategories job to evaluate the rule for all rule-based sales
categories, do not configure the job to run on a scheduled interval. If you want to evaluate the
rule for categories without waiting for the UpdateSearchIndex job to complete, run the job directly.
If you want to run the job because the rules are not evaluated and applied often enough, consider
decreasing the schedule interval of the UpdateSearchIndex job and configuring a shorter time
interval to automatically evaluate the rules instead. For more information about configuring the
evaluationTimeInterval
property in the wc-admin-component.xml
file, see Enabling rule-based sales categories.
Before you begin
- Deploy the WebSphere Commerce search server.
- Build or
rebuild the search index.
For WebSphere Commerce search to find catalog entries to assign to a rule-based sales category, the catalog entries must be indexed.
- Schedule the
UpdateSearchIndex job to routinely update the catalog search index.
If you plan to run the scheduled job to reapply the rule for categories frequently, schedule the UpdateSearchIndex job to run more frequently.
Procedure
-
Enable the configuration properties to add
support for reapplying the rule for a rule-based sales category with a scheduled job.
When you are working with the wc-admin-component.xml catalog component configuration file, ensure that you configure the following values for the appropriate configuration properties:
- Set the value for the
evaluationEnabled
configuration property to"true"
to enable the application of a rule to a rule-based sales category. - Set the value for the
evaluationTimeInterval
configuration property to a positive value. This value is the time interval in seconds that elapses before the scheduled job runs to apply the rule for a category. - Set the value for the
evaluationHostname
configuration property to ensure that the scheduled job runs on only a single node.
Note: By default, you cannot configure theEvaluateRuleBasedCategories
scheduled job to run in a production environment. When theEvaluateRuleBasedCategories
job runs, a check is performed to determine whether the environment that the job is running in has workspaces or a staging server configured. If neither configuration exists, theevaluationEnabled
property for enabling the application of rules to rule-based sales categories is disabled. - Set the value for the
- Open the Administration Console and select Site on the Administration Console Site/Store Selection page.
- Click . A list of jobs that are scheduled to run is displayed.
-
Create the EvaluateRuleBasedCategories scheduled job:
Results
evaluationTimeInterval
configuration property.