com.atlassian.greenhopper.service.workflow
Interface SimplifiedWorkflowService

All Known Implementing Classes:
SimplifiedWorkflowServiceImpl

public interface SimplifiedWorkflowService

Service which encapsulates the "Simplified Workflow" feature.

Due to limitations in OS Workflow, this feature will only work on JIRA versions 5.0.4 and above.


Method Summary
 ServiceOutcome<java.lang.Void> addStatusToGreenHopperSimplifiedWorkflow(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.workflow.JiraWorkflow workflow, com.atlassian.jira.issue.status.Status status)
          Modifies the GreenHopper Simplified Workflow to include the specified Status as a step with its associated global transitions.
 ServiceOutcome<com.atlassian.jira.issue.status.Status> canStatusBeRemovedFromGreenHopperSimplifiedWorkflow(com.atlassian.jira.workflow.JiraWorkflow workflow, java.lang.String statusId)
          Checks to see if the specified status can be removed from the specified JiraWorkflow.
 ServiceOutcome<CheckWorkflowEntitiesByNameResult> checkForSimplifiedWorkflowNamedAfterProject(java.lang.String projectKey)
          Look for the existence of workflows or workflow schemes with the reserved name for "GreenHopper Simplified Workflow" for the given project.
 ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> convertTransitionsToSimplified(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.workflow.JiraWorkflow workflow, java.util.List<com.atlassian.jira.issue.status.Status> resolutionDoneStatuses)
          Converts a workflow so that it will have only global transitions to all steps.
 ServiceOutcome<com.atlassian.jira.scheme.Scheme> createSimplifiedWorkflowForExistingProject(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.project.Project project, java.util.List<com.atlassian.jira.issue.status.Status> resolutionDoneStatuses)
          Take the workflow of the existing project, and create a copy which is a GreenHopper Simplified Workflow.
 ServiceOutcome<java.lang.Void> createSimplifiedWorkflowForNewProject(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.project.Project project, SimplifiedWorkflowPresets preset)
          Create a "GreenHopper Simplified Workflow" workflow scheme and workflow for the newly created project and associate it with the provided project
 ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.workflow.JiraWorkflow,com.atlassian.jira.scheme.Scheme>> createSimplifiedWorkflowForNewProject(com.atlassian.crowd.embedded.api.User user, java.lang.String projectKey, SimplifiedWorkflowPresets preset)
          Create a "GreenHopper Simplified Workflow" workflow scheme and workflow for a project with key projectKey.
 ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.workflow.JiraWorkflow,com.atlassian.jira.project.Project>> getGreenHopperSimplifiedWorkflow(com.atlassian.crowd.embedded.api.User user, com.atlassian.query.Query query)
          Attempts to retrieve the GreenHopper Simplified Workflow that is backing the Query.
 ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.workflow.JiraWorkflow,com.atlassian.jira.project.Project>> getPotentialWorkflowForConversion(com.atlassian.crowd.embedded.api.User user, com.atlassian.query.Query query)
          Attempts to retrieve a potential GreenHopper Simplified Workflow that is backing the Query.
 java.util.Map<SimplifiedWorkflowPresets,PresetData> getPresetDefinitions()
          get the map from WorkflowPreset enum to the bean encapsulating preset data
 boolean isFeatureEnabled()
           
 ServiceOutcome<java.lang.Boolean> isStatusResolutionDone(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.workflow.JiraWorkflow workflow, com.atlassian.jira.issue.status.Status status)
          Check if this status is marked as done in simplified workflow
 ServiceOutcome<java.lang.Void> removeStatusFromGreenHopperSimplifiedWorkflow(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.workflow.JiraWorkflow workflow, com.atlassian.jira.issue.status.Status status)
          Removes the specified Status associated step and global transition from the GreenHopper Simplified Workflow.
 ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> replaceInitialStatusInGreenHopperSimplifiedWorkflow(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.workflow.JiraWorkflow workflow, com.atlassian.jira.issue.status.Status oldInitialStatus, com.atlassian.jira.issue.status.Status newInitialStatus)
          Replaces the initial status specified in the workflow with a new one.
 ServiceOutcome<java.lang.Void> setStatusResolutionDone(com.atlassian.crowd.embedded.api.User user, com.atlassian.jira.workflow.JiraWorkflow workflow, com.atlassian.jira.issue.status.Status status, boolean done)
          Switches on/off the resolution to done for a certain workflow status
 

Method Detail

isFeatureEnabled

boolean isFeatureEnabled()
Returns:
if the feature is able to be used based on the JIRA version.

getGreenHopperSimplifiedWorkflow

@NotNull
ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.workflow.JiraWorkflow,com.atlassian.jira.project.Project>> getGreenHopperSimplifiedWorkflow(com.atlassian.crowd.embedded.api.User user,
                                                                                                                                                                        com.atlassian.query.Query query)
Attempts to retrieve the GreenHopper Simplified Workflow that is backing the Query. This will fail if the query does not meet the criteria for a Simplified Workflow.

The criteria is as follows:

Parameters:
user - the user trying to retrieve the workflow
query - the query to look at
Returns:
the result

getPotentialWorkflowForConversion

@NotNull
ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.workflow.JiraWorkflow,com.atlassian.jira.project.Project>> getPotentialWorkflowForConversion(com.atlassian.crowd.embedded.api.User user,
                                                                                                                                                                         @NotNull
                                                                                                                                                                         com.atlassian.query.Query query)
Attempts to retrieve a potential GreenHopper Simplified Workflow that is backing the Query. It is necessary that a Simplified Workflow is a potential Simplified Workflow, but not the other way around. This will just determine if the user may be allowed to kick off a conversion.

The criteria here is less stringent:

Parameters:
user - the user retrieving the workflow
query - the query to look at
Returns:
the result

canStatusBeRemovedFromGreenHopperSimplifiedWorkflow

@NotNull
ServiceOutcome<com.atlassian.jira.issue.status.Status> canStatusBeRemovedFromGreenHopperSimplifiedWorkflow(@NotNull
                                                                                                                   com.atlassian.jira.workflow.JiraWorkflow workflow,
                                                                                                                   @NotNull
                                                                                                                   java.lang.String statusId)
Checks to see if the specified status can be removed from the specified JiraWorkflow. It assumes that the workflow is a GreenHopper Simplified Workflow.

The status can only be removed if:

Parameters:
workflow - the workflow
statusId - the ID of the status to look for
Returns:
the outcome

removeStatusFromGreenHopperSimplifiedWorkflow

@NotNull
ServiceOutcome<java.lang.Void> removeStatusFromGreenHopperSimplifiedWorkflow(com.atlassian.crowd.embedded.api.User user,
                                                                                     @NotNull
                                                                                     com.atlassian.jira.workflow.JiraWorkflow workflow,
                                                                                     @NotNull
                                                                                     com.atlassian.jira.issue.status.Status status)
Removes the specified Status associated step and global transition from the GreenHopper Simplified Workflow. Assumes that the workflow is a GreenHopper Simplified Workflow.

If the status is no longer in use by any workflow, it will be removed from the system entirely.

Parameters:
user - the user
workflow - the workflow
status - the status to remove
Returns:
the result

replaceInitialStatusInGreenHopperSimplifiedWorkflow

@NotNull
ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> replaceInitialStatusInGreenHopperSimplifiedWorkflow(com.atlassian.crowd.embedded.api.User user,
                                                                                                                     @NotNull
                                                                                                                     com.atlassian.jira.workflow.JiraWorkflow workflow,
                                                                                                                     @NotNull
                                                                                                                     com.atlassian.jira.issue.status.Status oldInitialStatus,
                                                                                                                     @NotNull
                                                                                                                     com.atlassian.jira.issue.status.Status newInitialStatus)
Replaces the initial status specified in the workflow with a new one. Assumes that the workflow is a GreenHopper Simplified Workflow.

Parameters:
user - the user
workflow - the workflow
oldInitialStatus - the status to remove
newInitialStatus - the status to replace it with
Returns:
the result

addStatusToGreenHopperSimplifiedWorkflow

@NotNull
ServiceOutcome<java.lang.Void> addStatusToGreenHopperSimplifiedWorkflow(com.atlassian.crowd.embedded.api.User user,
                                                                                @NotNull
                                                                                com.atlassian.jira.workflow.JiraWorkflow workflow,
                                                                                @NotNull
                                                                                com.atlassian.jira.issue.status.Status status)
Modifies the GreenHopper Simplified Workflow to include the specified Status as a step with its associated global transitions.

If the status already exists in the specified workflow, nothing will be changed.

