|
Oracle Fusion Middleware Java API Reference for Oracle Business Rules 11g Release 1 (11.1.1) E10663-02 |
||||||||
| 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.Pattern
public class Pattern
A Pattern is used to structure rule conditions. A Pattern has a form property, one of
PatternTable, testForm, expression, simpleTestTable, connective, and operator properties of the Pattern should be used.A brief overview of Pattern properties:
For example, consider the following condition "no zebras are pink":
IF
there is no case where {
z is a Zebra and
z.color == "pink"
THEN
...
Code to construct this condition:
Pattern outer = rule.getRoot();
outer.setForm(Pattern.FORM_NESTED_TABLE);
outer.setOperator(Pattern.OPERATOR_NONE);
Pattern nested = outer.getNestedTable().add();
nested.setFactType("Zebra");
nested.setVariable("z");
nested.setTestForm(Pattern.TEST_FORM_SIMPLE);
SimpleTest test = nested.getSimpleTestTable().add();
test.getLeft().setValue("z.color");
test.getRight().setLiteralValue("pink");
| 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 |
CONNECTIVE_AND |
static java.lang.String |
CONNECTIVE_OR |
static java.lang.String |
FORM_FACT_PATH |
static java.lang.String |
FORM_FACT_TYPEUse with Pattern Form. |
static java.lang.String |
FORM_NESTED_TABLE |
static java.lang.String |
OPERATOR_AGGREGATE |
static java.lang.String |
OPERATOR_FOREACHUse with Pattern Operator. |
static java.lang.String |
OPERATOR_NONE |
static java.lang.String |
OPERATOR_SOME |
static java.lang.String |
TEST_FORM_ADVANCEDTEST_FORM_ADVANCED Specifies the use of boolean Expression located in Expression property. |
static java.lang.String |
TEST_FORM_NOTESTSpecifies test form. |
static java.lang.String |
TEST_FORM_SIMPLETEST_FORM_SIMPLE Specifies the use of SimpleTest, located in SimpleTestTable. |
| Method Summary | |
|---|---|
void |
desurround() |
AggregateTable |
getAggregateTable()Get the the Aggregate subtable when Operator is OPERATOR_AGGREGATE. |
TableProperty<Aggregate> |
getAggregteTableProperty()Get AggregateTable Property. |
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 |
getConnective()Get connective (and/or) which combines this Pattern with the following Pattern, if any. |
java.lang.String[] |
getConnectiveOptions() |
SettableProperty<java.lang.String> |
getConnectiveProperty()Get Connective Property. |
int |
getConnectiveSelected() |
Expression |
getExpression() |
DictionaryProperty<Expression> |
getExpressionProperty()Get Expression Property. |
java.lang.String |
getFactPath()Get the fact path. |
DOID[] |
getFactPathIDs()Get the IDs of the fact path. |
java.lang.String[] |
getFactPathOptions()get possible fact paths to choose from |
SettableProperty<java.lang.String> |
getFactPathProperty()Get FactPath Property. |
java.lang.String |
getFactType()Get the alias of the fact type. |
DOID |
getFactTypeID()Get the ID of the fact type. |
java.lang.String[] |
getFactTypeOptions()get possible fact types to choose from |
SettableProperty<java.lang.String> |
getFactTypeProperty()Get FactType Property. |
int |
getFactTypeSelected()get index of fact type selected from option list |
java.lang.String |
getForm()Get Form describing whether this Pattern simple fact type or a subtable of fact types. |
java.lang.String[] |
getFormOptions() |
SettableProperty<java.lang.String> |
getFormProperty()Get Form Property. |
int |
getFormSelected() |
PatternTable |
getNestedTable()Get the the Pattern subtable when Form is FORM_NESTED_TABLE. |
TableProperty<Pattern> |
getNestedTableProperty()Get NestedTable Property. |
java.lang.String |
getOperator()Get Pattern operator. |
java.lang.String[] |
getOperatorOptions() |
SettableProperty<java.lang.String> |
getOperatorProperty()Get Operator Property. |
int |
getOperatorSelected() |
Expression |
getSimpleTestLeft(int i)Shorthand for getSimpleTestTable.getSimpleTest(i).getLeft() |
java.lang.String |
getSimpleTestOperator(int i)Shorthand for getSimpleTestTable.getSimpleTest(i).getOperator() |
Expression |
getSimpleTestRight(int i)Shorthand for getSimpleTestTable.getSimpleTest(i).getRight() |
SimpleTestTable |
getSimpleTestTable()Get the table of tests for this Pattern. |
TableProperty<SimpleTest> |
getSimpleTestTableProperty()Get SimpleTestTable Property. |
static java.lang.String[] |
getSurroundingFormOptions(java.util.List<Pattern> patterns) |
java.lang.String |
getTestForm()get type of test associated with the Pattern. |
java.lang.String[] |
getTestFormOptions() |
SettableProperty<java.lang.String> |
getTestFormProperty()Get TestForm Property. |
int |
getTestFormSelected() |
java.lang.String |
getVariable() |
SettableProperty<java.lang.String> |
getVariableProperty()Get Variable Property. |
boolean |
hasFactType()Does the pattern have a fact type? |
boolean |
isVisible() |
void |
setConnective(java.lang.String connective)Set connective (and/or) which combines this Pattern with the following Pattern, if any. |
void |
setFactPath(java.lang.String factPath)Set the fact path. |
void |
setFactPathIDs(DOID[] factPathIDs)Set the IDs of the fact path. |
void |
setFactType(java.lang.String factType)Set the alias of the fact type. |
void |
setFactTypeID(DOID factTypeID)Set the ID of the fact type. |
void |
setForm(java.lang.String form)Set Form to Pattern.FORM_FACT_TYPE, Pattern.FORM_FACT_PATH, or Pattern.FORM_NESTED_TABLE. |
void |
setOperator(java.lang.String operator)Set Pattern operator. |
void |
setTestForm(java.lang.String testForm)set type of test associated with the Pattern. |
void |
setVariable(java.lang.String variable) |
Pattern |
surround() |
static Pattern |
surround(java.util.List<Pattern> patterns) |
Pattern |
surround(java.lang.String form) |
static Pattern |
surround(java.lang.String form, java.util.List<Pattern> patterns) |
| 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, get, 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, put, 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.ruleset.ScopedVariable |
|---|
getID, getRLName, isAssignable, setRLName, setRLName |
| 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 FORM_FACT_TYPE
public static final java.lang.String FORM_NESTED_TABLE
public static final java.lang.String FORM_FACT_PATH
public static final java.lang.String OPERATOR_FOREACH
OPERATOR_FOREACH corresponds to RL no pattern operator OPERATOR_SOME corresponds to RL exists pattern operator OPERATOR_NONE corresponds to RL not pattern operator OPERATOR_AGGREGATE corresponds to RL aggregate operator
public static final java.lang.String OPERATOR_SOME
public static final java.lang.String OPERATOR_NONE
public static final java.lang.String OPERATOR_AGGREGATE
public static final java.lang.String CONNECTIVE_AND
public static final java.lang.String CONNECTIVE_OR
public static final java.lang.String TEST_FORM_NOTEST
public static final java.lang.String TEST_FORM_SIMPLE
SimpleTest, located in SimpleTestTable.
public static final java.lang.String TEST_FORM_ADVANCED
Expression located in Expression property.
| Method Detail |
|---|
public void desurround()
public static Pattern surround(java.util.List<Pattern> patterns)
public static Pattern surround(java.lang.String form,
java.util.List<Pattern> patterns)
public Pattern surround()
public Pattern surround(java.lang.String form)
public static java.lang.String[] getSurroundingFormOptions(java.util.List<Pattern> patterns)
public Expression getSimpleTestLeft(int i)
i - ordinal of SimpleTest to retrieve from SimpleTestTablejava.lang.IndexOutOfBoundsExceptionpublic Expression getSimpleTestRight(int i)
i - ordinal of SimpleTest to retrieve from SimpleTestTablejava.lang.IndexOutOfBoundsExceptionpublic java.lang.String getSimpleTestOperator(int i)
i - ordinal of SimpleTest to retrieve from SimpleTestTablejava.lang.IndexOutOfBoundsExceptionpublic SettableProperty<java.lang.String> getFormProperty()
public java.lang.String getForm()
FORM_public void setForm(java.lang.String form)
Pattern.FORM_FACT_TYPE, Pattern.FORM_FACT_PATH, or Pattern.FORM_NESTED_TABLE. Note! For historical reasons, when you change to nested table, the fact type/path properties are copied to a newly created Pattern in the Pattern.getNestedTable().public java.lang.String[] getFormOptions()
public int getFormSelected()
public SettableProperty<java.lang.String> getFactTypeProperty()
public java.lang.String getFactType()
public void setFactType(java.lang.String factType)
public DOID getFactTypeID()
getFactTypeID in interface ScopedVariablepublic void setFactTypeID(DOID factTypeID)
public java.lang.String[] getFactTypeOptions()
public int getFactTypeSelected()
public SettableProperty<java.lang.String> getFactPathProperty()
public java.lang.String getFactPath()
public void setFactPath(java.lang.String factPath)
public DOID[] getFactPathIDs()
public void setFactPathIDs(DOID[] factPathIDs)
public java.lang.String[] getFactPathOptions()
public SettableProperty<java.lang.String> getTestFormProperty()
public java.lang.String getTestForm()
see TEST_FORM_ abovepublic void setTestForm(java.lang.String testForm)
see TEST_FORM_ abovepublic java.lang.String[] getTestFormOptions()
public int getTestFormSelected()
public TableProperty<SimpleTest> getSimpleTestTableProperty()
public SimpleTestTable getSimpleTestTable()
Pattern.hasFactType(). See SimpleTestpublic DictionaryProperty<Expression> getExpressionProperty()
public Expression getExpression()
public SettableProperty<java.lang.String> getVariableProperty()
public java.lang.String getVariable()
public void setVariable(java.lang.String variable)
public SettableProperty<java.lang.String> getOperatorProperty()
public java.lang.String getOperator()
Pattern.OPERATOR_FOREACH. Defaults to OPERATOR_FOREACHpublic void setOperator(java.lang.String operator)
Pattern.OPERATOR_FOREACH. Defaults to OPERATOR_FOREACHpublic java.lang.String[] getOperatorOptions()
public int getOperatorSelected()
public SettableProperty<java.lang.String> getConnectiveProperty()
public java.lang.String getConnective()
Util.CONNECTIVE_AND. Defaults to CONNECTIVE_AND.public void setConnective(java.lang.String connective)
Util.CONNECTIVE_AND. Defaults to CONNECTIVE_AND.public java.lang.String[] getConnectiveOptions()
public int getConnectiveSelected()
public TableProperty<Pattern> getNestedTableProperty()
public PatternTable getNestedTable()
public TableProperty<Aggregate> getAggregteTableProperty()
public AggregateTable getAggregateTable()
public java.lang.String getAlias()
getAlias in interface UnnamedComponentgetAlias in interface ScopedVariablegetAlias in class DictionaryComponentpublic boolean isVisible()
public boolean hasFactType()
|
Oracle Fusion Middleware Java API Reference for Oracle Business Rules 11g Release 1 (11.1.1) E10663-02 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||