|
Oracle Fusion Middleware Java API Reference for Oracle Business Rules 11g Release 1 (11.1.1.7) E10663-11 |
||||||||
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 has one of 4 Forms:
> Nested forms use only:
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().getValueOptions(), or getOperatorOptions(), etc.
Simple Tests may be grouped by use of the SimpleTestTable contained in each SimpleTest and setting of the Form property to FORM_NESTED or FORM_NESTED_NOT.
For Example:
Producing tests that are grouped in this way: not ( T1 && (T2 || T3) would require five SimpleTests: - SimpleTest with FORM_NESTED_NOT The embedded SimpleTestTable would contain two SimpleTests: - the first one with FORM_SIMPLE for T1 Connective: && - the second with FORM_NESTED the embedded SimpleTestTable would contain: two SimpleTests: - the first for T2 with connective: || - the second for T3
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
sombody.age between 20 and 30Note 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 | |
---|---|
static class |
SimpleTest.OperatorProperty
|
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 |
BUILTIN
|
static java.lang.String |
FORM_NESTED
indicates a SimpleTestTable is expected to have entries. |
static java.lang.String |
FORM_NESTED_NOT
indicates a SimpleTestTable is expected to have entries. |
static java.lang.String |
FORM_NOT_NESTED
Deprecated. use SimpleTest.FORM_SIMPLE |
static java.lang.String |
FORM_SIMPLE
indicates a variant of <expression> <operator> <expression> SimpleTestTable and Variable properties are not used. |
static java.lang.String |
FORM_VARIABLE_DEFINITION
indicates <variable> = <expression> SimpleTestTable property is ignored. |
Method Summary | |
---|---|
SimpleTest |
desurround()
if this is a nested simple test, replace it with the nested simple tests. |
java.lang.Object |
get(java.lang.Object key)
Generic property getter. |
java.lang.String |
getAlias()
Even though we extend UnnamedComponent, we need the variable name to translate expressions from persistent format (`ID`) to user format (name) |
java.lang.String |
getAlias(boolean translate)
Get alias of DictionaryComponent. |
java.lang.String |
getConnective()
Get the connective (and/or) combining this pattern with the next in the table. |
java.lang.String[] |
getConnectiveOptions()
|
TranslatedProperty |
getConnectiveProperty()
Get Connective Property. |
int |
getConnectiveSelected()
|
ExpressionTable |
getExpressionTable()
Get the expressions related by the test operator. |
java.lang.String |
getForm()
Get untranslated form of this test. |
java.lang.String[] |
getFormOptions()
Get untranslated options for the form of this test. |
TranslatedProperty |
getFormProperty()
Get Form Property. |
int |
getFormSelected()
|
Expression |
getLeft()
Short for getExpressionTableProperty().getValue().get(0) |
java.lang.String |
getOperator()
|
DOID |
getOperatorID()
|
java.lang.String[] |
getOperatorOptions()
|
SimpleTest.OperatorProperty |
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)
|
java.lang.String |
getVariable()
|
SettableProperty<java.lang.String> |
getVariableProperty()
Get Variable Property. |
boolean |
isBuiltInOperator()
|
boolean |
isNested()
is this test nested, e.g. (...) or not(...) |
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 form)
Set form of this test. |
void |
setOperator(java.lang.String operator)
|
void |
setOperatorID(DOID operator)
|
void |
setVariable(java.lang.String variable)
|
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, parentActionContext, parentFunction, parentPattern, parentRule, parentRuleCommon, parentRuleSheet, parentVariable, RHSRuleVariables |
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, getRuleSet, getState, getWarnings, hashCode, isModified, validate |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.rules.sdk2.dictionary.UnnamedComponent |
---|
getName, getPropertyNames, setAlias, setName |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
public static final java.lang.String BUILTIN
public static final java.lang.String FORM_SIMPLE
@Deprecated public static final java.lang.String FORM_NOT_NESTED
SimpleTest.FORM_SIMPLE
public static final java.lang.String FORM_VARIABLE_DEFINITION
public static final java.lang.String FORM_NESTED
public static final java.lang.String FORM_NESTED_NOT
Method Detail |
---|
public TranslatedProperty getFormProperty()
public void setForm(java.lang.String form)
form
- the untranslated form.
Form can be set using a translated form string using
getFormProperty().setTranslatedForm(translatedForm)
public java.lang.String getForm()
getFormProperty().getTranslatedValue()
public java.lang.String[] getFormOptions()
getFormProperty().getTranslatedOptions()
public int getFormSelected()
public SimpleTest.OperatorProperty 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 TranslatedProperty getConnectiveProperty()
public java.lang.String getConnective()
Util.CONNECTIVE_AND
if not set
public void setConnective(java.lang.String connective)
Util.CONNECTIVE_AND
if not set
public java.lang.String[] getConnectiveOptions()
public int getConnectiveSelected()
public TableProperty<SimpleTest> getSimpleTestTableProperty()
public SimpleTestTable getSimpleTestTable()
public SettableProperty<java.lang.String> getVariableProperty()
public java.lang.String getVariable()
public void setVariable(java.lang.String variable)
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 set
public java.lang.String getRightSeparator()
public SimpleTest 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()
public java.lang.String getAlias()
getAlias
in interface UnnamedComponent
getAlias
in class DictionaryComponent
public java.lang.String getAlias(boolean translate)
DictionaryComponent
getAlias
in class DictionaryComponent
translate
- whether to get the translated alias
public boolean isNested()
|
Oracle Fusion Middleware Java API Reference for Oracle Business Rules 11g Release 1 (11.1.1.7) E10663-11 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |