xflow.client
Class WorkflowManager

java.lang.Object
  extended byxflow.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 AbortWorkflowResponse abortWorkflow(java.lang.Integer workflowId, User user)
          Aborts an active workflow instance
static DeployModelResponse deployModel(java.lang.String xml, java.lang.String type, User user)
          Deploys a workflow model from an XML document
static java.util.List getActiveWorkflows(User user)
          Gets all active workflow instances
static java.util.List getAllWorkflows(User user)
          Gets all workflow instances
static java.util.List getAllWorkflowsByName(java.lang.String name, User user)
          Gets all workflow instances
static Node getNodeByName(java.lang.String workflowName, int workflowVersion, java.lang.String nodeName, User user)
          Gets all process nodes participating in a workflow instance
static java.util.List getProcessNodes(java.lang.Integer workflowId, User user)
          Gets all process nodes participating in a workflow instance
static java.lang.Object getVariable(java.lang.Integer workflowId, java.lang.String variableName, User user)
          Gets a variable for a specified workflow instance
static java.util.List getWorkflowModels(User user)
          Gets all deployed workflow models
static WorkflowState getWorkflowState(java.lang.Integer workflowId, User user)
          Gets the workflow state
static ResumeWorkflowResponse resumeWorkflow(java.lang.Integer workflowId, User user)
          Resumes a suspended workflow instance
static SetVariableResponse setVariable(java.lang.Integer workflowId, java.lang.String variableName, java.lang.Object variableValue, User user)
          Sets a variable for a specified workflow instance
static java.lang.Integer startWorkflow(java.lang.String workflowName, int workflowVersion, WorkItem workItem, User user)
          Starts a workflow with a specified version
static java.lang.Integer startWorkflow(java.lang.String workflowName, WorkItem workItem, User user)
          Starts a workflow.
static SuspendWorkflowResponse suspendWorkflow(java.lang.Integer workflowId, 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 DeployModelResponse deployModel(java.lang.String xml,
                                              java.lang.String type,
                                              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 java.lang.Integer startWorkflow(java.lang.String workflowName,
                                              WorkItem workItem,
                                              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 java.lang.Integer startWorkflow(java.lang.String workflowName,
                                              int workflowVersion,
                                              WorkItem workItem,
                                              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 AbortWorkflowResponse abortWorkflow(java.lang.Integer workflowId,
                                                  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 SuspendWorkflowResponse suspendWorkflow(java.lang.Integer workflowId,
                                                      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 ResumeWorkflowResponse resumeWorkflow(java.lang.Integer workflowId,
                                                    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 WorkflowState getWorkflowState(java.lang.Integer workflowId,
                                             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 SetVariableResponse setVariable(java.lang.Integer workflowId,
                                              java.lang.String variableName,
                                              java.lang.Object variableValue,
                                              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(java.lang.Integer workflowId,
                                           java.lang.String variableName,
                                           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.List getActiveWorkflows(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.List getAllWorkflows(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.List getAllWorkflowsByName(java.lang.String name,
                                                   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.List getProcessNodes(java.lang.Integer workflowId,
                                             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 Node getNodeByName(java.lang.String workflowName,
                                 int workflowVersion,
                                 java.lang.String nodeName,
                                 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)
nodeName - the node name
user - the user
Returns:
the Node object
Throws:
XflowException

getWorkflowModels

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

Returns:
the list of WorkflowModel objects
Throws:
XflowException