Class VWProcess
- java.lang.Object
-
- filenet.vw.api.VWProcess
-
- All Implemented Interfaces:
- java.io.Serializable
public final class VWProcess extends java.lang.Object implements java.io.SerializableUse this class to access information about an executing workflow, such as status, history, or child/split work object information.VWProcess contains methods
VWProcess.next()andVWProcess.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
Fields Modifier and Type Field and Description static intFILTER_COMPLETED_STEP_HISTORYValue of 1: Used in the filterFlags parameter of thefetchFilteredWorkflowHistorymethod to specify that only completed step history data is to be returned.static intFILTER_NONEValue of 0: Used in the filterFlags parameter of thefetchFilteredWorkflowHistorymethod to specify that all step history data is to be returned.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description voiddelete()Deletes all work objects of a running workflow process.VWWorkflowHistoryfetchFilteredWorkflowHistory(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.VWWorkflowMilestonesfetchReachedWorkflowMilestones(int theLevel)Fetches the milestone events reached, based on the milestone level specified.VWWorkflowDefinitionfetchWorkflowDefinition()Deprecated.Replaced byfetchWorkflowDefinitionFetches the workflow definition for this workflow process.VWWorkflowDefinitionfetchWorkflowDefinition(boolean convert)Fetches the workflow definition for this workflow process.VWWorkflowHistoryfetchWorkflowHistory(int instructionSheetID)Fetches the history data for this workflow process that is associated with this workflow instruction sheet ID.intgetBufferSize()Gets the value of the buffer size setting.java.lang.StringgetEventLogName()Gets the event log name of this workflow process.VWMilestoneDefinition[]getMilestoneDefinitions()Gets the milestone data for this workflow process.java.lang.StringgetRosterName()Gets the roster name of this workflow process.VWSessiongetSession()Get the session associated with this mapnode definition.java.lang.StringgetSuspendedDescription()Returns a description of why the process was suspended Does an RPC to the server if the VWProcess object was fetched with VWSession.getProcessjava.util.DategetSuspendedTime()Returns the time the process was suspendedjava.lang.StringgetSuspendedUser()Returns the name of the user who suspended the processjava.lang.StringgetWorkClassName()Gets the work class name associated with this workflow process.booleanhasNext()Determines whether there are more work objects to retrieve.booleanisSuspended()Returns whether or not this process is suspended.VWWorkObjectnext()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.voidresetFetch()Sets the fetch items count to zero (0) so the application can refetch items.voidsetBufferSize(int newSize)Sets the maximum number of elements to return in a fetch. The default value is 100.
-
-
-
Field Detail
-
FILTER_NONE
public static final int FILTER_NONE
Value of 0: Used in the filterFlags parameter of thefetchFilteredWorkflowHistorymethod 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 thefetchFilteredWorkflowHistorymethod to specify that only completed step history data is to be returned.- See Also:
- Constant Field Values
-
-
Method Detail
-
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 (seeVWMilestoneDefinition.setLevelandVWMilestoneDefinition.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 (seeVWMilestoneDefinition.setLevelandVWMilestoneDefinition.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
VWProcess.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:
VWProcess.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 VWExceptionSets 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 VWExceptionDetermines 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:
trueif there are more elements that can be fetched.- Throws:
VWException- See Also:
VWProcess.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.
-
delete
public void delete() throws VWExceptionDeletes all work objects of a running workflow process.- Throws:
VWException- Thrown if a work object cannot be deleted. The deletion is considered to fail if even one work object cannot be deleted.
-
getRosterName
public java.lang.String getRosterName() throws VWExceptionGets 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 VWExceptionGets the event log name of this workflow process. If a translation source exists, the authored name is translated.Does an RPC to the server if the VWProcess object was fetched with VWSession.getProcess
- 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 VWExceptionGets the work class name associated with this workflow process. If a translation source exists, the authored name is translated.Does an RPC to the server if the VWProcess object was fetched with VWSession.getProcess
- 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.Does an RPC to the server if the VWProcess object was fetched with VWSession.getProcess
- 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 byfetchWorkflowDefinitionFetches 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
-
isSuspended
public boolean isSuspended() throws VWExceptionReturns whether or not this process is suspended.Does an RPC to the server if the VWProcess object was fetched with VWSession.getProcess
- Throws:
VWException- Since:
- CPE 5.2.0.3
-
getSuspendedUser
public java.lang.String getSuspendedUser()
Returns the name of the user who suspended the processDoes an RPC to the server if the VWProcess object was fetched with VWSession.getProcess
- Returns:
- the name of the user who suspended the process
- Since:
- CPE 5.2.0.3
-
getSuspendedTime
public java.util.Date getSuspendedTime()
Returns the time the process was suspendedDoes an RPC to the server if the VWProcess object was fetched with VWSession.getProcess
- Returns:
- the time the process was suspended
- Since:
- CPE 5.2.0.3
-
getSuspendedDescription
public java.lang.String getSuspendedDescription()
Returns a description of why the process was suspended Does an RPC to the server if the VWProcess object was fetched with VWSession.getProcess- Returns:
- a description of why the process was suspended
- Since:
- CPE 5.2.0.3
-
-