xflow.client
Class WorkflowManager

java.lang.Object
  |
  +--xflow.client.WorkflowManager

public class WorkflowManager
extends java.lang.Object

WorkflowManager contains all workflow administrative functions. Clients needing to perform functions such as starting/aborting workflows, deploying workflows, etc should invoke methods from this class.


Field Summary
static java.lang.String BPEL
           
static java.lang.String XFLOW
           
 
Constructor Summary
WorkflowManager()
           
 
Method Summary
static void abortWorkflow(xflow.common.WorkflowId workflowId, xflow.security.User user)
          Aborts an active workflow instance
static void deployModel(java.lang.String xml, java.lang.String type, xflow.security.User user)
          Deploys a workflow model from an XML document
static java.util.Vector getActiveWorkflows(xflow.security.User user)
          Gets all active workflow instances
static java.util.Vector getAllWorkflows(xflow.security.User user)
          Gets all workflow instances
static java.util.Vector getAllWorkflowsByName(java.lang.String name, xflow.security.User user)
          Gets all workflow instances
static xflow.common.Node getNodeByName(java.lang.String workflowName, int workflowVersion, java.lang.String name, xflow.security.User user)
          Gets all process nodes participating in a workflow instance
static java.util.Vector getProcessNodes(xflow.common.WorkflowId workflowId, xflow.security.User user)
          Gets all process nodes participating in a workflow instance
static java.lang.Object getVariable(xflow.common.WorkflowId workflowId, java.lang.String variableName, xflow.security.User user)
          Gets a variable for a specified workflow instance
static java.util.Vector getWorkflowModels(xflow.security.User user)
          Gets all deployed workflow models
static xflow.common.WorkflowState getWorkflowState(xflow.common.WorkflowId workflowId, xflow.security.User user)
          Gets the workflow state
static void resumeWorkflow(xflow.common.WorkflowId workflowId, xflow.security.User user)
          Resumes a suspended workflow instance
static void setVariable(xflow.common.WorkflowId workflowId, java.lang.String variableName, java.lang.Object variableValue, xflow.security.User user)
          Sets a variable for a specified workflow instance
static xflow.common.WorkflowId startWorkflow(java.lang.String workflowName, int workflowVersion, xflow.common.WorkItem workItem, xflow.security.User user)
          Starts a workflow with a specified version
static xflow.common.WorkflowId startWorkflow(java.lang.String workflowName, xflow.common.WorkItem workItem, xflow.security.User user)
          Starts a workflow.
static void suspendWorkflow(xflow.common.WorkflowId workflowId, xflow.security.User user)
          Suspends an active workflow instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XFLOW

public static final java.lang.String XFLOW
See Also:
Constant Field Values

BPEL

public static final java.lang.String BPEL
See Also:
Constant Field Values
Constructor Detail

WorkflowManager

public WorkflowManager()
Method Detail

deployModel

public static void deployModel(java.lang.String xml,
                               java.lang.String type,
                               xflow.security.User user)
                        throws XflowException
Deploys a workflow model from an XML document

Parameters:
xml - the XML document
type - the XML document type valid type currently supported is: XFLOW. BPEL in the near future
user - the user
Throws:
XflowException

startWorkflow

public static xflow.common.WorkflowId startWorkflow(java.lang.String workflowName,
                                                    xflow.common.WorkItem workItem,
                                                    xflow.security.User user)
                                             throws XflowException
Starts a workflow.

Parameters:
workflowName - the workflow name
workItem - the work item
user - the initiator of the workflow
Returns:
the workflow ID of the newly created workflow instance
Throws:
XflowException

startWorkflow

public static xflow.common.WorkflowId startWorkflow(java.lang.String workflowName,
                                                    int workflowVersion,
                                                    xflow.common.WorkItem workItem,
                                                    xflow.security.User user)
                                             throws XflowException
Starts a workflow with a specified version

