@ExperimentalApi public interface

WorkflowSchemeService

com.atlassian.jira.bc.workflow.WorkflowSchemeService
Known Indirect Subclasses

@ExperimentalApi

This interface is considered usable by external developers but its contracts have not stabilized.

Experimental APIs may be changed at any time before being marked @Internal or @PublicApi.

Summary

Public Methods
AssignableWorkflowScheme.Builder assignableBuilder()
Return a builder that can be used to create a AssignableWorkflowScheme.
ServiceOutcome<DraftWorkflowScheme> createDraft(ApplicationUser creator, DraftWorkflowScheme draftWorkflowScheme)
Create a draft workflow scheme.
ServiceOutcome<DraftWorkflowScheme> createDraft(ApplicationUser creator, long parentId)
Create a draft for the passed workflow scheme.
@Nonnull ServiceOutcome<AssignableWorkflowScheme> createScheme(ApplicationUser creator, AssignableWorkflowScheme scheme)
Create a new workflow scheme.
ServiceOutcome<Void> deleteWorkflowScheme(ApplicationUser user, WorkflowScheme scheme)
Delete the passed workflow scheme.
DraftWorkflowScheme.Builder draftBuilder(AssignableWorkflowScheme parent)
Return a builder that can be used to create a DraftWorkflowScheme for the passed workflow scheme.
ServiceOutcome<DraftWorkflowScheme> getDraftWorkflowScheme(ApplicationUser user, AssignableWorkflowScheme parentScheme)
Return draft of the passed workflow scheme if it actually exists.
ServiceOutcome<DraftWorkflowScheme> getDraftWorkflowSchemeNotNull(ApplicationUser user, AssignableWorkflowScheme parentScheme)
Return draft of the passed workflow scheme if it actually exists.
ServiceOutcome<AssignableWorkflowScheme> getSchemeForProject(ApplicationUser user, Project project)
Return the workflow scheme associated with passed project.
int getUsageCount(AssignableWorkflowScheme assignableWorkflowScheme)
Return the number of projects that use the passed scheme.
ServiceOutcome<AssignableWorkflowScheme> getWorkflowScheme(ApplicationUser user, long id)
Return the workflow scheme for the passed id.
boolean isActive(WorkflowScheme workflowScheme)
Is the passed workflow scheme being used by a project in JIRA.
boolean isUsingDefaultScheme(Project project)
Tells the caller if the passed project is using the default workflow scheme.
ServiceOutcome<DraftWorkflowScheme> updateWorkflowScheme(ApplicationUser user, DraftWorkflowScheme scheme)
Save changes to the passed workflow scheme.
ServiceOutcome<AssignableWorkflowScheme> updateWorkflowScheme(ApplicationUser user, AssignableWorkflowScheme scheme)
Save changes to the passed workflow scheme.
ServiceOutcome<Void> validateUpdateWorkflowScheme(ApplicationUser user, AssignableWorkflowScheme scheme)
Validate that the passed scheme can be saved.

Public Methods

public AssignableWorkflowScheme.Builder assignableBuilder ()

Return a builder that can be used to create a AssignableWorkflowScheme. The actual scheme will not be created in JIRA until the createScheme(com.atlassian.jira.user.ApplicationUser, com.atlassian.jira.workflow.AssignableWorkflowScheme) method is called.

Returns

public ServiceOutcome<DraftWorkflowScheme> createDraft (ApplicationUser creator, DraftWorkflowScheme draftWorkflowScheme)

Create a draft workflow scheme. The draft can be created using the builder returned from the draftBuilder(com.atlassian.jira.workflow.AssignableWorkflowScheme) method.

To create a draft scheme the parent must be:

  1. Active: Used by a project.
  2. Draftless: The parent must not already has a draft workflow scheme.
  3. 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.

public ServiceOutcome<DraftWorkflowScheme> createDraft (ApplicationUser creator, long parentId)

Create a draft for the passed workflow scheme.

To create a draft scheme the parent must be:

  1. Active: Used by a project.
  2. Draftless: The parent must not already has a draft workflow scheme.
  3. 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.

@Nonnull public ServiceOutcome<AssignableWorkflowScheme> createScheme (ApplicationUser creator, 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.

public ServiceOutcome<Void> deleteWorkflowScheme (ApplicationUser user, WorkflowScheme scheme)

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.

public DraftWorkflowScheme.Builder draftBuilder (AssignableWorkflowScheme parent)

Return a builder that can be used to create a DraftWorkflowScheme for the passed workflow scheme. The actual scheme will not be created in JIRA until the createDraft(com.atlassian.jira.user.ApplicationUser, DraftWorkflowScheme) method is called.

Returns

public ServiceOutcome<DraftWorkflowScheme> getDraftWorkflowScheme (ApplicationUser user, 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.

public ServiceOutcome<DraftWorkflowScheme> getDraftWorkflowSchemeNotNull (ApplicationUser user, 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.

public ServiceOutcome<AssignableWorkflowScheme> getSchemeForProject (ApplicationUser user, Project project)

Return the workflow scheme associated with passed project.

Parameters
project the project.
Returns
  • the result of the operation.

public int getUsageCount (AssignableWorkflowScheme assignableWorkflowScheme)

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.

public ServiceOutcome<AssignableWorkflowScheme> getWorkflowScheme (ApplicationUser user, long id)

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.

public boolean isActive (WorkflowScheme workflowScheme)

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.

public boolean isUsingDefaultScheme (Project project)

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.

public ServiceOutcome<DraftWorkflowScheme> updateWorkflowScheme (ApplicationUser user, 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.

public ServiceOutcome<AssignableWorkflowScheme> updateWorkflowScheme (ApplicationUser user, 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.

public ServiceOutcome<Void> validateUpdateWorkflowScheme (ApplicationUser user, 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.