Parameters:
user - the user
workflow - the workflow to modify - must be a GreenHopper Simplified Workflow
status - the status
Returns:
the result

convertTransitionsToSimplified

@NotNull
ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> convertTransitionsToSimplified(com.atlassian.crowd.embedded.api.User user,
                                                                                                @NotNull
                                                                                                com.atlassian.jira.workflow.JiraWorkflow workflow,
                                                                                                java.util.List<com.atlassian.jira.issue.status.Status> resolutionDoneStatuses)
Converts a workflow so that it will have only global transitions to all steps. These transitions will not have any conditions, validators or screens, and will have the default post functions applied.

Parameters:
user - the user
workflow - the original workflow
resolutionDoneStatuses - optional status which will be marked as done
Returns:
the new workflow

checkForSimplifiedWorkflowNamedAfterProject

@NotNull
ServiceOutcome<CheckWorkflowEntitiesByNameResult> checkForSimplifiedWorkflowNamedAfterProject(java.lang.String projectKey)
Look for the existence of workflows or workflow schemes with the reserved name for "GreenHopper Simplified Workflow" for the given project. This is used when attempting to convert an existing project's workflow into the GreenHopper Simplified Workflow.

Parameters:
projectKey -
Returns:
the result
See Also:
CheckWorkflowEntitiesByNameResult

createSimplifiedWorkflowForNewProject

@NotNull
ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.workflow.JiraWorkflow,com.atlassian.jira.scheme.Scheme>> createSimplifiedWorkflowForNewProject(com.atlassian.crowd.embedded.api.User user,
                                                                                                                                                                           java.lang.String projectKey,
                                                                                                                                                                           SimplifiedWorkflowPresets preset)
Create a "GreenHopper Simplified Workflow" workflow scheme and workflow for a project with key projectKey. Does not associate scheme with project.

See Also:
createSimplifiedWorkflowForNewProject(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.project.Project, SimplifiedWorkflowPresets)

createSimplifiedWorkflowForNewProject

@NotNull
ServiceOutcome<java.lang.Void> createSimplifiedWorkflowForNewProject(com.atlassian.crowd.embedded.api.User user,
                                                                             com.atlassian.jira.project.Project project,
                                                                             SimplifiedWorkflowPresets preset)
Create a "GreenHopper Simplified Workflow" workflow scheme and workflow for the newly created project and associate it with the provided project


createSimplifiedWorkflowForExistingProject

@NotNull
ServiceOutcome<com.atlassian.jira.scheme.Scheme> createSimplifiedWorkflowForExistingProject(com.atlassian.crowd.embedded.api.User user,
                                                                                                    com.atlassian.jira.project.Project project,
                                                                                                    java.util.List<com.atlassian.jira.issue.status.Status> resolutionDoneStatuses)
Take the workflow of the existing project, and create a copy which is a GreenHopper Simplified Workflow. Does not associate the project to the workflow scheme.

Parameters:
user - the user
project - the existing project
Returns:
the new scheme which the project could be associated to

getPresetDefinitions

@NotNull
java.util.Map<SimplifiedWorkflowPresets,PresetData> getPresetDefinitions()
get the map from WorkflowPreset enum to the bean encapsulating preset data


isStatusResolutionDone

@NotNull
ServiceOutcome<java.lang.Boolean> isStatusResolutionDone(com.atlassian.crowd.embedded.api.User user,
                                                                 @NotNull
                                                                 com.atlassian.jira.workflow.JiraWorkflow workflow,
                                                                 @NotNull
                                                                 com.atlassian.jira.issue.status.Status status)
Check if this status is marked as done in simplified workflow

Parameters:
user - the user
workflow - the workflow
status - the status
Returns:

setStatusResolutionDone

ServiceOutcome<java.lang.Void> setStatusResolutionDone(com.atlassian.crowd.embedded.api.User user,
                                                       @NotNull
                                                       com.atlassian.jira.workflow.JiraWorkflow workflow,
                                                       @NotNull
                                                       com.atlassian.jira.issue.status.Status status,
                                                       boolean done)
Switches on/off the resolution to done for a certain workflow status

Parameters:
user - the user
workflow - the workflow
status - the status
done - whether to clear or set as done the resolution field
Returns:


Copyright © 2007-2013 Atlassian. All Rights Reserved.