Skip navigation links

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

E10663-03


oracle.rules.sdk2.datamodel
Class Function

java.lang.Object
  extended by oracle.rules.sdk2.dictionary.DictionaryObject
      extended by oracle.rules.sdk2.dictionary.DictionaryComponent
          extended by oracle.rules.sdk2.datamodel.ModelComponent
              extended by oracle.rules.sdk2.datamodel.TypedComponent
                  extended by oracle.rules.sdk2.datamodel.ConstrainableComponent
                      extended by oracle.rules.sdk2.datamodel.Function

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

public class Function
extends ConstrainableComponent
implements Callable, ParentComponent

Represent a RL function In addition to the usual getters and setters for designing the function, there is also Function.isTestEnabled() and Function.test(java.lang.StringBuilder) methods for providing a "Test" button in the UI that when pressed, actually invokes the defined function in a RuleSession and returns the result for the UI to display. See details for each method.

See Also:
Serialized Form

Nested Class Summary
static class Function.TestResult
           

 

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_FREE
          Deprecated. 
static java.lang.String FORM_STRUCTURED
          Deprecated. 

 

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_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_WRAPPER_SIGNATURE, PROP_WRITABLE, PROP_XML_NAME

 

Method Summary
 java.util.List<Action> getActions()
           
 ActionTable getActionTable()
          Retrieve the ActionTable used to create Function body (in place of Body parameter)
 TableProperty<Action> getActionTableProperty()
          Get ActionTable Property.
 java.util.List<java.util.List<DOID>> getAssertedTypeIDs()
           
 java.lang.String getBody()
          Deprecated. 
 java.lang.String[] getExceptions()
          Get all the exceptions of the function
 java.lang.String getForm()
          Deprecated. 
 FormalParameterTable getFormalParameterTable()
          Get all the parameters of the function
 TableProperty<FormalParameter> getFormalParameterTableProperty()
          Get FormalParameterTable Property.
 java.lang.String[] getFormOptions()
          Deprecated. 
 int getFormSelected()
          Deprecated. 
 java.lang.String getParameterList()
          Get parameter list as a String
 java.util.List<? extends Parameter> getParameters()
          Get all the parameters of the callable interface (Function/Method/Constructor) Function returns FormalParameterTable and Method/Constructor return OverloadedParameterTable
 java.util.List<Pattern> getPatterns()
           
 PatternTable getPatternTable()
           
 int getReturnExpressionTableSize()
           
 boolean isBuiltIn()
          Whether the funtion is a RL built-in function or user-defined function
 boolean isNameDistinct()
          are the names in the containing DictionaryComponentTable distinct?
 boolean isReturnTypePrimitive()
          Whether the return type of the function is primitive (i.e. int, char, double etc.)?
 boolean isTestEnabled()
          Should the UI enable the "Test" button?
 void setBody(java.lang.String body)
          Deprecated. 
 void setExceptions(java.lang.String[] exps)
          Set all the exceptions of the function
 void setForm(java.lang.String form)
          Deprecated. 
 boolean test(java.lang.StringBuilder stdout)
          Deprecated. 
 boolean test(java.lang.StringBuilder stdout, java.lang.ClassLoader parent)
          Execute this function in a new RuleSession, and return its result.
 Function.TestResult test(java.lang.StringBuilder stdout, java.lang.ClassLoader parent, java.lang.Integer level, java.lang.Integer limit)
           

 

Methods inherited from class oracle.rules.sdk2.datamodel.ConstrainableComponent
getBucketSetAlias, getBucketSetOptions, getBucketSetProperty, setBucketSet, setBucketSetByAlias, validate

 

Methods inherited from class oracle.rules.sdk2.datamodel.TypedComponent
getFullyQualifiedTypeName, getListContentType, getListContentTypeFullName, getListContentTypeID, getListContentTypeName, getListContentTypeOptions, getListContentTypeProperty, getType, getTypeID, getTypeName, getTypeOptions, getTypeProperty, getTypeSelected, isCollection, isPrimitiveType, setListContentType, setListContentTypeID, setListContentTypeName, setType, setTypeID, setTypeName

 

Methods inherited from class oracle.rules.sdk2.datamodel.ModelComponent
getParent, getParentTable, getVisibleProperty, isVisible, setVisible

 

Methods inherited from class oracle.rules.sdk2.dictionary.DictionaryComponent
clear, containsKey, containsValue, entrySet, get, getAlias, getAlias, getAliasProperty, getAllReferences, getCustom, getDependents, getDescription, getDescriptionProperty, getDiff, getDiffProperties, getDiffs, getFullyQualifiedAlias, getFullyQualifiedName, getName, getNameProperty, getNext, getObjectPath, getOptions, getPrevious, getProperties, getProperty, getSelected, hasDiff, init, isAliasDistinct, isEmpty, isFullyQualifiedName, keySet, put, putAll, remove, setAlias, setCustom, setDescription, setName, size, 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
getClass, notify, notifyAll, toString, wait, wait, wait

 

