com.atlassian.greenhopper.service.workflow
Class WorkflowServiceImpl

java.lang.Object
  extended by com.atlassian.greenhopper.service.workflow.WorkflowServiceImpl
All Implemented Interfaces:
WorkflowService

@Service(value="gh-workflowService")
public class WorkflowServiceImpl
extends java.lang.Object
implements WorkflowService

Provides workflow related service methods


Field Summary
 
Fields inherited from interface com.atlassian.greenhopper.service.workflow.WorkflowService
SERVICE
 
Constructor Summary
WorkflowServiceImpl()
           
 
Method Summary
 ServiceOutcome<java.lang.Void> associateSchemeToProject(com.atlassian.jira.project.Project project, com.atlassian.jira.scheme.Scheme scheme)
          Associates scheme to project
 ServiceOutcome<java.lang.Void> associateWorkflowToSchemeAsDefault(java.lang.String workflowName, com.atlassian.jira.scheme.Scheme scheme)
          Associates a workflow to the given scheme, makes it the default workflow for that scheme
 ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> copyWorkflow(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.workflow.JiraWorkflow workflow, java.lang.String newName, java.lang.String newDescription)
          Creates a new copy of the existing workflow, with the specified name and description.
 ServiceOutcome<java.lang.Void> deleteScheme(java.lang.String name)
          Delete a workflow scheme with the specified name
 ServiceOutcome<java.lang.Void> deleteWorkflow(java.lang.String name)
          Delete a workflow with the specified name.
 ServiceOutcome<java.lang.Boolean> doesWorkflowSchemeExist(java.lang.String name)
          Does a workflow scheme with the specified name exist?
 java.util.Set<com.atlassian.jira.issue.status.Status> getAccessibleStatuses(com.atlassian.crowd.embedded.api.User user, com.atlassian.query.Query query)
          Get the list of accessible statuses for issues potentially returned by the current query.
 java.util.Set<com.atlassian.jira.issue.status.Status> getAllWorkflowStatusObjects()
          Get all available status objects.
 java.util.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 error
 java.util.Collection<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(com.atlassian.jira.project.Project projectObj, java.lang.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 error
 com.atlassian.jira.issue.status.Status getStatusByName(java.lang.String statusName)
          Get a status given its name
 ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> getWorkflow(com.atlassian.crowd.embedded.api.User user, java.lang.String workflowName)
          Retrieve the workflow with the specified name
 ServiceOutcome<com.atlassian.jira.scheme.Scheme> getWorkflowSchemeForProject(com.atlassian.jira.project.Project project)
          Returns the scheme currently associated to the specified Project.
 ServiceOutcome<java.util.Collection<com.atlassian.jira.workflow.JiraWorkflow>> getWorkflowsForProject(com.atlassian.jira.project.Project project)
          Retrieve the workflows that are in use for the specified Project.
 com.atlassian.jira.issue.status.Status getWorkflowStatusObject(java.lang.String statusId)
          Get the status object for a given id
 ServiceOutcome<java.lang.Boolean> isStatusInitialStatus(com.atlassian.jira.workflow.JiraWorkflow workflow, com.atlassian.jira.issue.status.Status status)
          Is this status the initial status for this workflow?
 ServiceOutcome<java.lang.Boolean> isWorkflowSchemeActive(java.lang.String name)
          Is the workflow scheme with the specified name active?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowServiceImpl

public WorkflowServiceImpl()
Method Detail

getWorkflowStatusObject

public com.atlassian.jira.issue.status.Status getWorkflowStatusObject(java.lang.String statusId)
Description copied from interface: WorkflowService
Get the status object for a given id

Specified by:
getWorkflowStatusObject in interface WorkflowService
Parameters:
statusId - the id to look up
Returns:
a status object or null if the id is invalid

getStatusByName

public com.atlassian.jira.issue.status.Status getStatusByName(java.lang.String statusName)
Description copied from interface: WorkflowService
Get a status given its name

Specified by:
getStatusByName in interface WorkflowService

getAllWorkflowStatusObjects

public java.util.Set<com.atlassian.jira.issue.status.Status> 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:
getAllWorkflowStatusObjects in interface WorkflowService

getAccessibleStatuses

@NotNull
public java.util.Set<com.atlassian.jira.issue.status.Status> getAccessibleStatuses(com.atlassian.crowd.embedded.api.User user,
                                                                                           com.atlassian.query.Query query)
Description copied from interface: WorkflowService
Get 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:
getAccessibleStatuses in interface WorkflowService
Parameters:
user - the user who would be performing the search
query - the query being asked about
Returns:
the list of statuses

isStatusInitialStatus

public ServiceOutcome<java.lang.Boolean> isStatusInitialStatus(@NotNull
                                                               com.atlassian.jira.workflow.JiraWorkflow workflow,
                                                               @NotNull
                                                               com.atlassian.jira.issue.status.Status status)
Description copied from interface: WorkflowService
Is this status the initial status for this workflow?

Specified by:
isStatusInitialStatus in interface WorkflowService
Parameters:
workflow - the workflow
status - the status
Returns:
the result

getWorkflowSchemeForProject

public ServiceOutcome<com.atlassian.jira.scheme.Scheme> getWorkflowSchemeForProject(com.atlassian.jira.project.Project project)
Description copied from interface: WorkflowService
Returns the scheme currently associated to the specified Project. null will be the result if there is no scheme associated (i.e. the Default Scheme is in use).

Specified by:
getWorkflowSchemeForProject in interface WorkflowService
Parameters:
project - the project
Returns:
the result

getWorkflowsForProject

public ServiceOutcome<java.util.Collection<com.atlassian.jira.workflow.JiraWorkflow>> getWorkflowsForProject(com.atlassian.jira.project.Project project)
Description copied from interface: WorkflowService
Retrieve the workflows that are in use for the specified Project.

Specified by:
getWorkflowsForProject in interface WorkflowService
Parameters:
project - the project
Returns:
the result

copyWorkflow

public ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> copyWorkflow(com.atlassian.crowd.embedded.api.User user,
                                                                             com.atlassian.jira.workflow.JiraWorkflow workflow,
                                                                             java.lang.String newName,
                                                                             java.lang.String newDescription)
Description copied from interface: WorkflowService
Creates a new copy of the existing workflow, with the specified name and description.

Specified by:
copyWorkflow in interface WorkflowService
Parameters:
user - the user
workflow - the original workflow
newName - the new name
newDescription - the new description
Returns:
the new workflow

getWorkflow

public ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> getWorkflow(com.atlassian.crowd.embedded.api.User user,
                                                                            java.lang.String workflowName)
Description copied from interface: WorkflowService
Retrieve the workflow with the specified name

Specified by:
getWorkflow in interface WorkflowService
Parameters:
user - the user
workflowName - the workflow name
Returns:
the result

doesWorkflowSchemeExist

public ServiceOutcome<java.lang.Boolean> doesWorkflowSchemeExist(java.lang.String name)
Description copied from interface: WorkflowService
Does a workflow scheme with the specified name exist?

Specified by:
doesWorkflowSchemeExist in interface WorkflowService
Parameters:
name - the name
Returns:
the result

isWorkflowSchemeActive

public ServiceOutcome<java.lang.Boolean> isWorkflowSchemeActive(java.lang.String name)
Description copied from interface: WorkflowService
Is the workflow scheme with the specified name active?

Specified by:
isWorkflowSchemeActive in interface WorkflowService
Parameters:
name - the name
Returns:
the result

deleteScheme

public ServiceOutcome<java.lang.Void> deleteScheme(java.lang.String name)
Description copied from interface: WorkflowService
Delete a workflow scheme with the specified name

Specified by:
deleteScheme in interface WorkflowService
Parameters:
name - workflow scheme name
Returns:
the result

deleteWorkflow

public ServiceOutcome<java.lang.Void> deleteWorkflow(java.lang.String name)
Description copied from interface: WorkflowService
Delete a workflow with the specified name.

Specified by:
deleteWorkflow in interface WorkflowService
Parameters:
name - workflow name
Returns:
the result

getJiraWorkflows

@NotNull
public java.util.Collection<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(com.atlassian.jira.project.Project projectObj)
Description copied from interface: WorkflowService
Given a project, returns all JIRA workflows which are associated to that project Empty on error

Specified by:
getJiraWorkflows in interface WorkflowService

getJiraWorkflows

@NotNull
public java.util.Collection<com.atlassian.jira.workflow.JiraWorkflow> getJiraWorkflows(com.atlassian.jira.project.Project projectObj,
                                                                                               java.lang.String issueTypeId)
Description copied from interface: WorkflowService
Given 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:
getJiraWorkflows in interface WorkflowService

associateWorkflowToSchemeAsDefault

@NotNull
public ServiceOutcome<java.lang.Void> associateWorkflowToSchemeAsDefault(java.lang.String workflowName,
                                                                                 com.atlassian.jira.scheme.Scheme scheme)
Description copied from interface: WorkflowService
Associates a workflow to the given scheme, makes it the default workflow for that scheme

Specified by:
associateWorkflowToSchemeAsDefault in interface WorkflowService

associateSchemeToProject

@NotNull
public ServiceOutcome<java.lang.Void> associateSchemeToProject(com.atlassian.jira.project.Project project,
                                                                       com.atlassian.jira.scheme.Scheme scheme)
Description copied from interface: WorkflowService
Associates scheme to project

Specified by:
associateSchemeToProject in interface WorkflowService


Copyright © 2007-2013 Atlassian. All Rights Reserved.