Deleting precedence rules

The config-service:deletePrecedenceRules operation lets you remove an existing precedence rule from the MDEX Engine.

The Configuration Web Service's putPrecedenceRules operation takes one or more precedenceRule elements that will be deleted. Because precedence rules are stored as records in the MDEX Engine, you need to specify only the key attribute of the precedence rule, as in this example that deletes a precedence rule named "ProvinceRule":
<config-service:configTransaction 
     xmlns:config-service="http://www.endeca.com/MDEX/config/services/types" 
     xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09">
   <config-service:deletePrecedenceRules>
      <mdex:precedenceRule key="ProvinceRule"/>
   </config-service:deletePrecedenceRules>
</config-service:configTransaction>

To delete precedence rules from the MDEX Engine:

  1. Create an input file that contains one column, with a Key header name and with one or more rows of precedence rule names, as in this simple CSV example:

  2. Create a graph and add the components described in the "Adding components to the precedence rules graph" topic in this chapter.
  3. Configure the UniversalDataReader component as described in the "Configuring the precedence rules Reader" topic in this chapter. Make sure you use the file created in Step 1 as the input file and that the Number of skipped records per source field is set to 1.
  4. Use the "Configuring the precedence rules Reader Edge" topic in this chapter to configure the Reader Edge. Note that the Record field's Delimiter field will be empty, as there is only one column.
  5. Configure the Reformat component so that the CTL in the Source tab looks like this:
    function integer transform() {
       string prRecord = "";
    
       prRecord = "<mdex:precedenceRule key='" + $0.Key + "'/>";
    
       $0.xmlString = prRecord;
    
       return ALL;
    }
  6. Use the "Configuring the precedence rules Reformat Edge" topic in this chapter to configure the Reformat Edge. Note that the Record field's Delimiter field will be empty, as there is only one column.
  7. Use the "Configuring the precedence rules WebServiceClient component" topic in this chapter to configure the WebServiceClient component. The major difference is that you will add this text to the Generate request field:
    <config-service:deletePrecedenceRules  
       xmlns:config-service="http://www.endeca.com/MDEX/config/services/types"
       xmlns:mdex="http://www.endeca.com/MDEX/XQuery/2009/09">
    $xmlString
    </config-service:deletePrecedenceRules>
  8. Save the graph.

After creating the graph and configuring the components, run the graph to delete the precedence rules listed in the input file.