Package com.atlassian.jira.bc.workflow
Interface WorkflowSchemeService
- All Known Implementing Classes:
DefaultWorkflowSchemeService
@ExperimentalApi
public interface WorkflowSchemeService
-
Method Summary
Modifier and TypeMethodDescriptionReturn a builder that can be used to create aAssignableWorkflowScheme.createDraft(ApplicationUser creator, long parentId) Create a draft for the passed workflow scheme.createDraft(ApplicationUser creator, DraftWorkflowScheme draftWorkflowScheme) Create a draft workflow scheme.createScheme(ApplicationUser creator, AssignableWorkflowScheme scheme) Create a new workflow scheme.deleteWorkflowScheme(ApplicationUser user, WorkflowScheme scheme) Delete the passed workflow scheme.draftBuilder(AssignableWorkflowScheme parent) Return a builder that can be used to create aDraftWorkflowSchemefor the passed workflow scheme.getDraftWorkflowScheme(ApplicationUser user, AssignableWorkflowScheme parentScheme) Return draft of the passed workflow scheme if it actually exists.getDraftWorkflowSchemeNotNull(ApplicationUser user, AssignableWorkflowScheme parentScheme) Return draft of the passed workflow scheme if it actually exists.getSchemeForProject(ApplicationUser user, Project project) Return the workflow scheme associated with passed project.intgetUsageCount(AssignableWorkflowScheme assignableWorkflowScheme) Return the number of projects that use the passed scheme.getWorkflowScheme(ApplicationUser user, long id) Return the workflow scheme for the passed id.booleanisActive(WorkflowScheme workflowScheme) Is the passed workflow scheme being used by a project in JIRA.booleanisUsingDefaultScheme(Project project) Tells the caller if the passed project is using the default workflow scheme.updateWorkflowScheme(ApplicationUser user, AssignableWorkflowScheme scheme) Save changes to the passed workflow scheme.updateWorkflowScheme(ApplicationUser user, DraftWorkflowScheme scheme) Save changes to the passed workflow scheme.Validate that the passed scheme can be saved.
-
Method Details
-
assignableBuilder
AssignableWorkflowScheme.Builder assignableBuilder()Return a builder that can be used to create aAssignableWorkflowScheme. The actual scheme will not be created in JIRA until thecreateScheme(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.workflow.AssignableWorkflowScheme)method is called.- Returns:
- a builder that can be used to create a new
AssignableWorkflowScheme.
-
draftBuilder
Return a builder that can be used to create aDraftWorkflowSchemefor the passed workflow scheme. The actual scheme will not be created in JIRA until thecreateDraft(com.atlassian.jira.user.ApplicationUser, DraftWorkflowScheme)method is called.- Returns:
- a builder that can be used to create a new
DraftWorkflowScheme.
-
createScheme
@Nonnull ServiceOutcome<AssignableWorkflowScheme> createScheme(ApplicationUser creator, @Nonnull AssignableWorkflowScheme scheme) Create a new workflow scheme.- Parameters:
creator- the user creating the scheme.scheme- the scheme to create.- Returns:
- the result of the operation.
-
createDraft
Create a draft for the passed workflow scheme.To create a draft scheme the parent must be:
- Active: Used by a project.
- Draftless: The parent must not already has a draft workflow scheme.
- Not a draft
- Parameters:
creator- the user creating the draft.parentId- the workflow scheme to create a draft for.- Returns:
- result containing the new draft scheme or any errors that occur.
-
createDraft
ServiceOutcome<DraftWorkflowScheme> createDraft(ApplicationUser creator, DraftWorkflowScheme draftWorkflowScheme) Create a draft workflow scheme. The draft can be created using the builder returned from thedraftBuilder(com.atlassian.jira.workflow.AssignableWorkflowScheme)method.To create a draft scheme the parent must be:
- Active: Used by a project.
- Draftless: The parent must not already has a draft workflow scheme.
- Not a draft
- Parameters:
creator- the user creating the draft.draftWorkflowScheme- the draft to create.- Returns:
- result containing the new draft scheme or any errors that occur.
-
getWorkflowScheme
Return the workflow scheme for the passed id.- Parameters:
user- the user searching for the scheme.id- the id of the workflow scheme to find.- Returns:
- the result of the lookup.
-
getDraftWorkflowScheme
ServiceOutcome<DraftWorkflowScheme> getDraftWorkflowScheme(ApplicationUser user, @Nonnull AssignableWorkflowScheme parentScheme) Return draft of the passed workflow scheme if it actually exists. A succesful outcome with null result will be returned if the draft does not exist.- Parameters:
user- the user making the request.parentScheme- the workflow scheme whose draft we are searching for.- Returns:
- the result. A succesful outcome with null result will be returned if the draft does not exist.
-
getDraftWorkflowSchemeNotNull
ServiceOutcome<DraftWorkflowScheme> getDraftWorkflowSchemeNotNull(ApplicationUser user, @Nonnull AssignableWorkflowScheme parentScheme) Return draft of the passed workflow scheme if it actually exists. An unsuccessful outcome will be returned if the draft does not exist.- Parameters:
user- the user making the request.parentScheme- the workflow scheme whose draft we are searching for.- Returns:
- the result. An unsuccessful outcome will be returned if the draft does not exist.
-
deleteWorkflowScheme
Delete the passed workflow scheme. A workflow scheme can only be deleted if its a draft or its not active.- Parameters:
user- the user deleting the scheme.scheme- the scheme.- Returns:
- the result of the operation.
-
isActive
Is the passed workflow scheme being used by a project in JIRA.- Parameters:
workflowScheme- the workflow scheme to test.- Returns:
- true if the workflow scheme is being used false otherwise.
-
getSchemeForProject
ServiceOutcome<AssignableWorkflowScheme> getSchemeForProject(ApplicationUser user, @Nonnull Project project) Return the workflow scheme associated with passed project.- Parameters:
project- the project.- Returns:
- the result of the operation.
-
updateWorkflowScheme
ServiceOutcome<AssignableWorkflowScheme> updateWorkflowScheme(ApplicationUser user, @Nonnull AssignableWorkflowScheme scheme) Save changes to the passed workflow scheme.- Parameters:
user- the user making the changes.scheme- the scheme to change.- Returns:
- the scheme as now stored in the database.
-
validateUpdateWorkflowScheme
ServiceOutcome<Void> validateUpdateWorkflowScheme(ApplicationUser user, @Nonnull AssignableWorkflowScheme scheme) Validate that the passed scheme can be saved.- Parameters:
user- the user making the changes.scheme- the scheme to change.- Returns:
- the scheme as now stored in the database.
-
updateWorkflowScheme
ServiceOutcome<DraftWorkflowScheme> updateWorkflowScheme(ApplicationUser user, @Nonnull DraftWorkflowScheme scheme) Save changes to the passed workflow scheme.- Parameters:
user- the user making the changes.scheme- the scheme to change.- Returns:
- the scheme as now stored in the database.
-
getUsageCount
Return the number of projects that use the passed scheme.- Parameters:
assignableWorkflowScheme- the scheme to check.- Returns:
- the number of projects that use this scheme.
-
isUsingDefaultScheme
Tells the caller if the passed project is using the default workflow scheme.- Parameters:
project- the project to check.- Returns:
- true if the passed project is using the default scheme, false otherwise.
-