A rule is a SQL expression defined using the attributes of an event structure. Rules that share a common event structure belong to the same rule class. A rule has a description, action preferences, and a condition. Action preferences describe the event values associated with each rule for action execution. A rule condition is a SQL expression of the rule using the attributes defined in the event structure.
Through a series of right-mouse clicks and text entry, this interface can be used to create an XML Tree representation of a rule condition. The condition node is always at the root of the tree. To see a menu of available commands for any node, first click that node with the left mouse button to bring it into focus, then click that node with the right mouse button.
Inter-Event OperationsAND of Primitive EventsIntra-Event OperationsANY of Primitive EventsIf you select AND of Primitive Events, an AND of Primitive Events node is added to the XML tree structure below and within the condition node. Primitive Event nodes can be added beneath this node, and all events must occur with the specified conditions in order for this rules action to fire. Note that each event can occur zero or one times in the entire tree.
If you select Add Logical operator NOT, a NOT node is added to the XML tree structure below and within the AND of primitive events node. One primitive event can be added beneath this node. This primitive events condition must not occur in order for the rules action to fire.
If you select Add Logical operator NOTANY, a NOTANY node is added to the XML tree structure below and within the AND of primitive events node. More than one primitive event must be added beneath this node. These primitive events conditions must not occur in order for the rules action to fire.
If you select ANY of Primitive Events, an ANY of Primitive Events node is added to the XML tree structure below and within the condition node. Primitive Event nodes can be added beneath this node, and any one of the events can occur with the specified conditions in order for this rules action to fire. If the count attribute is set for this node, it specifies the minimum number of events that must occur for this rules action to fire.
Attributes
- Sequence - (valid for AND of Primitive Events, ANY of Primitive Events) If you select this attribute, a "sequence=yes" node will be added to the tree beneath the node you selected. This attribute requires that the events of this node occur in the specified order for the rules action to fire.
- Join - (valid for AND of Primitive Events, ANY of Primitive Events, NOT, NOTANY) If you select this attribute, a "join" node will be added to the tree beneath the selected node. You can then specify a condition on the attributes of different primtive events in order for the rules action to fire. The menu for the "join" node will have a list of available attributes and operators that can be used in constructing the join condition.
- Equal - (valid for AND of Primitive Events, ANY of Primitive Events) If you select this attribute, an "equal" node will be added to the tree beneath the selected node. You can then specify a list of attributes of different primtive events that must be equal in order for the rules action to fire. The menu for the "equal" node will have a list of available attributes that can be used in constructing the join condition.
- Count - (valid for ANY of Primitive Events, NOTANY) If you select this attribute, an empty "count" node will be added to the tree beneath the selected node. Click on the "count" node to select it, and enter a numerical value for the number of children of the selected node that you wish to be present in order for the rules action to fire. The value must be 1 or greater, and be less than the number of event children of this ANY of Primtive Events or NOTANY node.
- By - (valid for NOTANY, NOT) If you select this attribute, an empty "by" node will be added to the tree beneath the selected node. For a composite event, a rule defined with negation typically evaluates to true when one of the primtive events does not happen within a time delay of the others. Click on the "by" node to select it, and right-click to see a menu of available attributes to use when specifying the time value, including current system timestamp (SYSTIMESTAMP), and creation times of primitive events in the tree (<primevent>.rlm$crttime).
If you select Add Logical Operator AND an AND node is added to the XML tree structure below and within the event node.
If you select Logical Operator OR, an OR node is added to the XML tree structure below and within the event node.
If you select Predicate, a predicate node named "Predicate" is added to the XML tree structure. Next, select this Predicate node from the XML tree. Right click on the Predicate node to show the acceptable attribute choices the menu, as well as the acceptable operator choices in an Operators sub-menu. You can construct a predicate using values from this sub-menu as well as text entered directly in the editing area. When you are finished editing the predicate, move the focus away from the Predicate node by left-clicking on a different node. Repeat this process for each predicate node you want to add and then edit edit.
If you click a logical OR operator node to edit, the menu will display the Predicate option and the Add Logical Operator AND option. If you select Predicate, a predicate node named "Predicate" is added to the XML tree structure below and within the OR operator you originally selected. You can then select this "Predicate" node and edit its contents. If you select Add Logical Operator AND, an AND operator is added to the XML tree structure below and within the logical OR operator that you originally selected.
If you click a logical AND operator node to edit, the menu will display the Predicate option and the Add Logical Operator OR option. If you select Predicate, a predicate node named "Predicate" is added to the XML tree structure below and within the AND operator you originally selected. You can then select this "Predicate" node and edit its contents. If you select Add Logical Operator OR, and OR operator is added to the XML tree structure below and within the logical AND operator that you originally selected.
To remove any node from the XML tree, click the node to be removed to select it, then right click and select Remove current node and all of its children.
Press OK to validate the XML and enter it into the Rule Condition box. Press Cancel to ignore any changes made during the editing session for this tree.
Related Topics
Rule Creation Wizard - Rule Designer
Copyright © 2005, Oracle. All rights reserved.