com.opensymphony.workflow.soap
Class BasicSOAPWorkflow

java.lang.Object
  extended by com.opensymphony.workflow.soap.BasicSOAPWorkflow
All Implemented Interfaces:
Workflow
Direct Known Subclasses:
XFireSOAPWorkflow

public class BasicSOAPWorkflow
extends Object
implements Workflow

Soap enabled Wrapper around a BasicWorkflow


Field Summary
 
Fields inherited from interface com.opensymphony.workflow.Workflow
BSF_COL, BSF_LANGUAGE, BSF_ROW, BSF_SCRIPT, BSF_SOURCE, BSH_SCRIPT, CLASS_NAME, EJB_LOCATION, JNDI_LOCATION
 
Constructor Summary
BasicSOAPWorkflow()
           
 
Method Summary
 boolean canInitialize(String workflowName, int initialState)
          Check if the calling user has enough permissions to initialise the specified workflow.
 boolean canInitialize(String workflowName, int initialAction, Map inputs)
          Determine if a particular workflow can be initialized.
 boolean canModifyEntryState(long id, int newState)
          Check if the state of the specified workflow instance can be changed to the new specified one.
 void changeEntryState(long id, int newState)
          Modify the state of the specified workflow instance.
 void doAction(long id, int actionId, Map inputs)
          Perform an action on the specified workflow instance.
 void executeTriggerFunction(long id, int triggerId)
          Executes a special trigger-function using the context of the given workflow instance id.
 int[] getAvailableActions(long id)
           
 int[] getAvailableActions(long id, Map inputs)
          Get the available actions for the specified workflow instance.
 List getCurrentSteps(long id)
          Returns a Collection of Step objects that are the current steps of the specified workflow instance.
 int getEntryState(long id)
          Return the state of the specified workflow instance id.
 List getHistorySteps(long id)
          Returns a list of all steps that are completed for the given workflow instance id.
 com.opensymphony.module.propertyset.PropertySet getPropertySet(long id)
          Get the PropertySet for the specified workflow instance id.
protected  String getRemoteUser()
           
 List getSecurityPermissions(long id)
          Get a collection (Strings) of currently defined permissions for the specified workflow instance.
 List getSecurityPermissions(long id, Map inputs)
          Get a collection (Strings) of currently defined permissions for the specified workflow instance.
 WorkflowDescriptor getWorkflowDescriptor(String workflowName)
          Get the workflow descriptor for the specified workflow name.
 String getWorkflowName(long id)
          Get the name of the specified workflow instance.
 String[] getWorkflowNames()
          Get all available workflow names.
 long initialize(String workflowName, int initialState, Map inputs)
          Initializes a workflow so that it can begin processing.
 List query(WorkflowExpressionQuery query)
          Query the workflow store for matching instances
 List query(WorkflowQuery query)
          Query the workflow store for matching instances
 boolean removeWorkflowDescriptor(String workflowName)
          Remove the specified workflow descriptor.
 boolean saveWorkflowDescriptor(String workflowName, WorkflowDescriptor descriptor, boolean replace)
          Add a new workflow descriptor
 void setConfiguration(Configuration configuration)
          Set the configuration for this workflow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicSOAPWorkflow

public BasicSOAPWorkflow()
Method Detail

getAvailableActions

public int[] getAvailableActions(long id)
Specified by:
getAvailableActions in interface Workflow

getAvailableActions

public int[] getAvailableActions(long id,
                                 Map inputs)
Description copied from interface: Workflow
Get the available actions for the specified workflow instance.

Specified by:
getAvailableActions in interface Workflow
Parameters:
id - The workflow instance id.
inputs - The inputs map to pass on to conditions
Returns:
An array of action id's that can be performed on the specified entry

setConfiguration

public void setConfiguration(Configuration configuration)
Description copied from interface: Workflow
Set the configuration for this workflow. If not set, then the workflow will use the default configuration static instance.

Specified by:
setConfiguration in interface Workflow
Parameters:
configuration - a workflow configuration

getCurrentSteps

public List getCurrentSteps(long id)
Description copied from interface: Workflow
Returns a Collection of Step objects that are the current steps of the specified workflow instance.

Specified by:
getCurrentSteps in interface Workflow
Parameters:
id - The workflow instance id.
Returns:
The steps that the workflow instance is currently in.

getEntryState

public int getEntryState(long id)
Description copied from interface: Workflow
Return the state of the specified workflow instance id.

Specified by:
getEntryState in interface Workflow
Parameters:
id - The workflow instance id.
Returns:
int The state id of the specified workflow

getHistorySteps

public List getHistorySteps(long id)
Description copied from interface: Workflow
Returns a list of all steps that are completed for the given workflow instance id.

Specified by:
getHistorySteps in interface Workflow
Parameters:
id - The workflow instance id.
Returns:
a List of Steps
See Also:
Step

getPropertySet

public com.opensymphony.module.propertyset.PropertySet getPropertySet(long id)
Description copied from interface: Workflow
Get the PropertySet for the specified workflow instance id.

Specified by:
getPropertySet in interface Workflow
Parameters:
id - The workflow instance id.

getSecurityPermissions

public List getSecurityPermissions(long id)
Description copied from interface: Workflow
Get a collection (Strings) of currently defined permissions for the specified workflow instance.

Specified by:
getSecurityPermissions in interface Workflow
Parameters:
id - the workflow instance id.
Returns:
A List of permissions specified currently (a permission is a string name).

getSecurityPermissions

public List getSecurityPermissions(long id,
                                   Map inputs)
Description copied from interface: Workflow
Get a collection (Strings) of currently defined permissions for the specified workflow instance.

Specified by:
getSecurityPermissions in interface Workflow
Parameters:
id - id the workflow instance id.
inputs - inputs The inputs to the workflow instance.
Returns:
A List of permissions specified currently (a permission is a string name).

getWorkflowDescriptor

public WorkflowDescriptor getWorkflowDescriptor(String workflowName)
Description copied from interface: Workflow
Get the workflow descriptor for the specified workflow name.

Specified by:
getWorkflowDescriptor in interface Workflow
Parameters:
workflowName - The workflow name.

getWorkflowName

public String getWorkflowName(long id)
Description copied from interface: Workflow
Get the name of the specified workflow instance.

Specified by:
getWorkflowName in interface Workflow
Parameters:
id - the workflow instance id.

getWorkflowNames

public String[] getWorkflowNames()
Description copied from interface: Workflow
Get all available workflow names.

Specified by:
getWorkflowNames in interface Workflow

canInitialize

public boolean canInitialize(String workflowName,
                             int initialState)
Description copied from interface: Workflow
Check if the calling user has enough permissions to initialise the specified workflow.

Specified by:
canInitialize in interface Workflow
Parameters:
workflowName - The name of the workflow to check.
initialState - The id of the initial state to check.
Returns:
true if the user can successfully call initialize, false otherwise.

canInitialize

public boolean canInitialize(String workflowName,
                             int initialAction,
                             Map inputs)
Description copied from interface: Workflow
Determine if a particular workflow can be initialized.

Specified by:
canInitialize in interface Workflow
Parameters:
workflowName - The workflow name to check.
initialAction - The potential initial action.
inputs - The inputs to check.
Returns:
true if the workflow can be initialized, false otherwise.

canModifyEntryState

public boolean canModifyEntryState(long id,
                                   int newState)
Description copied from interface: Workflow
Check if the state of the specified workflow instance can be changed to the new specified one.

Specified by:
canModifyEntryState in interface Workflow
Parameters:
id - The workflow instance id.
newState - The new state id.
Returns:
true if the state of the workflow can be modified, false otherwise.

changeEntryState

public void changeEntryState(long id,
                             int newState)
                      throws WorkflowException
Description copied from interface: Workflow
Modify the state of the specified workflow instance.

Specified by:
changeEntryState in interface Workflow
Parameters:
id - The workflow instance id.
newState - the new state to change the workflow instance to. If the new state is com.opensymphony.workflow.spi.WorkflowEntry.KILLED or com.opensymphony.workflow.spi.WorkflowEntry.COMPLETED then all current steps are moved to history steps. If the new state is
Throws:
WorkflowException

doAction

public void doAction(long id,
                     int actionId,
                     Map inputs)
              throws WorkflowException
Description copied from interface: Workflow
Perform an action on the specified workflow instance.

Specified by:
doAction in interface Workflow
Parameters:
id - The workflow instance id.
actionId - The action id to perform (action id's are listed in the workflow descriptor).
inputs - The inputs to the workflow instance.
Throws:
InvalidInputException - if a validator is specified and an input is invalid.
WorkflowException

executeTriggerFunction

public void executeTriggerFunction(long id,
                                   int triggerId)
                            throws WorkflowException
Description copied from interface: Workflow
Executes a special trigger-function using the context of the given workflow instance id. Note that this method is exposed for Quartz trigger jobs, user code should never call it.

Specified by:
executeTriggerFunction in interface Workflow
Parameters:
id - The workflow instance id
triggerId - The id of the speciail trigger-function
Throws:
WorkflowException

initialize

public long initialize(String workflowName,
                       int initialState,
                       Map inputs)
                throws WorkflowException
Description copied from interface: Workflow
Initializes a workflow so that it can begin processing. A workflow must be initialized before it can begin any sort of activity. It can only be initialized once.

Specified by:
initialize in interface Workflow
Parameters:
workflowName - The workflow name to create and initialize an instance for
initialState - The initial step to start the workflow
inputs - The inputs entered by the end-user
Throws:
InvalidRoleException - if the user can't start this function
InvalidInputException - if a validator is specified and an input is invalid.
WorkflowException

query

public List query(WorkflowQuery query)
           throws StoreException
Description copied from interface: Workflow
Query the workflow store for matching instances

Specified by:
query in interface Workflow
Throws:
StoreException

query

public List query(WorkflowExpressionQuery query)
           throws WorkflowException
Description copied from interface: Workflow
Query the workflow store for matching instances

Specified by:
query in interface Workflow
Throws:
WorkflowException

removeWorkflowDescriptor

public boolean removeWorkflowDescriptor(String workflowName)
                                 throws FactoryException
Description copied from interface: Workflow
Remove the specified workflow descriptor.

Specified by:
removeWorkflowDescriptor in interface Workflow
Parameters:
workflowName - The workflow name of the workflow to remove.
Returns:
true if the workflow was removed, false otherwise.
Throws:
FactoryException - If the underlying workflow factory has an error removing the workflow, or if it does not support the removal of workflows.

saveWorkflowDescriptor

public boolean saveWorkflowDescriptor(String workflowName,
                                      WorkflowDescriptor descriptor,
                                      boolean replace)
                               throws FactoryException
Description copied from interface: Workflow
Add a new workflow descriptor

Specified by:
saveWorkflowDescriptor in interface Workflow
Parameters:
workflowName - The workflow name of the workflow to add
descriptor - The workflow descriptor to add
replace - true, if an existing descriptor should be overwritten
Returns:
true if the workflow was added, fales otherwise
Throws:
FactoryException - If the underlying workflow factory has an error adding the workflow, or if it does not support adding workflows.

getRemoteUser

protected String getRemoteUser()

OpenSymphony Workflow Project Page