Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1.6.3)

E10663-10


oracle.rules.sdk2.ruleset
Class SimpleTest

java.lang.Object
  extended by oracle.rules.sdk2.dictionary.DictionaryObject
      extended by oracle.rules.sdk2.dictionary.DictionaryComponent
          extended by oracle.rules.sdk2.ruleset.RuleComponent
              extended by oracle.rules.sdk2.ruleset.UnnamedRuleComponent
                  extended by oracle.rules.sdk2.ruleset.SimpleTest

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>, UnnamedComponent, ScopedVariable

public class SimpleTest
extends UnnamedRuleComponent
implements ScopedVariable

A SimpleTest has one of 4 Forms:

  1. FORM_SIMPLE (was FORM_NOT_NESTED)
  2. FORM_VARIABLE_DEFINITION
  3. FORM_NESTED
  4. FORM_NESTED_NOT

All forms use the Connective property to specify whether this test is connected to the next test in the containing table by "And" or "Or". FORM_SIMPLE consists of 3 additional properties describing the immediate simple test:

FORM_VARIABLE_DEFINITION consists of 2 additional properties:

The variable name is in scope in following ANDed tests, and in following ANDed patterns (if AND-connected)

> 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
 

between and in

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)

See Also:
Serialized Form

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.
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.

 

Fields inherited from class oracle.rules.sdk2.dictionary.DictionaryComponent
PROP_ACCESS, PROP_ACTION_SELECTED, PROP_ACTION_TABLE, PROP_ACTIVE, PROP_ADVANCED_MODE, PROP_AGGREGATE, PROP_AGGREGATE_TABLE, PROP_ALIAS, PROP_ALLOW_GAPS, PROP_ALWAYS_SELECTED, PROP_ARRAY, PROP_ARRAY_COMPONENT_TYPE, PROP_ARRAY_COMPONENT_TYPE_ID, PROP_ARRAY_FACT_TYPE_TABLE, PROP_AUTO_CONFLICT_RESOLUTION, PROP_AUTO_PATTERN_PROPERTY, PROP_BODY, PROP_BUCKET_ID_TABLE, PROP_BUCKET_SET, PROP_BUCKET_SET_ID, PROP_BUCKET_SET_TABLE, PROP_BUCKET_TABLE, PROP_CALENDAR_FORM, PROP_CHECK_RULE_FLOW, PROP_CHILD_DIMENSION_NODES, PROP_CONFLICT, PROP_CONFLICT_POLICY, PROP_CONNECTIVE, PROP_CONSTANT, PROP_CONSTRUCTOR, PROP_CONSTRUCTOR_TABLE, PROP_CREATION_UPDATE_NUMBER, PROP_CURSOR_POSITION, PROP_CUSTOM_BINDING, PROP_CUSTOMIZABLE, PROP_CUSTOMIZABLE_TEMPLATE, PROP_DATA_MODEL, PROP_DATA_SOURCE, PROP_DECISION_FUNCTION, PROP_DECISION_FUNCTION_INPUT_TABLE, PROP_DECISION_FUNCTION_OUTPUT_TABLE, PROP_DECISION_FUNCTION_RULESET_TABLE, PROP_DECISION_FUNCTION_TABLE, PROP_DESCRIPTION, PROP_DICTIONARY_LINK_TABLE, PROP_DIMENSION_NODE_TABLE, PROP_DIMENSION_TABLE, PROP_DT_ACTION_NODE_TABLE, PROP_DT_ACTION_PARAMETER_NAME, PROP_DTACTION_TABLE, PROP_DTRULE_TABLE, PROP_EFFECTIVE_END_DATE, PROP_EFFECTIVE_START_DATE, PROP_ENUM, PROP_ENUM_BUCKET_SET_ID, PROP_ENUM_TYPE, PROP_EXCEPTION_IDS, PROP_EXCEPTIONS, PROP_EXCLUDED, PROP_EXPRESSION, PROP_EXPRESSION_TABLE, PROP_FACT_PATH, PROP_FACT_PATH_IDS, PROP_FACT_TYPE, PROP_FACT_TYPE_ID, PROP_FACT_TYPE_TABLE, PROP_FIELD_TABLE, PROP_FINAL, PROP_FORM, PROP_FORMAL_PARAMETER_TABLE, PROP_FUNCTION, PROP_FUNCTION_ID, PROP_FUNCTION_SIGNATURE, PROP_FUNCTION_TABLE, PROP_GENERATED_FROM, PROP_ID, PROP_ID_COUNTER, PROP_INCLUDED, PROP_INTERFACE, PROP_INTERFACE_IDS, PROP_INTERFACES, PROP_IS_ABSTRACT, PROP_IS_CONSTANT, PROP_IS_ENUM, PROP_IS_FINAL, PROP_IS_JAXB2, PROP_IS_PRIMARY_KEY, PROP_IS_STATIC, PROP_IS_TOPLEVEL_VIEW_OBJECT, PROP_LEFT, PROP_LIFECYCLE, PROP_LIFECYCLE_DESCRIPTION, PROP_LIST, PROP_LIST_CONTENT_TYPE, PROP_LIST_CONTENT_TYPE_ID, PROP_LOCAL, PROP_LOGICAL, PROP_METHOD_TABLE, PROP_MODIFIERS, PROP_NAME, PROP_NAMESPACE, PROP_NESTED_TABLE, PROP_NO_CONFLICT, PROP_NODE_NAME, PROP_OPERATOR, PROP_OPERATOR_ID, PROP_ORDER_RULES_BY_BUCKET, PROP_OTHERWISE, PROP_OUTPUT_TYPES, PROP_OVERLOADED_PARAMETER_TABLE, PROP_OVERRIDDEN_BY, PROP_OVERRIDE, PROP_PACKAGE, PROP_PARAMETER_ALIAS, PROP_PARAMETER_ID, PROP_PARAMETER_LIST, PROP_PARAMETER_NAME, PROP_PARAMETER_REQUIRED, PROP_PARAMETER_TYPE_IDS, PROP_PARAMETER_TYPES, PROP_PARENT_DIMENSION_NODE, PROP_PATTERN_TABLE, PROP_PREFIX_LINKED_NAMES, PROP_PRIORITY, PROP_PRIVATE_BUCKET_SET, PROP_PROPERTIES, PROP_PROPERTY_TABLE, PROP_READABLE, PROP_REF_ID, PROP_REPORT_BYUSE_NAMES, PROP_REPORT_PATTERNS, PROP_RESOLVED_TARGET, PROP_RESOLVED_VALUE, PROP_RETURN_TYPE, PROP_RIGHT, PROP_RIGHT_SEPARATOR, PROP_RULE_FIRING_LIMIT, PROP_RULE_REPORT_TABLE, PROP_RULE_SET_TABLE, PROP_RULE_SHEET_TABLE, PROP_RULE_TABLE, PROP_RULESET, PROP_RUN_AFTER, PROP_RUN_BEFORE, PROP_SERVICE_CONFIGURATION, PROP_SERVICE_NAME, PROP_SERVICE_NAMESPACE, PROP_SHARED_BUCKET_SET, PROP_SHARED_BUCKET_SET_ID, PROP_SHOW_CONSTANTS, PROP_SHOW_FUNCTIONS, PROP_SHOW_VARIABLES, PROP_SIMPLE_TEST_TABLE, PROP_SOURCE, PROP_STATELESS, PROP_STATIC, PROP_SUPER_CLASS, PROP_SUPER_CLASS_ID, PROP_SUPPORT_XPATH, PROP_SUPPORTS_XPATH_ENABLED, PROP_SYSTEM, PROP_TARGET, PROP_TARGET_PACKAGE, PROP_TEST_FORM, PROP_TIMESTAMP, PROP_TOKEN_UNDER_CURSOR, PROP_TREE, PROP_TREE_MODE, PROP_TYPE, PROP_TYPE_ID, PROP_TYPE_IDS, PROP_TYPES, PROP_UPDATE_NUMBER, PROP_VALIDATION_UPDATE_NUMBER, PROP_VALUE, PROP_VALUES, PROP_VARIABLE, PROP_VARIABLE_TABLE, PROP_VERSION, PROP_VISIBILITY_FILTER, PROP_VISIBILITY_FILTER_ENABLED, PROP_VISIBLE, PROP_WEB_SERVICE, PROP_WRITABLE, PROP_XML_NAME

 

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 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()
           
 TranslatedProperty 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.DictionaryComponent
clear, containsKey, containsValue, entrySet, getAlias, getAliasProperty, getAllReferences, getCustom, getDependents, getDescription, getDescriptionProperty, getDiff, getDiffProperties, getDiffs, getFullyQualifiedAlias, getFullyQualifiedName, getIndex, getIndex, 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, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Methods inherited from interface oracle.rules.sdk2.ruleset.ScopedVariable
getFactTypeID, getID, getRLName, getRLValue, 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

FORM_SIMPLE

public static final java.lang.String FORM_SIMPLE
indicates a variant of <expression> <operator> <expression> SimpleTestTable and Variable properties are not used.
See Also:
Constant Field Values

FORM_NOT_NESTED

@Deprecated
public static final java.lang.String FORM_NOT_NESTED
Deprecated. use SimpleTest.FORM_SIMPLE
indicates a variant of <expression> <operator> <expression>
See Also:
Constant Field Values

FORM_VARIABLE_DEFINITION

public static final java.lang.String FORM_VARIABLE_DEFINITION
indicates <variable> = <expression> SimpleTestTable property is ignored.
See Also:
Constant Field Values

FORM_NESTED

public static final java.lang.String FORM_NESTED
indicates a SimpleTestTable is expected to have entries. ExpressionTable and Variable properties are ignored. Normally this is just "( test and/or test ... )", but could be "not ( test and/or test ... )" if operator is NOT
See Also:
Constant Field Values

FORM_NESTED_NOT

public static final java.lang.String FORM_NESTED_NOT
indicates a SimpleTestTable is expected to have entries. ExpressionTable is ignored. This is always "not( test and/or test ... )". The operator is always NOT.
See Also:
Constant Field Values

Method Detail

getFormProperty

public TranslatedProperty getFormProperty()
Get Form Property.
Returns:
TranslatedProperty

setForm

public void setForm(java.lang.String form)
Set form of this test.
Parameters:
form - the untranslated form. Form can be set using a translated form string using getFormProperty().setTranslatedForm(translatedForm)

getForm

public java.lang.String getForm()
Get untranslated form of this test. Translated form can be gotten from getFormProperty().getTranslatedValue()
Returns:
untranslated form

getFormOptions

public java.lang.String[] getFormOptions()
Get untranslated options for the form of this test. Translated options can be gotten from getFormProperty().getTranslatedOptions()
Returns:
untranslated options

getFormSelected

public int getFormSelected()

getOperatorProperty

public TranslatedProperty getOperatorProperty()
Get Operator Property.
Returns:
String SettableProperty

getOperator

public java.lang.String getOperator()

setOperator

public void setOperator(java.lang.String operator)

getOperatorID

public DOID getOperatorID()

setOperatorID

public void setOperatorID(DOID operator)

getOperatorOptions

public java.lang.String[] getOperatorOptions()

getOperatorSelected

public int getOperatorSelected()

getExpressionTable

public ExpressionTable getExpressionTable()
Get the expressions related by the test operator. Entry 0 is the left hand side, entry 1 is the right hand side. Entry 2 and above may apply if SimpleTest.getRightSeparator() returns other than "".
Returns:
expression table

