Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


oracle.rules.sdk.editor.datamodel
Class Variable

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byoracle.rules.sdk.editor.datamodel.ModelComponent
              extended byoracle.rules.sdk.editor.datamodel.Variable

All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class Variable
extends ModelComponent

global variable: similar to Java "static public" variable. A global variable can be constant or modifiable denoted by the final field. A global variable has a name, a value and an alias. The value could be a general expression such as pi/4 where pi is another constant variable.

See Also:
Serialized Form

Field Summary
static java.lang.String PROP_FINAL
           
static java.lang.String PROP_TYPE
           
static java.lang.String PROP_VALUE
           

 

Fields inherited from class oracle.rules.sdk.editor.datamodel.ModelComponent
PROP_ALIAS, PROP_ID, PROP_NAME, PROP_PROPERTIES, PROP_VISIBLE

 

Method Summary
 java.lang.Object get(java.lang.Object key)
          Overwrite hashtable get method.
 boolean getFinal()
          Whether the variable is final?
 java.lang.String getType()
          Get alias of the type of the variable.
 java.lang.String[] getTypeOptions()
          Get type options.
 int getTypeSelected()
          Get the index of the selected value for the property type options.
 InitValue getValue()
          Get the Value of the variable
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Overwrite hashtable put method.
 void setFinal(boolean isFinal)
          Set the variable final
 void setType(java.lang.String typeAlias)
          Set the type of the variable.
 void validate()
          validate consistency of the global variable definition

 

Methods inherited from class oracle.rules.sdk.editor.datamodel.ModelComponent
getAlias, getDataModel, getID, getName, getParent, getProperties, getVisible, setAlias, setName, setVisible

 

Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values

 

Methods inherited from class java.util.AbstractMap
equals, hashCode, toString

 

Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

 

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

 

Field Detail

PROP_TYPE

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

PROP_VALUE

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

PROP_FINAL

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

Method Detail

getType

public java.lang.String getType()
Get alias of the type of the variable.
Returns:
alias of the type of the variable

setType

public void setType(java.lang.String typeAlias)
Set the type of the variable.
Parameters:
typeAlias - alias of the type to be set

getTypeOptions

public java.lang.String[] getTypeOptions()
Get type options.
Returns:
the list of fact type alias includeing primitive, RL and Java Fact types, but excluding void.

getTypeSelected

public int getTypeSelected()
Get the index of the selected value for the property type options.
Returns:
the index of the selected value for the type choice list

getValue

public InitValue getValue()
Get the Value of the variable
Returns:
value of the variable

getFinal

public boolean getFinal()
Whether the variable is final?
Returns:
true if it is final

setFinal

public void setFinal(boolean isFinal)
Set the variable final
Parameters:
isFinal - boolean value

validate

public void validate()
              throws RulesSDKDMValidationException
validate consistency of the global variable definition
Overrides:
validate in class ModelComponent
Throws:
thrown - if any of the following happens (1)no initial value is assigned (2)type is not defined in the datamodel (3) Alias is conflicted with other global variable
RulesSDKDMValidationException

get

public java.lang.Object get(java.lang.Object key)
Overwrite hashtable get method. For property "Type", "Type_Selected", Type_Options we don't return the hashtable entry directly. Instead, we compute them dynamically.
Specified by:
get in interface java.util.Map
Overrides:
get in class ModelComponent
Parameters:
key - a String containing the property name to be fetched.
Returns:
the value corresponding to the key

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Overwrite hashtable put method. For property "type" we don't put the value (alias) directly. We get id of the type from alias, then put it into the table.
Parameters:
key - a String containing the property name to be saved.
value - a String corresponding to the key to be saved

Skip navigation links

Oracle Business Rules Java API Reference
10g (10.1.3.1.0)

B28966-01


Copyright © 2006, Oracle. All rights reserved.