com.atlassian.jira.web.action.admin.workflow
Interface WorkflowMigrationResult

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractWorkflowMigrationResult, WorkflowMigrationResultForMultipleProjects, WorkflowMigrationSuccess, WorkflowMigrationTerminated

public interface WorkflowMigrationResult
extends Serializable

This class communicates the results of migrating a project to a new workflow scheme.

The result could be either SUCCESS or TERMINATED. This object also communicates if there were any errors detected before migrating any issues to the new workflow or the number of issues that failed during migration. If there were failed issues, this object contains the issue ids and keys of failed issues.

The workflow migration is made to tolerate several failures. This ensures that if migrating a project with a large number of issues and only a few (a number lower than an agreed threshold) of them fail, the migration proceeds and does not leave the project in an inconsistent state.

Therefore, even if the result is SUCCESS, the object could contain information about one or more failed issues. To determine the number of failed issues, call getNumberOfFailedIssues() method. To get a Map of issue ids to issue key mappings call getFailedIssues() method.

If there were no failures, (a perfect migration). The getNumberOfFailedIssues() method will return 0 and the getFailedIssues() method will return an empty map.

If the result is SUCCESS the object should never have any error messages. Error messages are detected before the migration begins. If any errors are detected a TERMINATED result code should be returned.

If the result is TERMINATED, then the object can either contain one or more errors that were detected before any of the issues were migrated, or no errors and one or more failed issues. At no time can the object have errors as well as failed issues.

If TERMINATED is returned and the object contains one or more errors, then the migration did not actually occur as there were errors found with the data before migrating any issues.

If failed issues are returned, then no errors were found before the migration, but the migration terminated before completion as there were too many failures (more failures than the agreed threshold). In this case, the project is likely left in an inconsistent state and users should be warned.


Field Summary
static int SUCCESS
          The workflow migration has succeeded.
static int TERMINATED
          The workfow migration either did not occur as there were problems found with the data before starting the migration.
 
Method Summary
 ErrorCollection getErrorCollection()
          Returns a collection of errors that were found before starting the migration.
 Map<Long,String> getFailedIssues()
          A Map of issue ids to issue keys of failed issues.
 int getNumberOfFailedIssues()
          The number of issues that failed during the migration, or until the migration was terminated.
 int getResult()
          Returns the result of the workflow migration.
 

Field Detail

SUCCESS

static final int SUCCESS
The workflow migration has succeeded. However, there could still have been failures migrating several issues. See getNumberOfFailedIssues() and getFailedIssues().

See Also:
Constant Field Values

TERMINATED

static final int TERMINATED
The workfow migration either did not occur as there were problems found with the data before starting the migration. In this, there will be one or more errors. See getErrorCollection().

Otherwise, the migration could have been stopped before completion as too many failures were encountered. In this case getNumberOfFailedIssues() should return a positive number and getFailedIssues() should return the issue ids and issue keys.

See Also:
Constant Field Values
Method Detail

getResult

int getResult()
Returns the result of the workflow migration.

Returns:
Either SUCCESS or TERMINATED

getErrorCollection

ErrorCollection getErrorCollection()
Returns a collection of errors that were found before starting the migration.


getNumberOfFailedIssues

int getNumberOfFailedIssues()
The number of issues that failed during the migration, or until the migration was terminated.

Returns:
0 if no failures were encountered, or if the migration did not start due to found errors (see getNumberOfFailedIssues()). Or the number of failures during the migration, or until the migration was terminated.

getFailedIssues

Map<Long,String> getFailedIssues()
A Map of issue ids to issue keys of failed issues.

Returns:
an empty map if getNumberOfFailedIssues() is 0 or a mapping of issue id to issue key for every failed issue during the migration.


Copyright © 2002-2015 Atlassian. All Rights Reserved.