|
Oracle Fusion Middleware Java API Reference for Oracle Business Rules 11g Release 1 (11.1.1) E10663-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.rules.sdk2.dictionary.DictionaryObject
oracle.rules.sdk2.dictionary.DictionaryComponent
oracle.rules.sdk2.ruleset.RuleComponent
oracle.rules.sdk2.ruleset.UnnamedRuleComponent
oracle.rules.sdk2.ruleset.SimpleTest
public class SimpleTest
A SimpleTest consists of 3 items describing the immediate simple test:
and two items that control grouping behavior:
When the Form property is set to FORM_NOT_NESTED the embedded SimpleTestTable is ignored.
For Example:
Order.total > 500 AND...
"Order.total" is the left expression (expression[0]), ">=" is the comparison operator, "500" is the right expression (expression[1]), "AND" is the connective.
On output, valid choices for the context of the SimpleTest can be obtained by calling getLeft().getSingleTermValueOptions(), or getOperatorOptions(), etc.
Simple Tests may be grouped by use of the SimpleTestTable contained in each SimpleTest and setting of the Form property.
Setting the Form property to FORM_NESTED will cause left and right expression to be ignored, the operator options to contain a single not operator, and the embedded SimpleTestTable contains the tests which are to be grouped.
For Example:
Producing tests that are grouped in this way: not ( T1 && (T2 || T3) would require five SimpleTests: - SimpleTest with Form: FORM_NESTED and OPERATOR: ! The embedded SimpleTestTable would contain two SimpleTests: - the first one with Form: FORM_NOT_NESTED. left, right, operator for T1 Connective: && - the second with Form: FORM_NESTED the embedded SimpleTestTable would contain: two SimpleTests: - the first with left, right, operand for T2 and connective: || - the second with left, right, operand for T3
Most builtin simple tests are binary. The have 2 entries in the expression table, and convenience methods SimpleTest.getLeft()
and SimpleTest.getRight()
may be used as shorthand for
getExpressionTable().get(0) getExpressionTable().get(1)
respectively. The builtins "between" and "in" take 3 or more arguments. The first is the left side expression. The second, third, and possibly more are the right side expressions. Use SimpleTest.getRightSeparator()
to determine how to display the right side arguments. If this method returns "", there is only one right side expression. E.g. consider a SimpleTest with
This should be rendered as
sombody.age between 20 and 30
Note the "in" operator can have more than 3 expressions in its expression table. The SDK will create the first 3 expressions; the UI is responsible for adding more expressions and removing unwanted expressions. For example, the UI might show the following simple test:
item.color in "red", "blue" [+] [-]
The user can click on the [+] to add another color to the test
item.color in "red", "blue", "black" [+] [-]
The UI must call SimpleTest.getExpressionTable()
.add() to add a new expression for "black". When the user clicks [-], the UI calls getExpressionTable().remove(getExpressionTable().size()-1)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class oracle.rules.sdk2.dictionary.DictionaryComponent |
---|
DictionaryComponent.Diff, DictionaryComponent.DiffType |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary | |
---|---|
static java.lang.String |
FORM_NESTED indicates a SimpleTestTable is expected to have entries Right and Left are ignored. |
static java.lang.String |
FORM_NOT_NESTED indicates no nested table exists any entries in nested Simple Test Table are ignored. |
Method Summary | |
---|---|
void |
desurround() |
java.lang.Object |
get(java.lang.Object key) Generic property getter. |
java.lang.String |
getConnective() Get the connective (and/or) combining this pattern with the next in the table. |
java.lang.String[] |
getConnectiveOptions() |
SettableProperty<java.lang.String> |
getConnectiveProperty() Get Connective Property. |
int |
getConnectiveSelected() |
ExpressionTable |
getExpressionTable() Get the expressions related by the test operator. |
java.lang.String |
getForm() |
java.lang.String[] |
getFormOptions() |
SettableProperty<java.lang.String> |
getFormProperty() Get Form Property. |
int |
getFormSelected() |
Expression |
getLeft() Short for getExpressionTableProperty().getValue().get(0) |
java.lang.String |
getOperator() |
DOID |
getOperatorID() |
java.lang.String[] |
getOperatorOptions() |
SettableProperty<java.lang.String> |
getOperatorProperty() Get Operator Property. |
int |
getOperatorSelected() |
Expression |
getRight() Short for getExpressionTableProperty().getValue().get(1) |
java.lang.String |
getRightSeparator() |
SimpleTestTable |
getSimpleTestTable() Get the nested table of SimpleTests. |
TableProperty<SimpleTest> |
getSimpleTestTableProperty() Get SimpleTestTable Property. |
static java.lang.String[] |
getSurroundingFormOptions(java.util.List<SimpleTest> sts) |
boolean |
isBuiltInOperator() |
boolean |
isVisible() Should this test be rendered in the current mode? |
java.lang.Object |
put(java.lang.String key, java.lang.Object value) Generic property setter. |
void |
setConnective(java.lang.String connective) Set the connective (and/or) combining this pattern with the next in the table. |
void |
setForm(java.lang.String nf) |
void |
setOperator(java.lang.String operator) |
void |
setOperatorID(DOID operator) |
SimpleTest |
surround() |
static SimpleTest |
surround(java.util.List<SimpleTest> sts) |
SimpleTest |
surround(java.lang.String form) |
static SimpleTest |
surround(java.lang.String form, java.util.List<SimpleTest> sts) |
Methods inherited from class oracle.rules.sdk2.ruleset.UnnamedRuleComponent |
---|
init, isAliasDistinct, isNameDistinct |
Methods inherited from class oracle.rules.sdk2.ruleset.RuleComponent |
---|
get, getParent, getParentTable, parentAction, parentComponent, parentFunction, parentPattern, parentRule, parentRuleCommon, parentRuleSheet, parentVariable, RHSRuleVariables |
Methods inherited from class oracle.rules.sdk2.dictionary.DictionaryComponent |
---|
clear, containsKey, containsValue, entrySet, getAlias, getAlias, getAliasProperty, getAllReferences, getCustom, getDependents, getDescription, getDescriptionProperty, getDiff, getDiffProperties, getDiffs, getFullyQualifiedAlias, getFullyQualifiedName, getName, getNameProperty, getNext, getObjectPath, getOptions, getPrevious, getProperties, getProperty, getSelected, hasDiff, isEmpty, isFullyQualifiedName, keySet, putAll, remove, setAlias, setCustom, setDescription, setName, size, validate, validate, values |
Methods inherited from class oracle.rules.sdk2.dictionary.DictionaryObject |
---|
equals, exists, getAEReferences, getCombinedDataModel, getContainedIDs, getContainedIDs, getDataModel, getDictionary, getID, getIndent, getLevel, getObjectType, getParentByClass, getParentComponent, getParentComponentTable, getParentObject, getReferences, getRuleSet, getState, getWarnings, hashCode, isModified, validate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.rules.sdk2.dictionary.UnnamedComponent |
---|
getAlias, getName, getPropertyNames, setAlias, setName |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
public static final java.lang.String FORM_NOT_NESTED
public static final java.lang.String FORM_NESTED
Method Detail |
---|
public SettableProperty<java.lang.String> getFormProperty()
public void setForm(java.lang.String nf)
public java.lang.String getForm()
public java.lang.String[] getFormOptions()
public int getFormSelected()
public SettableProperty<java.lang.String> getOperatorProperty()
public java.lang.String getOperator()
public void setOperator(java.lang.String operator)
public DOID getOperatorID()
public void setOperatorID(DOID operator)
public java.lang.String[] getOperatorOptions()
public int getOperatorSelected()
public ExpressionTable getExpressionTable()
SimpleTest.getRightSeparator()
returns other than "".public Expression getLeft()
public Expression getRight()
public SettableProperty<java.lang.String> getConnectiveProperty()
public java.lang.String getConnective()
Util.CONNECTIVE_AND
if not setpublic void setConnective(java.lang.String connective)
Util.CONNECTIVE_AND
if not setpublic java.lang.String[] getConnectiveOptions()
public int getConnectiveSelected()
public TableProperty<SimpleTest> getSimpleTestTableProperty()
public SimpleTestTable getSimpleTestTable()
public java.lang.Object get(java.lang.Object key)
DictionaryComponent
Please see the specific bean class for a list of properties.
get
in interface java.util.Map<java.lang.String,java.lang.Object>
get
in class UnnamedRuleComponent
key
- a String containing the property name to be fetched.public java.lang.Object put(java.lang.String key, java.lang.Object value)
DictionaryComponent
A put() with either null key or null value throws a NullPointerException.
A put() with a key that is not a String throws a ClassCastException
A put() of a value that is not of the correct type for the key throws a ClassCastException.
Bean properties which have no set() method are read only, and cannot be modified using the put(). Attempting to do so throws a runtime IllegalArgumentException. PROP_ID, and PROP_*_SELECTED are always read only.
put
in interface java.util.Map<java.lang.String,java.lang.Object>
put
in class UnnamedRuleComponent
key
- the key of the property to setvalue
- the value of the named property to setpublic java.lang.String getRightSeparator()
public void desurround()
public static SimpleTest surround(java.util.List<SimpleTest> sts)
public static SimpleTest surround(java.lang.String form, java.util.List<SimpleTest> sts)
public SimpleTest surround()
public SimpleTest surround(java.lang.String form)
public static java.lang.String[] getSurroundingFormOptions(java.util.List<SimpleTest> sts)
public boolean isBuiltInOperator()
public boolean isVisible()
|
Oracle Fusion Middleware Java API Reference for Oracle Business Rules 11g Release 1 (11.1.1) E10663-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |