Precedence rules delay the display of dimensions until they offer useful refinements of the shopper's navigation state.
A precedence rule specifies that a dimension (the target dimension) not be displayed until a shopper selects a dimension value in another dimension (the trigger dimension).
For example, you might not want dimensions named Country and Province to appear simultaneously. You can configure a precedence rule to cause Province to appear only after a shopper selects a dimension value in Country. Shoppers thus have simpler navigation choices, because the Province dimension does not appear until it is relevant to the shopper's current navigation state.
You define precedence rules that meet the requirements of your application under a custom owner that you define, as described in Precedence rules below.
Note
Oracle recommends that you create precedence rules only under a single custom owner. Do not create precedence rules under predefined owners such as System or ATG.
The following table summarizes the configurable attributes of precedence rules.
JSON element |
Required? |
Type |
Description |
---|---|---|---|
ecr:type |
Required* |
STRING |
Indicates that this configuration is for Precedence Rules |
triggerDimension |
Required* |
STRING |
Specifies the trigger dimension for a precedence rule. When a shopper selects the trigger dimension, the target dimension (previously unavailable) is made available to the shopper. |
targetDimension |
Required* |
STRING |
Specifies the target dimension for a precedence rule. |
triggerDimensionValueSpec |
Optional |
STRING |
Specifies the dimension value specification of the triggerDimension. If omitted, the precedence rule fires for any selection from the trigger dimension. |
isEnabled |
Optional |
BOOLEAN |
Indicates whether the precedence rule is processed by CAS when CAS writes MDEX-compatible output. TRUE includes the precedence rule during processing; FALSE excludes the rule. |
isLeafTrigger |
Optional |
BOOLEAN |
Indicates if the trigger is a leaf trigger or not. If TRUE, the rule is triggered only when shoppers select leaf dimension values. |
mergeAction |
Optional |
STRING |
Supported values are ADD (add the precedence rule to the index configuration) or UPDATE (update the index configuration with the precedence rule). |
The ECR type
precedence-rules-folder
is the root of precedence rule
configuration for all owners, and is configured as follows:
{ "ecr:type": "precedence-rules-folder" }
All the rules belonging to a particular owner are configured within a
precedence-rules-owner-folder
object. Each precedence
rule is configured as a
precedence-rule
object; for example:
{ "ecr:type": "precedence-rules-owner-folder", "aspectRatioDigitalCamerasRule": { "ecr:type": "precedence-rule", "targetDimension": "camera.aspect_ratio", "isLeafTrigger": false, "triggerDimension": "product.category", "triggerDimensionValueSpec": "575" }, "digitalZoomDigitalCamerasRule": { "ecr:type": "precedence-rule", "targetDimension": "camera.digital_zoom", "isLeafTrigger": true, "triggerDimension": "product.category", "triggerDimensionValueSpec": "600" } }
To configure precedence rules for your application, follow these steps:
On your local file system, create the following directory structure to contain all existing precedence rule configuration, which you will export in the following step:
where /CustomPrecRuleOwnerName is the folder in which you will create precedence rules for the specific needs of your application. The name of the folder is used as the name of the owner. Do not create more than one folder for a custom owner of precedence rules.
Do not modify or add to the contents of the /system and /ATG subfolders. If no configuration is exported to these subfolders, you may delete them.
Configuration is exported to the respective subfolders in ZIP files containing JSON files named
_.json
.Export existing precedence rules for your application, by executing the following command:
runcommand.bat IFCR exportContent precedenceRules directory true
where
directory
is the path to the /precedenceRules folder that you created in the previous step. All existing precedence rule configuration will be exported into the subfolders of /precedenceRules.Create or modify any existing precedence rule configuration in the /CustomPrecRuleOwnerName folder to meet your application's requirements; for example, the following JSON code defines two precedence rules for the custom owner CustomPrecRuleOwnerName:
"ecr:type": "precedence-rules-owner-folder", "aspectRatioDigitalCamerasRule": { "ecr:type": "precedence-rule", "targetDimension": "camera.aspect_ratio", "isLeafTrigger": false, "triggerDimension": "product.category", "triggerDimensionValueSpec": "575" }, "digitalZoomDigitalCamerasRule": { "ecr:type": "precedence-rule", "targetDimension": "camera.digital_zoom", "isLeafTrigger": true, "triggerDimension": "product.category", "triggerDimensionValueSpec": "600" }
Import the edited precedence rule configuration, by executing the following command:
runcommand.bat IFCR importContent precedenceRules directory
where directory is the path to the /precedenceRules folder that you created in the first step above.