|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.workflow.MockJiraWorkflow
public class MockJiraWorkflow
New Mock for JiraWorkflow. Note that there is another existing MockJiraWorkflow, but it relies on the underlying OSWorkflow implementation.
Field Summary |
---|
Constructor Summary | |
---|---|
MockJiraWorkflow()
|
|
MockJiraWorkflow(String name)
|
Method Summary | |
---|---|
MockJiraWorkflow |
addAction(com.opensymphony.workflow.loader.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)
|
Collection<com.opensymphony.workflow.loader.ActionDescriptor> |
getActionsForScreen(FieldScreen fieldScreen)
|
Collection<com.opensymphony.workflow.loader.ActionDescriptor> |
getActionsWithResult(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor)
Get all the actions which have a particular step as their unconditional result. |
String |
getActionType(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
|
Collection<com.opensymphony.workflow.loader.ActionDescriptor> |
getAllActions()
Get all the actions in this workflow, global, common and from steps. |
String |
getDescription()
|
com.opensymphony.workflow.loader.WorkflowDescriptor |
getDescriptor()
|
String |
getDisplayName()
|
org.ofbiz.core.entity.GenericValue |
getLinkedStatus(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor)
Get the Status associated with the given StepDescriptor. |
List<org.ofbiz.core.entity.GenericValue> |
getLinkedStatuses()
Returns all statuses for this workflow |
Status |
getLinkedStatusObject(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor)
Get the Status associated with the given StepDescriptor. |
List<Status> |
getLinkedStatusObjects()
Returns all statuses for this workflow |
com.opensymphony.workflow.loader.StepDescriptor |
getLinkedStep(org.ofbiz.core.entity.GenericValue status)
Get the StepDescriptor linked to the given status for this workflow. |
com.opensymphony.workflow.loader.StepDescriptor |
getLinkedStep(Status status)
Get the StepDescriptor linked to the given status for this workflow. |
String |
getMode()
Returns either JiraWorkflow.DRAFT or JiraWorkflow.LIVE depending on the workflow implementation. |
String |
getName()
|
int |
getNextActionId()
Get the next available action id |
Collection<com.opensymphony.workflow.loader.FunctionDescriptor> |
getPostFunctionsForTransition(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
Returns all post-functions of the transition, including the ones on all conditional results, unconditional results and 'global' (non-result) postfunctions. |
Collection<com.opensymphony.workflow.loader.StepDescriptor> |
getStepsForTransition(com.opensymphony.workflow.loader.ActionDescriptor action)
Returns a collection of all step descriptors that reference the given common action. |
ApplicationUser |
getUpdateAuthor()
Returns the most recent author |
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(com.opensymphony.workflow.loader.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(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
|
boolean |
isInitialAction(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
|
boolean |
isOrdinaryAction(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
|
boolean |
isSystemWorkflow()
Determines if the workflow is loaded from XML or the database |
boolean |
removeStep(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor)
Remove a step from the workflow. |
void |
reset()
|
void |
setDraftWorkflow(boolean draftWorkflow)
|
void |
setName(String name)
|
void |
setWorkflowDescriptor(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MockJiraWorkflow()
public MockJiraWorkflow(String name)
Method Detail |
---|
public String getName()
getName
in interface JiraWorkflow
public String getDisplayName()
getDisplayName
in interface JiraWorkflow
public void setName(String name)
public String getDescription()
getDescription
in interface JiraWorkflow
public com.opensymphony.workflow.loader.WorkflowDescriptor getDescriptor()
getDescriptor
in interface JiraWorkflow
public void setWorkflowDescriptor(com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor)
public Collection<com.opensymphony.workflow.loader.ActionDescriptor> getAllActions()
JiraWorkflow
getAllActions
in interface JiraWorkflow
ActionDescriptor
s.public MockJiraWorkflow addAction(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
public Collection<com.opensymphony.workflow.loader.ActionDescriptor> getActionsWithResult(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor)
JiraWorkflow
getActionsWithResult
in interface JiraWorkflow
public boolean removeStep(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor)
JiraWorkflow
This method will also remove all actions with this step ID as their unconditional result.
removeStep
in interface JiraWorkflow
true
if the remove was successfulpublic com.opensymphony.workflow.loader.StepDescriptor getLinkedStep(org.ofbiz.core.entity.GenericValue status)
JiraWorkflow
getLinkedStep
in interface JiraWorkflow
status
- the Status
public com.opensymphony.workflow.loader.StepDescriptor getLinkedStep(Status status)
JiraWorkflow
getLinkedStep
in interface JiraWorkflow
status
- the Status
public List<org.ofbiz.core.entity.GenericValue> getLinkedStatuses()
JiraWorkflow
getLinkedStatuses
in interface JiraWorkflow
List
of GenericValue
public List<Status> getLinkedStatusObjects()
JiraWorkflow
getLinkedStatusObjects
in interface JiraWorkflow
List
of Status
objectspublic boolean isActive() throws WorkflowException
JiraWorkflow
isActive
in interface JiraWorkflow
true
if this workflow object is active.
WorkflowException
- Runtime Exception indicating a problem in the WorkflowManager.public boolean isSystemWorkflow() throws WorkflowException
JiraWorkflow
isSystemWorkflow
in interface JiraWorkflow
true
if this workflow object is the uneditable system workflow.
WorkflowException
- Runtime Exception indicating a problem in the WorkflowManager.public boolean isEditable() throws WorkflowException
JiraWorkflow
System workflows are never editable. The "published" version of an active workflow is not editable, but the draft version is. Inactive workflows are editable.
isEditable
in interface JiraWorkflow
true
if this workflow is editable.
WorkflowException
- Runtime Exception indicating a problem in the WorkflowManager.public boolean isDefault()
JiraWorkflow
isDefault
in interface JiraWorkflow
true
if this is the workflow is the default JIRA workflow.public boolean hasDraftWorkflow()
JiraWorkflow
hasDraftWorkflow
in interface JiraWorkflow
true
if this workflow has a draft edit copy.public int getNextActionId()
JiraWorkflow
getNextActionId
in interface JiraWorkflow
public Collection<com.opensymphony.workflow.loader.StepDescriptor> getStepsForTransition(com.opensymphony.workflow.loader.ActionDescriptor action)
JiraWorkflow
getStepsForTransition
in interface JiraWorkflow
public Collection<com.opensymphony.workflow.loader.FunctionDescriptor> getPostFunctionsForTransition(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
JiraWorkflow
getPostFunctionsForTransition
in interface JiraWorkflow
public boolean isInitialAction(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
isInitialAction
in interface JiraWorkflow
public boolean isCommonAction(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
isCommonAction
in interface JiraWorkflow
public boolean isGlobalAction(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
isGlobalAction
in interface JiraWorkflow
public boolean isOrdinaryAction(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
isOrdinaryAction
in interface JiraWorkflow
public org.ofbiz.core.entity.GenericValue getLinkedStatus(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor)
JiraWorkflow
getLinkedStatus
in interface JiraWorkflow
stepDescriptor
- the StepDescriptor
public Status getLinkedStatusObject(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor)
JiraWorkflow
getLinkedStatusObject
in interface JiraWorkflow
stepDescriptor
- the StepDescriptor
public String getActionType(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor)
getActionType
in interface JiraWorkflow
public void reset()
reset
in interface JiraWorkflow
public Collection<com.opensymphony.workflow.loader.ActionDescriptor> getActionsForScreen(FieldScreen fieldScreen)
getActionsForScreen
in interface JiraWorkflow
public String getUpdateAuthorName()
JiraWorkflow
getUpdateAuthorName
in interface JiraWorkflow
public ApplicationUser getUpdateAuthor()
JiraWorkflow
UserManager.isUserExisting(com.atlassian.jira.user.ApplicationUser)
if you want to check user's existence.
getUpdateAuthor
in interface JiraWorkflow
public Date getUpdatedDate()
JiraWorkflow
getUpdatedDate
in interface JiraWorkflow
public String getMode()
JiraWorkflow
JiraWorkflow.DRAFT
or JiraWorkflow.LIVE
depending on the workflow implementation.
getMode
in interface JiraWorkflow
JiraWorkflow.DRAFT
or JiraWorkflow.LIVE
public int compareTo(JiraWorkflow o)
compareTo
in interface Comparable<JiraWorkflow>
public void addStep(int id, String statusName)
public void clear()
public boolean isDraftWorkflow()
JiraWorkflow
isDraftWorkflow
in interface JiraWorkflow
true
if an draft workflow, false otherwise.public void setDraftWorkflow(boolean draftWorkflow)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |