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

E10663-11

oracle.rules.sdk2.ruleset
Class Action

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.Action
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>, UnnamedComponent
Direct Known Subclasses:
DTAction

public class Action
extends UnnamedRuleComponent

An action, such as assert, assign, call, or retract.

When using this interface, selecting the Form property first will fix the options for target, which in turn will fix the number of expressions and the option list for each. The expressions cannot be added to the table; this is done automatically when the form or target is selected.

Actions are described using a combination of properties, dictated by the Form property:

The valid combinations and meaning are described in the following table.
Form SimpleTestTable ExpressionTable ActionTable Variable Target
rl - - - - RL
call - arguments - - function or method
assert - object to assert - - object to assert
assert tree - tree to assert - - tree to assert
assert new - property values - - fact type
retract - fact to retract - - fact to retract
assign - RHS - - LHS
assign new - initial value - name fact type
expression - expression - - -
modify - property values - - fact to modify
synchronized- lock object - - lock object
if - boolean expression if actions - -
else if - boolean expression if actions - -
if test test - if actions - -
else if testtest - if actions - -
else - - else actions - -
for - List expression loop actions loop var list content type
while - boolean expression loop actions - -
while test test - loop actions - -
return - return expression - - -
throw - throw expression - - -
try - - try actions - -
catch - - catch actionsexcep nameexcep type
finally - - final actions- -
Actions may be executed conditionally and in blocks by using an Action form that provides a nested ActionTable. Actions listed in a nested ActionTable are only executed if the conditions in the parent action are satisfied, or a preceeding Action conditional dropped through to the nested Action Table. Tests that apply property of an ActionTable should not be confused with the Test property of a Rule's Pattern. A Pattern test is used to match and select FACTS in working memory. An Action Test does not refer to facts; it only contains expressions consisting of variable references and literals. For Actions that complete the action portion of a rule, a variable may be an instance reference to FACT selected by the rule's Pattern. For Actions used in a Function body, no FACT instances are available.
For example, an If action (FORM_IF) is required to have a nested block. The nested block contains any statements that in within the scope of the if test FORM_IF ActionTable contains the statment belonging to the if condition expression

The for action supports both for (i = 0; i < 10; i = i + 1) and for (Foo f : listFoo). The first form is deprecated. The UI should support the second form as follows: for (<type> <var> : <collection>) { The type is bound to Action.target, the var is bound to Action.variable, and collection is bound to Action.expression(0).value

See Also:
Serialized Form

Nested Class Summary
 class Action.FormProperty
           
 class Action.TargetProperty
          A target property can get and set its translated value using its expression parser.
 
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_ADVANCED
           
static java.lang.String FORM_ASSERT
           
static java.lang.String FORM_ASSERT_NEW
           
static java.lang.String FORM_ASSERT_TREE
           
static java.lang.String FORM_ASSIGN
           
static java.lang.String FORM_ASSIGN_NEW
           
static java.lang.String FORM_BASIC
           
static java.lang.String FORM_CALL
           
static java.lang.String FORM_CATCH
           
static java.lang.String FORM_DEFAULT
           
static java.lang.String FORM_ELSE
           
static java.lang.String FORM_ELSE_IF
           
static java.lang.String FORM_ELSE_IF_TEST
           
static java.lang.String FORM_EXPRESSION
           
static java.lang.String FORM_FINALLY
           
static java.lang.String FORM_FOR
           
static java.lang.String FORM_IF
           
static java.lang.String FORM_IF_TEST
           
static java.lang.String FORM_MODIFY
           
static java.lang.String FORM_RETRACT
           
static java.lang.String FORM_RETURN
           
static java.lang.String FORM_RL
           
static java.lang.String FORM_SYNCHRONIZED
           
static java.lang.String FORM_TEST
           
static java.lang.String FORM_THROW
           
static java.lang.String FORM_TRY
           
static java.lang.String FORM_WHILE
           
static java.lang.String FORM_WHILE_TEST
           
static java.lang.String KEYWORD_DO
           
static java.lang.String KEYWORD_THEN
           
 
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, 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_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_RESOURCE_BUNDLE, PROP_RETURN_TYPE, PROP_RIGHT, PROP_RIGHT_SEPARATOR, PROP_RULE_FIRING_LIMIT, PROP_RULE_FIRING_LIMIT_ERROR, 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_TRANSLATED_ALIAS, PROP_TRANSLATED_DESCRIPTION, PROP_TRANSLATED_PARAMETER_LIST, PROP_TRANSLATED_VARIABLE, PROP_TREE, PROP_TREE_MODE, PROP_TYPE, PROP_TYPE_ID, PROP_TYPE_IDS, PROP_TYPES, PROP_UNSAVED_TRANSLATED_ALIAS, PROP_UNSAVED_TRANSLATED_DESCRIPTION, PROP_UPDATE_NUMBER, PROP_UPDATE_TIME, 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()
           
 ActionTable getActionTable()
           
 TableProperty<Action> getActionTableProperty()
          Get ActionTable Property.
 java.util.List<DOID> getAEReferences()
          Get the DOIDs referenced by all directly or indirectly contained actions and expressions
 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.util.List<DOID> getAllReferences()
          Get the DOIDs referenced by this component or contained components
 Expression getExpression(int i)
          Shorthand for getExpressionTable.getExpression(i)
 Expression getExpressionByParameterAlias(java.lang.String parameterAlias)
          Get Expression from this action's expression table by parameter alias.
 Expression getExpressionByParameterName(java.lang.String parameterName)
          Get Expression from this action's expression table by parameter name.
 ExpressionTable getExpressionTable()
           
 TableProperty<Expression> getExpressionTableProperty()
          Get ExpressionTable Property.
 DOID getFactTypeID()
           
 java.lang.String getForm()
          Get What kind of action.
 java.lang.String[] getFormOptions()
           
 Action.FormProperty getFormProperty()
          Get Form Property.
 int getFormSelected()
           
 java.util.List<DOID> getReferences()
          Get the DOIDs referenced by this component (but not the contained components)
 SimpleTestTable getSimpleTestTable()
           
 TableProperty<SimpleTest> getSimpleTestTableProperty()
          Get SimpleTestTable Property.
static java.util.List<Choice> getSurroundingFormChoices(java.util.List<Action> actions)
           
static java.lang.String[] getSurroundingFormOptions(java.util.List<Action> actions)
           
static java.lang.String[] getSurroundingFormOptions(java.util.List<Action> actions, boolean translate)
           
 java.lang.String getTarget()
           
 DOID getTargetID()
           
 java.lang.String[] getTargetOptions()
           
 Action.TargetProperty getTargetProperty()
          Get Target Property.
 int getTargetSelected()
           
 java.lang.String getVariable()
           
 SettableProperty<java.lang.String> getVariableProperty()
          Get Variable Property.
 boolean hasNestedActions()
          can this action's actionTable contain actions?
 boolean hasTarget()
          Does this form of action have a target?
 boolean isValueRequired(Expression e)
           
 void setForm(java.lang.String form)
          Set What kind of action.
 void setTarget(java.lang.String target)
           
 void setVariable(java.lang.String v)
           
 Action surround(java.lang.String form)
           
static Action surround(java.lang.String form, java.util.List<Action> actions)
           
 
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, get, getAlias, getAlias, getAliasProperty, getCustom, getDependents, getDescription, getDescription, getDescriptionProperty, getDiff, getDiffProperties, getDiffs, getFullyQualifiedAlias, getFullyQualifiedName, getIndex, getIndex, getName, getNameProperty, getNext, getObjectPath, getOptions, getPrevious, getProperties, getProperty, getSelected, getTranslatedAlias, getTranslatedAlias, getTranslatedDescription, hasDiff, init, isEmpty, isFullyQualifiedName, isSystemProperty, isUnsavedTranslatedAlias, isUnsavedTranslatedDescription, keySet, put, putAll, remove, setAlias, setAlias, setCustom, setDescription, setDescription, setName, setTranslatedAlias, setTranslatedDescription, size, validate, validate, values
 
Methods inherited from class oracle.rules.sdk2.dictionary.DictionaryObject
equals, exists, 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
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

FORM_DEFAULT

public static final java.lang.String FORM_DEFAULT
See Also:
Constant Field Values

FORM_ASSERT

public static final java.lang.String FORM_ASSERT
See Also:
Constant Field Values

FORM_ASSERT_TREE

public static final java.lang.String FORM_ASSERT_TREE
See Also:
Constant Field Values

FORM_ASSERT_NEW

public static final java.lang.String FORM_ASSERT_NEW
See Also:
Constant Field Values

FORM_ASSIGN

public static final java.lang.String FORM_ASSIGN
See Also:
Constant Field Values

FORM_CALL

public static final java.lang.String FORM_CALL
See Also:
Constant Field Values

FORM_RETRACT

public static final java.lang.String FORM_RETRACT
See Also:
Constant Field Values

FORM_RL

public static final java.lang.String FORM_RL
See Also:
Constant Field Values

FORM_ASSIGN_NEW

public static final java.lang.String FORM_ASSIGN_NEW
See Also:
Constant Field Values

FORM_EXPRESSION

public static final java.lang.String FORM_EXPRESSION
See Also:
Constant Field Values

FORM_IF

public static final java.lang.String FORM_IF
See Also:
Constant Field Values

FORM_ELSE

public static final java.lang.String FORM_ELSE
See Also:
Constant Field Values

FORM_ELSE_IF

public static final java.lang.String FORM_ELSE_IF
See Also:
Constant Field Values

FORM_THROW

public static final java.lang.String FORM_THROW
See Also:
Constant Field Values

FORM_CATCH

public static final java.lang.String FORM_CATCH
See Also:
Constant Field Values

FORM_TRY

public static final java.lang.String FORM_TRY
See Also:
Constant Field Values

FORM_FINALLY

public static final java.lang.String FORM_FINALLY
See Also:
Constant Field Values

FORM_FOR

public static final java.lang.String FORM_FOR
See Also:
Constant Field Values

FORM_MODIFY

public static final java.lang.String FORM_MODIFY
See Also:
Constant Field Values

FORM_WHILE

public static final java.lang.String FORM_WHILE
See Also:
Constant Field Values

FORM_RETURN

public static final java.lang.String FORM_RETURN
See Also:
Constant Field Values

FORM_SYNCHRONIZED

public static final java.lang.String FORM_SYNCHRONIZED
See Also:
Constant Field Values

FORM_IF_TEST

public static final java.lang.String FORM_IF_TEST
See Also:
Constant Field Values

FORM_ELSE_IF_TEST

public static final java.lang.String FORM_ELSE_IF_TEST
See Also:
Constant Field Values

FORM_WHILE_TEST

public static final java.lang.String FORM_WHILE_TEST
See Also:
Constant Field Values

FORM_BASIC

public static final java.lang.String FORM_BASIC
See Also:
Constant Field Values

FORM_TEST

public static final java.lang.String FORM_TEST
See Also:
Constant Field Values

FORM_ADVANCED

public static final java.lang.String FORM_ADVANCED
See Also:
Constant Field Values

KEYWORD_THEN

public static final java.lang.String KEYWORD_THEN
See Also:
Constant Field Values

KEYWORD_DO

public static final java.lang.String KEYWORD_DO
See Also:
Constant Field Values
Method Detail

desurround

public void desurround()

surround

public Action surround(java.lang.String form)

surround

public static Action surround(java.lang.String form,
                              java.util.List<Action> actions)

getSurroundingFormOptions

public static java.lang.String[] getSurroundingFormOptions(java.util.List<Action> actions)

getSurroundingFormOptions

public static java.lang.String[] getSurroundingFormOptions(java.util.List<Action> actions,
                                                           boolean translate)

getSurroundingFormChoices

public static java.util.List<Choice> getSurroundingFormChoices(java.util.List<Action> actions)

isValueRequired

public boolean isValueRequired(Expression e)

hasNestedActions

public boolean hasNestedActions()
can this action's actionTable contain actions?

Returns:
boolean

getExpression

public Expression getExpression(int i)
Shorthand for getExpressionTable.getExpression(i)

Parameters:
i - ordinal of SimpleTest to retrieve from SimpleTestTable
Returns:
the Expression on the left side of the SimpleTest
Throws:
java.lang.IndexOutOfBoundsException

getExpressionByParameterName

public Expression getExpressionByParameterName(java.lang.String parameterName)
Get Expression from this action's expression table by parameter name.

Parameters:
parameterName - name of parameter
Returns:
Expression corresponding to value of named parameter, or null if no such parameter.

getExpressionByParameterAlias

public Expression getExpressionByParameterAlias(java.lang.String parameterAlias)
Get Expression from this action's expression table by parameter alias.

Parameters:
parameterAlias - alias of parameter
Returns:
Expression corresponding to value of named parameter, or null if no such parameter.

getFormProperty

public Action.FormProperty getFormProperty()
Get Form Property.

Returns:
String SettableProperty

getForm

public java.lang.String getForm()
Get What kind of action. see FORM_ above


setForm

public void setForm(java.lang.String form)
Set What kind of action. see FORM_ above


getFormOptions

public java.lang.String[] getFormOptions()

getFormSelected

public int getFormSelected()

getTargetProperty

public Action.TargetProperty getTargetProperty()
Get Target Property.

Returns:
ChoosableProperty

getTarget

public java.lang.String getTarget()

setTarget

public void setTarget(java.lang.String target)

getTargetOptions

public java.lang.String[] getTargetOptions()

getTargetSelected

public int getTargetSelected()

getExpressionTableProperty

public TableProperty<Expression> getExpressionTableProperty()
Get ExpressionTable Property.

Returns:
Expression TableProperty

getExpressionTable

public ExpressionTable getExpressionTable()

getActionTableProperty

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

Returns:
Action TableProperty

getActionTable

public ActionTable getActionTable()

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 v)

