|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.opensymphony.workflow.AbstractWorkflow
public class AbstractWorkflow
Abstract workflow instance that serves as the base for specific implementations, such as EJB or SOAP.
| Field Summary | |
|---|---|
protected WorkflowContext |
context
|
| 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 | |
|---|---|
AbstractWorkflow()
|
|
| Method Summary | |
|---|---|
boolean |
canInitialize(String workflowName,
int initialAction)
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. |
protected void |
checkImplicitFinish(ActionDescriptor action,
long id)
|
protected void |
completeEntry(ActionDescriptor action,
long id,
Collection currentSteps,
int state)
Mark the specified entry as completed, and move all current steps to history. |
void |
doAction(long id,
int actionId,
Map inputs)
Perform an action on the specified workflow instance. |
protected void |
executeFunction(FunctionDescriptor function,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
Executes a function. |
void |
executeTriggerFunction(long id,
int triggerId)
Executes a special trigger-function using the context of the given workflow instance id. |
int[] |
getAvailableActions(long id)
Deprecated. use getAvailableActions(long, Map) with an empty Map instead. |
int[] |
getAvailableActions(long id,
Map inputs)
Get the available actions for the specified workflow instance. |
protected List |
getAvailableActionsForStep(WorkflowDescriptor wf,
Step step,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
|
protected int[] |
getAvailableAutoActions(long id,
Map inputs)
|
protected List |
getAvailableAutoActionsForStep(WorkflowDescriptor wf,
Step step,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
Get just auto action availables for a step |
Configuration |
getConfiguration()
Get the configuration for this workflow. |
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. |
protected WorkflowStore |
getPersistence()
|
Properties |
getPersistenceProperties()
|
com.opensymphony.module.propertyset.PropertySet |
getPropertySet(long id)
Get the PropertySet for the specified workflow ID |
TypeResolver |
getResolver()
|
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)
Returns a workflow definition object associated with the given name. |
String |
getWorkflowName(long id)
Get the name of the specified workflow instance. |
String[] |
getWorkflowNames()
Get a list of workflow names available |
long |
initialize(String workflowName,
int initialAction,
Map inputs)
Initializes a workflow so that it can begin processing. |
protected boolean |
passesCondition(ConditionDescriptor conditionDesc,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps,
int currentStepId)
|
protected boolean |
passesConditions(ConditionsDescriptor descriptor,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps,
int currentStepId)
|
protected boolean |
passesConditions(String conditionType,
List conditions,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps,
int currentStepId)
|
protected void |
populateTransientMap(WorkflowEntry entry,
Map transientVars,
List registers,
Integer actionId,
Collection currentSteps,
com.opensymphony.module.propertyset.PropertySet ps)
|
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. |
void |
setResolver(TypeResolver resolver)
|
protected boolean |
transitionWorkflow(WorkflowEntry entry,
List currentSteps,
WorkflowStore store,
WorkflowDescriptor wf,
ActionDescriptor action,
Map transientVars,
Map inputs,
com.opensymphony.module.propertyset.PropertySet ps)
|
protected void |
verifyInputs(WorkflowEntry entry,
List validators,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
Validates input against a list of ValidatorDescriptor objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected WorkflowContext context
| Constructor Detail |
|---|
public AbstractWorkflow()
| Method Detail |
|---|
public int[] getAvailableActions(long id)
getAvailableActions(long, Map) with an empty Map instead.
getAvailableActions in interface Workflow
public int[] getAvailableActions(long id,
Map inputs)
getAvailableActions in interface Workflowid - The workflow instance id.inputs - The inputs map to pass on to conditions
IllegalArgumentException - if the specified id does not exist, or if its workflow
descriptor is no longer available or has become invalid.public void setConfiguration(Configuration configuration)
Workflow
setConfiguration in interface Workflowconfiguration - a workflow configurationpublic Configuration getConfiguration()
public List getCurrentSteps(long id)
Workflow
getCurrentSteps in interface Workflowid - The workflow instance id.
public int getEntryState(long id)
Workflow
getEntryState in interface Workflowid - The workflow instance id.
public List getHistorySteps(long id)
Workflow
getHistorySteps in interface Workflowid - The workflow instance id.
Steppublic Properties getPersistenceProperties()
public com.opensymphony.module.propertyset.PropertySet getPropertySet(long id)
getPropertySet in interface Workflowid - The workflow IDpublic void setResolver(TypeResolver resolver)
public TypeResolver getResolver()
public List getSecurityPermissions(long id)
Workflow
getSecurityPermissions in interface Workflowid - the workflow instance id.
public List getSecurityPermissions(long id,
Map inputs)
Workflow
getSecurityPermissions in interface Workflowid - id the workflow instance id.inputs - inputs The inputs to the workflow instance.
public WorkflowDescriptor getWorkflowDescriptor(String workflowName)
getWorkflowDescriptor in interface WorkflowworkflowName - the name of the workflow
public String getWorkflowName(long id)
Workflow
getWorkflowName in interface Workflowid - the workflow instance id.public String[] getWorkflowNames()
getWorkflowNames in interface Workflow
public boolean canInitialize(String workflowName,
int initialAction)
Workflow
canInitialize in interface WorkflowworkflowName - The name of the workflow to check.initialAction - The id of the initial state to check.
public boolean canInitialize(String workflowName,
int initialAction,
Map inputs)
Workflow
canInitialize in interface WorkflowworkflowName - the name of the workflow to checkinitialAction - The initial action to checkinputs - the inputs map
public boolean canModifyEntryState(long id,
int newState)
Workflow
canModifyEntryState in interface Workflowid - The workflow instance id.newState - The new state id.
public void changeEntryState(long id,
int newState)
throws WorkflowException
Workflow
changeEntryState in interface Workflowid - 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
WorkflowException
public void doAction(long id,
int actionId,
Map inputs)
throws WorkflowException
Workflow
doAction in interface Workflowid - 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.
InvalidInputException - if a validator is specified and an input is invalid.
WorkflowException
public void executeTriggerFunction(long id,
int triggerId)
throws WorkflowException
Workflow
executeTriggerFunction in interface Workflowid - The workflow instance idtriggerId - The id of the speciail trigger-function
WorkflowException
public long initialize(String workflowName,
int initialAction,
Map inputs)
throws InvalidRoleException,
InvalidInputException,
WorkflowException
Workflow
initialize in interface WorkflowworkflowName - The workflow name to create and initialize an instance forinitialAction - The initial step to start the workflowinputs - The inputs entered by the end-user
InvalidRoleException - if the user can't start this function
InvalidInputException - if a validator is specified and an input is invalid.
WorkflowException
public List query(WorkflowQuery query)
throws StoreException
Workflow
query in interface WorkflowStoreException
public List query(WorkflowExpressionQuery query)
throws WorkflowException
Workflow
query in interface WorkflowWorkflowException
public boolean removeWorkflowDescriptor(String workflowName)
throws FactoryException
Workflow
removeWorkflowDescriptor in interface WorkflowworkflowName - The workflow name of the workflow to remove.
FactoryException - If the underlying workflow factory has an error removing the workflow,
or if it does not support the removal of workflows.
public boolean saveWorkflowDescriptor(String workflowName,
WorkflowDescriptor descriptor,
boolean replace)
throws FactoryException
Workflow
saveWorkflowDescriptor in interface WorkflowworkflowName - The workflow name of the workflow to adddescriptor - The workflow descriptor to addreplace - true, if an existing descriptor should be overwritten
FactoryException - If the underlying workflow factory has an error adding the workflow,
or if it does not support adding workflows.
protected List getAvailableActionsForStep(WorkflowDescriptor wf,
Step step,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
throws WorkflowException
WorkflowException
protected int[] getAvailableAutoActions(long id,
Map inputs)
protected List getAvailableAutoActionsForStep(WorkflowDescriptor wf,
Step step,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
throws WorkflowException
WorkflowException
protected WorkflowStore getPersistence()
throws StoreException
StoreException
protected void checkImplicitFinish(ActionDescriptor action,
long id)
throws WorkflowException
WorkflowException
protected void completeEntry(ActionDescriptor action,
long id,
Collection currentSteps,
int state)
throws StoreException
StoreException
protected void executeFunction(FunctionDescriptor function,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
throws WorkflowException
function - the function to executetransientVars - the transientVars given by the end-userps - the persistence variables
WorkflowException
protected boolean passesCondition(ConditionDescriptor conditionDesc,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps,
int currentStepId)
throws WorkflowException
WorkflowException
protected boolean passesConditions(String conditionType,
List conditions,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps,
int currentStepId)
throws WorkflowException
WorkflowException
protected boolean passesConditions(ConditionsDescriptor descriptor,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps,
int currentStepId)
throws WorkflowException
WorkflowException
protected void populateTransientMap(WorkflowEntry entry,
Map transientVars,
List registers,
Integer actionId,
Collection currentSteps,
com.opensymphony.module.propertyset.PropertySet ps)
throws WorkflowException
WorkflowException
protected boolean transitionWorkflow(WorkflowEntry entry,
List currentSteps,
WorkflowStore store,
WorkflowDescriptor wf,
ActionDescriptor action,
Map transientVars,
Map inputs,
com.opensymphony.module.propertyset.PropertySet ps)
throws WorkflowException
WorkflowException
protected void verifyInputs(WorkflowEntry entry,
List validators,
Map transientVars,
com.opensymphony.module.propertyset.PropertySet ps)
throws WorkflowException
entry - the workflow instancevalidators - the list of ValidatorDescriptorstransientVars - the transientVarsps - the persistence variables
InvalidInputException - if the input is deemed invalid by any validator
WorkflowException
|
OpenSymphony Workflow Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||