Process API

filenet.vw.api
Class VWProcess

java.lang.Object
  extended by filenet.vw.api.VWProcess
All Implemented Interfaces:
java.io.Serializable

public final class VWProcess
extends java.lang.Object
implements java.io.Serializable

Use this class to access information about an executing workflow, such as status, history, or child/split work object information.

VWProcess contains methods next() and hasNext() which function similarly to the next() and hasNext() methods in the Iterator interface in Java 2 to retrieve all active work objects in this workflow. A retrieval series completes when the next() method returns a null value.

Since:
VWWS3.10
See Also:
VWQueueElement, VWRosterElement, VWStepElement, VWWorkObject, VWFetchType, VWStepHistory, Serialized Form

Field Summary
static int FILTER_COMPLETED_STEP_HISTORY
          Value of 1: Used in the filterFlags parameter of the fetchFilteredWorkflowHistory method to specify that only completed step history data is to be returned.
static int FILTER_NONE
          Value of 0: Used in the filterFlags parameter of the fetchFilteredWorkflowHistory method to specify that all step history data is to be returned.
 
Method Summary
static java.lang.String _get_FILE_AUTHOR()
          For FileNet internal use only, do not call.
static java.lang.String _get_FILE_DATE()
          For FileNet internal use only, do not call.
static java.lang.String _get_FILE_REVISION()
          For FileNet internal use only, do not call.
 void delete()
          Deletes all work objects of a running workflow process.
 VWWorkflowHistory fetchFilteredWorkflowHistory(int mapId, int filterFlag)
          Fetches step history data for the current workflow process associated with the specified workflow map.
 VWMilestoneElement[] fetchFilteredWorkflowMilestones(int level, boolean bLastOnly, boolean bReachedOnly)
          Fetches the milestone data for this workflow process, based on the filtering levels specified.
 VWWorkflowMilestones fetchReachedWorkflowMilestones(int theLevel)
          Fetches the milestone events reached, based on the milestone level specified.
 VWWorkflowDefinition fetchWorkflowDefinition()
          Deprecated. Replaced by fetchWorkflowDefinition Fetches the workflow definition for this workflow process.
 VWWorkflowDefinition fetchWorkflowDefinition(boolean convert)
          Fetches the workflow definition for this workflow process.
 VWWorkflowHistory fetchWorkflowHistory(int instructionSheetID)
          Fetches the history data for this workflow process that is associated with this workflow instruction sheet ID.
 int getBufferSize()
          Gets the value of the buffer size setting.
 java.lang.String getEventLogName()
          Gets the event log name of this workflow process.
 VWMilestoneDefinition[] getMilestoneDefinitions()
          Gets the milestone data for this workflow process.
 java.lang.String getRosterName()
          Gets the roster name of this workflow process.
 VWSession getSession()
          Get the session associated with this mapnode definition.
 java.lang.String getWorkClassName()
          Gets the work class name associated with this workflow process.
 boolean hasNext()
          Determines whether there are more work objects to retrieve.
 VWWorkObject next()
          Retrieves the subsequent work object in the series of active work objects associated with this process.
 void resetFetch()
          Sets the fetch items count to zero (0) so the application can refetch items.
 void setBufferSize(int newSize)
          Sets the maximum number of elements to return in a fetch.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILTER_NONE

public static final int FILTER_NONE
Value of 0: Used in the filterFlags parameter of the fetchFilteredWorkflowHistory method to specify that all step history data is to be returned.

See Also:
Constant Field Values

FILTER_COMPLETED_STEP_HISTORY

public static final int FILTER_COMPLETED_STEP_HISTORY
Value of 1: Used in the filterFlags parameter of the fetchFilteredWorkflowHistory method to specify that only completed step history data is to be returned.

See Also:
Constant Field Values
Method Detail

_get_FILE_DATE

public static java.lang.String _get_FILE_DATE()
For FileNet internal use only, do not call.


_get_FILE_AUTHOR

public static java.lang.String _get_FILE_AUTHOR()
For FileNet internal use only, do not call.


_get_FILE_REVISION

public static java.lang.String _get_FILE_REVISION()
For FileNet internal use only, do not call.


