@PublicApi
public interface WorkflowService
WorkflowManager
.Modifier and Type | Method and Description |
---|---|
JiraWorkflow |
copyWorkflow(JiraServiceContext jiraServiceContext,
String clonedWorkflowName,
String clonedWorkflowDescription,
JiraWorkflow workflowToClone)
Clones and persists a new workflow with the name given.
|
JiraWorkflow |
createDraftWorkflow(JiraServiceContext jiraServiceContext,
String parentWorkflowName)
Creates a copy of an active workflow for editing.
|
boolean |
deleteDraftWorkflow(JiraServiceContext jiraServiceContext,
String parentWorkflowName)
Deletes draft workflows (there should only be one) that are associated with the given parent workflow name.
|
ServiceOutcome<Void> |
deleteWorkflow(ApplicationUser deletingUser,
String workflowName)
Deletes the workflow which has the passed name.
|
JiraWorkflow |
getDraftWorkflow(JiraServiceContext jiraServiceContext,
String parentWorkflowName)
Given a parentWorkflowName, this methods will retrieved the relevant draft workflow linked to that
parent.
|
JiraWorkflow |
getWorkflow(JiraServiceContext jiraServiceContext,
String name)
Returns the workflow with the given name.
|
boolean |
isStepOnDraftWithNoTransitionsOnParentWorkflow(JiraServiceContext jiraServiceContext,
JiraWorkflow workflow,
int stepId)
Given a draft workflow and a step Id, this method returns true, if the step does not have any transitions on
the original workflow.
|
void |
overwriteActiveWorkflow(JiraServiceContext jiraServiceContext,
String parentWorkflowName)
This method will overwrite the parentWorkflow with a draft Workflow if
it exists.
|
void |
updateWorkflow(JiraServiceContext jiraServiceContext,
JiraWorkflow workflow)
Updates the workflow descriptor provided in the persistance mechanism implemented.
|
void |
updateWorkflowNameAndDescription(JiraServiceContext jiraServiceContext,
JiraWorkflow currentWorkflow,
String newName,
String newDescription)
Used to change the name and description of an existing worfklow with the given name.
|
void |
validateAddWorkflowTransitionToDraft(JiraServiceContext jiraServiceContext,
JiraWorkflow newJiraworkflow,
int stepId)
Validates if a workflow transition can be added to a draft.
|
void |
validateCopyWorkflow(JiraServiceContext jiraServiceContext,
String newWorkflowName)
Validates if a workflow can be cloned and saved with the provided name.
|
void |
validateOverwriteWorkflow(JiraServiceContext jiraServiceContext,
String workflowName)
Validates that the draft workflow with the given name is allowed to be saved into the corresponding active
workflow.
|
void |
validateUpdateWorkflowNameAndDescription(JiraServiceContext jiraServiceContext,
JiraWorkflow currentWorkflow,
String newWorkflowName)
Validates that the workflow with currentName can have its name and description changed to newWorkflowName and
newDescription.
|
JiraWorkflow getDraftWorkflow(JiraServiceContext jiraServiceContext, String parentWorkflowName)
jiraServiceContext
- service context with user and error collectionparentWorkflowName
- The parent workflow name to create an draft copy of.JiraWorkflow createDraftWorkflow(JiraServiceContext jiraServiceContext, String parentWorkflowName)
jiraServiceContext
- service context with user and error collectionparentWorkflowName
- The parent workflow name to create an draft copy of.boolean deleteDraftWorkflow(JiraServiceContext jiraServiceContext, String parentWorkflowName)
jiraServiceContext
- service context with user and error collectionparentWorkflowName
- The parent workflow name that the draft workflow to be deleted is associated withServiceOutcome<Void> deleteWorkflow(ApplicationUser deletingUser, String workflowName)
deletingUser
- user who performs the deletionworkflowName
- name of the workflow to be deletedvoid overwriteActiveWorkflow(JiraServiceContext jiraServiceContext, String parentWorkflowName)
validateOverwriteWorkflow(com.atlassian.jira.bc.JiraServiceContext, String)
to ensure the active
workflow isn't being overwritten with an invalid draft workflow.jiraServiceContext
- service context with user and error collectionparentWorkflowName
- The parent workflow name that will be overwritten with its draft workflowvoid validateOverwriteWorkflow(JiraServiceContext jiraServiceContext, String workflowName)
jiraServiceContext
- JiraServiceContextworkflowName
- Name of the workflow to be validated.void updateWorkflow(JiraServiceContext jiraServiceContext, JiraWorkflow workflow)
overwriteActiveWorkflow(com.atlassian.jira.bc.JiraServiceContext, String)
}
jiraServiceContext
- service context with user and error collectionworkflow
- contains the descriptor that the workflow will be updated to.IllegalArgumentException
- if theworkflow or its descriptor is null. Also thrown if there is no draft
workflow associated with the provided parentWorkflowName.void validateUpdateWorkflowNameAndDescription(JiraServiceContext jiraServiceContext, JiraWorkflow currentWorkflow, String newWorkflowName)
jiraServiceContext
- service context with user and error collectioncurrentWorkflow
- The current workflow to be updated.newWorkflowName
- The new name to save with the workflowvoid updateWorkflowNameAndDescription(JiraServiceContext jiraServiceContext, JiraWorkflow currentWorkflow, String newName, String newDescription)
jiraServiceContext
- service context with user and error collectioncurrentWorkflow
- The current workflow to be updated.newName
- The new name to save with the workflownewDescription
- The new descriptio to save with the workflowJiraWorkflow getWorkflow(JiraServiceContext jiraServiceContext, String name)
jiraServiceContext
- service context with user and error collectionname
- the name of the workflowvoid validateCopyWorkflow(JiraServiceContext jiraServiceContext, String newWorkflowName)
jiraServiceContext
- service context with user and error collectionnewWorkflowName
- The name of the cloned workflow.JiraWorkflow copyWorkflow(JiraServiceContext jiraServiceContext, String clonedWorkflowName, String clonedWorkflowDescription, JiraWorkflow workflowToClone)
jiraServiceContext
- service context with user and error collectionclonedWorkflowName
- The name to store the cloned workflow with.clonedWorkflowDescription
- The description of the new copy. May be null.workflowToClone
- The workflow to clone.boolean isStepOnDraftWithNoTransitionsOnParentWorkflow(JiraServiceContext jiraServiceContext, JiraWorkflow workflow, int stepId)
jiraServiceContext
- service context with user and error collectionworkflow
- The draft workflow with the new stepstepId
- The stepId of the step to checkvoid validateAddWorkflowTransitionToDraft(JiraServiceContext jiraServiceContext, JiraWorkflow newJiraworkflow, int stepId)
jiraServiceContext
- service context with user and error collectionnewJiraworkflow
- The draft workflow to which the transition is being addedstepId
- The step to which the transition is being added.Copyright © 2002-2015 Atlassian. All Rights Reserved.