Parameters:
workflowName - the workflow name
workflowVersion - the workflow version
workItem - the work item
user - the initiator of the workflow
Returns:
the workflow ID of the newly created workflow instance
Throws:
XflowException

abortWorkflow

public static void abortWorkflow(xflow.common.WorkflowId workflowId,
                                 xflow.security.User user)
                          throws XflowException
Aborts an active workflow instance

Parameters:
workflowId - the workflow instance ID
user - the user requesting the abort
Throws:
XflowException

suspendWorkflow

public static void suspendWorkflow(xflow.common.WorkflowId workflowId,
                                   xflow.security.User user)
                            throws XflowException
Suspends an active workflow instance

Parameters:
workflowId - the workflow instance ID
user - the user requesting the suspend
Throws:
XflowException

resumeWorkflow

public static void resumeWorkflow(xflow.common.WorkflowId workflowId,
                                  xflow.security.User user)
                           throws XflowException
Resumes a suspended workflow instance

Parameters:
workflowId - the workflow instance ID
user - the user requesting the resume
Throws:
XflowException

getWorkflowState

public static xflow.common.WorkflowState getWorkflowState(xflow.common.WorkflowId workflowId,
                                                          xflow.security.User user)
                                                   throws XflowException
Gets the workflow state

Parameters:
workflowId - the workflow instance ID
user - the user
Returns:
the workflow state
Throws:
XflowException

setVariable

public static void setVariable(xflow.common.WorkflowId workflowId,
                               java.lang.String variableName,
                               java.lang.Object variableValue,
                               xflow.security.User user)
                        throws XflowException
Sets a variable for a specified workflow instance

Parameters:
workflowId - the workflow instance ID
variableName - the variable name
variableValue - the variable value - must be serializable
user - the user
Throws:
XflowException

getVariable

public static java.lang.Object getVariable(xflow.common.WorkflowId workflowId,
                                           java.lang.String variableName,
                                           xflow.security.User user)
                                    throws XflowException
Gets a variable for a specified workflow instance

Parameters:
workflowId - the workflow instance ID
variableName - the variable name
user - the user
Returns:
the variable value
Throws:
XflowException

getActiveWorkflows

public static java.util.Vector getActiveWorkflows(xflow.security.User user)
                                           throws XflowException
Gets all active workflow instances

Parameters:
user - the user
Returns:
the list of WorkflowState objects of currently active workflow instances
Throws:
XflowException

getAllWorkflows

public static java.util.Vector getAllWorkflows(xflow.security.User user)
                                        throws XflowException
Gets all workflow instances

Parameters:
user - the user
Returns:
the list of WorkflowState objects of all workflow instances
Throws:
XflowException

getAllWorkflowsByName

public static java.util.Vector getAllWorkflowsByName(java.lang.String name,
                                                     xflow.security.User user)
                                              throws XflowException
Gets all workflow instances

Parameters:
name - the workflow model name
user - the user
Returns:
the list of WorkflowState objects of all workflow instances
Throws:
XflowException

getProcessNodes

public static java.util.Vector getProcessNodes(xflow.common.WorkflowId workflowId,
                                               xflow.security.User user)
                                        throws XflowException
Gets all process nodes participating in a workflow instance

Parameters:
workflowId - the workflow instance ID
user - the user
Returns:
the list of Node objects
Throws:
XflowException

getNodeByName

public static xflow.common.Node getNodeByName(java.lang.String workflowName,
                                              int workflowVersion,
                                              java.lang.String name,
                                              xflow.security.User user)
                                       throws XflowException
Gets all process nodes participating in a workflow instance

Parameters:
workflowName - the workflow model name
workflowVersion - the workflow version (-1 means get the latest)
user - the user
Returns:
the Node object
Throws:
XflowException

getWorkflowModels

public static java.util.Vector getWorkflowModels(xflow.security.User user)
                                          throws XflowException
Gets all deployed workflow models

Returns:
the list of WorkflowModel objects
Throws:
XflowException