wt.workflow.engine
Class ProcessData

java.lang.Object
  extended bywt.workflow.engine.ProcessData
All Implemented Interfaces:
Evolvable, Externalizable, NetFactor, Serializable

public class ProcessData
extends Object
implements Externalizable, NetFactor, Evolvable

The ProcessData represents data used by execution objects. It supports methods to retrieve and set values, and query properties (elements) of the object. It also contains a method to initialize the process data based in the process data of a process object as well update the process data of a process object. The order in which the data elements occur in the process data is relevant.

This class represents a way to create attributes dynamically, without the need to model them beforehand.

Use the newProcessData static factory method(s), not the ProcessData constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private  WfVariable[] variables
           
private static boolean VERBOSE
           
 
Constructor Summary
ProcessData()
           
 
Method Summary
 void checkDataMissing(String exec_obj_name)
          Throws a DataMissingException variable if a doesn't have a value (is null); nothing happens otherwise.
 ProcessData copy()
          Produces a copy of the ProcessData object.
 ClassInfo getClassInfo()
          Returns the ClassInfo object for this class.
 String getConceptualClassname()
          Deprecated.  
 String[] getDisplayNames(Locale locale)
          Returns a list of the displayNames in the process data object for the specified locale.
 String[] getNames()
          Returns a list of the names in the process data object.
 Object[] getObjects()
          Returns an array of objects containing the values of the ProcessData object.
 Object getValue(String name)
          Returns the value corresponding to the variable whose name is passed as argument.
 Object getValueObject(String name)
           
 WfVariable getVariable(String name)
           
 Class getVariableClass(String name)
          Returns the class of the variable given its name.
 WfVariable[] getVariableList()
          Returns an array containing the variables of the ProcessData object.
protected  void initialize(ProcessDataInfo data_info)
          Supports initialization, following construction of an instance.
 boolean isVariable(String name)
          Returns true if the name passed as argument is the name of a property, false otherwise.
static ProcessData newProcessData(ProcessDataInfo data_info)
          Constructs a process data object from the ProcessDataInfo object passed as argument..
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
 boolean readValues(ProcessData input, WfVariableMap variable_map)
          Initializes values in the process data object.
protected  boolean readVersion(ProcessData thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void reset(ProcessDataInfo data_info)
          Resets the values to the object.
 void setValue(String name, Object value)
          Sets the value corresponding to the variable whose name is passed as argument.
 void setValues(Object[] valueArray)
          Sets the values of the current object from the Object array passed as argument.
 void setVariables(WfVariable[] vars)
           
 String toString()
          Returns the conceptual (modeled) name for the class.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 boolean writeValues(ProcessData output, WfVariableMap variable_map)
          Updates values in the context of a process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

variables

private WfVariable[] variables

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE
Constructor Detail

ProcessData

public ProcessData()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(ProcessData thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Returns:
String

toString

public String toString()
Returns the conceptual (modeled) name for the class.

Supported API: false

Returns:
String

getClassInfo

public ClassInfo getClassInfo()
                       throws WTIntrospectionException
Returns the ClassInfo object for this class.

Supported API: false

Specified by:
getClassInfo in interface NetFactor
Returns:
ClassInfo
Throws:
WTIntrospectionException

getValue

public Object getValue(String name)
Returns the value corresponding to the variable whose name is passed as argument. Retuns null if variable doesn't exist (or has no value assigned to it).

Supported API: false

Parameters:
name -
Returns:
Object

setValue

public void setValue(String name,
                     Object value)
              throws InvalidDataException
Sets the value corresponding to the variable whose name is passed as argument. Throws an InvalidData exception if there is no variable with the name passed as argument.

Supported API: false

Parameters:
name -
value -
Throws:
InvalidDataException

getNames

public String[] getNames()
Returns a list of the names in the process data object.

Supported API: false

Returns:
String[]

getDisplayNames

public String[] getDisplayNames(Locale locale)
Returns a list of the displayNames in the process data object for the specified locale.

Supported API: false

Parameters:
locale -
Returns:
String[]

readValues

public boolean readValues(ProcessData input,
                          WfVariableMap variable_map)
                   throws WTException
Initializes values in the process data object. Returns true if at least a value was read; false otherwise. The values are extracted form the input process data passed as argument. The values are set according to the WfVariableMap also passed as argument. The keys of the WfVariableMap (a Hashtable object) must be the names of the variables to be initialized and the values the names of the variables from which the values are read. An InvalidData exception is thrown if an non-existing variable occurs as a value in the WfVariableMap.

Supported API: false

Parameters:
input -
variable_map -
Returns:
boolean
Throws:
WTException

writeValues

public boolean writeValues(ProcessData output,
                           WfVariableMap variable_map)
                    throws WTException
Updates values in the context of a process. Returns true if at least a value was read; false otherwise. The values are read form the process data and written to the output process data passed as argument. The values are set according to the WfVariableMao also passed as argument. The keys of the WfVariableMap (a Hashtable object) must be the names of the variables from which the values are read and the values the names of the variables that are updated. An InvalidData exception is thrown if an non-existing variable occurs as a value in the WfVariableMap.

Supported API: false

Parameters:
output -
variable_map -
Returns:
boolean
Throws:
WTException

isVariable

public boolean isVariable(String name)
Returns true if the name passed as argument is the name of a property, false otherwise.

Supported API: false

Parameters:
name -
Returns:
boolean

newProcessData

public static ProcessData newProcessData(ProcessDataInfo data_info)
                                  throws WTException
Constructs a process data object from the ProcessDataInfo object passed as argument..

Supported API: false

Parameters:
data_info -
Returns:
ProcessData
Throws:
WTException

initialize

protected void initialize(ProcessDataInfo data_info)
                   throws WTException
Supports initialization, following construction of an instance. Invoked by "new" factory having the same signature.

Supported API: false

Parameters:
data_info -
Throws:
WTException

getObjects

public Object[] getObjects()
Returns an array of objects containing the values of the ProcessData object.

Supported API: false

Returns:
Object[]

getVariableClass

public Class getVariableClass(String name)
Returns the class of the variable given its name. Returns null if variable with the given name doesn't exist.

Supported API: false

Parameters:
name -
Returns:
Class

setValues

public void setValues(Object[] valueArray)
               throws InvalidDataException
Sets the values of the current object from the Object array passed as argument.

Supported API: false

Parameters:
valueArray -
Throws:
InvalidDataException

getVariableList

public WfVariable[] getVariableList()
Returns an array containing the variables of the ProcessData object.

Supported API: true

Returns:
WfVariable[]

reset

public void reset(ProcessDataInfo data_info)
           throws InvalidVariableInfoException
Resets the values to the object. If the variable is not resetable (resetable == true) the value is not changed, otherwise the value is set to the default value when it exists or to null when it doesn't.

Supported API: false

Parameters:
data_info -
Throws:
InvalidVariableInfoException

copy

public ProcessData copy()
                 throws WTException
Produces a copy of the ProcessData object.

Supported API: false

Returns:
ProcessData
Throws:
WTException

checkDataMissing

public void checkDataMissing(String exec_obj_name)
                      throws DataMissingException
Throws a DataMissingException variable if a doesn't have a value (is null); nothing happens otherwise. The name of the execution objec t is passed so the a menaingful error error message is constructed.

Supported API: false

Parameters:
exec_obj_name -
Throws:
DataMissingException

getVariable

public WfVariable getVariable(String name)

getValueObject

public Object getValueObject(String name)

setVariables

public void setVariables(WfVariable[] vars)