A rule set can also include sorting directives, which determine the order in which targeting results should be returned for display, based on properties of the target objects. The application can then either display the targeting results in that order, or select items from the targeting results based on the order created by the sorting directives. For example, to sort the results of the previous example by company name, in alphabetical order, you write a sorting directive like this and add it to your rule set:

<sortby>
  <sortbyvalue value="company" dir="ascending">
</sortby>

See <sortby> Tag and <sortbyvalue> Tag for details about sorting directives.

Example: A Complete Rule Set

Here is an example of a complete rule set, putting together all the elements discussed in this section:

<ruleset>
<!-- This rule delivers items about non-U.S. rubber companies to analysts who
     cover the rubber industry -->

<!-- Accept rules -->

<accepts>
  <rule op=eq name="Rubber sector">
    <valueof target="industry sector">
    <valueof constant="rubber">
  </rule>
  <rule op=includes name="Rubber analysts">
    <valueof bean="Profile.sectorsCovered">
    <valueof constant="rubber">
  </rule>
</accepts>

<!-- Reject rule -->

<rejects>
  <rule op=eq name="U.S. companies"
    <valueof target="companyCountry">
    <valueof constant="United States">
  </rule>
</rejects>

<!-- Sorting Directive -->

<sortby>
  <sortbyvalue value="company" dir=ascending>
</sortby>
</ruleset>

Copyright © 1997, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices