|
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.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.
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 | |
---|---|
class |
Pattern.FactPathProperty
|
class |
Pattern.VariableProperty
|
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_TYPE
Use with Pattern Form. |
static java.lang.String |
FORM_NESTED_TABLE
|
static java.lang.String |
OPERATOR_AGGREGATE
|
static java.lang.String |
OPERATOR_FOREACH
Use with Pattern Operator. |
static java.lang.String |
OPERATOR_NONE
|
static java.lang.String |
OPERATOR_SOME
|
static java.lang.String |
TEST_FORM_ADVANCED
TEST_FORM_ADVANCED Specifies the use of boolean Expression located in Expression property. |
static java.lang.String |
TEST_FORM_NOTEST
Specifies test form. |
static java.lang.String |
TEST_FORM_SIMPLE
TEST_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 |
getAlias(boolean translate)
Get alias of DictionaryComponent. |
java.lang.String |
getConnective()
Get connective (and/or) which combines this Pattern with the following Pattern, if any. |
java.lang.String[] |
getConnectiveOptions()
|
TranslatedProperty |
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 |
Pattern.FactPathProperty |
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 |
AliasRefProperty |
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()
|
TranslatedProperty |
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()
|
TranslatedProperty |
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()
|
TranslatedProperty |
getTestFormProperty()
Get TestForm Property. |
int |
getTestFormSelected()
|
java.lang.String |
getVariable()
|
java.lang.String |
getVariable(boolean translate)
|
Pattern.VariableProperty |
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, 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 |
---|
equals, 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 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 SimpleTestTable
java.lang.IndexOutOfBoundsException
public Expression getSimpleTestRight(int i)
i
- ordinal of SimpleTest to retrieve from SimpleTestTable
java.lang.IndexOutOfBoundsException
public java.lang.String getSimpleTestOperator(int i)
i
- ordinal of SimpleTest to retrieve from SimpleTestTable
java.lang.IndexOutOfBoundsException
public TranslatedProperty 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 AliasRefProperty getFactTypeProperty()
public java.lang.String getFactType()
public void setFactType(java.lang.String factType)
public DOID getFactTypeID()
public void setFactTypeID(DOID factTypeID)
public java.lang.String[] getFactTypeOptions()
public int getFactTypeSelected()
public Pattern.FactPathProperty 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 TranslatedProperty getTestFormProperty()
public java.lang.String getTestForm()
see TEST_FORM_ above
public void setTestForm(java.lang.String testForm)
see TEST_FORM_ above
public java.lang.String[] getTestFormOptions()
public int getTestFormSelected()
public TableProperty<SimpleTest> getSimpleTestTableProperty()
public SimpleTestTable getSimpleTestTable()
Pattern.hasFactType()
.
See SimpleTest
public DictionaryProperty<Expression> getExpressionProperty()
public Expression getExpression()
public Pattern.VariableProperty getVariableProperty()
public java.lang.String getVariable()
public java.lang.String getVariable(boolean translate)
public void setVariable(java.lang.String variable)
public TranslatedProperty getOperatorProperty()
public java.lang.String getOperator()
Pattern.OPERATOR_FOREACH
. Defaults to OPERATOR_FOREACH
public void setOperator(java.lang.String operator)
Pattern.OPERATOR_FOREACH
. Defaults to OPERATOR_FOREACH
public java.lang.String[] getOperatorOptions()
public int getOperatorSelected()
public TranslatedProperty 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 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 isVisible()
public boolean hasFactType()
|
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 |