Class AmetysObjectWorkflowStore
java.lang.Object
org.ametys.plugins.workflow.store.AbstractJackrabbitWorkflowStore
org.ametys.plugins.workflow.store.AmetysObjectWorkflowStore
- All Implemented Interfaces:
com.opensymphony.workflow.spi.WorkflowStore
,AmetysWorkflowStore
- Direct Known Subclasses:
WebAmetysObjectWorkflowStore
Workflow store that creates local entries for an Ametys object.
Each entry belong to an ametys object as soon as the entry is created.
-
Field Summary
Modifier and TypeFieldDescriptionprotected WorkflowAwareAmetysObject
The ametys objectprotected com.opensymphony.workflow.spi.WorkflowEntry
Temporary entry created in memoryFields inherited from class org.ametys.plugins.workflow.store.AbstractJackrabbitWorkflowStore
__NAMESPACE, __NAMESPACE_PREFIX, __NM_PREFIX, __ROOT_NT, _log, _repository
-
Constructor Summary
ConstructorDescriptionAmetysObjectWorkflowStore
(javax.jcr.Repository repository, WorkflowAwareAmetysObject ametysObject) Creates a workflow store for Ametys object.AmetysObjectWorkflowStore
(javax.jcr.Repository repository, WorkflowAwareAmetysObject ametysObject, boolean preserveHistory) Creates a workflow store for Ametys object. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Create the root node.protected javax.jcr.Node
Provides the ametys object node in the current sessionprotected long
Generate an unique entry id.protected javax.jcr.Node
_getOrCreateParentEntryNode
(javax.jcr.Node root, long id) Retrieves the parent node of a workflow entry.protected javax.jcr.Node
_getRootNode
(javax.jcr.Session session) Get the workflow store root nodeprotected javax.jcr.Session
Open a session to the _repository.protected void
_release
(javax.jcr.Session session) Release a session.void
bindAmetysObject
(WorkflowAwareAmetysObject ametysObject) Bind an ametys object to this store.Ametys object getterboolean
Returns true if the history steps have to be removed when the workflow reaches its final stepprotected void
storeNewEntry
(com.opensymphony.workflow.spi.WorkflowEntry workflowEntry) Store a new workflow entry into the JCR repositoryMethods inherited from class org.ametys.plugins.workflow.store.AbstractJackrabbitWorkflowStore
__toCalendar, _getNextStepId, buildFieldExpression, buildNestedExpression, clearHistory, createCurrentStep, createEntry, deleteInstance, findCurrentSteps, findEntry, findHistorySteps, getCondition, getEntryNode, getFirstFieldExpression, getPredicate, getPropertyName, getPropertySet, getSortCriteria, init, markFinished, moveToHistory, query, query, removeEntry, setEntryState, translateValue
-
Field Details
-
_ametysObject
The ametys object -
_inMemoryEntry
Temporary entry created in memory
-
-
Constructor Details
-
AmetysObjectWorkflowStore
public AmetysObjectWorkflowStore(javax.jcr.Repository repository, WorkflowAwareAmetysObject ametysObject) Creates a workflow store for Ametys object. The history steps will be clear on workflow completion.- Parameters:
repository
- the JCR Repository to use.ametysObject
- The ametys object for this store. Can be null in case of an object creation.
-
AmetysObjectWorkflowStore
public AmetysObjectWorkflowStore(javax.jcr.Repository repository, WorkflowAwareAmetysObject ametysObject, boolean preserveHistory) Creates a workflow store for Ametys object.- Parameters:
repository
- the JCR Repository to use.ametysObject
- The ametys object for this store. Can be null in case of an object creation.preserveHistory
- Set to true to preserve history steps when workflow is complete.
-
-
Method Details
-
shouldClearHistory
Description copied from interface:AmetysWorkflowStore
Returns true if the history steps have to be removed when the workflow reaches its final step- Returns:
- true if the history history has to be cleared.
-
getAmetysObject
Ametys object getter- Returns:
- The ametys object
-
_getSession
Description copied from class:AbstractJackrabbitWorkflowStore
Open a session to the _repository.- Overrides:
_getSession
in classAbstractJackrabbitWorkflowStore
- Returns:
- the session opened.
- Throws:
javax.jcr.RepositoryException
- if an error occurs.
-
_release
Description copied from class:AbstractJackrabbitWorkflowStore
Release a session.Default implementation calls logout on the session.
- Overrides:
_release
in classAbstractJackrabbitWorkflowStore
- Parameters:
session
- the session to release.
-
_getAmetysObjectNode
Provides the ametys object node in the current session- Returns:
- node
- Throws:
javax.jcr.RepositoryException
- on repository error
-
_createRootNode
Description copied from class:AbstractJackrabbitWorkflowStore
Create the root node.- Specified by:
_createRootNode
in classAbstractJackrabbitWorkflowStore
- Throws:
javax.jcr.RepositoryException
- if an error occurs.
-
_getRootNode
protected javax.jcr.Node _getRootNode(javax.jcr.Session session) throws javax.jcr.RepositoryException Description copied from class:AbstractJackrabbitWorkflowStore
Get the workflow store root node- Specified by:
_getRootNode
in classAbstractJackrabbitWorkflowStore
- Parameters:
session
- the session to use- Returns:
- The workflow store root node
- Throws:
javax.jcr.RepositoryException
- if an error occurs.
-
_getOrCreateParentEntryNode
protected javax.jcr.Node _getOrCreateParentEntryNode(javax.jcr.Node root, long id) throws javax.jcr.RepositoryException Description copied from class:AbstractJackrabbitWorkflowStore
Retrieves the parent node of a workflow entry. Creates non existing ancestor nodes when necessary.- Specified by:
_getOrCreateParentEntryNode
in classAbstractJackrabbitWorkflowStore
- Parameters:
root
- The workflow store root nodeid
- The workflow entry id- Returns:
- The parent node
- Throws:
javax.jcr.RepositoryException
- on repository error
-
_getNextEntryId
Description copied from class:AbstractJackrabbitWorkflowStore
Generate an unique entry id.- Overrides:
_getNextEntryId
in classAbstractJackrabbitWorkflowStore
- Returns:
- A new entry id.
- Throws:
javax.jcr.RepositoryException
- if an error occurs.
-
storeNewEntry
protected void storeNewEntry(com.opensymphony.workflow.spi.WorkflowEntry workflowEntry) throws com.opensymphony.workflow.StoreException Store a new workflow entry into the JCR repository- Overrides:
storeNewEntry
in classAbstractJackrabbitWorkflowStore
- Parameters:
workflowEntry
- The new entry- Throws:
com.opensymphony.workflow.StoreException
- on error
-
bindAmetysObject
public void bindAmetysObject(WorkflowAwareAmetysObject ametysObject) throws com.opensymphony.workflow.StoreException Bind an ametys object to this store. Must be done in case of an object creation. As soon as the ametys object is created, the store must be notified to persist the workflow entry into the repository.- Parameters:
ametysObject
- The ametys object to bind- Throws:
com.opensymphony.workflow.StoreException
- on error
-