Interface BasicWorkflowService

  • All Superinterfaces:
    WorkflowService<BasicWorkflowItem>
    All Known Implementing Classes:
    BasicWorkflowServiceImpl

    public interface BasicWorkflowService
    extends WorkflowService<BasicWorkflowItem>
    Workflow state machine Notes: Determining item status from the database: When an item has not been submitted yet, it is in the user's personal workspace (there is a row in PersonalWorkspace pointing to it.) When an item is submitted and is somewhere in a workflow, it has a row in the WorkflowItem table pointing to it. The state of the workflow can be determined by looking at WorkflowItem.getState() When a submission is complete, the WorkflowItem pointing to the item is destroyed and the archive() method is called, which hooks the item up to the archive. Notification: When an item enters a state that requires notification, (WFSTATE_STEP1POOL, WFSTATE_STEP2POOL, WFSTATE_STEP3POOL,) the workflow needs to notify the appropriate groups that they have a pending task to claim. Revealing lists of approvers, editors, and reviewers. A method could be added to do this, but it isn't strictly necessary. (say public List getStateEPeople( WorkflowItem wi, int state ) could return people affected by the item's current state.
    • Method Detail

      • getWorkflowID

        int getWorkflowID​(String state)
        Translate symbolic name of workflow state into number. The name is case-insensitive. Returns -1 when name cannot be matched.
        Parameters:
        state - symbolic name of workflow state, must be one of the elements of workflowText array.
        Returns:
        numeric workflow state or -1 for error.
      • getOwnedTasks

        List<BasicWorkflowItem> getOwnedTasks​(Context context,
                                              EPerson e)
                                       throws SQLException
        getOwnedTasks() returns a List of WorkflowItems containing the tasks claimed and owned by an EPerson. The GUI displays this info on the MyDSpace page.
        Parameters:
        context - The relevant DSpace Context.
        e - The EPerson we want to fetch owned tasks for.
        Returns:
        list of basic workflow items
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • getPooledTasks

        List<BasicWorkflowItem> getPooledTasks​(Context context,
                                               EPerson e)
                                        throws SQLException
        getPooledTasks() returns a List of WorkflowItems an EPerson could claim (as a reviewer, etc.) for display on a user's MyDSpace page.
        Parameters:
        context - The relevant DSpace Context.
        e - The Eperson we want to fetch the pooled tasks for.
        Returns:
        list of basic workflow items
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • claim

        void claim​(Context context,
                   BasicWorkflowItem workflowItem,
                   EPerson e)
            throws SQLException,
                   IOException,
                   AuthorizeException
        claim() claims a workflow task for an EPerson
        Parameters:
        context - The relevant DSpace Context.
        workflowItem - WorkflowItem to do the claim on
        e - The EPerson doing the claim
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
        IOException - A general class of exceptions produced by failed or interrupted I/O operations.
        AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
      • advance

        void advance​(Context context,
                     BasicWorkflowItem workflowItem,
                     EPerson e)
              throws SQLException,
                     IOException,
                     AuthorizeException
        advance() sends an item forward in the workflow (reviewers, approvers, and editors all do an 'approve' to move the item forward) if the item arrives at the submit state, then remove the WorkflowItem and call the archive() method to put it in the archive, and email notify the submitter of a successful submission
        Parameters:
        context - The relevant DSpace Context.
        workflowItem - WorkflowItem do do the approval on
        e - EPerson doing the approval
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
        IOException - A general class of exceptions produced by failed or interrupted I/O operations.
        AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
      • advance

        boolean advance​(Context context,
                        BasicWorkflowItem workflowItem,
                        EPerson e,
                        boolean curate,
                        boolean record)
                 throws SQLException,
                        IOException,
                        AuthorizeException
        advance() sends an item forward in the workflow (reviewers, approvers, and editors all do an 'approve' to move the item forward) if the item arrives at the submit state, then remove the WorkflowItem and call the archive() method to put it in the archive, and email notify the submitter of a successful submission
        Parameters:
        context - The relevant DSpace Context.
        workflowItem - WorkflowItem do do the approval on
        e - EPerson doing the approval
        curate - boolean indicating whether curation tasks should be done
        record - boolean indicating whether to record action
        Returns:
        true if the item was successfully archived
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
        IOException - A general class of exceptions produced by failed or interrupted I/O operations.
        AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
      • unclaim

        void unclaim​(Context context,
                     BasicWorkflowItem workflowItem,
                     EPerson e)
              throws SQLException,
                     IOException,
                     AuthorizeException
        unclaim() returns an owned task/item to the pool
        Parameters:
        context - Context
        workflowItem - WorkflowItem to operate on
        e - EPerson doing the operation
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
        IOException - A general class of exceptions produced by failed or interrupted I/O operations.
        AuthorizeException - Exception indicating the current user of the context does not have permission to perform a particular action.
      • getWorkflowText

        String getWorkflowText​(int state)
        Get the text representing the given workflow state
        Parameters:
        state - the workflow state
        Returns:
        the text representation
      • getItemTitle

        String getItemTitle​(BasicWorkflowItem wi)
                     throws SQLException
        get the title of the item in this workflow
        Parameters:
        wi - the workflow item object
        Returns:
        item title
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.
      • getSubmitterName

        String getSubmitterName​(BasicWorkflowItem wi)
                         throws SQLException
        get the name of the eperson who started this workflow
        Parameters:
        wi - the workflow item
        Returns:
        submitter's name
        Throws:
        SQLException - An exception that provides information on a database access error or other errors.