com.opensymphony.workflow.spi.memory
Class SerializableWorkflowStore

java.lang.Object
  extended by com.opensymphony.workflow.spi.memory.MemoryWorkflowStore
      extended by com.opensymphony.workflow.spi.memory.SerializableWorkflowStore
All Implemented Interfaces:
WorkflowStore

public class SerializableWorkflowStore
extends MemoryWorkflowStore

Simple flat file implementation. Following properties are required:

Author:
Guillaume Bort

Field Summary
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
SerializableWorkflowStore()
           
 
Method Summary
 Step createCurrentStep(long entryId, int stepId, String owner, Date startDate, Date dueDate, String status, long[] previousIds)
          Persists a step with the given parameters.
 WorkflowEntry createEntry(String workflowName)
          Persists a new workflow entry that has not been initialized.
 List findCurrentSteps(long entryId)
          Returns a list of all current steps for the given workflow instance ID.
 WorkflowEntry findEntry(long entryId)
          Pulls up the workflow entry data for the entry ID given.
 List findHistorySteps(long entryId)
          Returns a list of all steps that are finished for the given workflow instance ID.
 com.opensymphony.module.propertyset.PropertySet getPropertySet(long entryId)
          Returns a PropertySet that is associated with this workflow instance ID.
static String getStoreFile()
           
 void init(Map props)
          Called once when the store is first created.
 Step markFinished(Step step, int actionId, Date finishDate, String status, String caller)
          Mark the specified step as finished.
 void moveToHistory(Step step)
          Called when a step is finished and can be moved to workflow history.
static void setStoreFile(String storeFile)
           
 
Methods inherited from class com.opensymphony.workflow.spi.memory.MemoryWorkflowStore
query, query, reset, setEntryState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Constructor Detail

SerializableWorkflowStore

public SerializableWorkflowStore()
Method Detail

getPropertySet

public com.opensymphony.module.propertyset.PropertySet getPropertySet(long entryId)
Description copied from interface: WorkflowStore
Returns a PropertySet that is associated with this workflow instance ID.

Specified by:
getPropertySet in interface WorkflowStore
Overrides:
getPropertySet in class MemoryWorkflowStore
Parameters:
entryId - The workflow instance id.
Returns:
a property set unique to this entry ID

setStoreFile

public static void setStoreFile(String storeFile)

getStoreFile

public static String getStoreFile()

createCurrentStep

public Step createCurrentStep(long entryId,
                              int stepId,
                              String owner,
                              Date startDate,
                              Date dueDate,
                              String status,
                              long[] previousIds)
Description copied from interface: WorkflowStore
Persists a step with the given parameters.

Specified by:
createCurrentStep in interface WorkflowStore
Overrides:
createCurrentStep in class MemoryWorkflowStore
Parameters:
entryId - The workflow instance id.
stepId - the ID of the workflow step associated with this new Step (not to be confused with the step primary key)
owner - the owner of the step
startDate - the start date of the step
status - the status of the step
previousIds - the previous step IDs
Returns:
a representation of the workflow step persisted

createEntry

public WorkflowEntry createEntry(String workflowName)
Description copied from interface: WorkflowStore
Persists a new workflow entry that has not been initialized.

Specified by:
createEntry in interface WorkflowStore
Overrides:
createEntry in class MemoryWorkflowStore
Parameters:
workflowName - the workflow name that this entry is an instance of
Returns:
a representation of the workflow instance persisted

findCurrentSteps

public List findCurrentSteps(long entryId)
Description copied from interface: WorkflowStore
Returns a list of all current steps for the given workflow instance ID.

Specified by:
findCurrentSteps in interface WorkflowStore
Overrides:
findCurrentSteps in class MemoryWorkflowStore
Parameters:
entryId - The workflow instance id.
Returns:
a List of Steps
See Also:
Step

findEntry

public WorkflowEntry findEntry(long entryId)
Description copied from interface: WorkflowStore
Pulls up the workflow entry data for the entry ID given.

Specified by:
findEntry in interface WorkflowStore
Overrides:
findEntry in class MemoryWorkflowStore
Parameters:
entryId - The workflow instance id.
Returns:
a representation of the workflow instance persisted

findHistorySteps

public List findHistorySteps(long entryId)
Description copied from interface: WorkflowStore
Returns a list of all steps that are finished for the given workflow instance ID.

Specified by:
findHistorySteps in interface WorkflowStore
Overrides:
findHistorySteps in class MemoryWorkflowStore
Parameters:
entryId - The workflow instance id.
Returns:
a List of Steps
See Also:
Step

init

public void init(Map props)
Description copied from interface: WorkflowStore
Called once when the store is first created.

Specified by:
init in interface WorkflowStore
Overrides:
init in class MemoryWorkflowStore
Parameters:
props - properties set in osworkflow.xml

markFinished

public Step markFinished(Step step,
                         int actionId,
                         Date finishDate,
                         String status,
                         String caller)
Description copied from interface: WorkflowStore
Mark the specified step as finished.

Specified by:
markFinished in interface WorkflowStore
Overrides:
markFinished in class MemoryWorkflowStore
Parameters:
step - the step to finish.
actionId - The action that caused the step to finish.
finishDate - the date when the step was finished.
status - The status to set the finished step to.
caller - The caller that caused the step to finish.
Returns:
the finished step

moveToHistory

public void moveToHistory(Step step)
Description copied from interface: WorkflowStore
Called when a step is finished and can be moved to workflow history.

Specified by:
moveToHistory in interface WorkflowStore
Overrides:
moveToHistory in class MemoryWorkflowStore
Parameters:
step - the step to be moved to workflow history

OpenSymphony Workflow Project Page