Skip navigation links

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

E10663-05


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

public class SimpleTest
extends UnnamedRuleComponent

A SimpleTest consists of 3 items describing the immediate simple test:

  1. expression table containing 2 or more expressions,
  2. comparison operator,
  3. connective

and two items that control grouping behavior:

  1. a Form property and
  2. a SimpleTestTable.

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
 

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

 

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_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
 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()
           
 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)
           
 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, 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.dictionary.UnnamedComponent
getAlias, getName, getPropertyNames, setAlias, setName

 

Methods inherited from interface java.util.Map
equals, hashCode

 

Field Detail

FORM_NOT_NESTED

public static final java.lang.String FORM_NOT_NESTED
indicates no nested table exists any entries in nested Simple Test Table are ignored.
See Also:
Constant Field Values

FORM_NESTED

public static final java.lang.String FORM_NESTED
indicates a SimpleTestTable is expected to have entries Right and Left are ignored.
See Also:
Constant Field Values

Method Detail

getFormProperty

public SettableProperty<java.lang.String> getFormProperty()
Get Form Property.
Returns:
String SettableProperty

setForm

public void setForm(java.lang.String nf)

getForm

public java.lang.String getForm()

getFormOptions

public java.lang.String[] getFormOptions()

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 SettableProperty<java.lang.String> getConnectiveProperty()
Get Connective Property.
Returns:
String SettableProperty

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

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 void desurround()

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

Skip navigation links

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

E10663-05


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