|
Oracle Business Rules Java API Reference 10g (10.1.3.1.0) B28966-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
java.util.AbstractMap
java.util.HashMap
oracle.rules.sdk.editor.ruleset.RuleComponent
oracle.rules.sdk.editor.ruleset.Rule
A Rule consists of a table of Pattern
s to be matched, and a table of Action
s to be taken when a match occurs. See also RuleSet
.
A Rule is structured as a set of nested tables.
Rule Pattern Table SimpleTest Table Action Table
E.g., The following rule has a PatternTable with 2 FactPatterns. Each fact pattern has one SimpleTest. The rule has an Action table with two actions. The second action has a parameter table with one parameter.
Rule myRule { if ((patternA && patternA.x == 1) && (patternB && patternB.y = patternA.y)) { delete patternB; println(PatternB.y + "deleted"); } }
The following applies to the Rule classes and to the nested classes it uses.
On output, String properties can be accessed using specific getters, such as getName(), or generic getters, such as getProperty("name"). There are corresponding methods for accessing option lists for the properties and the selected option. See RuleComponent
On input, property values can be set back into the same instances or into a copy (see RuleComponent copy()). If set into a copy, the apply method is used to update the original. On input, property values are always Strings.
Input events can be handled through use of specific methods on the classes or using theTableEditor class.
Validation is done when validate() is called rather than at set time.
Field Summary | |
static java.lang.String |
PROP_ACTION_TABLE |
static java.lang.String |
PROP_NAME |
static java.lang.String |
PROP_PATTERN_TABLE |
static java.lang.String |
PROP_PRIORITY |
Method Summary | |
Action |
getAction(int i) Shorthand for getActionTable.getAction(i) |
ActionTable |
getActionTable() table the actions for the rule |
java.lang.String |
getName() Get the name of the rule which must be unique within the rule set |
java.lang.String |
getNameConstraint() |
java.lang.String[] |
getNameOptions() |
int |
getNameSelected() |
Pattern |
getPattern(int i) Shorthand for getPatternTable.getPattern(i) |
PatternTable |
getPatternTable() table containing the patterns for the rule |
java.lang.String |
getPriority() Get a String containing a negative or positive integer. |
java.lang.String |
getPriorityConstraint() |
java.lang.String[] |
getPriorityOptions() |
int |
getPrioritySelected() |
java.lang.String[] |
getPropertyNames() |
void |
setActionTable(ActionTable actionTable) |
void |
setName(java.lang.String name) Set the name of the rule which must be unique within the rule set |
void |
setNameConstraint(java.lang.String nameConstraint) |
void |
setNameOptions(java.lang.String[] nameOptions) |
void |
setPatternTable(PatternTable patternTable) |
void |
setPriority(java.lang.String priority) Set a String containing a negative or positive integer. |
void |
setPriorityConstraint(java.lang.String priorityConstraint) |
void |
setPriorityOptions(java.lang.String[] priorityOptions) |
void |
validate() Validates the correctness of the RuleComponent and all RuleComponents below it. |
Methods inherited from class oracle.rules.sdk.editor.ruleset.RuleComponent |
clear, discardCopy, get, get, getConstraint, getConstraintList, getCustom, getDescription, getID, getOptions, getParent, getParentTable, getRange, getRuleDictionary, getSelected, put, remove, restoreCopy, saveCopy, setCustom, setDescription, setRuleDictionary, toString |
Methods inherited from class java.util.HashMap |
clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Field Detail |
public static final java.lang.String PROP_NAME
public static final java.lang.String PROP_PRIORITY
public static final java.lang.String PROP_PATTERN_TABLE
public static final java.lang.String PROP_ACTION_TABLE
Method Detail |
public void validate() throws RuleEditorException, RuleEditorSDKException
RuleComponent
validate
in class RuleComponent
RuleEditorSDKException
- incorrect SDK usageRuleEditorException
- for user input errorspublic Pattern getPattern(int i)
i
- ordinal of pattern to retrieve from PatternTablejava.lang.IndexOutOfBoundsException
public Action getAction(int i)
i
- ordinal of Action to retrieve from ActionTablejava.lang.IndexOutOfBoundsException
public java.lang.String[] getPropertyNames()
getPropertyNames
in class RuleComponent
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getNameConstraint()
public void setNameConstraint(java.lang.String nameConstraint)
public java.lang.String[] getNameOptions()
public void setNameOptions(java.lang.String[] nameOptions)
public int getNameSelected()
public java.lang.String getPriority()
public void setPriority(java.lang.String priority)
public java.lang.String getPriorityConstraint()
public void setPriorityConstraint(java.lang.String priorityConstraint)
public java.lang.String[] getPriorityOptions()
public void setPriorityOptions(java.lang.String[] priorityOptions)
public int getPrioritySelected()
public PatternTable getPatternTable()
public void setPatternTable(PatternTable patternTable)
public ActionTable getActionTable()
public void setActionTable(ActionTable actionTable)
|
Oracle Business Rules Java API Reference 10g (10.1.3.1.0) B28966-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |