Each non-RuleWizard command in the shortcut menu is followed by a symbol that describes the function of the item. These symbols are described in the following table:

Symbol

Description

[...]

Indicates an item which can have either a direct or indirect check.

(S)

Indicates an item that takes a string input.

[T/F]

Indicates an item that lets you toggle between true and false inputs.

[M]

Indicates an item that lets you choose between predetermined input options. For example, Permission [M].

(#)

Indicates an item that takes a numerical input.

*

Indicates a property/node that is available from more than one command. For example, if you can choose the Body property from more than one of the available commands, the Body command will contain an asterisk.

The commands available depend on which node or rule element was selected. Most commands represent standard programming elements. Some of the commands that you may not be familiar with are described in the following table.

Node PropertyDescription

Body

The set of nodes contained within the body of the current node. Choosing Body allows you to create a rule condition about the code element that is a subnode of the parent node. 

For example, the body of Node A returns a “body” that is A’s subnode; the exact definition of the “body” depends on the node itself.

Count

Allows you to create a rule condition that restricts a node’s quantity. Must be used in conjunction with the Create Collector command (First, create a collector, then right-click the collector and choose Count). The collector keeps track of the number of times a pattern is found; Count places a condition on what number of instances constitutes a rule violation. For information on determining exactly how counts are calculated, see Working with Node Sets.

Context

Lets you create a rule condition about the code element that contains the parent node. (The context of Node A returns the node that contains Node A). For example, if you wanted to create a rule that said “always put X inside of Y,” you would create a parent node for X, use Context to attach Y, create a collector, then use Count to specify that a count of $$==0 constitutes a violation.
 
Some rules can use only Body, some can use only Context, some can use neither, and some can use both. If you have a choice, choose Bodybecause Body will result in better performance than Context. In many—but not all—cases, Body and Context are inverse operations. For example, an expression can be in the context of a statement, but be contained in the condition (rather than the body) of the statement.




  • No labels