@Service public class SimplifiedWorkflowServiceImpl extends Object implements SimplifiedWorkflowService
Modifier and Type | Field and Description |
---|---|
static int |
JIRA_5_0_4_BUILD_NUMBER |
protected LoggerWrapper |
log |
static String |
SIMPLIFIED_WORKFLOW_DESC_PREFIX |
static String |
SIMPLIFIED_WORKFLOW_NAME_PREFIX |
static String |
SIMPLIFIED_WORKFLOW_SCHEME_NAME_PREFIX |
Constructor and Description |
---|
SimplifiedWorkflowServiceImpl() |
Modifier and Type | Method and Description |
---|---|
ServiceOutcome<Void> |
addStatusToGreenHopperSimplifiedWorkflow(com.atlassian.jira.user.ApplicationUser 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,
String statusId)
Checks to see if the specified status can be removed from the specified
JiraWorkflow . |
ServiceOutcome<CheckWorkflowEntitiesByNameResult> |
checkForSimplifiedWorkflowNamedAfterProject(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.jira.user.ApplicationUser user,
com.atlassian.jira.workflow.JiraWorkflow mutable,
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.jira.user.ApplicationUser user,
com.atlassian.jira.project.Project project,
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<Void> |
createSimplifiedWorkflowForNewProject(com.atlassian.jira.user.ApplicationUser 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.jira.user.ApplicationUser user,
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.jira.user.ApplicationUser 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.jira.user.ApplicationUser user,
com.atlassian.query.Query query)
Attempts to retrieve a potential GreenHopper Simplified Workflow that is backing the
Query . |
Map<SimplifiedWorkflowPresets,PresetData> |
getPresetDefinitions()
get the map from WorkflowPreset enum to the bean encapsulating preset data
|
boolean |
isFeatureEnabled() |
ServiceOutcome<Boolean> |
isStatusResolutionDone(com.atlassian.jira.user.ApplicationUser 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<Void> |
removeStatusFromGreenHopperSimplifiedWorkflow(com.atlassian.jira.user.ApplicationUser 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.jira.user.ApplicationUser 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<Void> |
setStatusResolutionDone(com.atlassian.jira.user.ApplicationUser 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
|
protected final LoggerWrapper log
public static final int JIRA_5_0_4_BUILD_NUMBER
public static final String SIMPLIFIED_WORKFLOW_NAME_PREFIX
public static final String SIMPLIFIED_WORKFLOW_DESC_PREFIX
public static final String SIMPLIFIED_WORKFLOW_SCHEME_NAME_PREFIX
public boolean isFeatureEnabled()
isFeatureEnabled
in interface SimplifiedWorkflowService
public ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.workflow.JiraWorkflow,com.atlassian.jira.project.Project>> getGreenHopperSimplifiedWorkflow(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query)
SimplifiedWorkflowService
Query
. This will fail if
the query does not meet the criteria for a Simplified Workflow.
The criteria is as follows:
SIMPLIFIED_WORKFLOW_NAME_FMT
getGreenHopperSimplifiedWorkflow
in interface SimplifiedWorkflowService
user
- the user trying to retrieve the workflowquery
- the query to look atpublic ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.workflow.JiraWorkflow,com.atlassian.jira.project.Project>> getPotentialWorkflowForConversion(com.atlassian.jira.user.ApplicationUser user, com.atlassian.query.Query query)
SimplifiedWorkflowService
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:
getPotentialWorkflowForConversion
in interface SimplifiedWorkflowService
user
- the user retrieving the workflowquery
- the query to look atpublic ServiceOutcome<com.atlassian.jira.issue.status.Status> canStatusBeRemovedFromGreenHopperSimplifiedWorkflow(com.atlassian.jira.workflow.JiraWorkflow workflow, String statusId)
SimplifiedWorkflowService
JiraWorkflow
. It assumes that
the workflow is a GreenHopper Simplified Workflow.
The status can only be removed if:
canStatusBeRemovedFromGreenHopperSimplifiedWorkflow
in interface SimplifiedWorkflowService
workflow
- the workflowstatusId
- the ID of the status to look forpublic ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> replaceInitialStatusInGreenHopperSimplifiedWorkflow(com.atlassian.jira.user.ApplicationUser user, @NotNull com.atlassian.jira.workflow.JiraWorkflow workflow, @NotNull com.atlassian.jira.issue.status.Status oldInitialStatus, @NotNull com.atlassian.jira.issue.status.Status newInitialStatus)
SimplifiedWorkflowService
replaceInitialStatusInGreenHopperSimplifiedWorkflow
in interface SimplifiedWorkflowService
user
- the userworkflow
- the workflowoldInitialStatus
- the status to removenewInitialStatus
- the status to replace it withpublic ServiceOutcome<Void> addStatusToGreenHopperSimplifiedWorkflow(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.workflow.JiraWorkflow workflow, com.atlassian.jira.issue.status.Status status)
SimplifiedWorkflowService
Status
as a step with its associated
global transitions.
If the status already exists in the specified workflow, nothing will be changed.addStatusToGreenHopperSimplifiedWorkflow
in interface SimplifiedWorkflowService
user
- the userworkflow
- the workflow to modify - must be a GreenHopper Simplified Workflowstatus
- the statuspublic ServiceOutcome<Void> removeStatusFromGreenHopperSimplifiedWorkflow(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.workflow.JiraWorkflow workflow, com.atlassian.jira.issue.status.Status status)
SimplifiedWorkflowService
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.removeStatusFromGreenHopperSimplifiedWorkflow
in interface SimplifiedWorkflowService
user
- the userworkflow
- the workflowstatus
- the status to removepublic ServiceOutcome<com.atlassian.jira.workflow.JiraWorkflow> convertTransitionsToSimplified(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.workflow.JiraWorkflow mutable, List<com.atlassian.jira.issue.status.Status> resolutionDoneStatuses)
SimplifiedWorkflowService
convertTransitionsToSimplified
in interface SimplifiedWorkflowService
user
- the usermutable
- the original workflowresolutionDoneStatuses
- optional status which will be marked as donepublic Map<SimplifiedWorkflowPresets,PresetData> getPresetDefinitions()
SimplifiedWorkflowService
getPresetDefinitions
in interface SimplifiedWorkflowService
public ServiceOutcome<CheckWorkflowEntitiesByNameResult> checkForSimplifiedWorkflowNamedAfterProject(String projectKey)
SimplifiedWorkflowService
checkForSimplifiedWorkflowNamedAfterProject
in interface SimplifiedWorkflowService
CheckWorkflowEntitiesByNameResult
public ServiceOutcome<com.atlassian.jira.util.lang.Pair<com.atlassian.jira.workflow.JiraWorkflow,com.atlassian.jira.scheme.Scheme>> createSimplifiedWorkflowForNewProject(com.atlassian.jira.user.ApplicationUser user, String projectKey, SimplifiedWorkflowPresets preset)
SimplifiedWorkflowService
createSimplifiedWorkflowForNewProject
in interface SimplifiedWorkflowService
#createSimplifiedWorkflowForNewProject(com.atlassian.crowd.embedded.api.User, com.atlassian.jira.project.Project, SimplifiedWorkflowPresets)
public ServiceOutcome<Void> createSimplifiedWorkflowForNewProject(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.project.Project project, SimplifiedWorkflowPresets preset)
SimplifiedWorkflowService
createSimplifiedWorkflowForNewProject
in interface SimplifiedWorkflowService
public ServiceOutcome<com.atlassian.jira.scheme.Scheme> createSimplifiedWorkflowForExistingProject(com.atlassian.jira.user.ApplicationUser user, com.atlassian.jira.project.Project project, List<com.atlassian.jira.issue.status.Status> resolutionDoneStatuses)
SimplifiedWorkflowService
createSimplifiedWorkflowForExistingProject
in interface SimplifiedWorkflowService
user
- the userproject
- the existing projectpublic ServiceOutcome<Boolean> isStatusResolutionDone(com.atlassian.jira.user.ApplicationUser user, @NotNull com.atlassian.jira.workflow.JiraWorkflow workflow, @NotNull com.atlassian.jira.issue.status.Status status)
SimplifiedWorkflowService
isStatusResolutionDone
in interface SimplifiedWorkflowService
user
- the userworkflow
- the workflowstatus
- the statuspublic ServiceOutcome<Void> setStatusResolutionDone(com.atlassian.jira.user.ApplicationUser user, @NotNull com.atlassian.jira.workflow.JiraWorkflow workflow, @NotNull com.atlassian.jira.issue.status.Status status, boolean done)
SimplifiedWorkflowService
setStatusResolutionDone
in interface SimplifiedWorkflowService
user
- the userworkflow
- the workflowstatus
- the statusdone
- whether to clear or set as done the resolution fieldCopyright © 2007–2015 Atlassian. All rights reserved.