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 a Workspace to a HippoWorkspace, where the HippoWorkspace.getWorkflowManager() method returns the work-flow manager for the session. The Workspace itself is obtained though the Session.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 a Node. 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 Detail

      • getSession

        Session getSession()
                    throws 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:
        RepositoryException
      • getInternalWorkflowSession

        Session getInternalWorkflowSession()
      • getWorkflowDescriptor

        WorkflowDescriptor getWorkflowDescriptor​(String category,
                                                 Node item)
                                          throws 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 workflow
        item - the document or request for which to obtain the workflow
        Throws:
        RepositoryException
      • getWorkflowDescriptor

        WorkflowDescriptor getWorkflowDescriptor​(String category,
                                                 Document document)
                                          throws 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 workflow
        document - the document for which to obtain the workflow
        Throws:
        RepositoryException