fetchReachedWorkflowMilestones

public VWWorkflowMilestones fetchReachedWorkflowMilestones(int theLevel)
                                                    throws VWException
Fetches the milestone events reached, based on the milestone level specified. If a translation source exists, the authored data is translated.

Parameters:
theLevel - An integer indicating the milestone level (see VWMilestoneDefinition.setLevel and VWMilestoneDefinition.getLevel) to use as the limiting level. Milestones having a level value less than or equal to this value will be fetched from the event log.
Returns:
A VWWorkflowMilestones object (an iterator) representing the milestone events reached. If a translation source exists, the translated data is returned; otherwise, the authored data is returned.
Throws:
VWException
See Also:
VWMilestoneDefinition

fetchFilteredWorkflowMilestones

public VWMilestoneElement[] fetchFilteredWorkflowMilestones(int level,
                                                            boolean bLastOnly,
                                                            boolean bReachedOnly)
                                                     throws VWException
Fetches the milestone data for this workflow process, based on the filtering levels specified. If a translation source exists, the authored data is translated.

Parameters:
level - An integer indicating the milestone level (see VWMilestoneDefinition.setLevel and VWMilestoneDefinition.getLevel) to use as the limiting level. Only milestones having a level value less than or equal to this value will be fetched from the event log.

bLastOnly - A boolean of true indicates the fetch operation is further limited to the milestone objects with the latest timestamp; false indicates the fetch does not eliminate milestone objects on the basis of timestamp.

bReachedOnly - A boolean value of true indicates the fetch operation is further limited to the reached milestone objects; false indicates the fetch is not limited on the basis of whether the milestone is reached.

Returns:
An array of VWMilestoneElement objects representing the milestone data. If a translation source exists, the translated data is returned; otherwise, the authored data is returned.
Throws:
VWException
See Also:
VWMilestoneDefinition

fetchWorkflowHistory

public VWWorkflowHistory fetchWorkflowHistory(int instructionSheetID)
                                       throws VWException
Fetches the history data for this workflow process that is associated with this workflow instruction sheet ID. If a translation source exists, the translated workflow history data is returned; otherwise, the authored data is returned.

Parameters:
instructionSheetID - An integer indicating the ID of the associated VWMapDefinition object.
Returns:
The VWWorkflowHistory object associated with this workflow process. If a translation source exists, the translated workflow history data is returned; otherwise, the authored data is returned. If no workflow history exists, null is returned.
Throws:
VWException

next

public VWWorkObject next()
                  throws VWException
Retrieves the subsequent work object in the series of active work objects associated with this process. Invoke this method repeatedly to retrieve a series of active work objects. Returns null when no more active work objects can be returned.

After a set of items in the current retrieval buffer is exhausted, additional items will be retrieved from the Process server and buffered. The effective buffer block size is the lesser of the number specified with a preceding setBufferSize(int) call and the number imposed by the Process server limit.

You can modify retrieval performance by changing the retrieval buffer size. To change the current retrieval buffer size, set it with a setBufferSize(int) call.
Note
This method requires a buffer size greater than 1 to operate properly.

Returns:
An active work object for this workflow process, or null if more work objects remain to be fetched from the series.
Throws:
VWException
See Also:
hasNext()

getBufferSize

public int getBufferSize()
Gets the value of the buffer size setting.

Returns:
An integer value indicating the buffer size, which is the maximum number of elements to return in a fetch.

setBufferSize

public void setBufferSize(int newSize)
                   throws VWException
Sets the maximum number of elements to return in a fetch.  The default value is 100.

Parameters:
newSize - An integer value to use for setting the maximum number of elements to return in a fetch. The value must be greater than zero (0).
Throws:
VWException - The method throws an exception if the buffer is less than or equal to zero (0).

hasNext

public boolean hasNext()
                throws VWException
Determines whether there are more work objects to retrieve.
Note
This method requires a buffer size greater than 1 to operate properly. The default buffersize is 50.

Returns:
true if there are more elements that can be fetched.
Throws:
VWException
See Also:
next()

resetFetch

public void resetFetch()
Sets the fetch items count to zero (0) so the application can refetch items. Calling this method between fetches allows the caller to return to the beginning of a fetch.

