|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WorkflowService
This class is responsible for validation before passing the actual call to the underlying
WorkflowManager
.
Method Summary | |
---|---|
JiraWorkflow |
copyWorkflow(JiraServiceContext jiraServiceContext,
String clonedWorkflowName,
String clonedWorkflowDescription,
JiraWorkflow workflowToClone)
Clones and persists a new workflow with the name given. |
JiraWorkflow |
createDraftWorkflow(JiraServiceContext jiraServiceContext,
String parentWorkflowName)
Creates a copy of an active workflow for editing. |
boolean |
deleteDraftWorkflow(JiraServiceContext jiraServiceContext,
String parentWorkflowName)
Deletes draft workflows (there should only be one) that are associated with the given parent workflow name. |
JiraWorkflow |
getDraftWorkflow(JiraServiceContext jiraServiceContext,
String parentWorkflowName)
Given a parentWorkflowName, this methods will retrieved the relevant draft workflow linked to that parent. |
JiraWorkflow |
getWorkflow(JiraServiceContext jiraServiceContext,
String name)
Returns the workflow with the given name. |
boolean |
isStepOnDraftWithNoTransitionsOnParentWorkflow(JiraServiceContext jiraServiceContext,
JiraWorkflow workflow,
int stepId)
Given a draft workflow and a step Id, this method returns true, if the step does not have any transitions on the original workflow. |
void |
overwriteActiveWorkflow(JiraServiceContext jiraServiceContext,
String parentWorkflowName)
This method will overwrite the parentWorkflow with a JiraDraftWorkflow if
it exists. |
void |
updateWorkflow(JiraServiceContext jiraServiceContext,
JiraWorkflow workflow)
Updates the workflow descriptor provided in the persistance mechanism implemented. |
void |
updateWorkflowNameAndDescription(JiraServiceContext jiraServiceContext,
JiraWorkflow currentWorkflow,
String newName,
String newDescription)
Used to change the name and description of an existing worfklow with the given name. |
void |
validateAddWorkflowTransitionToDraft(JiraServiceContext jiraServiceContext,
JiraWorkflow newJiraworkflow,
int stepId)
Validates if a workflow transition can be added to a draft. |
void |
validateCopyWorkflow(JiraServiceContext jiraServiceContext,
String newWorkflowName)
Validates if a workflow can be cloned and saved with the provided name. |
void |
validateOverwriteWorkflow(JiraServiceContext jiraServiceContext,
String workflowName)
Validates that the draft workflow with the given name is allowed to be saved into the corresponding active workflow. |
void |
validateUpdateWorkflowNameAndDescription(JiraServiceContext jiraServiceContext,
JiraWorkflow currentWorkflow,
String newWorkflowName)
Validates that the workflow with currentName can have its name and description changed to newWorkflowName and newDescription. |
Method Detail |
---|
JiraWorkflow getDraftWorkflow(JiraServiceContext jiraServiceContext, String parentWorkflowName)
jiraServiceContext
- service context with user and error collectionparentWorkflowName
- The parent workflow name to create an draft copy of.
JiraDraftWorkflow
or null if no draft workflow is foundJiraWorkflow createDraftWorkflow(JiraServiceContext jiraServiceContext, String parentWorkflowName)
jiraServiceContext
- service context with user and error collectionparentWorkflowName
- The parent workflow name to create an draft copy of.
JiraDraftWorkflow
boolean deleteDraftWorkflow(JiraServiceContext jiraServiceContext, String parentWorkflowName)
jiraServiceContext
- service context with user and error collectionparentWorkflowName
- The parent workflow name that the draft workflow to be deleted is associated with
void overwriteActiveWorkflow(JiraServiceContext jiraServiceContext, String parentWorkflowName)
JiraDraftWorkflow
if
it exists. If it doesn't exist, this method will add an error to the errorcollection in the service context.
The method will also check for the existance of the parent, and call
validateOverwriteWorkflow(com.atlassian.jira.bc.JiraServiceContext, String)
to ensure the active
workflow isn't being overwritten with an invalid draft workflow.
jiraServiceContext
- service context with user and error collectionparentWorkflowName
- The parent workflow name that will be overwritten with its draft workflowvoid validateOverwriteWorkflow(JiraServiceContext jiraServiceContext, String workflowName)
jiraServiceContext
- JiraServiceContextworkflowName
- Name of the workflow to be validated.void updateWorkflow(JiraServiceContext jiraServiceContext, JiraWorkflow workflow)
overwriteActiveWorkflow(com.atlassian.jira.bc.JiraServiceContext, String)
}
jiraServiceContext
- service context with user and error collectionworkflow
- contains the descriptor that the workflow will be updated to.
IllegalArgumentException
- if theworkflow or its descriptor is null. Also thrown if there is no draft
workflow associated with the provided parentWorkflowName.void validateUpdateWorkflowNameAndDescription(JiraServiceContext jiraServiceContext, JiraWorkflow currentWorkflow, String newWorkflowName)
jiraServiceContext
- service context with user and error collectioncurrentWorkflow
- The current workflow to be updated.newWorkflowName
- The new name to save with the workflowvoid updateWorkflowNameAndDescription(JiraServiceContext jiraServiceContext, JiraWorkflow currentWorkflow, String newName, String newDescription)
jiraServiceContext
- service context with user and error collectioncurrentWorkflow
- The current workflow to be updated.newName
- The new name to save with the workflownewDescription
- The new descriptio to save with the workflowJiraWorkflow getWorkflow(JiraServiceContext jiraServiceContext, String name)
jiraServiceContext
- service context with user and error collectionname
- the name of the workflow
void validateCopyWorkflow(JiraServiceContext jiraServiceContext, String newWorkflowName)
jiraServiceContext
- service context with user and error collectionnewWorkflowName
- The name of the cloned workflow.JiraWorkflow copyWorkflow(JiraServiceContext jiraServiceContext, String clonedWorkflowName, String clonedWorkflowDescription, JiraWorkflow workflowToClone)
jiraServiceContext
- service context with user and error collectionclonedWorkflowName
- The name to store the cloned workflow with.clonedWorkflowDescription
- The description of the new copy. May be null.workflowToClone
- The workflow to clone.
boolean isStepOnDraftWithNoTransitionsOnParentWorkflow(JiraServiceContext jiraServiceContext, JiraWorkflow workflow, int stepId)
jiraServiceContext
- service context with user and error collectionworkflow
- The draft workflow with the new stepstepId
- The stepId of the step to check
void validateAddWorkflowTransitionToDraft(JiraServiceContext jiraServiceContext, JiraWorkflow newJiraworkflow, int stepId)
jiraServiceContext
- service context with user and error collectionnewJiraworkflow
- The draft workflow to which the transition is being addedstepId
- The step to which the transition is being added.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |