Rules are used in several places in Document! X (Build Profile Editor Filters page, the Project Search Tool, AutoDoc Files) to match items or content according to one or more conditions. For example, the Build Profile Editor Filters page allows you to specify one or more rules that govern whether items are included in the output generated by that Build Profile.
Rules save you time and effort by allowing you to match a set of items without having to find and manually flag or identify them manually.
There are several different kinds of Rules that you can use when defining a Rule set:
Build Flag Rule
Compares against Build Flags applied to items or defined in Content. This Rule is commonly used in the Build Profile editor to selectively include items and content only if they have specific Build Flag(s) applied.
Item Name Rule
Compares against the item name. This Rule matches items that have a specific name, or naming pattern.
Item Property Rule
This powerful Rule allows you to compare against the value of a wide variety of Metadata Elements - the same elements that can be used in custom Template Page Layouts. Using this kind of Rule it is possible to match on almost any value present in the generated output.
Item Type Rule
Compares against the type of item, allowing specific item types to be selected. This kind of Rule is commonly used in combination with one of the other Rule kinds - e.g. selecting methods named "Refresh" by combining with an Item Name Rule to select specifically named items, but only if they are of the "Method" item type.
Rule Group
This Rule kind exists to allow you to create child groups of rules, in order to logically combine several rules in "And" or "Or" groupings.
For more complex Rule sets, you may find it necessary to group rules into logical "And" or "Or" groups to achieve the desired logic. You can do this by adding Rule Group items to your Rule Set which allow you to group child rules using a logical "And"/"Or" operator.
In the screenshot below, the illustrated Build Profile Rule set will exclude any methods with names that begin with "internal" or "hidden". The Rule Group is necessary in this scenario as items should only be excluded if both top level parts of the Rule set must match (Item Type must be "Method" And Item Name is one of the patterns specified), but the Item Name rule group should match any of the Item Name values (Item Name begins with "internal" Or Item Name begins with "hidden").
Step by Step to create the example Rule Set
To create the example rule set above:
This Rule Set will now exclude any methods that have names that begin with "internal" or "hidden".
Grouping by adding Rule Groups to the Rule set allows for complex Rule sets to be defined that would not otherwise by possible.