Process Class Relationships

filenet.vw.api
Class VWNewWorkObject

java.lang.Object
  |
  +--filenet.vw.api.VWFieldsObject
        |
        +--filenet.vw.api.VWNewWorkObject
All Implemented Interfaces:
java.io.Serializable

public final class VWNewWorkObject
extends filenet.vw.api.VWFieldsObject

Use this class to create a work object. A work class associated with a specified roster instantiates the new Work Object. The VWSession.createWorkObject() method creates an instance of this class.

You can modify data field values and save the new Work Object to a roster. The doSave() and doSaveMany() methods inject, respectively, a single work object or an array of Work Objects to a server. See the VWInjectSessionInfo class for procedures on obtaining inject session information.

See Also:
VWRoster, VWInjectSessionInfo, Serialized Form

Method Summary
 VWDataField[] getDataFields()
          Lists the data fields supported by the new work object.
 java.lang.String[] getFieldNames()
          Lists data field names for this work object.
 java.lang.Object getFieldValue(java.lang.String fieldName)
          Gets the value of the specified data field.
 int getServerLocation()
          Get the current server location of the work object.
 java.lang.String getStepName()
          Gets the step name.
 java.lang.String getWorkFlowNumber()
          Get the string version of the WorkFlow number.
 boolean hasFieldName(java.lang.String fieldName)
          Indicates whether or not the specified data field exists.
 void save()
          Saves a new work object to the server.
static VWException[] SaveMany(VWNewWorkObject[] workObjects, VWRoster serverToUse, java.lang.String sessionName, java.lang.String sessionStatusLabel)
          Saves an array of new work objects.
 void setFieldValue(java.lang.String fieldName, java.lang.Object fieldValue)
          Sets a value in the specified data field.
 java.lang.String toString()
          Returns the string version of the new work object name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

SaveMany

public static VWException[] SaveMany(VWNewWorkObject[] workObjects,
                                     VWRoster serverToUse,
                                     java.lang.String sessionName,
                                     java.lang.String sessionStatusLabel)
                              throws VWException
Saves an array of new work objects. You can save a new Work Object only once. When specifying the server for the inject session, set the serverToUse parameter to the server on which most important work objects reside, to insure that the inject session occurs on that server.

When specifying the server for recovery, avoid the problem of the default server being different from the server on which other work objects in the array reside. The default server becomes the server of the first work object in the array, unless you specify the server.

Optional session name and status label parameters specify useful information for session query and recovery.

Parameters:
workObjects - An array of work objects to save. The array can include objects from various work classes.

serverToUse - A roster object specifying the server on which the inject session operation occurs. The default is null, which indicates that the server being used is the server specified in the first work object in the array.

sessionName - The name of the inject session. The default value is null.

sessionStatusLabel - A string containg the transaction label. The value for this setting is optional: however, null specifies no label.

An entry specifies a label. The VWInjectSessionInfo.getInjectSessionInfo() method returns the label if the save transaction succeeds; otherwise, the method returns label from the last successful transaction.

Returns:
An array of null values or a VWException that corresponds to the input elements The errors indicate that the system previously saved the work object.
Throws:
VWException - The method throws an exception if the work object injection failed. The system injects either all or none of the work objects using this method.

save

public void save()
          throws VWException
Saves a new work object to the server. Call this method only once for each new work object.
Throws:
VWException - The method throws an exception if it cannot saves a new work object to the server.

getFieldNames

public java.lang.String[] getFieldNames()
Lists data field names for this work object.
Returns:
A string containing an array of data field names.

getFieldValue

public java.lang.Object getFieldValue(java.lang.String fieldName)
                               throws VWException
Gets the value of the specified data field.
Parameters:
fieldName - The name for which data will be retrieved.
Returns:
An object containing the value of the specified data field. Objects and arrays of objects must be one of the following types: Integer, String, Double, or Boolean. A data field can have a null value.
Throws:
VWException - The method throws an exception if the data field specified in the fieldName parameter does not exist.

setFieldValue

public void setFieldValue(java.lang.String fieldName,
                          java.lang.Object fieldValue)
                   throws VWException
Sets a value in the specified data field.
Parameters:
fieldName - The name of the data field to update.
fieldValue - An integer value used to update the data field.
Throws:
VWException - The method returns an exception if the field name specified in the fieldName parameter does not exist.

hasFieldName

public boolean hasFieldName(java.lang.String fieldName)
                     throws VWException
Indicates whether or not the specified data field exists.
Parameters:
fieldName - The data field name being checked.
Returns:
A Boolean value. The method returns true if data field specified in the fieldName parameter exists; otherwise the method returns false.
Throws:
VWException - The method throws an exception if the field name parameter value is null.

toString

public java.lang.String toString()
Returns the string version of the new work object name.
Overrides:
toString in class java.lang.Object
Returns:
The name of the new work object.

getDataFields

public VWDataField[] getDataFields()
                            throws VWException
Lists the data fields supported by the new work object.
Returns:
An array of data field objects.
Since:
VWWS3.10
See Also:
VWDataField

getWorkFlowNumber

public java.lang.String getWorkFlowNumber()
                                   throws VWException
Get the string version of the WorkFlow number.
Use the returned F_WorkFlowNumber as an index key component.
Returns:
WorkFlow Object number as a string, which corresponds to the F_WorkFlowNumber, if null then field does not exist.
Throws:
VWException - Thrown if a problem occurs

getStepName

public java.lang.String getStepName()
                             throws VWException
Gets the step name.
Returns:
A String containing the step name. A null value means that the field does not exist.
Throws:
VWException - Thrown if the method is unable to get a string containing the step name.

getServerLocation

public int getServerLocation()
                      throws VWException
Get the current server location of the work object.
Returns:
Number of the server where the work object is
Throws:
VWException - Thrown if a problem occurs

Process Class Relationships

Copyright © 2002 FileNET Corporation. All rights reserved.