Methods inherited from interface oracle.rules.sdk2.datamodel.Callable
getFullyQualifiedName, getID, getType, getTypeID

 

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

 

Field Detail

FORM_STRUCTURED

@Deprecated
public static final java.lang.String FORM_STRUCTURED
Deprecated. 
See Also:
Constant Field Values

FORM_FREE

@Deprecated
public static final java.lang.String FORM_FREE
Deprecated. 
See Also:
Constant Field Values

Method Detail

getForm

@Deprecated
public java.lang.String getForm()
Deprecated. 

setForm

@Deprecated
public void setForm(java.lang.String form)
Deprecated. 

getFormOptions

@Deprecated
public java.lang.String[] getFormOptions()
Deprecated. 

getFormSelected

@Deprecated
public int getFormSelected()
Deprecated. 

isBuiltIn

public boolean isBuiltIn()
Whether the funtion is a RL built-in function or user-defined function
Returns:
true if the funtion is a RL built-in function

getFormalParameterTableProperty

public TableProperty<FormalParameter> getFormalParameterTableProperty()
Get FormalParameterTable Property.
Returns:
FormalParameter TableProperty

getFormalParameterTable

public FormalParameterTable getFormalParameterTable()
Get all the parameters of the function
Returns:
The list of parameters of the funciton.

getActionTableProperty

public TableProperty<Action> getActionTableProperty()
Get ActionTable Property.
Returns:
Action TableProperty

getActionTable

public ActionTable getActionTable()
Retrieve the ActionTable used to create Function body (in place of Body parameter)
Specified by:
getActionTable in interface ParentComponent

getParameters

public java.util.List<? extends Parameter> getParameters()
Description copied from interface: Callable
Get all the parameters of the callable interface (Function/Method/Constructor) Function returns FormalParameterTable and Method/Constructor return OverloadedParameterTable
Specified by:
getParameters in interface Callable
Returns:
all the formal parameters of the callable interface

getExceptions

public java.lang.String[] getExceptions()
Get all the exceptions of the function
Returns:
The list of exceptions of the function.

setExceptions

public void setExceptions(java.lang.String[] exps)
Set all the exceptions of the function
Parameters:
exps - The list of exceptions of the function.

getActions

public java.util.List<Action> getActions()
Specified by:
getActions in interface ParentComponent

getPatterns

public java.util.List<Pattern> getPatterns()
Specified by:
getPatterns in interface ParentComponent

getPatternTable

public PatternTable getPatternTable()
Specified by:
getPatternTable in interface ParentComponent

getReturnExpressionTableSize

public int getReturnExpressionTableSize()

getBody

@Deprecated
public java.lang.String getBody()
Deprecated. 
Get function body as a String
Returns:
Body of the function

setBody

@Deprecated
public void setBody(java.lang.String body)
Deprecated. 
Set function body
Parameters:
body - A string represeting body of the function

isReturnTypePrimitive

public boolean isReturnTypePrimitive()
Whether the return type of the function is primitive (i.e. int, char, double etc.)?
Returns:
true if return type is primitive; false if return type is java or RL class

getParameterList

public java.lang.String getParameterList()
Get parameter list as a String
Specified by:
getParameterList in interface Callable
Returns:
return the method's parameter list in the format paramType, paramType ...

isNameDistinct

public boolean isNameDistinct()
Description copied from class: DictionaryComponent
are the names in the containing DictionaryComponentTable distinct?
Overrides:
isNameDistinct in class DictionaryComponent

getAssertedTypeIDs

public java.util.List<java.util.List<DOID>> getAssertedTypeIDs()

isTestEnabled

public boolean isTestEnabled()
Should the UI enable the "Test" button? The "Test" button is used to actually invoke the function in a new RuleSession and return whether it passed or failed. To be enabled, the function must take no parameters and return boolean, and the containing RuleDictionary must be valid.
Returns:
boolean indicating the "Test" button is enabled
See Also:
Function.test(java.lang.StringBuilder)

test

@Deprecated
public boolean test(java.lang.StringBuilder stdout)
             throws RLException,
                    SDKException
Deprecated. 
Throws:
RLException
SDKException

test

public boolean test(java.lang.StringBuilder stdout,
                    java.lang.ClassLoader parent)
             throws RLException,
                    SDKException
Execute this function in a new RuleSession, and return its result. The UI should call this when the user presses the "Test" button. The "Test" button should be enabled when Function.isTestEnabled() is true. The UI should invoke test() as follows:
 Function f;
 StringBuilder output = new StringBuilder();
 try {
     boolean testPassed = f.test(output);
     // display Test Passed or Test Failed
 }
 catch (Exception e) {
     // display information about e, including stacktrace
 }
 // display output
 
Parameters:
stdout - the output StringBuilder
Returns:
success or failure of executing the function
Throws:
RLException
SDKException

test

public Function.TestResult test(java.lang.StringBuilder stdout,
                                java.lang.ClassLoader parent,
                                java.lang.Integer level,
                                java.lang.Integer limit)
                         throws RLException,
                                SDKException
Throws:
RLException
SDKException

Skip navigation links

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

E10663-03


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