getLeft

public Expression getLeft()
Short for getExpressionTableProperty().getValue().get(0)
Returns:
first expression in the table

getRight

public Expression getRight()
Short for getExpressionTableProperty().getValue().get(1)
Returns:
second expression in the table

getConnectiveProperty

public TranslatedProperty getConnectiveProperty()
Get Connective Property.
Returns:
TranslatedProperty

getConnective

public java.lang.String getConnective()
Get the connective (and/or) combining this pattern with the next in the table. Defaults to Util.CONNECTIVE_AND if not set

setConnective

public void setConnective(java.lang.String connective)
Set the connective (and/or) combining this pattern with the next in the table. Defaults to Util.CONNECTIVE_AND if not set

getConnectiveOptions

public java.lang.String[] getConnectiveOptions()

getConnectiveSelected

public int getConnectiveSelected()

getSimpleTestTableProperty

public TableProperty<SimpleTest> getSimpleTestTableProperty()
Get SimpleTestTable Property.
Returns:
SimpleTest TableProperty

getSimpleTestTable

public SimpleTestTable getSimpleTestTable()
Get the nested table of SimpleTests. This must contain at least one entry if the form is set to FORM_NESTED_TABLE

getVariableProperty

public SettableProperty<java.lang.String> getVariableProperty()
Get Variable Property.
Returns:
String SettableProperty

getVariable

public java.lang.String getVariable()

setVariable

public void setVariable(java.lang.String variable)

get

public java.lang.Object get(java.lang.Object key)
Description copied from class: DictionaryComponent
Generic property getter.

Please see the specific bean class for a list of properties.

Specified by:
get in interface java.util.Map<java.lang.String,java.lang.Object>
Overrides:
get in class UnnamedRuleComponent
Parameters:
key - a String containing the property name to be fetched.
Returns:
the value corresponding to the key: a String, String[], DictionaryComponent, DictionaryComponentTable, etc.

put

public java.lang.Object put(java.lang.String key,
                            java.lang.Object value)
Description copied from class: DictionaryComponent
Generic property setter. Throws runtime exceptions for incorrect arguments. Please see the specific bean class for a list of properties, their types, and permissible values.

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.

Specified by:
put in interface java.util.Map<java.lang.String,java.lang.Object>
Overrides:
put in class UnnamedRuleComponent
Parameters:
key - the key of the property to set
value - the value of the named property to set
Returns:
the previous value of the property

getRightSeparator

public java.lang.String getRightSeparator()

desurround

public SimpleTest desurround()
if this is a nested simple test, replace it with the nested simple tests. If not nested, do nothing. If the return value is not this SimpleTest, then this SimpleTest has been removed from the dictionary and should not be referenced again.
Returns:
the simple test replacing this one, or this if this is not nested, or null, if this is nested but empty

surround

public static SimpleTest surround(java.util.List<SimpleTest> sts)

surround

public static SimpleTest surround(java.lang.String form,
                                  java.util.List<SimpleTest> sts)

surround

public SimpleTest surround()

surround

public SimpleTest surround(java.lang.String form)

getSurroundingFormOptions

public static java.lang.String[] getSurroundingFormOptions(java.util.List<SimpleTest> sts)

isBuiltInOperator

public boolean isBuiltInOperator()

isVisible

public boolean isVisible()
Should this test be rendered in the current mode? Tree mode generates join tests that are hidden in tree mode.
Returns:
boolean flag

getAlias

public 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)
Specified by:
getAlias in interface UnnamedComponent
Specified by:
getAlias in interface ScopedVariable
Overrides:
getAlias in class DictionaryComponent
Returns:
the name of the pattern bind variable

isNested

public boolean isNested()
is this test nested, e.g. (...) or not(...)
Returns:
boolean

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1.6.3)

E10663-10


Copyright © 2012, Oracle and/or its affiliates. All rights reserved.