Class VWDataField
- java.lang.Object
-
- filenet.vw.api.VWDataField
-
- All Implemented Interfaces:
- IVWField
public final class VWDataField extends java.lang.Object implements IVWField
Use this class to access a workflow object data field. Once you have access to the field you can determine or set the field value, determine the type, and determine if the field is an array. Use the Java type when setting the value of a field.Refer to the
VWFieldTypeField Summary for the supported Java types and their VWFieldType mappings.The Java Object array (Object[]) can contain a heterogeneous collection of the basic types, mentioned above.
Call this class from the following:
- VWQueueElement.getDataFields()
- VWRosterElement.getDataFields()
- VWWorkObject.getDataFields()
- Since:
- VWWS3.10
- See Also:
VWFieldType,VWAttachment
-
-
Method Summary
Methods Modifier and Type Method and Description java.lang.StringgetAuthoredName()Gets the authored, untranslated name of a field.intgetFieldType()Gets an integer value associated with a valid data field type.booleangetIsSystemField()Determines if the field is a system field.booleangetIsWritable()Determines if the field is editable (writable).intgetMode()Returns the integer value associated with the mode of the data field.java.lang.StringgetName()Gets the long name of this field.java.lang.StringgetStringValue()Gets the data field value as a String.java.lang.ObjectgetValue()Gets the value of a field as a valid field type object.booleanisArray()Determines whether the data field is an array.voidsetValue(java.lang.Object newValue)Sets the value of data contained in an editable field.java.lang.StringtoString()Gets the data field value as a String.voidtoXML(java.lang.StringBuffer theBuffer)Appends an XML string representing this instance to the buffer specified.
-
-
-
Method Detail
-
getFieldType
public int getFieldType()
Gets an integer value associated with a valid data field type.- Specified by:
getFieldTypein interfaceIVWField- Returns:
- An integer value that represents the data field type.
- See Also:
VWFieldType
-
getIsSystemField
public boolean getIsSystemField()
Determines if the field is a system field.- Returns:
- True if the field is a system field; false otherwise.
-
getIsWritable
public boolean getIsWritable()
Determines if the field is editable (writable).- Returns:
- True if the field can be modified; false otherwise.
-
getName
public java.lang.String getName()
Gets the long name of this field. If a field name contains more than 30 characters, use this method to access the full String, which can contain spaces. If a translation source exists, the authored name of the field is translated.Note: The translation is done only at runtime, so will not appear in design-time applications (such as the Process Designer or Configuration Console).
- Returns:
- A String containing the translated name for this field, if a translation source exists; otherwise the authored name is returned.
- See Also:
VWFieldType.isValidName for more information on field naming conventions.
-
getAuthoredName
public java.lang.String getAuthoredName() throws VWExceptionGets the authored, untranslated name of a field.- Returns:
- A String containing the authored, untranslated field name.
- Throws:
VWException- See Also:
VWFieldType.isValidName for more information on field naming conventions.
-
getValue
public java.lang.Object getValue() throws VWExceptionGets the value of a field as a valid field type object. If this value is an array (testable withVWDataField.isArray()), cast the returned value to the correct array type to access individual elements.- Specified by:
getValuein interfaceIVWField- Returns:
- The value contained in the data field or null if the type is invalid.
- Throws:
VWException- Thrown when the parameter is not one of the specific field types in VWFieldType.- See Also:
VWFieldType
-
isArray
public boolean isArray()
Determines whether the data field is an array.
-
setValue
public void setValue(java.lang.Object newValue) throws VWExceptionSets the value of data contained in an editable field.
Note If the field is an array, you can cast the array to an Object to pass it to this method.- Specified by:
setValuein interfaceIVWField- Parameters:
newValue- An Object containing the new value for the field.- Throws:
VWException- Causes include the following conditions:- 1) The field is a system field. System fields are not editable.
- 2) The field is an invalid type.
- 3) The field is a FIELD_TYPE_ATTACHMENT type.
- 4) The field is a FIELD_TYPE_WORKFLOW_GROUP type.
-
toString
public java.lang.String toString()
Gets the data field value as a String.- Overrides:
toStringin classjava.lang.Object- Returns:
- A String representation of the data field's value property.
-
getStringValue
public java.lang.String getStringValue()
Gets the data field value as a String. This method is consistent with the equivalent design-time method VWFieldDefinition.getStringValue.Date/Time values returned are formatted using the format defined in
VWFieldType.TIME_MASK. Prior releases used a long format (for example, "Sun Apr 17 04:00:00 PST 1977"). If you want to continue to return date/time values in a long format, you can use code similar to the following:if (vwDataField.getType == VWFieldType.FIELD_TYPEDEF_TIME32 || vwDataField.getType == VWFieldType.FIELD_TYPEDEF_TIME64) { Object fieldValue = vwDataField.getValue(); //java.util.Date if (fieldValue != null) { if (vwDataField.isArray()) stringValue = fieldValue.toString(); //long format else { stringValue = "{"; for (int nIndex = 0; nIndex < vwDataField.length; nIndex++) { stringValue += "\"" + fieldValue.toString() + "\""; } stringValue += "}"; } } }- Specified by:
getStringValuein interfaceIVWField- Returns:
- A String representation of the data field's value property.
- See Also:
VWFieldType
-
getMode
public int getMode()
Returns the integer value associated with the mode of the data field. Valid modes are:- 1: Input (MODE_TYPE_IN)
- 2: Output (MODE_TYPE_OUT)
- 3: Input/Output (MODE_TYPE_IN_OUT)
- Returns:
- An integer value that indicates the data field mode.
- See Also:
VWModeType
-
toXML
public void toXML(java.lang.StringBuffer theBuffer) throws VWExceptionAppends an XML string representing this instance to the buffer specified.Warning: This XML string is nonextensible, and cannot be modified in any way.
- Parameters:
theBuffer- A StringBuffer that will be appended with the XML content.- Throws:
VWException- Thrown if the specified buffer is null.- See Also:
VWXMLUtil
-
-