Rules View
This view contains a list of all the rules defined for the current template. Rules are divided into two types Default and Conditional.
Default rules are those that apply in all contexts. In processing these will be evaluated first. Conditional rules are those that are parented under a Context with a condition. These conditions are expressed as xpath statements. They may refer to parameter values passed into the CAM template at runtime or nodes within the structure. Conditions may also be a simple xpath indicating the existence of a node. In this case the xpath used in the context is prepended to any item level xpaths used within the rules.

Contexts are shown with the folder symbol, rules withthe paper symbol. Annotated rules and context are decorated with the annotation paper clip symbol.
The context menu for the Rules View is as follows, all the options apply to both contexts and rules:
- Edit Rule
- this launches the Edit Rule wizard
- Delete Rule
- remove the current rule from the template.
- Edit Rule Annotation
- this opens the annotation wizard
to allow detailed descriptions associated with the rules to be added.
The view has 6 columns as follows:
- Type and Conditions
- this contains the tree of rules. If the rule is a conditional context or has a simple condition this is given as the text alongside the context and rule icons.
- Category
- shows if the rule is part of the default rules set or based upon a define conditional context. Values CONDITIONAL or DEFAULT.
- Item
- this is the xpath defined when the rule was created and it will point to the item selected in the Structure View. A rule may apply to many items if the xpath is defined in such a way as to point to more than one item. (not for contexts)
- Action
- this is the CAM action that will be performed or checked should this rule fire. (not for contexts)
- Scope
- this is a complex concept that allows an xpath to be given which indicates when a rule should be calculated. This is used to set parameters based upon a value in say a repeating group. For example, if each order line has a different structure based upon the product type being ordered, then the scope would point to the orderline element as each time one was encoutered any rules within this scope would be applied.
- Annotation
- this contains the first line of the first documentation element of an annotation associated with a rule.
Rules Usage
After a template has been run in the editor the rules that were applied to the XML file can be seen by going to this view. After the run there will be small green highlights on the icons associated with the rules than have been applied. See the following picture. The first three rules were applied the next three were not, etc.
