Package com.atlassian.jira.workflow.edit
Class WorkflowsImpl
java.lang.Object
com.atlassian.jira.workflow.edit.WorkflowsImpl
- All Implemented Interfaces:
Workflows
Service style operations that can be applied to workflow objects.
-
Constructor Summary
ConstructorsConstructorDescriptionWorkflowsImpl(JiraAuthenticationContext jiraAuthenticationContext, WorkflowFunctionUtilities workflowFunctionUtilities, WorkflowManager workflowManager, WorkflowService workflowService, TransitionOptions transitionOptions, ScreenNameResolver screenNameResolver, OutcomeHelper outcomeHelper) -
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 jiraWorkflow) 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.
-
Constructor Details
-
WorkflowsImpl
public WorkflowsImpl(JiraAuthenticationContext jiraAuthenticationContext, WorkflowFunctionUtilities workflowFunctionUtilities, WorkflowManager workflowManager, WorkflowService workflowService, TransitionOptions transitionOptions, ScreenNameResolver screenNameResolver, OutcomeHelper outcomeHelper)
-
-
Method Details
-
getMutableWorkflow
Description copied from interface:WorkflowsGet a workflow that can be changed.- Specified by:
getMutableWorkflowin interfaceWorkflows- Parameters:
workflowName- The workflow's name.- Returns:
- A mutable version of the requested workflow or an error message.
-
getMutableWorkflowWithoutValidation
Description copied from interface:WorkflowsGets a mutable workflow with no validation applied to it. This will either return the workflow or null if not found.- Specified by:
getMutableWorkflowWithoutValidationin interfaceWorkflows- Returns:
- Workflow
-
saveWorkflow
Description copied from interface:WorkflowsSave changes that have been made to a workflow and return aServiceOutcome.- Specified by:
saveWorkflowin interfaceWorkflows- Parameters:
workflow- The workflow to save.- Returns:
- A
ServiceOutcomecontaining value or an error message.
-
discardDraft
Description copied from interface:WorkflowsDiscard the draft for the specified workflow. If no draft existed for the specified workflow, it will treat the operation as successful.- Specified by:
discardDraftin interfaceWorkflows- 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
Description copied from interface:WorkflowsGet 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:
getWorkflowin interfaceWorkflows- 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
Description copied from interface:WorkflowsRetrieves a draft workflow with the given name.- Specified by:
getDraftWorkflowin interfaceWorkflows- 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
Description copied from interface:WorkflowsReturnsWorkflowfrom mutableJiraWorkflow- Specified by:
getWorkflowin interfaceWorkflows- Returns:
Workflowfor passedmutableWorkflowor null if passedmutableWorkflowis null
-
workflowExists
Description copied from interface:WorkflowsDetermine 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:
workflowExistsin interfaceWorkflows- 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
Description copied from interface:WorkflowsDetermine if a workflow with the given name is editable. Non-existing workflow is considered non-editable.- Specified by:
workflowIsEditablein interfaceWorkflows- Parameters:
isDraft- Whether the workflow is a draft.workflowName- The workflow's name.- Returns:
- true iff a workflow named workflowName is editable.
-
publishDraft
Description copied from interface:WorkflowsPublish a draft workflow.- Specified by:
publishDraftin interfaceWorkflows- 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
Description copied from interface:WorkflowsGet a clone of workflow. This does nothing to any existing drafts.
-