Class WorkflowsImpl

java.lang.Object
com.atlassian.jira.workflow.edit.WorkflowsImpl
All Implemented Interfaces:
Workflows

public class WorkflowsImpl extends Object implements Workflows
Service style operations that can be applied to workflow objects.
  • Constructor Details

  • Method Details

    • getMutableWorkflow

      public ServiceOutcome<Workflow> getMutableWorkflow(String workflowName)
      Description copied from interface: Workflows
      Get a workflow that can be changed.
      Specified by:
      getMutableWorkflow in interface Workflows
      Parameters:
      workflowName - The workflow's name.
      Returns:
      A mutable version of the requested workflow or an error message.
    • getMutableWorkflowWithoutValidation

      public Workflow getMutableWorkflowWithoutValidation(String workflowName)
      Description copied from interface: Workflows
      Gets a mutable workflow with no validation applied to it. This will either return the workflow or null if not found.
      Specified by:
      getMutableWorkflowWithoutValidation in interface Workflows
      Returns:
      Workflow
    • saveWorkflow

      public ServiceOutcome<Workflow> saveWorkflow(Workflow workflow)
      Description copied from interface: Workflows
      Save changes that have been made to a workflow and return a ServiceOutcome.
      Specified by:
      saveWorkflow in interface Workflows
      Parameters:
      workflow - The workflow to save.
      Returns:
      A ServiceOutcome containing value or an error message.
    • discardDraft

      public ServiceOutcome<Void> discardDraft(String workflowName)
      Description copied from interface: Workflows
      Discard the draft for the specified workflow. If no draft existed for the specified workflow, it will treat the operation as successful.
      Specified by:
      discardDraft in interface Workflows
      Parameters:
      workflowName - The name of the workflow of which the draft should be deleted.
      Returns:
      A ServiceOutcome containing null or an error message in case of failure.
    • getWorkflow

      public Workflow getWorkflow(boolean isDraft, String workflowName)
      Description copied from interface: Workflows
      Get the workflow specified by the supplied name in the state specified by isDraft. If workflow exists and isDraft is true, draft workflow will be created when draft does not already exist.
      Specified by:
      getWorkflow in interface Workflows
      Parameters:
      isDraft - whether the draft workflow should be returned. If true, a draft will be created if it does not already exist
      workflowName - the name of the workflow
      Returns:
      A workflow object or null if the workflow could not be found.
    • getDraftWorkflow

      public Workflow getDraftWorkflow(String workflowName)
      Description copied from interface: Workflows
      Retrieves a draft workflow with the given name.
      Specified by:
      getDraftWorkflow in interface Workflows
      Parameters:
      workflowName - The workflow's name.
      Returns:
      the draft workflow iff a draft workflow with name workflowName exists. Returns null if no draft workflow with this name found.
    • getWorkflow

      public Workflow getWorkflow(JiraWorkflow jiraWorkflow)
      Description copied from interface: Workflows
      Returns Workflow from mutable JiraWorkflow
      Specified by:
      getWorkflow in interface Workflows
      Returns:
      Workflow for passed mutableWorkflow or null if passed mutableWorkflow is null
    • workflowExists

      public boolean workflowExists(boolean isDraft, String workflowName)
      Description copied from interface: Workflows
      Determine if a workflow with the given name exists. If workflow exists and isDraft is true, draft workflow will be created when it does not already exist.
      Specified by:
      workflowExists in interface Workflows
      Parameters:
      isDraft - Whether the workflow is a draft. If true, a draft will be created if it does not already exist
      workflowName - The workflow's name.
      Returns:
      true iff a workflow named workflowName exists.
    • workflowIsEditable

      public boolean workflowIsEditable(boolean isDraft, String workflowName)
      Description copied from interface: Workflows
      Determine if a workflow with the given name is editable. Non-existing workflow is considered non-editable.
      Specified by:
      workflowIsEditable in interface Workflows
      Parameters:
      isDraft - Whether the workflow is a draft.
      workflowName - The workflow's name.
      Returns:
      true iff a workflow named workflowName is editable.
    • publishDraft

      public ServiceOutcome<Workflow> publishDraft(String parentWorkflowName)
      Description copied from interface: Workflows
      Publish a draft workflow.
      Specified by:
      publishDraft in interface Workflows
      Parameters:
      parentWorkflowName - The parent workflow name that will be overwritten with its draft workflow.
      Returns:
      ServiceOutcome The workflow that was published or an error message.
    • getClone

      public Workflow getClone(String workflowName)
      Description copied from interface: Workflows
      Get a clone of workflow. This does nothing to any existing drafts.
      Specified by:
      getClone in interface Workflows
      Returns: