Package org.hippoecm.repository.api
Interface WorkflowManager
-
public interface WorkflowManager
The work-flow manager is a service associated with a JCR session which provides access to a work-flow associated with a document stored in the repository. A work-flow is an implementation that can perform some transformation on the document. This implementation is represented as a Java interface, while the possible work-flow steps are methods of this interface. Because multiple work-flows may be active, a category is used to uniquely identify a specific work-flow. Although a work-flow manager is associated with a session, the actual transformation is commonly used by a new session, to obtain higher credentials. The internal implementation of the repository provides these credentials which are only accessible by the repository itself, and have the same permissions as the system user (effectively permissions to do everything). The work-flow manager is obtained by casting aWorkspace
to aHippoWorkspace
, where theHippoWorkspace.getWorkflowManager()
method returns the work-flow manager for the session. TheWorkspace
itself is obtained though theSession.getWorkspace()
. From the work-flow manager, you might directly obtain access to a work-flow, or obtain a reference (a WorkflowDescriptor) to the work-flow, which is a cheaper operation. This WorkflowDescriptor allows some querying to introspect the work-flow available. The work-flow descriptor may be used to obtain the actual work-flow again from the work-flow manager. The methods to obtain either the work-flow directly or a descriptor allow you to access a work-flow based on a Document object or on aNode
. In the latter case, the indicated node should be of a hippo:document (or derived) node type or of a hippo:request (or derived) node type. There are some internal-only exceptions, such as the root node, but in all cases the node must be referenceable and contain no pending changes in the current session.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.jcr.Session
getSession()
Workflow Managers are associated with an authenticated session, even though most of the operations executed by workflows are executed from a seperated (unaccessible) session with higher credentials.Workflow
getWorkflow(String category, javax.jcr.Node item)
Obtains the workflow for the document as indicated by the javax.jcr.Node instance in the specified category.Workflow
getWorkflow(String category, Document document)
Obtains the workflow for the document as indicated Document instance in the specified category.Workflow
getWorkflow(WorkflowDescriptor descriptor)
Obtains the workflow for the previously requested workflow descriptor within the same session.WorkflowDescriptor
getWorkflowDescriptor(String category, javax.jcr.Node item)
Obtains a reference to the workflow for the document as indicated by the javax.jcr.Node in the specified category.WorkflowDescriptor
getWorkflowDescriptor(String category, Document document)
Obtains a reference to the workflow for the document as indicated Document instance in the specified category.
-
-
-
Method Detail
-
getSession
javax.jcr.Session getSession() throws javax.jcr.RepositoryException
Workflow Managers are associated with an authenticated session, even though most of the operations executed by workflows are executed from a seperated (unaccessible) session with higher credentials.- Returns:
- the session which with this workflow manager object is associated with
- Throws:
javax.jcr.RepositoryException
-
getWorkflowDescriptor
WorkflowDescriptor getWorkflowDescriptor(String category, javax.jcr.Node item) throws javax.jcr.RepositoryException
Obtains a reference to the workflow for the document as indicated by the javax.jcr.Node in the specified category.- Parameters:
category
- category in which to look for the workflowitem
- the document or request for which to obtain the workflow- Throws:
javax.jcr.RepositoryException
-
getWorkflowDescriptor
WorkflowDescriptor getWorkflowDescriptor(String category, Document document) throws javax.jcr.RepositoryException
Obtains a reference to the workflow for the document as indicated Document instance in the specified category.- Parameters:
category
- category in which to look for the workflowdocument
- the document for which to obtain the workflow- Throws:
javax.jcr.RepositoryException
-
getWorkflow
Workflow getWorkflow(String category, javax.jcr.Node item) throws MappingException, javax.jcr.RepositoryException
Obtains the workflow for the document as indicated by the javax.jcr.Node instance in the specified category.- Parameters:
category
- category in which to look for the workflowitem
-- Returns:
- the document or request for which to obtain the workflow
- Throws:
MappingException
javax.jcr.RepositoryException
-
getWorkflow
Workflow getWorkflow(String category, Document document) throws MappingException, javax.jcr.RepositoryException
Obtains the workflow for the document as indicated Document instance in the specified category.- Parameters:
category
- category in which to look for the workflowdocument
- the document for which to obtain the workflow- Throws:
MappingException
javax.jcr.RepositoryException
-
getWorkflow
Workflow getWorkflow(WorkflowDescriptor descriptor) throws MappingException, javax.jcr.RepositoryException
Obtains the workflow for the previously requested workflow descriptor within the same session.- Parameters:
descriptor
- the workflow descriptor obtained from the same workflow manager earlier- Returns:
- the workflow associated with the document and category as descriped in the descriptor
- Throws:
MappingException
javax.jcr.RepositoryException
-
-