Class WorkflowServiceImpl
java.lang.Object
com.atlassian.greenhopper.service.workflow.WorkflowServiceImpl
- All Implemented Interfaces:
WorkflowService
Provides workflow related service methods
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.greenhopper.service.workflow.WorkflowService
WorkflowService.WorkTransitions -
Field Summary
Fields inherited from interface com.atlassian.greenhopper.service.workflow.WorkflowService
DEFAULT_MAX_NUMBER_OF_PROJECTS, MAX_NUMBER_OF_PROJECTS, SERVICE -
Constructor Summary
ConstructorsConstructorDescriptionWorkflowServiceImpl(com.atlassian.jira.config.ConstantsManager constantsManager, com.atlassian.jira.bc.issue.search.SearchService jiraSearchService, com.atlassian.jira.project.ProjectManager projectManager, com.atlassian.jira.workflow.WorkflowSchemeManager workflowSchemeManager, com.atlassian.jira.workflow.WorkflowManager workflowManager, com.atlassian.jira.bc.workflow.WorkflowService jiraWorkflowService, com.atlassian.jira.transition.TransitionManager transitionManager, com.atlassian.jira.security.PermissionManager permissionManager, com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.jira.config.properties.ApplicationProperties applicationProperties) -
Method Summary
Modifier and TypeMethodDescriptionassociateSchemeToProject(com.atlassian.jira.project.Project project, com.atlassian.jira.scheme.Scheme scheme) Associates scheme to projectassociateWorkflowToSchemeAsDefault(String workflowName, com.atlassian.jira.scheme.Scheme scheme) Associates a workflow to the given scheme, makes it the default workflow for that schemeServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> copyWorkflow(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.workflow.JiraWorkflow workflow, String newName, String newDescription) Creates a new copy of the existing workflow, with the specified name and description.deleteScheme(String name) Delete a workflow scheme with the specified namedeleteWorkflow(String name) Delete a workflow with the specified name.Does a workflow scheme with the specified name exist?Set<com.atlassian.jira.issue.status.Status> getAccessibleStatuses(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query) Get the list of accessible statuses for issues potentially returned by the current query.Set<com.atlassian.jira.issue.status.Status> Get all available status objects of all active workflows.Set<com.atlassian.jira.issue.status.Status> Get all available status objects.Collection<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(com.atlassian.jira.project.Project projectObj) Given a project, returns all JIRA workflows which are associated to that project Empty on errorCollection<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(com.atlassian.jira.project.Project projectObj, String issueTypeId) Given a project and an issue type id, returns the JIRA Workflow which is associated to that project for that issue type Empty on errorSet<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(Set<com.atlassian.jira.issue.Issue> issues) Given a set of issues, returns the JIRA Workflows which are associated to those issuescom.atlassian.jira.issue.status.StatusgetStatusByName(String statusName) Get a status given its namegetTransitions(com.atlassian.jira.user.ApplicationUser user, List<Long> projectIds) Get the transitions data for the given projects This will have the workflows for each project and issue type pair.ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> getWorkflow(com.atlassian.jira.user.ApplicationUser user, String workflowName) Retrieve the workflow with the specified nameOptional<com.atlassian.jira.scheme.Scheme> getWorkflowSchemeForProject(com.atlassian.jira.project.Project project) Returns the scheme currently associated to the specifiedProject.ServiceOutcome<Collection<com.atlassian.jira.workflow.JiraWorkflow>> getWorkflowsForProject(com.atlassian.jira.project.Project project) Retrieve the workflows that are in use for the specifiedProject.com.atlassian.jira.issue.status.StatusgetWorkflowStatusObject(String statusId) Get the status object for a given idisStatusInitialStatus(com.atlassian.jira.workflow.JiraWorkflow workflow, com.atlassian.jira.issue.status.Status status) Is this status the initial status for this workflow?isWorkflowSchemeActive(String name) Is the workflow scheme with the specified name active?
-
Constructor Details
-
WorkflowServiceImpl
public WorkflowServiceImpl(com.atlassian.jira.config.ConstantsManager constantsManager, com.atlassian.jira.bc.issue.search.SearchService jiraSearchService, com.atlassian.jira.project.ProjectManager projectManager, com.atlassian.jira.workflow.WorkflowSchemeManager workflowSchemeManager, com.atlassian.jira.workflow.WorkflowManager workflowManager, com.atlassian.jira.bc.workflow.WorkflowService jiraWorkflowService, com.atlassian.jira.transition.TransitionManager transitionManager, com.atlassian.jira.security.PermissionManager permissionManager, com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.jira.config.properties.ApplicationProperties applicationProperties)
-
-
Method Details
-
getWorkflowStatusObject
Description copied from interface:WorkflowServiceGet the status object for a given id- Specified by:
getWorkflowStatusObjectin interfaceWorkflowService- Parameters:
statusId- the id to look up- Returns:
- a status object or null if the id is invalid
-
getStatusByName
Description copied from interface:WorkflowServiceGet a status given its name- Specified by:
getStatusByNamein interfaceWorkflowService
-
getAllWorkflowStatusObjects
Get all available status objects. Statuses are global in JIRA, the actual workflows define to what steps each status is attached to.- Specified by:
getAllWorkflowStatusObjectsin interfaceWorkflowService
-
getAllActiveWorkflowStatusObjects
Get all available status objects of all active workflows. Statuses are global in JIRA, the actual workflows define to what steps each status is attached to.- Specified by:
getAllActiveWorkflowStatusObjectsin interfaceWorkflowService
-
getAccessibleStatuses
@Nonnull public Set<com.atlassian.jira.issue.status.Status> getAccessibleStatuses(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query) Description copied from interface:WorkflowServiceGet the list of accessible statuses for issues potentially returned by the current query. In effect we are asking, "What projects and issue types could be returned by this query for this user, and what statuses are linked to workflows assigned to those projects and issue types?".- Specified by:
getAccessibleStatusesin interfaceWorkflowService- Parameters:
user- the user who would be performing the searchquery- the query being asked about- Returns:
- the list of statuses
-
isStatusInitialStatus
@Nonnull public ServiceOutcome<Boolean> isStatusInitialStatus(@Nonnull com.atlassian.jira.workflow.JiraWorkflow workflow, @Nonnull com.atlassian.jira.issue.status.Status status) Description copied from interface:WorkflowServiceIs this status the initial status for this workflow?- Specified by:
isStatusInitialStatusin interfaceWorkflowService- Parameters:
workflow- the workflowstatus- the status- Returns:
- the result
-
getWorkflowSchemeForProject
@Nonnull public Optional<com.atlassian.jira.scheme.Scheme> getWorkflowSchemeForProject(com.atlassian.jira.project.Project project) Description copied from interface:WorkflowServiceReturns the scheme currently associated to the specifiedProject.nullwill be the result if there is no scheme associated (i.e. the Default Scheme is in use).- Specified by:
getWorkflowSchemeForProjectin interfaceWorkflowService- Parameters:
project- the project- Returns:
- the result
-
getWorkflowsForProject
@Nonnull public ServiceOutcome<Collection<com.atlassian.jira.workflow.JiraWorkflow>> getWorkflowsForProject(com.atlassian.jira.project.Project project) Description copied from interface:WorkflowServiceRetrieve the workflows that are in use for the specifiedProject.- Specified by:
getWorkflowsForProjectin interfaceWorkflowService- Parameters:
project- the project- Returns:
- the result
-
copyWorkflow
@Nonnull public ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> copyWorkflow(com.atlassian.jira.user.ApplicationUser user, @Nonnull com.atlassian.jira.workflow.JiraWorkflow workflow, @Nonnull String newName, @Nonnull String newDescription) Description copied from interface:WorkflowServiceCreates a new copy of the existing workflow, with the specified name and description.- Specified by:
copyWorkflowin interfaceWorkflowService- Parameters:
user- the userworkflow- the original workflownewName- the new namenewDescription- the new description- Returns:
- the new workflow
-
getWorkflow
@Nonnull public ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> getWorkflow(com.atlassian.jira.user.ApplicationUser user, @Nonnull String workflowName) Description copied from interface:WorkflowServiceRetrieve the workflow with the specified name- Specified by:
getWorkflowin interfaceWorkflowService- Parameters:
user- the userworkflowName- the workflow name- Returns:
- the result
-
doesWorkflowSchemeExist
Description copied from interface:WorkflowServiceDoes a workflow scheme with the specified name exist?- Specified by:
doesWorkflowSchemeExistin interfaceWorkflowService- Parameters:
name- the name- Returns:
- the result
-
isWorkflowSchemeActive
Description copied from interface:WorkflowServiceIs the workflow scheme with the specified name active?- Specified by:
isWorkflowSchemeActivein interfaceWorkflowService- Parameters:
name- the name- Returns:
- the result
-
deleteScheme
Description copied from interface:WorkflowServiceDelete a workflow scheme with the specified name- Specified by:
deleteSchemein interfaceWorkflowService- Parameters:
name- workflow scheme name- Returns:
- the result
-
deleteWorkflow
Description copied from interface:WorkflowServiceDelete a workflow with the specified name.- Specified by:
deleteWorkflowin interfaceWorkflowService- Parameters:
name- workflow name- Returns:
- the result
-
getJiraWorkflows
@Nonnull public Collection<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(com.atlassian.jira.project.Project projectObj) Description copied from interface:WorkflowServiceGiven a project, returns all JIRA workflows which are associated to that project Empty on error- Specified by:
getJiraWorkflowsin interfaceWorkflowService
-
getJiraWorkflows
@Nonnull public Collection<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(com.atlassian.jira.project.Project projectObj, String issueTypeId) Description copied from interface:WorkflowServiceGiven a project and an issue type id, returns the JIRA Workflow which is associated to that project for that issue type Empty on error- Specified by:
getJiraWorkflowsin interfaceWorkflowService
-
getJiraWorkflows
@Nonnull public Set<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(@Nonnull Set<com.atlassian.jira.issue.Issue> issues) Description copied from interface:WorkflowServiceGiven a set of issues, returns the JIRA Workflows which are associated to those issues- Specified by:
getJiraWorkflowsin interfaceWorkflowService- Parameters:
issues- Set of issues to get workflows from- Returns:
- A set of all the
JiraWorkflowobjects associated to the providedissues, or an empty set if no workflows could be found.
-
associateWorkflowToSchemeAsDefault
@Nonnull public ServiceResult associateWorkflowToSchemeAsDefault(String workflowName, com.atlassian.jira.scheme.Scheme scheme) Description copied from interface:WorkflowServiceAssociates a workflow to the given scheme, makes it the default workflow for that scheme- Specified by:
associateWorkflowToSchemeAsDefaultin interfaceWorkflowService
-
associateSchemeToProject
@Nonnull public ServiceResult associateSchemeToProject(com.atlassian.jira.project.Project project, com.atlassian.jira.scheme.Scheme scheme) Description copied from interface:WorkflowServiceAssociates scheme to project- Specified by:
associateSchemeToProjectin interfaceWorkflowService
-
getTransitions
@Nonnull public ServiceOutcome<WorkflowService.WorkTransitions> getTransitions(com.atlassian.jira.user.ApplicationUser user, List<Long> projectIds) Description copied from interface:WorkflowServiceGet the transitions data for the given projects This will have the workflows for each project and issue type pair. A project will be omitted if the user does not have permission to view it or it is not present.- Specified by:
getTransitionsin interfaceWorkflowService
-