Package com.opensymphony.workflow
Interface Workflow
- All Known Implementing Classes:
AbstractWorkflow,BasicWorkflow,OfbizWorkflow
public interface Workflow
The core workflow interface.
- Author:
- Patrick Lightbody
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleancanInitialize(String workflowName, int initialStep) Check if the calling user has enough permissions to initialise the specified workflow.booleancanInitialize(String workflowName, int initialAction, Map inputs) Determine if a particular workflow can be initialized.booleancanModifyEntryState(long id, int newState) Check if the state of the specified workflow instance can be changed to the new specified one.voidchangeEntryState(long id, int newState) Modify the state of the specified workflow instance.voidPerform an action on the specified workflow instance.voidexecuteTriggerFunction(long id, int triggerId) Executes a special trigger-function using the context of the given workflow instance id.int[]getAvailableActions(long id) Deprecated.int[]getAvailableActions(long id, Map inputs) Get the available actions for the specified workflow instance.getCurrentSteps(long id) Returns a Collection of Step objects that are the current steps of the specified workflow instance.intgetEntryState(long id) Return the state of the specified workflow instance id.getHistorySteps(long id) Returns a list of all steps that are completed for the given workflow instance id.com.opensymphony.module.propertyset.PropertySetgetPropertySet(long id) Get the PropertySet for the specified workflow instance id.getSecurityPermissions(long id) Deprecated.usegetSecurityPermissions(long, java.util.Map)with a null map instead.getSecurityPermissions(long id, Map inputs) Get a collection (Strings) of currently defined permissions for the specified workflow instance.getWorkflowDescriptor(String workflowName) Get the workflow descriptor for the specified workflow name.getWorkflowName(long id) Get the name of the specified workflow instance.String[]Get all available workflow names.longinitialize(String workflowName, int initialAction, Map inputs) Initializes a workflow so that it can begin processing.query(WorkflowExpressionQuery query) Query the workflow store for matching instancesquery(WorkflowQuery query) Deprecated.usequery(WorkflowExpressionQuery)instead.booleanremoveWorkflowDescriptor(String workflowName) Remove the specified workflow descriptor.booleansaveWorkflowDescriptor(String workflowName, WorkflowDescriptor descriptor, boolean replace) Add a new workflow descriptorvoidsetConfiguration(Configuration configuration) Set the configuration for this workflow.
-
Field Details
-
BSF_COL
- See Also:
-
BSF_LANGUAGE
- See Also:
-
BSF_ROW
- See Also:
-
BSF_SCRIPT
- See Also:
-
BSF_SOURCE
- See Also:
-
BSH_SCRIPT
- See Also:
-
CLASS_NAME
- See Also:
-
EJB_LOCATION
- See Also:
-
JNDI_LOCATION
- See Also:
-
-
Method Details
-
getAvailableActions
int[] getAvailableActions(long id) Deprecated.usegetAvailableActions(long, Map)with an empty Map instead. -
getCurrentSteps
Returns a Collection of Step objects that are the current steps of the specified workflow instance.- Parameters:
id- The workflow instance id.- Returns:
- The steps that the workflow instance is currently in.
-
getEntryState
int getEntryState(long id) Return the state of the specified workflow instance id.- Parameters:
id- The workflow instance id.- Returns:
- int The state id of the specified workflow
-
getHistorySteps
Returns a list of all steps that are completed for the given workflow instance id.- Parameters:
id- The workflow instance id.- Returns:
- a List of Steps
- See Also:
-
getPropertySet
com.opensymphony.module.propertyset.PropertySet getPropertySet(long id) Get the PropertySet for the specified workflow instance id.- Parameters:
id- The workflow instance id.
-
getSecurityPermissions
Deprecated.usegetSecurityPermissions(long, java.util.Map)with a null map instead.Get a collection (Strings) of currently defined permissions for the specified workflow instance.- Parameters:
id- the workflow instance id.- Returns:
- A List of permissions specified currently (a permission is a string name).
-
getSecurityPermissions
Get a collection (Strings) of currently defined permissions for the specified workflow instance.- 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
Get the workflow descriptor for the specified workflow name.- Parameters:
workflowName- The workflow name.
-
getWorkflowName
Get the name of the specified workflow instance.- Parameters:
id- the workflow instance id.
-
canInitialize
Check if the calling user has enough permissions to initialise the specified workflow.- Parameters:
workflowName- The name of the workflow to check.initialStep- The id of the initial state to check.- Returns:
- true if the user can successfully call initialize, false otherwise.
-
canModifyEntryState
boolean canModifyEntryState(long id, int newState) Check if the state of the specified workflow instance can be changed to the new specified one.- 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
Modify the state of the specified workflow instance.- Parameters:
id- The workflow instance id.newState- the new state to change the workflow instance to. If the new state isorinvalid reference
com.opensymphony.workflow.spi.WorkflowEntry.KILLEDthen all current steps are moved to history steps. If the new state isinvalid reference
com.opensymphony.workflow.spi.WorkflowEntry.COMPLETED- Throws:
WorkflowException
-
doAction
Perform an action on the specified workflow instance.- 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.InvalidActionException- if the action is invalid for the specified workflow instance's current state.WorkflowException
-
executeTriggerFunction
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.- Parameters:
id- The workflow instance idtriggerId- The id of the speciail trigger-function- Throws:
WorkflowException
-
initialize
long initialize(String workflowName, int initialAction, Map inputs) throws InvalidRoleException, InvalidInputException, WorkflowException, InvalidEntryStateException, InvalidActionException 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.- Parameters:
workflowName- The workflow name to create and initialize an instance forinitialAction- The initial step to start the workflowinputs- The inputs entered by the end-user- Throws:
InvalidRoleException- if the user can't start this functionInvalidInputException- if a validator is specified and an input is invalid.InvalidActionException- if the specified initial action is invalid for the specified workflow.WorkflowExceptionInvalidEntryStateException
-
query
Deprecated.usequery(WorkflowExpressionQuery)instead.Query the workflow store for matching instances- Throws:
WorkflowException
-
query
Query the workflow store for matching instances- Throws:
WorkflowException
-
getAvailableActions
Get the available actions for the specified workflow instance.- 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
- Throws:
IllegalArgumentException- if the specified id does not exist, or if its workflow descriptor is no longer available or has become invalid.
-
setConfiguration
Set the configuration for this workflow. If not set, then the workflow will use the default configuration static instance.- Parameters:
configuration- a workflow configuration
-
getWorkflowNames
String[] getWorkflowNames()Get all available workflow names. -
canInitialize
Determine if a particular workflow can be initialized.- 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.
-
removeWorkflowDescriptor
Remove the specified workflow descriptor.- 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
boolean saveWorkflowDescriptor(String workflowName, WorkflowDescriptor descriptor, boolean replace) throws FactoryException Add a new workflow descriptor- Parameters:
workflowName- The workflow name of the workflow to adddescriptor- The workflow descriptor to addreplace- 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.
-
getAvailableActions(long, Map)with an empty Map instead.