wt.workflow.definer
Class WfVariableInfo

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

public class WfVariableInfo
extends Object
implements Externalizable, NetFactor, Evolvable

Simple structure containing information pertaining to a execution object variable.

Use the newWfVariableInfo static factory method(s), not the WfVariableInfo 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 BOOLEAN
           
private static String BYTE
           
private static String CHAR
           
private static String CLASSNAME
           
static String DEFAULT_VALUE
          Label for the attribute; Initial value of the variable.
private  Object defaultValue
           
private  WfDestination destination
           
static String DESTINATION
          Label for the attribute; Indicates whether the variable can be used in input, output, or both variable maps

Supported API: false
static String DISPLAY_NAME_MAP
          Label for the attribute; Map of locale String representations to displayName for that locale.
private  HashMap displayNameMap
           
private static String DOUBLE
           
private static ClassInfo ENUMERATEDTYPE
           
static long EXTERNALIZATION_VERSION_UID
           
private static String FLOAT
           
private static String INT
           
private static String LONG
           
private  boolean mutable
           
static String MUTABLE
          Label for the attribute; Indicates whether WfVariableInfo can be changed by the user in definer GUI.
private  String name
           
static String NAME
          Label for the attribute; Variable name.
protected static long OLD_FORMAT_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID_1
           
protected static long OLD_FORMAT_VERSION_UID_2
           
protected static long OLD_FORMAT_VERSION_UID_3
           
static String PERMISSION_LIST
          Label for the attribute; permissionList stores the set of perrmissions granted to the task participant over the object referenced by the variable.
private  PermissionSet permissionList
           
private static ClassInfo PERSISTABLE
           
static String READ_ONLY
          Label for the attribute; Determines whether the variable can be modified by the assignee of a task.
private  boolean readOnly
           
private  boolean required
           
static String REQUIRED
          Label for the attribute; Indicates whether the variable is mandatory (a value must be supplied).
private  boolean resetable
           
static String RESETABLE
          Label for the attribute; Indicates whether value is reset after RESET transition.
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static String SHORT
           
private static Class TARGET_CLASS
           
private static String TARGET_CLASS_NAME
           
static String TYPE_NAME
          Label for the attribute; Internal String representing the name of the class.
private  String typeName
           
static String VECTOR_CLASS_NAME
           
private static boolean VERBOSE
           
private  boolean visible
           
static String VISIBLE
          Label for the attribute; Indicates whether variable should be shown to user.
private static ClassInfo WTREFERENCE
           
 
Constructor Summary
WfVariableInfo()
           
 
Method Summary
protected  WfVariableInfo copy()
          Creates a copy of the current variable info.
 WfVariable createWfVariable()
          Creates a WfVariable object with the same name, type, default value and requiredness.
 boolean equals(Object obj)
          Determines if the current object is equal to the one passed as argument.
 ClassInfo getClassInfo()
          Returns the ClassInfo object for this class.
 String getConceptualClassname()
          Deprecated.  
 Object getDefaultValue()
          Gets the value of the attribute: DEFAULT_VALUE.
 Object getDefaultValueObject()
          Returns the value of the variable without any conversion.
 WfDestination getDestination()
          Gets the value of the attribute: DESTINATION.
 String getDisplayName()
          Returns the default displayNameMap entry.
 String getDisplayName(Locale locale)
          Returns the displayNameMap entry for the specified Locale if it exists.
 HashMap getDisplayNameMap()
          Gets the value of the attribute: DISPLAY_NAME_MAP.
 String getName()
          Gets the value of the attribute: NAME.
 PermissionSet getPermissionList()
          Gets the value of the attribute: PERMISSION_LIST.
 String getTypeName()
          Gets the value of the attribute: TYPE_NAME.
 Class getVariableClass()
          Returns variable class.
protected  Vector getVector()
          Returns the default value as a Vector object.
 int hashCode()
          Returns an int to serve as hash code of the object.
