|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WorkflowManager
The WorkflowManager is used to interface with the workflow implementation
Method Summary | |
---|---|
void |
copyAndDeleteDraftWorkflows(com.atlassian.crowd.embedded.api.User user,
Set<JiraWorkflow> workflows)
Provided a set of workflows, this method will check, if the passed in workflows have any draft workflows linked to them. |
JiraWorkflow |
copyWorkflow(String username,
String clonedWorkflowName,
String clonedWorkflowDescription,
JiraWorkflow workflowToClone)
Clones a workflow by creating a deep copy of the workflow provided. |
JiraWorkflow |
createDraftWorkflow(String username,
String parentWorkflowName)
This will create an draft workflow of the named active workflow. |
org.ofbiz.core.entity.GenericValue |
createIssue(String remoteUserName,
Map<String,Object> fields)
Create an issue in the database. |
void |
createWorkflow(String username,
JiraWorkflow workflow)
|
void |
createWorkflow(com.atlassian.crowd.embedded.api.User user,
JiraWorkflow workflow)
|
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(WorkflowProgressAware workflowProgressAware)
|
Collection<JiraWorkflow> |
getActiveWorkflows()
Retrieve all currently active workflows. |
JiraWorkflow |
getDefaultWorkflow()
|
JiraWorkflow |
getDraftWorkflow(String parentWorkflowName)
Retrieve a single draft workflow by name. |
Map<com.opensymphony.workflow.loader.ActionDescriptor,Collection<com.opensymphony.workflow.loader.FunctionDescriptor>> |
getPostFunctionsForWorkflow(JiraWorkflow workflow)
Retrieve a map: actions -> post functions for a workflow. |
com.atlassian.crowd.embedded.api.User |
getRemoteUser(Map transientVars)
Deprecated. Please use WorkflowUtil.getCaller(java.util.Map) or WorkflowUtil.getCallerName(java.util.Map) . Deprecated since 4.3 |
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)
Retrieve the workflow for a given issue. |
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. |
Collection<JiraWorkflow> |
getWorkflows()
Retrieve all of the workflows in the system |
Collection<JiraWorkflow> |
getWorkflowsFromScheme(org.ofbiz.core.entity.GenericValue 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 |
isSystemWorkflow(JiraWorkflow workflow)
Determine whether or not a given workflow is a system workflow. |
com.opensymphony.workflow.Workflow |
makeWorkflow(String userName)
|
com.opensymphony.workflow.Workflow |
makeWorkflow(com.atlassian.crowd.embedded.api.User user)
|
void |
migrateIssueToWorkflow(org.ofbiz.core.entity.GenericValue issue,
JiraWorkflow newWorkflow,
org.ofbiz.core.entity.GenericValue status)
Deprecated. Please use migrateIssueToWorkflow(com.atlassian.jira.issue.MutableIssue,JiraWorkflow,com.atlassian.jira.issue.status.Status) .
Since: 3.9. |
void |
migrateIssueToWorkflow(MutableIssue issue,
JiraWorkflow newWorkflow,
Status status)
Migrates given issue to new workflow and sets new status on it. |
void |
overwriteActiveWorkflow(String username,
String workflowName)
Saves the draft workflow into the active workflow. |
void |
removeWorkflowEntries(org.ofbiz.core.entity.GenericValue issue)
|
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(String username,
JiraWorkflow workflow)
Saves the given JiraWorkflow, which may be either a "live" or "draft" version. |
void |
updateWorkflowNameAndDescription(String username,
JiraWorkflow currentWorkflow,
String newName,
String newDescription)
Used to change the name and description of an existing worfklow with the given name. |
boolean |
workflowExists(String name)
|
Method Detail |
---|
Collection<JiraWorkflow> getWorkflows()
JiraWorkflow
objects.List<JiraWorkflow> getWorkflowsIncludingDrafts()
JiraWorkflow
objects.boolean isActive(JiraWorkflow workflow) throws WorkflowException
workflow
- the JiraWorkflow to check
WorkflowException
- RuntimeException wrapper for any errors.boolean isSystemWorkflow(JiraWorkflow workflow) throws WorkflowException
workflow
- the JiraWorkflow to check
WorkflowException
- 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 name
JiraWorkflow
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 name
JiraWorkflow
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
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 thrown
JiraWorkflow
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 exists
IllegalArgumentException
- 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
issue
- the Issue
WorkflowException
- RuntimeException wrapper for any errors.JiraWorkflow getWorkflow(Issue issue) throws WorkflowException
issue
- the Issue
WorkflowException
- RuntimeException wrapper for any errors.JiraWorkflow getWorkflow(Long projectId, String issueTypeId) throws WorkflowException
projectId
- the ProjectissueTypeId
- the IssueType ID
WorkflowException
- RuntimeException wrapper for any errors.JiraWorkflow getWorkflowFromScheme(org.ofbiz.core.entity.GenericValue scheme, String issueTypeId) throws WorkflowException
scheme
- the SchemeissueTypeId
- the IssueType ID
WorkflowException
- RuntimeException wrapper for any errors.Collection<JiraWorkflow> getWorkflowsFromScheme(org.ofbiz.core.entity.GenericValue 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) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
void doWorkflowAction(WorkflowProgressAware from)
com.atlassian.crowd.embedded.api.User getRemoteUser(Map transientVars)
WorkflowUtil.getCaller(java.util.Map)
or WorkflowUtil.getCallerName(java.util.Map)
. Deprecated since 4.3
transientVars
- ??
com.opensymphony.workflow.spi.WorkflowStore getStore() throws com.opensymphony.workflow.StoreException
com.opensymphony.workflow.StoreException
void createWorkflow(String username, JiraWorkflow workflow) throws WorkflowException
WorkflowException
void createWorkflow(com.atlassian.crowd.embedded.api.User user, JiraWorkflow workflow) throws WorkflowException
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 status
WorkflowException
- 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 status
WorkflowException
- if migration failscom.opensymphony.workflow.Workflow makeWorkflow(String userName)
com.opensymphony.workflow.Workflow makeWorkflow(com.atlassian.crowd.embedded.api.User user)
boolean workflowExists(String name) throws WorkflowException
WorkflowException
boolean isEditable(Issue issue)
Map<com.opensymphony.workflow.loader.ActionDescriptor,Collection<com.opensymphony.workflow.loader.FunctionDescriptor>> getPostFunctionsForWorkflow(JiraWorkflow workflow)
workflow
- The Workflow
String getStepId(long actionDescriptorId, String workflowName)
actionDescriptorId
- id of the ActionDescriptorworkflowName
- name of the JiraWorkflow
void overwriteActiveWorkflow(String username, String workflowName)
username
- User will be added to the workflows Audit trailworkflowName
- The workflow to be overwrittenvoid updateWorkflow(String username, JiraWorkflow workflow)
overwriteActiveWorkflow(String, String)
username
- 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)
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.
void updateWorkflowNameAndDescription(String username, JiraWorkflow currentWorkflow, String newName, String newDescription)
username
- The user performing the operationcurrentWorkflow
- The workflow to update.newName
- The new name to save with the workflownewDescription
- The new descriptio to save with the workflowvoid copyAndDeleteDraftWorkflows(com.atlassian.crowd.embedded.api.User user, Set<JiraWorkflow> workflows)
user
- The user performing the operationworkflows
- A set of parent JiraWorkflow
s
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |