Class JdbcWorkflowStore
- java.lang.Object
-
- com.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore
-
- org.ametys.plugins.workflow.store.JdbcWorkflowStore
-
- All Implemented Interfaces:
com.opensymphony.workflow.spi.WorkflowStore
,AmetysWorkflowStore
,Disposable
,Initializable
,Component
,Configurable
,Serviceable
public class JdbcWorkflowStore extends com.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore implements AmetysWorkflowStore, Component, Serviceable, Configurable, Initializable, Disposable
Ametys JDBC workflow store
-
-
Field Summary
Fields Modifier and Type Field Description protected String
_databaseType
Configured data source typeprotected String
_dataSourceId
Configured datasource idprotected String
_entrySequenceIncrement
from com.opensymphony.workflow.spi.jdbc.MySQLWorkflowStoreprotected String
_entrySequenceRetrieve
from com.opensymphony.workflow.spi.jdbc.MySQLWorkflowStoreprotected org.slf4j.Logger
_logger
Loggerprotected SQLDataSourceManager
_sqlDataSourceManager
The manager for SQL data sourceprotected String
_stepSequenceIncrement
from com.opensymphony.workflow.spi.jdbc.MySQLWorkflowStoreprotected String
_stepSequenceRetrieve
from com.opensymphony.workflow.spi.jdbc.MySQLWorkflowStorestatic String
ROLE
Avalon role.-
Fields inherited from class com.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore
closeConnWhenDone, currentPrevTable, currentTable, ds, entryId, entryName, entrySequence, entryState, entryTable, historyPrevTable, historyTable, stepActionId, stepCaller, stepDueDate, stepEntryId, stepFinishDate, stepId, stepOwner, stepPreviousId, stepSequence, stepStartDate, stepStatus, stepStepId
-
-
Constructor Summary
Constructors Constructor Description JdbcWorkflowStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cleanup(Connection connection, Statement statement, ResultSet result)
void
clearHistory(long idWorkflow)
Removes all history steps of an instance from the database.
All future calls to the history will return an empty List of Step.void
configure(Configuration configuration)
void
deleteInstance(long idWorkflow)
Deletes a workflow instance from the database.
All future calls from the workflow to this instance will failed.void
dispose()
String
getDatabaseType()
Database type getterprotected long
getNextEntrySequence(Connection c)
protected long
getNextStepSequence(Connection c)
com.opensymphony.module.propertyset.PropertySet
getPropertySet(long id)
void
init(Map props)
void
initialize()
List
query(com.opensymphony.workflow.query.WorkflowExpressionQuery e)
void
service(ServiceManager manager)
boolean
shouldClearHistory()
Returns true if the history steps have to be removed when the workflow reaches its final step-
Methods inherited from class com.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore
addPreviousSteps, checkIfORExists, createCurrentStep, createCurrentStep, createEntry, findCurrentSteps, findEntry, findHistorySteps, getConnection, markFinished, moveToHistory, query, setEntryState
-
-
-
-
Field Detail
-
_logger
protected org.slf4j.Logger _logger
Logger
-
_sqlDataSourceManager
protected SQLDataSourceManager _sqlDataSourceManager
The manager for SQL data source
-
_dataSourceId
protected String _dataSourceId
Configured datasource id
-
_databaseType
protected String _databaseType
Configured data source type
-
_entrySequenceIncrement
protected String _entrySequenceIncrement
from com.opensymphony.workflow.spi.jdbc.MySQLWorkflowStore
-
_entrySequenceRetrieve
protected String _entrySequenceRetrieve
from com.opensymphony.workflow.spi.jdbc.MySQLWorkflowStore
-
_stepSequenceIncrement
protected String _stepSequenceIncrement
from com.opensymphony.workflow.spi.jdbc.MySQLWorkflowStore
-
_stepSequenceRetrieve
protected String _stepSequenceRetrieve
from com.opensymphony.workflow.spi.jdbc.MySQLWorkflowStore
-
-
Constructor Detail
-
JdbcWorkflowStore
public JdbcWorkflowStore()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceDisposable
-
init
public void init(Map props) throws com.opensymphony.workflow.StoreException
- Specified by:
init
in interfacecom.opensymphony.workflow.spi.WorkflowStore
- Overrides:
init
in classcom.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore
- Throws:
com.opensymphony.workflow.StoreException
-
getDatabaseType
public String getDatabaseType() throws SQLException
Database type getter- Returns:
- The database type
- Throws:
SQLException
- on error
-
getPropertySet
public com.opensymphony.module.propertyset.PropertySet getPropertySet(long id)
- Specified by:
getPropertySet
in interfacecom.opensymphony.workflow.spi.WorkflowStore
- Overrides:
getPropertySet
in classcom.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore
-
shouldClearHistory
public boolean shouldClearHistory()
Description copied from interface:AmetysWorkflowStore
Returns true if the history steps have to be removed when the workflow reaches its final step- Specified by:
shouldClearHistory
in interfaceAmetysWorkflowStore
- Returns:
- true if the history history has to be cleared.
-
cleanup
protected void cleanup(Connection connection, Statement statement, ResultSet result)
- Overrides:
cleanup
in classcom.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore
-
deleteInstance
public void deleteInstance(long idWorkflow)
Description copied from interface:AmetysWorkflowStore
Deletes a workflow instance from the database.
All future calls from the workflow to this instance will failed.- Specified by:
deleteInstance
in interfaceAmetysWorkflowStore
- Parameters:
idWorkflow
- The id of a workflow instance.
-
clearHistory
public void clearHistory(long idWorkflow)
Description copied from interface:AmetysWorkflowStore
Removes all history steps of an instance from the database.
All future calls to the history will return an empty List of Step.- Specified by:
clearHistory
in interfaceAmetysWorkflowStore
- Parameters:
idWorkflow
- the id of a workflow instance.
-
query
public List query(com.opensymphony.workflow.query.WorkflowExpressionQuery e) throws com.opensymphony.workflow.StoreException
- Specified by:
query
in interfacecom.opensymphony.workflow.spi.WorkflowStore
- Overrides:
query
in classcom.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore
- Throws:
com.opensymphony.workflow.StoreException
-
getNextEntrySequence
protected long getNextEntrySequence(Connection c) throws SQLException
- Overrides:
getNextEntrySequence
in classcom.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore
- Throws:
SQLException
-
getNextStepSequence
protected long getNextStepSequence(Connection c) throws SQLException
- Overrides:
getNextStepSequence
in classcom.opensymphony.workflow.spi.jdbc.JDBCWorkflowStore
- Throws:
SQLException
-
-