protected  void initialize()
          Supports initialization, following construction of an instance.
 boolean isMutable()
          Gets the value of the attribute: MUTABLE.
private  boolean isPrimitive()
          Returns true if variable holds a prmitive Java type; false otherwise.
 boolean isReadOnly()
          Gets the value of the attribute: READ_ONLY.
 boolean isRequired()
          Gets the value of the attribute: REQUIRED.
 boolean isResetable()
          Gets the value of the attribute: RESETABLE.
 boolean isTypeCompatibleWith(WfVariableInfo src_var)
          Returns whether the current variable as a destination is "type compatible" with the passed as argument.
 boolean isValid()
          Returns whether the variable info is valid.
protected  boolean isValidValue(Object value)
          Returns whether the value passed as argument can be set, given the variables type.
 boolean isVisible()
          Gets the value of the attribute: VISIBLE.
static WfVariableInfo newWfVariableInfo()
          No-arg constructor.
 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.
protected  boolean readVersion(WfVariableInfo thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void setDefaultValue(Object a_DefaultValue)
          Sets the value of the attribute: DEFAULT_VALUE.
 void setDefaultValueObject(Object a_value)
          Sets the value of the variable to the value passed as argument.
 void setDestination(WfDestination a_Destination)
          Sets the value of the attribute: DESTINATION.
 void setDisplayNameMap(HashMap a_DisplayNameMap)
          Sets the value of the attribute: DISPLAY_NAME_MAP.
 void setMutable(boolean a_Mutable)
          Sets the value of the attribute: MUTABLE.
 void setName(String a_Name)
          Sets the value of the attribute: NAME.
 void setPermissionList(PermissionSet a_PermissionList)
          Sets the value of the attribute: PERMISSION_LIST.
 void setReadOnly(boolean a_ReadOnly)
          Sets the value of the attribute: READ_ONLY.
 void setRequired(boolean a_Required)
          Sets the value of the attribute: REQUIRED.
 void setResetable(boolean a_Resetable)
          Sets the value of the attribute: RESETABLE.
 void setTypeName(String a_TypeName)
          Sets the value of the attribute: TYPE_NAME.
 void setVariableClass(Class var_class)
          Sets variable class.
protected  void setVector(Vector vect_obj)
          Sets the default value to be the vector passed as argument.
 void setVisible(boolean a_Visible)
          Sets the value of the attribute: VISIBLE.
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

NAME

public static final String NAME
Label for the attribute; Variable name. Must be non null.

Supported API: true

See Also:
Constant Field Values

name

private String name

TYPE_NAME

public static final String TYPE_NAME
Label for the attribute; Internal String representing the name of the class. For setting/retrieving the variable class, the set/getClass should be used. For non-primitive types this is the class name. For primitive types, the standard representation is adopted (the same returned by the getName method of the Class class.
 int -> "int"
 boolean -> "boolean"
 char -> "char"
 byte -> "byte"
 short ->"short"
 long -> "long"
 float -> "float"
 double -> "double"
 


Supported API: false

See Also:
Constant Field Values

typeName

private String typeName

REQUIRED

public static final String REQUIRED
Label for the attribute; Indicates whether the variable is mandatory (a value must be supplied). Default is false.

Supported API: false

See Also:
Constant Field Values

required

private boolean required

VISIBLE

public static final String VISIBLE
Label for the attribute; Indicates whether variable should be shown to user. Default is true.

Supported API: false

See Also:
Constant Field Values

visible

private boolean visible

DEFAULT_VALUE

public static final String DEFAULT_VALUE
Label for the attribute; Initial value of the variable. The class of the value must be a subclass of the class of the variable.

Important Note: all primitive variables must be assigned a default value.

Supported API: true

See Also:
Constant Field Values

defaultValue

private Object defaultValue

RESETABLE

public static final String RESETABLE
Label for the attribute; Indicates whether value is reset after RESET transition. If false the value of the variable is unchanged after a RESET transition of the execution object; otherwise (true) the value is set to the default value (if it exists) or null if (it doesn't). Initial value is 'true'.

Supported API: false

See Also:
Constant Field Values

resetable

private boolean resetable

MUTABLE

public static final String MUTABLE
Label for the attribute; Indicates whether WfVariableInfo can be changed by the user in definer GUI.

Supported API: false

See Also:
Constant Field Values

mutable

private boolean mutable

DESTINATION

public static final String DESTINATION
Label for the attribute; Indicates whether the variable can be used in input, output, or both variable maps

Supported API: false

See Also:
Constant Field Values

destination

private WfDestination destination

PERMISSION_LIST

public static final String PERMISSION_LIST
Label for the attribute; permissionList stores the set of perrmissions granted to the task participant over the object referenced by the variable.

Supported API: false

See Also:
Constant Field Values

permissionList

private PermissionSet permissionList

READ_ONLY

public static final String READ_ONLY
Label for the attribute; Determines whether the variable can be modified by the assignee of a task. Not enforced internally, just used by the GUI.

Supported API: true

See Also:
Constant Field Values

readOnly

private boolean readOnly

DISPLAY_NAME_MAP

public static final String DISPLAY_NAME_MAP
Label for the attribute; Map of locale String representations to displayName for that locale.

Supported API: false

See Also:
Constant Field Values

displayNameMap

private HashMap displayNameMap

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

OLD_FORMAT_VERSION_UID_1

protected static final long OLD_FORMAT_VERSION_UID_1
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID_2

protected static final long OLD_FORMAT_VERSION_UID_2
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID_3

protected static final long OLD_FORMAT_VERSION_UID_3
See Also:
Constant Field Values

VECTOR_CLASS_NAME

public static final String VECTOR_CLASS_NAME

BOOLEAN

private static final String BOOLEAN
See Also:
Constant Field Values

BYTE

private static final String BYTE
See Also:
Constant Field Values

CHAR

private static final String CHAR
See Also:
Constant Field Values

DOUBLE

private static final String DOUBLE
See Also:
Constant Field Values

FLOAT

private static final String FLOAT
See Also:
Constant Field Values

INT

private static final String INT
See Also:
Constant Field Values

LONG

private static final String LONG
See Also:
Constant Field Values

SHORT

private static final String SHORT
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE

TARGET_CLASS_NAME

private static final String TARGET_CLASS_NAME

TARGET_CLASS

private static final Class TARGET_CLASS

PERSISTABLE

private static ClassInfo PERSISTABLE

WTREFERENCE

private static ClassInfo WTREFERENCE

ENUMERATEDTYPE

private static ClassInfo ENUMERATEDTYPE
Constructor Detail

WfVariableInfo

public WfVariableInfo()
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(WfVariableInfo 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

getName

public String getName()
Gets the value of the attribute: NAME. Variable name. Must be non null.

Supported API: true

Returns:
String

setName

public void setName(String a_Name)
Sets the value of the attribute: NAME. Variable name. Must be non null.

Supported API: true

Parameters:
a_Name -

getTypeName

public String getTypeName()
Gets the value of the attribute: TYPE_NAME. Internal String representing the name of the class. For setting/retrieving the variable class, the set/getClass should be used. For non-primitive types this is the class name. For primitive types, the standard representation is adopted (the same returned by the getName method of the Class class.
 int -> "int"
 boolean -> "boolean"
 char -> "char"
 byte -> "byte"
 short ->"short"
 long -> "long"
 float -> "float"
 double -> "double"
 


Supported API: false

Returns:
String

setTypeName

public void setTypeName(String a_TypeName)
Sets the value of the attribute: TYPE_NAME. Internal String representing the name of the class. For setting/retrieving the variable class, the set/getClass should be used. For non-primitive types this is the class name. For primitive types, the standard representation is adopted (the same returned by the getName method of the Class class.
 int -> "int"
 boolean -> "boolean"
 char -> "char"
 byte -> "byte"
 short ->"short"
 long -> "long"
 float -> "float"
 double -> "double"
 


Supported API: false

Parameters:
a_TypeName -

isRequired

public boolean isRequired()
Gets the value of the attribute: REQUIRED. Indicates whether the variable is mandatory (a value must be supplied). Default is false.

Supported API: false

Returns:
boolean

setRequired

public void setRequired(boolean a_Required)
Sets the value of the attribute: REQUIRED. Indicates whether the variable is mandatory (a value must be supplied). Default is false.

Supported API: false

Parameters:
a_Required -

isVisible

public boolean isVisible()
Gets the value of the attribute: VISIBLE. Indicates whether variable should be shown to user. Default is true.

Supported API: false

Returns:
boolean

setVisible

public void setVisible(boolean a_Visible)
Sets the value of the attribute: VISIBLE. Indicates whether variable should be shown to user. Default is true.

Supported API: false

Parameters:
a_Visible -

getDefaultValue

public Object getDefaultValue()
Gets the value of the attribute: DEFAULT_VALUE. Initial value of the variable. The class of the value must be a subclass of the class of the variable.

Important Note: all primitive variables must be assigned a default value.

Supported API: true

Returns:
Object

setDefaultValue

public void setDefaultValue(Object a_DefaultValue)
Sets the value of the attribute: DEFAULT_VALUE. Initial value of the variable. The class of the value must be a subclass of the class of the variable.

Important Note: all primitive variables must be assigned a default value.

Supported API: true

Parameters:
a_DefaultValue -

isResetable

public boolean isResetable()
Gets the value of the attribute: RESETABLE. Indicates whether value is reset after RESET transition. If false the value of the variable is unchanged after a RESET transition of the execution object; otherwise (true) the value is set to the default value (if it exists) or null if (it doesn't). Initial value is 'true'.

Supported API: false

Returns:
boolean

setResetable

public void setResetable(boolean a_Resetable)
Sets the value of the attribute: RESETABLE. Indicates whether value is reset after RESET transition. If false the value of the variable is unchanged after a RESET transition of the execution object; otherwise (true) the value is set to the default value (if it exists) or null if (it doesn't). Initial value is 'true'.

Supported API: false

Parameters:
a_Resetable -

isMutable

public boolean isMutable()
Gets the value of the attribute: MUTABLE. Indicates whether WfVariableInfo can be changed by the user in definer GUI.

Supported API: false

Returns:
boolean

setMutable

public void setMutable(boolean a_Mutable)
Sets the value of the attribute: MUTABLE. Indicates whether WfVariableInfo can be changed by the user in definer GUI.

Supported API: false

Parameters:
a_Mutable -

getDestination

public WfDestination getDestination()
Gets the value of the attribute: DESTINATION. Indicates whether the variable can be used in input, output, or both variable maps

Supported API: false

Returns:
WfDestination

setDestination

public void setDestination(WfDestination a_Destination)
Sets the value of the attribute: DESTINATION. Indicates whether the variable can be used in input, output, or both variable maps

Supported API: false

Parameters:
a_Destination -

getPermissionList

public PermissionSet getPermissionList()
Gets the value of the attribute: PERMISSION_LIST. permissionList stores the set of perrmissions granted to the task participant over the object referenced by the variable.

Supported API: false

Returns:
PermissionSet

setPermissionList

public void setPermissionList(PermissionSet a_PermissionList)
Sets the value of the attribute: PERMISSION_LIST. permissionList stores the set of perrmissions granted to the task participant over the object referenced by the variable.

Supported API: false

Parameters:
a_PermissionList -

isReadOnly

public boolean isReadOnly()
Gets the value of the attribute: READ_ONLY. Determines whether the variable can be modified by the assignee of a task. Not enforced internally, just used by the GUI.

Supported API: true

Returns:
boolean

setReadOnly

public void setReadOnly(boolean a_ReadOnly)
Sets the value of the attribute: READ_ONLY. Determines whether the variable can be modified by the assignee of a task. Not enforced internally, just used by the GUI.

Supported API: true

Parameters:
a_ReadOnly -

getDisplayNameMap

public HashMap getDisplayNameMap()
Gets the value of the attribute: DISPLAY_NAME_MAP. Map of locale String representations to displayName for that locale.

Supported API: false

Returns:
HashMap

setDisplayNameMap

public void setDisplayNameMap(HashMap a_DisplayNameMap)
Sets the value of the attribute: DISPLAY_NAME_MAP. Map of locale String representations to displayName for that locale.

Supported API: false

Parameters:
a_DisplayNameMap -

isValid

public boolean isValid()
Returns whether the variable info is valid. Checks for the following:

Supported API: false

Returns:
boolean

newWfVariableInfo

public static WfVariableInfo newWfVariableInfo()
                                        throws WTException
No-arg constructor. Initializes default values.

Supported API: false

Returns:
WfVariableInfo
Throws:
WTException

initialize

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

Supported API: false

Throws:
WTException

getVariableClass

public Class getVariableClass()
Returns variable class. Returns null if variable hasn't been set yet.

Supported API: false

Returns:
Class

setVariableClass

public void setVariableClass(Class var_class)
Sets variable class. Also sets default value in case the type is a primitive Java type.

Supported API: false

Parameters:
var_class -

equals

public boolean equals(Object obj)
Determines if the current object is equal to the one passed as argument.

Supported API: false

Parameters:
obj -
Returns:
boolean

hashCode

public int hashCode()
Returns an int to serve as hash code of the object.

Supported API: false

Returns:
int

isTypeCompatibleWith

public boolean isTypeCompatibleWith(WfVariableInfo src_var)
Returns whether the current variable as a destination is "type compatible" with the passed as argument. To be type compatible the source must be a subclass of the destination. If a variable "a" is type compatible is "b", then assignments of the type "a = b;" are legal.

Supported API: false

Parameters:
src_var -
Returns:
boolean

createWfVariable

public WfVariable createWfVariable()
                            throws WTException
Creates a WfVariable object with the same name, type, default value and requiredness.

Supported API: false

Returns:
WfVariable
Throws:
WTException

getDisplayName

public String getDisplayName(Locale locale)
Returns the displayNameMap entry for the specified Locale if it exists. If it does not, it defaults to the default entry. If this does not exist, the variable Name is returned.

Supported API: false

Parameters:
locale -
Returns:
String

getDisplayName

public String getDisplayName()
Returns the default displayNameMap entry. If this does not exist, the variable Name is returned.

Supported API: false

Returns:
String

isValidValue

protected boolean isValidValue(Object value)
Returns whether the value passed as argument can be set, given the variables type.

Parameters:
value - object to be set
Returns:
boolean

copy

protected WfVariableInfo copy()
Creates a copy of the current variable info.

Returns:
copy of the current object

isPrimitive

private boolean isPrimitive()
Returns true if variable holds a prmitive Java type; false otherwise.

Assumes getTypeName () != null


setVector

protected void setVector(Vector vect_obj)
                  throws ClassNotFoundException,
                         IOException,
                         WTException
Sets the default value to be the vector passed as argument.

Parameters:
vect_obj -
Throws:
ClassNotFoundException
IOException
WTException

getVector

protected Vector getVector()
                    throws ClassNotFoundException,
                           IOException,
                           WTException
Returns the default value as a Vector object.

Returns:
Vector
Throws:
ClassNotFoundException
IOException
WTException

setDefaultValueObject

public void setDefaultValueObject(Object a_value)
Sets the value of the variable to the value passed as argument. Used internally.


getDefaultValueObject

public Object getDefaultValueObject()
Returns the value of the variable without any conversion. Used internally.

Returns:
Object