Precedence rule schema

Each precedence rule is represented as a single record in the data domain.

The config-service:putPrecedenceRules operation processes precedence rules, adding new rules and updating existing rules. Each precedenceRule element uses the following schema syntax:
<mdex:precedenceRule 
   key="ruleName" 
   triggerAttributeKey="triggerAttrName"
   triggerAttributeValue="mval|sval" 
   targetAttributeKey="targetAttrName"
   isLeafTrigger="true|false"/>
The following table describes the meaning of the precedenceRule attributes:
Table 1. Meaning of precedenceRule attribute schema
precedenceRule attribute Meaning
key Specifies a unique identifier for the precedence rule (that is, it is the name of the rule). The identifier is a string, which does not have to follow the NCName format.
triggerAttributeKey Specifies the name of the Endeca standard attribute or managed attribute that will trigger the precedence rule. That is, the specified attribute must be selected before the user can see the target attribute.
triggerAttributeValue Optional. If used, specifies the attribute value (either managed value spec or standard attribute value) that must be selected before the user can see the target attribute. If not used, then any value in the trigger attribute will trigger the rule. Use of triggerAttributeValue in effect further refines the trigger to a specific standard or managed value.
targetAttributeKey Specifies the name of the Endeca standard or managed attribute that appears after the trigger attribute value is selected.
isLeafTrigger If the trigger is a managed attribute, isLeafTrigger specifies a Boolean value (that must be in lower case) that denotes the type of the trigger attribute value:
  • If true, the trigger attribute is a leaf type, which means that the precedence rule will fire only if a leaf value is selected. That is, querying any leaf managed value from the trigger managed attribute will cause the target managed value to be displayed (many triggers, one target).
  • If false (the default), the trigger attribute is a non-leaf type, which means that the precedence rule will fire when any value is selected. That is, if the managed value specified as the trigger or any of its descendants are in the navigation state, then the target is presented (one trigger, one target).

Note that isLeafTrigger does not apply to Endeca standard attributes. You must specify it when you create a precedence rule, but whichever value you use is ignored by the Dgraph when the precedence rule is run.

Precedence rule example

The following is an example of a config-service:putPrecedenceRules operation that creates a precedence rule named ProvinceRule:
<config-service:configTransaction 
   xmlns:config-service="http://www.endeca.com/MDEX/config/services/types/1/0" 
   xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09">
  <config-service:putPrecedenceRules>
     <mdex:precedenceRule
        key="ProvinceRule" 
        triggerAttributeKey="DimGeography_StateProvinceName"
        triggerAttributeValue="Queensland" 
        targetAttributeKey="DimGeography_City"
        isLeafTrigger="true"/>
  </config-service:putPrecedenceRules>
</config-service:configTransaction>

Note that this example does not use the optional OuterTransactionId element for the operation. This operation can be placed in a request structure of a WebServiceClient component.