Package com.atlassian.jira.workflow
Class AbstractJiraWorkflow
java.lang.Object
com.atlassian.jira.workflow.AbstractJiraWorkflow
- All Implemented Interfaces:
JiraWorkflow
,Comparable<JiraWorkflow>
- Direct Known Subclasses:
ConfigurableJiraWorkflow
,DefaultJiraWorkflow
,JiraDraftWorkflow
,MockXmlLoadableJiraWorkflow
-
Field Summary
FieldsFields inherited from interface com.atlassian.jira.workflow.JiraWorkflow
ACTION_ORIGIN_STEP_ID, ACTION_SCREEN_ATTRIBUTE, ACTION_TYPE_ALL, ACTION_TYPE_COMMON, ACTION_TYPE_GLOBAL, ACTION_TYPE_INITIAL, ACTION_TYPE_ORDINARY, DEFAULT_WORKFLOW_NAME, DRAFT, JIRA_META_ATTRIBUTE_ALLOWED_LIST, JIRA_META_ATTRIBUTE_EDIT_ALLOWED, JIRA_META_ATTRIBUTE_EXCLUDE_RESOLUTION, JIRA_META_ATTRIBUTE_I18N, JIRA_META_ATTRIBUTE_I18N_SUBMIT, JIRA_META_ATTRIBUTE_INCLUDE_RESOLUTION, JIRA_META_ATTRIBUTE_KEY_PREFIX, JIRA_META_ATTRIBUTE_PERMISSION, JIRA_META_UPDATE_AUTHOR_KEY, JIRA_META_UPDATE_AUTHOR_NAME, JIRA_META_UPDATED_DATE, LIVE, STEP_STATUS_KEY, WORKFLOW_DESCRIPTION_ATTRIBUTE, WORKFLOW_VIEW_FIELDLAYOUT_KEY_ATTRIBUTE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractJiraWorkflow
(WorkflowManager workflowManager, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor) -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Collection
<com.opensymphony.workflow.loader.ActionDescriptor> getActionsByName
(String name) Get all actions in this workflow, global, common and from steps, whose name matchedname
.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.getActionType
(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor) Collection
<com.opensymphony.workflow.loader.ActionDescriptor> Get all the actions in this workflow, global, common and from steps.com.opensymphony.workflow.loader.WorkflowDescriptor
getLinkedStatus
(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor) Get the Status associated with the given StepDescriptor.List
<org.ofbiz.core.entity.GenericValue> Returns all statuses for this workflowgetLinkedStatusId
(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor) Get the id of theStatus
associated with the givenStepDescriptor
Returns all status ids for this workflowgetLinkedStatusObject
(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor) Get the Status associated with the given StepDescriptor.Returns all statuses for this workflowcom.opensymphony.workflow.loader.StepDescriptor
getLinkedStep
(Status status) Get the StepDescriptor linked to the given status 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.getMode()
Returns eitherJiraWorkflow.DRAFT
orJiraWorkflow.LIVE
depending on the workflow implementation.abstract String
getName()
int
Get the next available action idCollection
<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.getStepsForTransition
(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor) Returns a collection of all step descriptors that reference the given common action.getStepsWithAction
(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor) Returns the most recent authorReturns the most recent authors username.Returns the date of the most recent update to this workflow.boolean
Determines if this workflow has a draft edit copy.int
hashCode()
boolean
isActive()
Determine whether this workflow object is currently active.boolean
isCommonAction
(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor) boolean
Determines if the workflow is the default JIRA workflowboolean
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
Determines if the workflow is loaded from XML or the databaseboolean
removeStep
(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor) Remove a step from the workflow.void
reset()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.jira.workflow.JiraWorkflow
isDraftWorkflow
-
Field Details
-
workflowManager
-
-
Constructor Details
-
AbstractJiraWorkflow
protected AbstractJiraWorkflow(WorkflowManager workflowManager, com.opensymphony.workflow.loader.WorkflowDescriptor workflowDescriptor)
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceJiraWorkflow
-
getDescription
- Specified by:
getDescription
in interfaceJiraWorkflow
-
getDisplayName
- Specified by:
getDisplayName
in interfaceJiraWorkflow
-
getDescriptor
public com.opensymphony.workflow.loader.WorkflowDescriptor getDescriptor()- Specified by:
getDescriptor
in interfaceJiraWorkflow
-
getAllActions
Description copied from interface:JiraWorkflow
Get all the actions in this workflow, global, common and from steps.- Specified by:
getAllActions
in interfaceJiraWorkflow
- Returns:
- A collection of
ActionDescriptor
s.
-
getActionsByName
Description copied from interface:JiraWorkflow
Get all actions in this workflow, global, common and from steps, whose name matchedname
.- Specified by:
getActionsByName
in interfaceJiraWorkflow
- Parameters:
name
- of the action to match. This is case-insensitive.- Returns:
- A collection of
ActionDescriptor
whose name matched the givenname
.
-
getNextActionId
public int getNextActionId()Description copied from interface:JiraWorkflow
Get the next available action id- Specified by:
getNextActionId
in interfaceJiraWorkflow
- Returns:
- The next available action id.
-
getActionsWithResult
public Collection<com.opensymphony.workflow.loader.ActionDescriptor> getActionsWithResult(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor) Description copied from interface:JiraWorkflow
Get all the actions which have a particular step as their unconditional result.- Specified by:
getActionsWithResult
in interfaceJiraWorkflow
- Returns:
- all the actions which have a particular step as their unconditional result.
-
getStepsWithAction
public Collection getStepsWithAction(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor) -
removeStep
public boolean removeStep(com.opensymphony.workflow.loader.StepDescriptor stepDescriptor) Description copied from interface:JiraWorkflow
Remove a step from the workflow.This method will also remove all actions with this step ID as their unconditional result.
- Specified by:
removeStep
in interfaceJiraWorkflow
- Returns:
true
if the remove was successful
-
getLinkedStep
public com.opensymphony.workflow.loader.StepDescriptor getLinkedStep(org.ofbiz.core.entity.GenericValue status) Description copied from interface:JiraWorkflow
Get the StepDescriptor linked to the given status for this workflow.- Specified by:
getLinkedStep
in interfaceJiraWorkflow
- Parameters:
status
- the Status- Returns:
- The StepDescriptor linked, or null if no steps are linked to this status.
-
getLinkedStep
Description copied from interface:JiraWorkflow
Get the StepDescriptor linked to the given status for this workflow.- Specified by:
getLinkedStep
in interfaceJiraWorkflow
- Parameters:
status
- the Status- Returns:
- The StepDescriptor linked, or null if no steps are linked to this status.
-
getLinkedStatus
Description copied from interface:JiraWorkflow
Get the Status associated with the given StepDescriptor.- Specified by:
getLinkedStatus
in interfaceJiraWorkflow
- Parameters:
stepDescriptor
- the StepDescriptor- Returns:
- the Status associated with the given StepDescriptor.
-
getLinkedStatusObject
Description copied from interface:JiraWorkflow
Get the Status associated with the given StepDescriptor.- Specified by:
getLinkedStatusObject
in interfaceJiraWorkflow
- Parameters:
stepDescriptor
- the StepDescriptor- Returns:
- the Status associated with the given StepDescriptor.
-
getLinkedStatusId
Description copied from interface:JiraWorkflow
Get the id of theStatus
associated with the givenStepDescriptor
- Specified by:
getLinkedStatusId
in interfaceJiraWorkflow
- Parameters:
stepDescriptor
- the StepDescriptor- Returns:
- the id of the status associated with the given StepDescriptor.
-
getLinkedStatuses
Description copied from interface:JiraWorkflow
Returns all statuses for this workflow- Specified by:
getLinkedStatuses
in interfaceJiraWorkflow
- Returns:
- a
List
ofGenericValue
-
getLinkedStatusObjects
Description copied from interface:JiraWorkflow
Returns all statuses for this workflow- Specified by:
getLinkedStatusObjects
in interfaceJiraWorkflow
- Returns:
- a
List
ofStatus
objects
-
getLinkedStatusIds
Description copied from interface:JiraWorkflow
Returns all status ids for this workflow- Specified by:
getLinkedStatusIds
in interfaceJiraWorkflow
- Returns:
- a
Set
ofString
status id's
-
getStepsForTransition
public Collection getStepsForTransition(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor) Description copied from interface:JiraWorkflow
Returns a collection of all step descriptors that reference the given common action.- Specified by:
getStepsForTransition
in interfaceJiraWorkflow
- Returns:
- a collection of all step descriptors that reference the given common action.
-
getPostFunctionsForTransition
public Collection<com.opensymphony.workflow.loader.FunctionDescriptor> getPostFunctionsForTransition(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor) Description copied from interface:JiraWorkflow
Returns all post-functions of the transition, including the ones on all conditional results, unconditional results and 'global' (non-result) postfunctions.- Specified by:
getPostFunctionsForTransition
in interfaceJiraWorkflow
- Returns:
- all post-functions of the transition, including the ones on all conditional results, unconditional results and 'global' (non-result) postfunctions.
-
isActive
Description copied from interface:JiraWorkflow
Determine whether this workflow object is currently active.- Specified by:
isActive
in interfaceJiraWorkflow
- Returns:
true
if this workflow object is active.- Throws:
WorkflowException
- Runtime Exception indicating a problem in the WorkflowManager.
-
isSystemWorkflow
Description copied from interface:JiraWorkflow
Determines if the workflow is loaded from XML or the database- Specified by:
isSystemWorkflow
in interfaceJiraWorkflow
- Returns:
true
if this workflow object is the uneditable system workflow.- Throws:
WorkflowException
- Runtime Exception indicating a problem in the WorkflowManager.
-
isEditable
Description copied from interface:JiraWorkflow
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.
- Specified by:
isEditable
in interfaceJiraWorkflow
- Returns:
true
if this workflow is editable.- Throws:
WorkflowException
- Runtime Exception indicating a problem in the WorkflowManager.
-
isDefault
public boolean isDefault()Description copied from interface:JiraWorkflow
Determines if the workflow is the default JIRA workflow- Specified by:
isDefault
in interfaceJiraWorkflow
- Returns:
true
if this is the workflow is the default JIRA workflow.
-
isInitialAction
public boolean isInitialAction(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor) - Specified by:
isInitialAction
in interfaceJiraWorkflow
-
isCommonAction
public boolean isCommonAction(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor) - Specified by:
isCommonAction
in interfaceJiraWorkflow
-
isGlobalAction
public boolean isGlobalAction(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor) - Specified by:
isGlobalAction
in interfaceJiraWorkflow
-
isOrdinaryAction
public boolean isOrdinaryAction(com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor) - Specified by:
isOrdinaryAction
in interfaceJiraWorkflow
-
getActionType
- Specified by:
getActionType
in interfaceJiraWorkflow
-
reset
public void reset()- Specified by:
reset
in interfaceJiraWorkflow
-
getActionsForScreen
public Collection<com.opensymphony.workflow.loader.ActionDescriptor> getActionsForScreen(FieldScreen fieldScreen) - Specified by:
getActionsForScreen
in interfaceJiraWorkflow
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<JiraWorkflow>
-
getUpdateAuthorName
Description copied from interface:JiraWorkflow
Returns the most recent authors username.- Specified by:
getUpdateAuthorName
in interfaceJiraWorkflow
- Returns:
- Returns the authors username
-
getUpdateAuthor
Description copied from interface:JiraWorkflow
Returns the most recent author Notice: This method will also return proxy user even when is not existing. Please useUserManager.isUserExisting(com.atlassian.jira.user.ApplicationUser)
if you want to check user's existence.- Specified by:
getUpdateAuthor
in interfaceJiraWorkflow
- Returns:
- The update author.
-
getUpdatedDate
Description copied from interface:JiraWorkflow
Returns the date of the most recent update to this workflow.- Specified by:
getUpdatedDate
in interfaceJiraWorkflow
- Returns:
- date of the most recent update to this workflow
-
hasDraftWorkflow
public boolean hasDraftWorkflow()Description copied from interface:JiraWorkflow
Determines if this workflow has a draft edit copy.- Specified by:
hasDraftWorkflow
in interfaceJiraWorkflow
- Returns:
true
if this workflow has a draft edit copy.
-
getMode
Description copied from interface:JiraWorkflow
Returns eitherJiraWorkflow.DRAFT
orJiraWorkflow.LIVE
depending on the workflow implementation.- Specified by:
getMode
in interfaceJiraWorkflow
- Returns:
JiraWorkflow.DRAFT
orJiraWorkflow.LIVE
-