com.atlassian.jira.workflow
Interface DraftWorkflowStore

All Known Implementing Classes:
CachingDraftWorkflowStore, OfBizDraftWorkflowStore

public interface DraftWorkflowStore

This store is used to persist copies of active workflows. This is useful when editing an active workflow, without applying any of the changes yet.

Since:
v3.13

Method Summary
 JiraWorkflow createDraftWorkflow(String authorName, JiraWorkflow parentWorkflow)
          Creates a temporary workflow linked back to the named active workflow by id.
 boolean deleteDraftWorkflow(String parentWorkflowName)
          Removes a temporary workflow linked to the workflow name.
 JiraWorkflow getDraftWorkflow(String parentWorkflowName)
          This will retrieve an draft workflow that is related to the named saved workflow.
 JiraWorkflow updateDraftWorkflow(String username, String parentWorkflowName, JiraWorkflow workflow)
          Updates a temporary workflow with the one provided for the parent workflow name passed in.
 JiraWorkflow updateDraftWorkflowWithoutAudit(String parentWorkflowName, JiraWorkflow workflow)
          Updates a temporary workflow with the one provided for the parent workflow name passed in.
 

Method Detail

getDraftWorkflow

JiraWorkflow getDraftWorkflow(String parentWorkflowName)
                              throws DataAccessException
This will retrieve an draft workflow that is related to the named saved workflow. If an draft workflow is not associated with the passed in name this will return null.

Parameters:
parentWorkflowName - of the saved parent workflow.
Returns:
workflow that represents the draft "copy" of the named active workflow. This will be of type JiraDraftWorkflow.
Throws:
DataAccessException - DataAccessException

createDraftWorkflow

JiraWorkflow createDraftWorkflow(String authorName,
                                 JiraWorkflow parentWorkflow)
                                 throws DataAccessException,
                                        IllegalStateException,
                                        IllegalArgumentException
Creates a temporary workflow linked back to the named active workflow by id. If a temporary workflow already exists, this method will throw an exception.

Parameters:
authorName - The username of the user making the edit
parentWorkflow - The parent workflow to copy for the draft workflow.
Returns:
workflow that represents the draft "copy" of the named active workflow. This will be of type JiraDraftWorkflow.
Throws:
DataAccessException - if there are any db errors
IllegalStateException - thrown if you are adding an draft workflow which already exists for the provided parent workflow
IllegalArgumentException - If the username is null

deleteDraftWorkflow

boolean deleteDraftWorkflow(String parentWorkflowName)
                            throws DataAccessException
Removes a temporary workflow linked to the workflow name.

Parameters:
parentWorkflowName - of the saved parent workflow.
Returns:
True if deleted successfully
Throws:
DataAccessException - RuntimeException wrapper around a DB Exception.

updateDraftWorkflow

JiraWorkflow updateDraftWorkflow(String username,
                                 String parentWorkflowName,
                                 JiraWorkflow workflow)
                                 throws DataAccessException
Updates a temporary workflow with the one provided for the parent workflow name passed in. Throws an exception, if no temporary workflow exists for the one being updated.

Parameters:
username - is the username of the user updating this draft workflow.
parentWorkflowName - of the saved parent workflow.
workflow - The JiraWorkflow to use for the update.
Returns:
workflow that represents the draft "copy" of the named active workflow. This will be of type JiraDraftWorkflow.
Throws:
DataAccessException - RuntimeException wrapper around a DB Exception.

updateDraftWorkflowWithoutAudit

JiraWorkflow updateDraftWorkflowWithoutAudit(String parentWorkflowName,
                                             JiraWorkflow workflow)
                                             throws DataAccessException
Updates a temporary workflow with the one provided for the parent workflow name passed in. Throws an exception, if no temporary workflow exists for the one being updated. This will not update the draft author or the draft date. This method should only be used by upgrade tasks. Use updateDraftWorkflow(String, String, JiraWorkflow) instead.

Parameters:
parentWorkflowName - of the saved parent workflow.
workflow - The JiraWorkflow to use for the update.
Returns:
workflow that represents the draft "copy" of the named active workflow. This will be of type JiraDraftWorkflow.
Throws:
DataAccessException - RuntimeException wrapper around a DB Exception.


Copyright © 2002-2013 Atlassian. All Rights Reserved.