getSimpleTestTableProperty

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

Returns:
SimpleTest TableProperty

getSimpleTestTable

public SimpleTestTable getSimpleTestTable()

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
Overrides:
getAlias in class DictionaryComponent
Returns:
the name of the target variable

getAlias

public java.lang.String getAlias(boolean translate)
Description copied from class: DictionaryComponent
Get alias of DictionaryComponent.

Overrides:
getAlias in class DictionaryComponent
Parameters:
translate - whether to get the translated alias
Returns:
translated alias of the dictionary component, or alias if translation does not exist

getFactTypeID

public DOID getFactTypeID()
Returns:
FactType ID of Target

getTargetID

public DOID getTargetID()

hasTarget

public boolean hasTarget()
Does this form of action have a target?

Returns:
boolean flag

getReferences

public java.util.List<DOID> getReferences()
Description copied from class: DictionaryComponent
Get the DOIDs referenced by this component (but not the contained components)

Overrides:
getReferences in class DictionaryComponent
Returns:
list of the DOIDS

getAEReferences

public java.util.List<DOID> getAEReferences()
Description copied from class: DictionaryComponent
Get the DOIDs referenced by all directly or indirectly contained actions and expressions

Overrides:
getAEReferences in class DictionaryComponent
Returns:
list of the DOIDS

getAllReferences

public java.util.List<DOID> getAllReferences()
Description copied from class: DictionaryComponent
Get the DOIDs referenced by this component or contained components

Overrides:
getAllReferences in class DictionaryComponent
Returns:
list of the DOIDS

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

E10663-11

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