Precedence rule list and delete operations

The Configuration Web Service has operations for listing and deleting precedence rules.

Listing precedence rules

The listPrecedenceRules and exportPrecedenceRules operations return information about your current set of precedence rules. The following is an example of the listPrecedenceRules operation:
<soapenv:Envelope 
   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
   xmlns:ns="http://www.endeca.com/MDEX/config/services/types/3/0" 
   xmlns:ns1="http://www.endeca.com/MDEX/config/XQuery/2009/09">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:configTransaction>
         <ns:listPrecedenceRules/>
      </ns:configTransaction>
   </soapenv:Body>
</soapenv:Envelope>
If there are no precedence rules defined, the response would be:
<config-types:results xmlns:config-types="http://www.endeca.com/MDEX/config/services/types/3/0">
   <precedenceRules xmlns="http://www.endeca.com/MDEX/config/XQuery/2009/09"/>
</config-types:results>
If there are defined precedence rules, the response will include one or more precedenceRule elements, as shown in this example:
<config-types:results xmlns:config-types="http://www.endeca.com/MDEX/config/services/types/3/0">
   <precedenceRules xmlns="http://www.endeca.com/MDEX/config/XQuery/2009/09">
      <precedenceRule key="AUS_Rule" triggerAttributeKey="DimGeography_CountryRegionName" 
        triggerAttributeValue="Australia" targetAttributeKey="DimGeography_StateProvinceName" 
        isLeafTrigger="false"/>
      <precedenceRule key="City_Rule" triggerAttributeKey="DimGeography_StateProvinceName" 
        triggerAttributeValue="Victoria" targetAttributeKey="DimGeography_City" 
        isLeafTrigger="false"/>
   </precedenceRules>
</config-types:results>

Deleting precedence rules

The deletePrecedenceRules operation deletes one or more specified precedence rules. The only attribute that you need to specify is the name of the precedence rule in the key attribute, as in this example:
<soapenv:Envelope 
   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
   xmlns:ns="http://www.endeca.com/MDEX/config/services/types/3/0" 
   xmlns:ns1="http://www.endeca.com/MDEX/config/XQuery/2009/09">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:configTransaction>
         <ns:deletePrecedenceRules>
            <ns1:precedenceRule key="City_Rule"/>
         </ns:deletePrecedenceRules>
      </ns:configTransaction>
   </soapenv:Body>
</soapenv:Envelope>
If the delete operation is successful, the response will be:
<config-types:results xmlns:config-types="http://www.endeca.com/MDEX/config/services/types/3/0"/>
If the delete operation fails because the specified precedence rule does not exist, the response will be similar to this example:
<soapenv:Fault>
   <faultcode>soapenv:Client</faultcode>
   <faultstring>endeca-err:MDEX0001 : Invalid input : No record has an assignment of 
     value 'Citty_Rule' for property 'mdex-precedenceRule_Key'</faultstring>
</soapenv:Fault>

In the example, the operation failed because the name of the precedence rule was misspelled.