public class

MockJiraWorkflow

extends Object
implements JiraWorkflow
java.lang.Object
   ↳ com.atlassian.jira.workflow.MockJiraWorkflow

Class Overview

New Mock for JiraWorkflow. Note that there is another existing MockJiraWorkflow, but it relies on the underlying OSWorkflow implementation.

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.workflow.JiraWorkflow
[Expand]
Inherited Fields
From interface com.atlassian.jira.workflow.JiraWorkflow
Public Constructors
MockJiraWorkflow()
MockJiraWorkflow(String name)
Public Methods
MockJiraWorkflow addAction(ActionDescriptor actionDescriptor)
void addStep(int id, String statusName)
Adds a step to this fake workflow with the given status
void clear()
int compareTo(JiraWorkflow o)
String getActionType(ActionDescriptor actionDescriptor)
Collection<ActionDescriptor> getActionsByName(String name)
Get all actions in this workflow, global, common and from steps, whose name matched name.
Collection<ActionDescriptor> getActionsForScreen(FieldScreen fieldScreen)
Collection<ActionDescriptor> getActionsWithResult(StepDescriptor stepDescriptor)
Get all the actions which have a particular step as their unconditional result.
Collection<ActionDescriptor> getAllActions()
Get all the actions in this workflow, global, common and from steps.
String getDescription()
WorkflowDescriptor getDescriptor()
String getDisplayName()
Status getLinkedStatus(StepDescriptor stepDescriptor)
Get the Status associated with the given StepDescriptor.
String getLinkedStatusId(StepDescriptor stepDescriptor)
Get the id of the Status associated with the given StepDescriptor
Set<String> getLinkedStatusIds()
Returns all status ids for this workflow
Status getLinkedStatusObject(StepDescriptor stepDescriptor)
Get the Status associated with the given StepDescriptor.
List<Status> getLinkedStatusObjects()
Returns all statuses for this workflow
List<GenericValue> getLinkedStatuses()
Returns all statuses for this workflow
StepDescriptor getLinkedStep(Status status)
Get the StepDescriptor linked to the given status for this workflow.
StepDescriptor getLinkedStep(GenericValue status)
Get the StepDescriptor linked to the given status for this workflow.
String getMode()
Returns either DRAFT or LIVE depending on the workflow implementation.
String getName()
int getNextActionId()
Get the next available action id
Collection<FunctionDescriptor> getPostFunctionsForTransition(ActionDescriptor actionDescriptor)
Returns all post-functions of the transition, including the ones on all conditional results, unconditional results and 'global' (non-result) postfunctions.
Collection<StepDescriptor> getStepsForTransition(ActionDescriptor action)
Returns a collection of all step descriptors that reference the given common action.
ApplicationUser getUpdateAuthor()
Returns the most recent author

Notice: This method will also return proxy user even when is not existing.
String getUpdateAuthorName()
Returns the most recent authors username.
Date getUpdatedDate()
Returns the date of the most recent update to this workflow.
boolean hasDraftWorkflow()
Determines if this workflow has a draft edit copy.
boolean isActive()
Determine whether this workflow object is currently active.
boolean isCommonAction(ActionDescriptor actionDescriptor)
boolean isDefault()
Determines if the workflow is the default JIRA workflow
boolean isDraftWorkflow()
Determines if the workflow is an draft edit of an active workflow.
boolean isEditable()
Determines if the workflow can be modifed within JIRA.
boolean isGlobalAction(ActionDescriptor actionDescriptor)
boolean isInitialAction(ActionDescriptor actionDescriptor)
boolean isOrdinaryAction(ActionDescriptor actionDescriptor)
boolean isSystemWorkflow()
Determines if the workflow is loaded from XML or the database
boolean removeStep(StepDescriptor stepDescriptor)
Remove a step from the workflow.
void reset()
void setDraftWorkflow(boolean draftWorkflow)
void setName(String name)
void setWorkflowDescriptor(WorkflowDescriptor workflowDescriptor)
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.workflow.JiraWorkflow
From interface java.lang.Comparable

Public Constructors

public MockJiraWorkflow ()

public MockJiraWorkflow (String name)

Public Methods

public MockJiraWorkflow addAction (ActionDescriptor actionDescriptor)

public void addStep (int id, String statusName)

Adds a step to this fake workflow with the given status

public void clear ()

public int compareTo (JiraWorkflow o)

public String getActionType (ActionDescriptor actionDescriptor)

public Collection<ActionDescriptor> getActionsByName (String name)

Get all actions in this workflow, global, common and from steps, whose name matched name.

Parameters
name of the action to match. This is case-insensitive.
Returns
  • A collection of ActionDescriptor whose name matched the given name.

public Collection<ActionDescriptor> getActionsForScreen (FieldScreen fieldScreen)

public Collection<ActionDescriptor> getActionsWithResult (StepDescriptor stepDescriptor)

Get all the actions which have a particular step as their unconditional result.

Returns
  • all the actions which have a particular step as their unconditional result.

public Collection<ActionDescriptor> getAllActions ()

Get all the actions in this workflow, global, common and from steps.

Returns
  • A collection of ActionDescriptors.

public String getDescription ()

public WorkflowDescriptor getDescriptor ()

public String getDisplayName ()

public Status getLinkedStatus (StepDescriptor stepDescriptor)

Get the Status associated with the given StepDescriptor.

Parameters
stepDescriptor the StepDescriptor
Returns
  • the Status associated with the given StepDescriptor.

public String getLinkedStatusId (StepDescriptor stepDescriptor)

Get the id of the Status associated with the given StepDescriptor

Parameters
stepDescriptor the StepDescriptor
Returns
  • the id of the status associated with the given StepDescriptor.

public Set<String> getLinkedStatusIds ()

Returns all status ids for this workflow

Returns

public Status getLinkedStatusObject (StepDescriptor stepDescriptor)

Get the Status associated with the given StepDescriptor.

Parameters
stepDescriptor the StepDescriptor
Returns
  • the Status associated with the given StepDescriptor.

public List<Status> getLinkedStatusObjects ()

Returns all statuses for this workflow

Returns

public List<GenericValue> getLinkedStatuses ()

Returns all statuses for this workflow

Returns
  • a List of GenericValue

public StepDescriptor getLinkedStep (Status status)

Get the StepDescriptor linked to the given status for this workflow.

Parameters
status the Status
Returns
  • The StepDescriptor linked, or null if no steps are linked to this status.

public StepDescriptor getLinkedStep (GenericValue status)

Get the StepDescriptor linked to the given status for this workflow.

Parameters
status the Status
Returns
  • The StepDescriptor linked, or null if no steps are linked to this status.

public String getMode ()

Returns either DRAFT or LIVE depending on the workflow implementation.

Returns

public String getName ()

public int getNextActionId ()

Get the next available action id

Returns
  • The next available action id.

public Collection<FunctionDescriptor> getPostFunctionsForTransition (ActionDescriptor actionDescriptor)

Returns all post-functions of the transition, including the ones on all conditional results, unconditional results and 'global' (non-result) postfunctions.

Returns
  • all post-functions of the transition, including the ones on all conditional results, unconditional results and 'global' (non-result) postfunctions.

public Collection<StepDescriptor> getStepsForTransition (ActionDescriptor action)

Returns a collection of all step descriptors that reference the given common action.

Returns
  • a collection of all step descriptors that reference the given common action.

public ApplicationUser getUpdateAuthor ()

Returns the most recent author

Notice: This method will also return proxy user even when is not existing. Please use isUserExisting(com.atlassian.jira.user.ApplicationUser) if you want to check user's existence.

Returns
  • The update author.

public String getUpdateAuthorName ()

Returns the most recent authors username.

Returns
  • Returns the authors username

public Date getUpdatedDate ()

Returns the date of the most recent update to this workflow.

Returns
  • date of the most recent update to this workflow

public boolean hasDraftWorkflow ()

Determines if this workflow has a draft edit copy.

Returns
  • true if this workflow has a draft edit copy.

public boolean isActive ()

Determine whether this workflow object is currently active.

Returns
  • true if this workflow object is active.

public boolean isCommonAction (ActionDescriptor actionDescriptor)

public boolean isDefault ()

Determines if the workflow is the default JIRA workflow

Returns
  • true if this is the workflow is the default JIRA workflow.

public boolean isDraftWorkflow ()

Determines if the workflow is an draft edit of an active workflow.

Returns
  • true if an draft workflow, false otherwise.

public boolean isEditable ()

Determines if the workflow can be modifed within JIRA.

System workflows are never editable. The "published" version of an active workflow is not editable, but the draft version is. Inactive workflows are editable.

Returns
  • true if this workflow is editable.

public boolean isGlobalAction (ActionDescriptor actionDescriptor)

public boolean isInitialAction (ActionDescriptor actionDescriptor)

public boolean isOrdinaryAction (ActionDescriptor actionDescriptor)

public boolean isSystemWorkflow ()

Determines if the workflow is loaded from XML or the database

Returns
  • true if this workflow object is the uneditable system workflow.

public boolean removeStep (StepDescriptor stepDescriptor)

Remove a step from the workflow.

This method will also remove all actions with this step ID as their unconditional result.

Returns
  • true if the remove was successful

public void reset ()

public void setDraftWorkflow (boolean draftWorkflow)

public void setName (String name)

public void setWorkflowDescriptor (WorkflowDescriptor workflowDescriptor)

public String toString ()