@PublicApi
public interface WorkflowManager
Modifier and Type | Method and Description |
---|---|
void |
copyAndDeleteDraftsForInactiveWorkflowsIn(ApplicationUser user,
Iterable<JiraWorkflow> workflows)
Provided a set of workflows, this method will check, if the passed in inactive workflows have any drafts linked
to them.
|
void |
copyAndDeleteDraftWorkflows(ApplicationUser user,
Set<JiraWorkflow> workflows)
Deprecated.
Since 5.1. This method should not be used directly by external developers as it is an operation
that only makes sense in the context of a higher level operation in JIRA (i.e. project removal / changing the
workflow scheme of a given project).
Please use the API calls for these higher level operations instead. |
JiraWorkflow |
copyWorkflow(ApplicationUser user,
String clonedWorkflowName,
String clonedWorkflowDescription,
JiraWorkflow workflowToClone)
Clones a workflow by creating a deep copy of the workflow provided.
|
JiraWorkflow |
copyWorkflow(String username,
String clonedWorkflowName,
String clonedWorkflowDescription,
JiraWorkflow workflowToClone)
Deprecated.
Use
copyWorkflow(com.atlassian.jira.user.ApplicationUser, String, String, JiraWorkflow) instead. Since v6.0. |
JiraWorkflow |
createDraftWorkflow(ApplicationUser user,
String parentWorkflowName)
This will create an draft workflow of the named active workflow.
|
JiraWorkflow |
createDraftWorkflow(String username,
String parentWorkflowName)
Deprecated.
Use
createDraftWorkflow(com.atlassian.jira.user.ApplicationUser, String) instead. Since v6.0. |
org.ofbiz.core.entity.GenericValue |
createIssue(String remoteUserName,
Map<String,Object> fields)
Create an issue in the database.
|
void |
createWorkflow(ApplicationUser user,
JiraWorkflow workflow) |
void |
createWorkflow(String username,
JiraWorkflow workflow)
Deprecated.
Use
createWorkflow(com.atlassian.jira.user.ApplicationUser, JiraWorkflow) instead. Since v6.0. |
boolean |
deleteDraftWorkflow(String parentWorkflowName)
Deletes all draft workflows (there should every be only one) for a given parent workflow.
|
void |
deleteWorkflow(JiraWorkflow workflow) |
void |
doWorkflowAction(WorkflowProgressAware from) |
com.opensymphony.workflow.loader.ActionDescriptor |
getActionDescriptor(Issue issue,
int actionId)
Given an issue and the identifier if a workflow action, returns the ActionDescriptor associated.
|
com.opensymphony.workflow.loader.ActionDescriptor |
getActionDescriptor(WorkflowProgressAware workflowProgressAware) |
Collection<JiraWorkflow> |
getActiveWorkflows()
Retrieve all currently active workflows.
|
JiraWorkflow |
getDefaultWorkflow() |
JiraWorkflow |
getDraftWorkflow(String parentWorkflowName)
Retrieve a single draft workflow by name.
|
Optional<String> |
getInitialStatusIdForIssue(Issue issue)
Returns the initial status for the workflow the given issue belongs to.
|
String |
getNextStatusIdForAction(Issue issue,
int actionId)
Given an issue and the identifier of a workflow action, returns the next status id for the issue if the action gets executed.
|
Map<com.opensymphony.workflow.loader.ActionDescriptor,Collection<com.opensymphony.workflow.loader.FunctionDescriptor>> |
getPostFunctionsForWorkflow(JiraWorkflow workflow)
Retrieve a map: actions -> post functions for a workflow.
|
String |
getStepId(long actionDescriptorId,
String workflowName)
Gets the first stepId for the given action and workflow name.
|
com.opensymphony.workflow.spi.WorkflowStore |
getStore() |
JiraWorkflow |
getWorkflow(org.ofbiz.core.entity.GenericValue issue)
Deprecated.
Use
getWorkflow(com.atlassian.jira.issue.Issue) instead. Since v6.2. |
JiraWorkflow |
getWorkflow(Issue issue)
Retrieve the workflow for a given issue.
|
JiraWorkflow |
getWorkflow(Long projectId,
String issueTypeId)
Retrieve the workflow for a given project - issue type pair.
|
JiraWorkflow |
getWorkflow(String name)
Retrieve a single workflow by name.
|
JiraWorkflow |
getWorkflowClone(String name)
This method returns a JiraWorkflow, that contains a
WorkflowDescriptor
that is mutable. |
JiraWorkflow |
getWorkflowFromScheme(org.ofbiz.core.entity.GenericValue scheme,
String issueTypeId)
Return the workflow in a particular scheme for a given issue type.
|
JiraWorkflow |
getWorkflowFromScheme(WorkflowScheme scheme,
String issueTypeId)
Return the workflow in a particular scheme for a given issue type.
|
Collection<JiraWorkflow> |
getWorkflows()
Retrieve all of the workflows in the system
|
Collection<JiraWorkflow> |
getWorkflowsFromScheme(org.ofbiz.core.entity.GenericValue workflowScheme)
Deprecated.
Since 5.0. Use
getWorkflowsFromScheme(com.atlassian.jira.scheme.Scheme) instead. |
Iterable<JiraWorkflow> |
getWorkflowsFromScheme(Scheme workflowScheme)
Returns all workflows for a given scheme.
|
List<JiraWorkflow> |
getWorkflowsIncludingDrafts()
Retrieve all of the workflows in the system including drafts.
|
boolean |
isActive(JiraWorkflow workflow)
Determine whether or not a given workflow is active in the system.
|
boolean |
isEditable(Issue issue) |
boolean |
isEditable(Issue issue,
String nextStatusId)
Checks if the issue will be editable in workflow step with given id.
|
boolean |
isSystemWorkflow(JiraWorkflow workflow)
Determine whether or not a given workflow is a system workflow.
|
com.opensymphony.workflow.Workflow |
makeWorkflow(ApplicationUser user)
Prepares
Workflow object with given user as caller |
com.opensymphony.workflow.Workflow |
makeWorkflow(String userName)
Deprecated.
Use
makeWorkflow(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. |
com.opensymphony.workflow.Workflow |
makeWorkflowWithUserKey(String userKey) |
com.opensymphony.workflow.Workflow |
makeWorkflowWithUserName(String userName) |
void |
migrateIssueToWorkflow(org.ofbiz.core.entity.GenericValue issue,
JiraWorkflow newWorkflow,
org.ofbiz.core.entity.GenericValue status)
Deprecated.
|
void |
migrateIssueToWorkflow(MutableIssue issue,
JiraWorkflow newWorkflow,
Status status)
Migrates given issue to new workflow and sets new status on it.
|
boolean |
migrateIssueToWorkflowNoReindex(org.ofbiz.core.entity.GenericValue issue,
JiraWorkflow newWorkflow,
org.ofbiz.core.entity.GenericValue status)
Migrates given issue to new workflow and sets new status on it.
|
void |
overwriteActiveWorkflow(ApplicationUser user,
String workflowName)
Saves the draft workflow into the active workflow.
|
void |
overwriteActiveWorkflow(String username,
String workflowName)
Deprecated.
Use
overwriteActiveWorkflow(com.atlassian.jira.user.ApplicationUser, String) instead. Since v6.0. |
void |
removeWorkflowEntries(org.ofbiz.core.entity.GenericValue issue) |
void |
replaceConditionInTransition(com.opensymphony.workflow.loader.ActionDescriptor transition,
Map<String,String> matchMap,
Map<String,String> newMap)
Changes the parameter map of all conditions that have the parameter map matching matchMap by adding all properties from newMap.
|
void |
saveWorkflowWithoutAudit(JiraWorkflow workflow)
This method will save the workflow and it will not affect the updatedDate and updatedAuthorName meta attributes
of the workflow.
|
void |
updateWorkflow(ApplicationUser user,
JiraWorkflow workflow)
Saves the given JiraWorkflow, which may be either a "live" or "draft" version.
|
void |
updateWorkflow(String username,
JiraWorkflow workflow)
Deprecated.
Use
updateWorkflow(com.atlassian.jira.user.ApplicationUser, JiraWorkflow) instead. Since v6.0. |
void |
updateWorkflowNameAndDescription(ApplicationUser user,
JiraWorkflow currentWorkflow,
String newName,
String newDescription)
Used to change the name and description of an existing worfklow with the given name.
|
void |
updateWorkflowNameAndDescription(String username,
JiraWorkflow currentWorkflow,
String newName,
String newDescription)
Deprecated.
|
boolean |
workflowExists(String name) |
Collection<JiraWorkflow> getWorkflows()
JiraWorkflow
objects.List<JiraWorkflow> getWorkflowsIncludingDrafts()
JiraWorkflow
objects.boolean isActive(JiraWorkflow workflow) throws WorkflowException
Active workflows are those currently assigned to schemes and associated with projects - they cannot be edited but can be used.
workflow
- the JiraWorkflow to checkWorkflowException
- RuntimeException wrapper for any errors.boolean isSystemWorkflow(JiraWorkflow workflow) throws WorkflowException
Check for a system or XML based workflow - can not be edited.
workflow
- the JiraWorkflow to checkWorkflowException
- maybe - but it doesn't look like it?Collection<JiraWorkflow> getActiveWorkflows() throws WorkflowException
WorkflowException
- RuntimeException wrapper for any errors.JiraWorkflow getWorkflow(String name)
JiraWorkflow
contains a
descriptor that by default isn't mutable.
If you need to edit a workflow, please see getWorkflowClone(String)
.
name
- The workflow nameJiraWorkflow
that wraps an Immutable WorkflowDescriptor or nullgetWorkflowClone(String)
JiraWorkflow getWorkflowClone(String name)
WorkflowDescriptor
that is mutable. This method should be called, if you require to edit the workflow.
If you only need to view a workflow, please use getWorkflow(String)
as it will provide better
performance. Cloning a workflow is expensive, as it requires de-constructing and re-constructing the underlying
WorkflowDescriptor
from XML.
name
- The workflow nameJiraWorkflow
or null if it doesn't exist.getWorkflow(String)
JiraWorkflow getDraftWorkflow(String parentWorkflowName) throws IllegalArgumentException
parentWorkflowName
- is the name of the Saved workflow which identifies then paritally edited draft workflow
to retrieve.IllegalArgumentException
- if no parentWorkflow with the name provided can be found.JiraWorkflow createDraftWorkflow(String username, String parentWorkflowName) throws IllegalStateException, IllegalArgumentException
createDraftWorkflow(com.atlassian.jira.user.ApplicationUser, String)
instead. Since v6.0.IllegalStateException
in
this case.parentWorkflowName
- identifies the parent workflow that should be used as the template for creating the
draft workflow.username
- identifies the user performing the action so that we can keep an audit trail of who has last
saved the workflow. Empty string for anonymous user. If null an IllegalArgumentException
will be thrownJiraWorkflow
that represents a copy of the parent that can be edited without
overwriting the active workflow immediately.IllegalStateException
- thrown if the parentWorkflow is not Active or the draft already existsIllegalArgumentException
- If the username is nullJiraWorkflow createDraftWorkflow(ApplicationUser user, String parentWorkflowName) throws IllegalStateException, IllegalArgumentException
IllegalStateException
in
this case.parentWorkflowName
- identifies the parent workflow that should be used as the template for creating the
draft workflow.user
- identifies the user performing the action so that we can keep an audit trail of who has last
saved the workflow. Empty string for anonymous user. If null an IllegalArgumentException
will be thrownJiraWorkflow
that represents a copy of the parent that can be edited without
overwriting the active workflow immediately.IllegalStateException
- thrown if the parentWorkflow is not Active or the draft already existsIllegalArgumentException
- If the username is nullboolean deleteDraftWorkflow(String parentWorkflowName) throws IllegalArgumentException
parentWorkflowName
- The parentworkflow for which the draft workflow needs to be deleted.IllegalArgumentException
- if the parentWorkflowName is nullJiraWorkflow getWorkflow(org.ofbiz.core.entity.GenericValue issue) throws WorkflowException
getWorkflow(com.atlassian.jira.issue.Issue)
instead. Since v6.2.issue
- the IssueWorkflowException
- RuntimeException wrapper for any errors.JiraWorkflow getWorkflow(Issue issue) throws WorkflowException
issue
- the IssueWorkflowException
- RuntimeException wrapper for any errors.JiraWorkflow getWorkflow(Long projectId, String issueTypeId) throws WorkflowException
projectId
- the ProjectissueTypeId
- the IssueType IDWorkflowException
- RuntimeException wrapper for any errors.JiraWorkflow getWorkflowFromScheme(org.ofbiz.core.entity.GenericValue scheme, String issueTypeId) throws WorkflowException
scheme
- the SchemeissueTypeId
- the IssueType IDWorkflowException
- RuntimeException wrapper for any errors.JiraWorkflow getWorkflowFromScheme(WorkflowScheme scheme, String issueTypeId) throws WorkflowException
scheme
- the SchemeissueTypeId
- the IssueType IDWorkflowException
- RuntimeException wrapper for any errors.Collection<JiraWorkflow> getWorkflowsFromScheme(org.ofbiz.core.entity.GenericValue workflowScheme) throws WorkflowException
getWorkflowsFromScheme(com.atlassian.jira.scheme.Scheme)
instead.workflowScheme
- the Workflow Scheme.WorkflowException
- RuntimeException wrapper for any errors.Iterable<JiraWorkflow> getWorkflowsFromScheme(Scheme workflowScheme) throws WorkflowException
workflowScheme
- the Workflow Scheme.WorkflowException
- RuntimeException wrapper for any errors.JiraWorkflow getDefaultWorkflow() throws WorkflowException
WorkflowException
org.ofbiz.core.entity.GenericValue createIssue(String remoteUserName, Map<String,Object> fields) throws WorkflowException
remoteUserName
- Issue creatorfields
- Map of fields. The key is the name of the field, and the type of the value depends on the key. Must
include a key "issue", which contains MutableIssue
object (holding values, not
yet persisted to disk). May include other fields (eg "pkey"->String key of project, "originalissueobject"->Issue
object) passed onto the workflow engine.WorkflowException
- If any errors occur while trying to create the issue.void removeWorkflowEntries(org.ofbiz.core.entity.GenericValue issue)
void doWorkflowAction(WorkflowProgressAware from)
com.opensymphony.workflow.spi.WorkflowStore getStore() throws com.opensymphony.workflow.StoreException
com.opensymphony.workflow.StoreException
void createWorkflow(String username, JiraWorkflow workflow) throws WorkflowException
createWorkflow(com.atlassian.jira.user.ApplicationUser, JiraWorkflow)
instead. Since v6.0.username
- workflow
- WorkflowException
void createWorkflow(ApplicationUser user, JiraWorkflow workflow) throws WorkflowException
user
- workflow
- WorkflowException
void saveWorkflowWithoutAudit(JiraWorkflow workflow) throws WorkflowException
updateWorkflow(String, JiraWorkflow)
workflow
- the workflow to save.WorkflowException
- RuntimeException wrapper for any errors.void deleteWorkflow(JiraWorkflow workflow) throws WorkflowException
WorkflowException
com.opensymphony.workflow.loader.ActionDescriptor getActionDescriptor(WorkflowProgressAware workflowProgressAware) throws Exception
Exception
void migrateIssueToWorkflow(MutableIssue issue, JiraWorkflow newWorkflow, Status status) throws WorkflowException
issue
- issue to migratenewWorkflow
- new workflowstatus
- new statusWorkflowException
- if migration failsvoid migrateIssueToWorkflow(org.ofbiz.core.entity.GenericValue issue, JiraWorkflow newWorkflow, org.ofbiz.core.entity.GenericValue status) throws WorkflowException
migrateIssueToWorkflow(com.atlassian.jira.issue.MutableIssue, JiraWorkflow, com.atlassian.jira.issue.status.Status)
.
Since: 3.9.issue
- issue to migratenewWorkflow
- new workflowstatus
- new statusWorkflowException
- if migration failsboolean migrateIssueToWorkflowNoReindex(org.ofbiz.core.entity.GenericValue issue, JiraWorkflow newWorkflow, org.ofbiz.core.entity.GenericValue status) throws WorkflowException
issue
- issue to migratenewWorkflow
- new workflowstatus
- new statusWorkflowException
- if migration failscom.opensymphony.workflow.Workflow makeWorkflow(String userName)
makeWorkflow(com.atlassian.jira.user.ApplicationUser)
instead. Since v6.0.Workflow
object with given username as calleruserName
- caller usernameWorkflow
com.opensymphony.workflow.Workflow makeWorkflow(ApplicationUser user)
Workflow
object with given user as calleruser
- callerWorkflow
com.opensymphony.workflow.Workflow makeWorkflowWithUserName(String userName)
com.opensymphony.workflow.Workflow makeWorkflowWithUserKey(String userKey)
boolean workflowExists(String name) throws WorkflowException
WorkflowException
boolean isEditable(Issue issue)
@ExperimentalApi boolean isEditable(@Nonnull Issue issue, @Nonnull String nextStatusId)
issue
- the issue which is affected by the workflow actionnextStatusId
- the workflow status that the issue will be in after transitionMap<com.opensymphony.workflow.loader.ActionDescriptor,Collection<com.opensymphony.workflow.loader.FunctionDescriptor>> getPostFunctionsForWorkflow(JiraWorkflow workflow)
workflow
- The WorkflowString getStepId(long actionDescriptorId, String workflowName)
actionDescriptorId
- id of the ActionDescriptorworkflowName
- name of the JiraWorkflowvoid overwriteActiveWorkflow(String username, String workflowName)
overwriteActiveWorkflow(com.atlassian.jira.user.ApplicationUser, String)
instead. Since v6.0.username
- User will be added to the workflows Audit trailworkflowName
- The workflow to be overwrittenvoid overwriteActiveWorkflow(ApplicationUser user, String workflowName)
user
- User will be added to the workflows Audit trailworkflowName
- The workflow to be overwrittenvoid updateWorkflow(String username, JiraWorkflow workflow)
updateWorkflow(com.atlassian.jira.user.ApplicationUser, JiraWorkflow)
instead. Since v6.0.overwriteActiveWorkflow(String, String)
username
- User making the request.workflow
- The JiraWorkflow to save.IllegalArgumentException
- if the workflow or its descriptor is null.void updateWorkflow(ApplicationUser user, JiraWorkflow workflow)
overwriteActiveWorkflow(ApplicationUser, String)
user
- User making the request.workflow
- The JiraWorkflow to save.IllegalArgumentException
- if the workflow or its descriptor is null.JiraWorkflow copyWorkflow(String username, String clonedWorkflowName, String clonedWorkflowDescription, JiraWorkflow workflowToClone)
copyWorkflow(com.atlassian.jira.user.ApplicationUser, String, String, JiraWorkflow)
instead. Since v6.0.username
- The user performing the operationclonedWorkflowName
- The name to store the new workflow with.clonedWorkflowDescription
- The description to store with the cloned workflow. Can be null.workflowToClone
- The workflow to copy.JiraWorkflow copyWorkflow(ApplicationUser user, String clonedWorkflowName, String clonedWorkflowDescription, JiraWorkflow workflowToClone)
user
- The user performing the operationclonedWorkflowName
- The name to store the new workflow with.clonedWorkflowDescription
- The description to store with the cloned workflow. Can be null.workflowToClone
- The workflow to copy.void updateWorkflowNameAndDescription(String username, JiraWorkflow currentWorkflow, String newName, String newDescription)
updateWorkflowNameAndDescription(com.atlassian.jira.user.ApplicationUser, JiraWorkflow, String, String)
instead. Since v6.0.username
- The user performing the operationcurrentWorkflow
- The workflow to update.newName
- The new name to save with the workflownewDescription
- The new description to save with the workflowvoid updateWorkflowNameAndDescription(ApplicationUser user, JiraWorkflow currentWorkflow, String newName, String newDescription)
user
- The user performing the operationcurrentWorkflow
- The workflow to update.newName
- The new name to save with the workflownewDescription
- The new description to save with the workflowvoid copyAndDeleteDraftWorkflows(ApplicationUser user, Set<JiraWorkflow> workflows)
Please use the API calls for these higher level operations instead.
user
- The user performing the operationworkflows
- A set of parent JiraWorkflow
s@Internal void copyAndDeleteDraftsForInactiveWorkflowsIn(ApplicationUser user, Iterable<JiraWorkflow> workflows)
This method is only meant to be used internally in JIRA. External developers should not call this method directly.
user
- The user performing the operationworkflows
- A set of parent JiraWorkflow
s@Internal @Nonnull String getNextStatusIdForAction(@Nonnull Issue issue, int actionId)
issue
- The issueactionId
- The identifier of a workflow action@ExperimentalApi @Internal @Nonnull Optional<String> getInitialStatusIdForIssue(@Nonnull Issue issue)
issue
- the issue in workflow for which the initial status should be returned@Nonnull com.opensymphony.workflow.loader.ActionDescriptor getActionDescriptor(@Nonnull Issue issue, int actionId)
issue
- The issue.actionId
- The identifier of a workflow action.void replaceConditionInTransition(@Nonnull com.opensymphony.workflow.loader.ActionDescriptor transition, @Nonnull Map<String,String> matchMap, @Nonnull Map<String,String> newMap)
transition
- transition to change the conditions inmatchMap
- the map used to determine if the condition should be modifiednewMap
- a map of properties to be added to the parameter mapCopyright © 2002-2021 Atlassian. All Rights Reserved.