Package com.atlassian.jira.workflow.edit
Interface Workflows
- All Known Implementing Classes:
WorkflowsImpl
@Internal
public interface Workflows
-
Method Summary
Modifier and TypeMethodDescriptiondiscardDraft(String workflowName) Discard the draft for the specified workflow.Get a clone of workflow.getDraftWorkflow(String workflowName) Retrieves a draft workflow with the given name.getMutableWorkflow(String workflowName) Get a workflow that can be changed.getMutableWorkflowWithoutValidation(String workflowName) Gets a mutable workflow with no validation applied to it.getWorkflow(boolean isDraft, String workflowName) Get the workflow specified by the supplied name in the state specified by isDraft.getWorkflow(JiraWorkflow mutableWorkflow) ReturnsWorkflowfrom mutableJiraWorkflowpublishDraft(String parentWorkflowName) Publish a draft workflow.saveWorkflow(Workflow workflow) Save changes that have been made to a workflow and return aServiceOutcome.booleanworkflowExists(boolean isDraft, String workflowName) Determine if a workflow with the given name exists.booleanworkflowIsEditable(boolean isDraft, String workflowName) Determine if a workflow with the given name is editable.
-
Method Details
-
getMutableWorkflow
Get a workflow that can be changed.- Parameters:
workflowName- The workflow's name.- Returns:
- A mutable version of the requested workflow or an error message.
-
getMutableWorkflowWithoutValidation
Gets a mutable workflow with no validation applied to it. This will either return the workflow or null if not found.- Parameters:
workflowName-- Returns:
- Workflow
-
saveWorkflow
Save changes that have been made to a workflow and return aServiceOutcome.- Parameters:
workflow- The workflow to save.- Returns:
- A
ServiceOutcomecontaining value or an error message.
-
discardDraft
Discard the draft for the specified workflow. If no draft existed for the specified workflow, it will treat the operation as successful.- Parameters:
workflowName- The name of the workflow of which the draft should be deleted.- Returns:
- A
ServiceOutcomecontaining null or an error message in case of failure.
-
getWorkflow
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.- Parameters:
isDraft- whether the draft workflow should be returned. If true, a draft will be created if it does not already existworkflowName- the name of the workflow- Returns:
- A workflow object or null if the workflow could not be found.
-
getDraftWorkflow
Retrieves a draft workflow with the given name.- 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.
-
workflowExists
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.- Parameters:
isDraft- Whether the workflow is a draft. If true, a draft will be created if it does not already existworkflowName- The workflow's name.- Returns:
- true iff a workflow named workflowName exists.
-
workflowIsEditable
Determine if a workflow with the given name is editable. Non-existing workflow is considered non-editable.- Parameters:
isDraft- Whether the workflow is a draft.workflowName- The workflow's name.- Returns:
- true iff a workflow named workflowName is editable.
-
publishDraft
Publish a draft workflow.- Parameters:
parentWorkflowName- The parent workflow name that will be overwritten with its draft workflow.- Returns:
ServiceOutcomeThe workflow that was published or an error message.
-
getClone
Get a clone of workflow. This does nothing to any existing drafts.- Parameters:
workflowName-- Returns:
-
getWorkflow
ReturnsWorkflowfrom mutableJiraWorkflow- Parameters:
mutableWorkflow-- Returns:
Workflowfor passedmutableWorkflowor null if passedmutableWorkflowis null
-