xflow.client
Class WorkflowProcess

java.lang.Object
  extended byxflow.client.WorkflowProcess
All Implemented Interfaces:
javax.jms.MessageListener

public class WorkflowProcess
extends java.lang.Object
implements javax.jms.MessageListener

A WorkflowProcess receives work items from the XFlow system and "works" on them. It is bound or associated to a node in the workflow model.


Constructor Summary
WorkflowProcess(java.lang.String wfName, int wfVersion, java.lang.String processName, InboxMessageListener listener, User user)
          WorkflowProcess constructor
 
Method Summary
 CompleteWorkItemResponse completeWorkItem(WorkItem workItem)
          Completes a work item.
 WorkItem getNextWorkItem()
          Gets the next work item (in First-In-First-Out order) from the inbox
 WorkItem getWorkItem(java.lang.Integer workItemId)
          Gets a work item with a specific work item ID from the inbox
 java.util.List getWorkItems()
          Gets a list of work items from this process's inbox.
 void onMessage(javax.jms.Message msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowProcess

public WorkflowProcess(java.lang.String wfName,
                       int wfVersion,
                       java.lang.String processName,
                       InboxMessageListener listener,
                       User user)
                throws XflowException
WorkflowProcess constructor

Parameters:
wfName - the workflow name
wfVersion - the workflow version - set to -1 if the latest version is to be used
processName - the process name - must be the name of a valid process node in the workflow model
listener - the inbox listener for asynchronous delivery of work items - may be null
user - the user
Throws:
XflowException
Method Detail

onMessage

public void onMessage(javax.jms.Message msg)
Specified by:
onMessage in interface javax.jms.MessageListener

getWorkItems

public java.util.List getWorkItems()
                            throws XflowException
Gets a list of work items from this process's inbox.

Returns:
A list of WorkItem objects
Throws:
XflowException

getNextWorkItem

public WorkItem getNextWorkItem()
                         throws XflowException
Gets the next work item (in First-In-First-Out order) from the inbox

Returns:
A WorkItem object or null - if there are no work items.
Throws:
XflowException

getWorkItem

public WorkItem getWorkItem(java.lang.Integer workItemId)
                     throws XflowException
Gets a work item with a specific work item ID from the inbox

Returns:
A WorkItem object or null - if there is no such work item
Throws:
XflowException

completeWorkItem

public CompleteWorkItemResponse completeWorkItem(WorkItem workItem)
                                          throws XflowException
Completes a work item. This is typically invoked by a workflow process after it is done with its processing of the work item.

Throws:
XflowException