See Also:
fetchWorkflowHistory(int), VWWorkflowDefinition

delete

public void delete()
            throws VWException
Deletes all work objects of a running workflow process.

Throws:
VWException - Thrown if a work object cannot be deleted. Even if only one work object cannot be deleted, the entire deletion fails.

getRosterName

public java.lang.String getRosterName()
                               throws VWException
Gets the roster name of this workflow process. If a translation source exists, the authored name is translated.

Returns:
A String containing the translated name of the roster, if a translation source exists; otherwise the authored name is returned.
Throws:
VWException - Thrown if the associated roster name cannot be found.

getEventLogName

public java.lang.String getEventLogName()
                                 throws VWException
Gets the event log name of this workflow process. If a translation source exists, the authored name is translated.

Returns:
A String containing the translated name of the event log, if a translation source exists; otherwise the authored name is returned.
Throws:
VWException - Thrown if the associated event log name cannot be found.

getWorkClassName

public java.lang.String getWorkClassName()
                                  throws VWException
Gets the work class name associated with this workflow process. If a translation source exists, the authored name is translated.

Returns:
A String containing the translated name of the work class, if a translation source exists; otherwise the authored name is returned.
Throws:
VWException - Thrown if the associated work class name cannot be found.

getMilestoneDefinitions

public VWMilestoneDefinition[] getMilestoneDefinitions()
                                                throws VWException
Gets the milestone data for this workflow process. If a translation source exists, the authored name is translated.

Returns:
A array of VWMilestoneDefinition objects associated with this workflow process. If a translation source exists, the translated milestone data is returned; otherwise, the authored data is returned. If there is no milestone data, the method returns null.
Throws:
VWException - Thrown if the milestone data cannot be found.

fetchWorkflowDefinition

public VWWorkflowDefinition fetchWorkflowDefinition()
                                             throws VWException
Deprecated. Replaced by fetchWorkflowDefinition Fetches the workflow definition for this workflow process.

Returns:
A VWWorkflowDefinition object for this workflow process.
Throws:
VWException

fetchWorkflowDefinition

public VWWorkflowDefinition fetchWorkflowDefinition(boolean convert)
                                             throws VWException
Fetches the workflow definition for this workflow process. If a translation source exists, the authored workflow definition data is translated.

Parameters:
convert - A boolean value of true indicates that the fetched workflow definition should be converted. This ensures thatthe workflow definition is correct and complete in the following situations:
  • The workflow definition references a work class from a former version of the Process Engine called Panagon Visual WorkFlow.
  • The workflow definition was defined with a default terminate or malfunction map and the fetched workflow definition should include such a map.

A value of false indicates that conversion (for the purposes indicated above) is not necessary, and the returned workflow definition should be in the same form as it was before it was transferred to the server.

Returns:
The VWWorkflowDefinition object associated with this workflow process. If a translation source exists, the translated workflow definition data is returned; otherwise, the authored data is returned.
Throws:
VWException

fetchFilteredWorkflowHistory

public VWWorkflowHistory fetchFilteredWorkflowHistory(int mapId,
                                                      int filterFlag)
                                               throws VWException
Fetches step history data for the current workflow process associated with the specified workflow map. This can be either the completed step history only, or all history data. If a translation source exists, the authored data is translated.

Parameters:
mapId - An integer for the ID of the workflow map definition object.
filterFlag - Set this to FILTER_COMPLETED_STEP_HISTORY (value of 1) if you want the method to exclusively return completed step history data, or FILTER_NONE (value of 0) to return all history data.
Returns:
A VWWorkflowHistory object associated with this workflow process. If a translation source exists, the translated data is returned; otherwise, the authored data is returned. If no completed step history exists and FILTER_COMPLETED_STEP_HISTORY is specified, null is returned.
Throws:
VWException
See Also:
fetchWorkflowHistory

getSession

public VWSession getSession()
                     throws VWException
Get the session associated with this mapnode definition.

Returns:
The session associated with this mapnode definition, may return null.
Throws:
VWException

Process API

© Copyright IBM Corporation 2002, 2008. All rights reserved.