Package com.atlassian.jira.workflow
Class OSWorkflowManager
java.lang.Object
com.atlassian.jira.workflow.OSWorkflowManager
- All Implemented Interfaces:
WorkflowManager
-
Constructor Summary
ConstructorsConstructorDescriptionOSWorkflowManager(com.opensymphony.workflow.config.Configuration configuration, DraftWorkflowStore draftWorkflowStore, com.atlassian.event.api.EventPublisher eventPublisher, WorkflowsRepository workflowsRepository, WorkflowCopyNameFactory workflowCopyNameFactory, JiraAuthenticationContext context, IssueTextFieldCharacterLengthValidator textFieldCharacterLengthValidator) -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyAndDeleteDraftsForInactiveWorkflowsIn(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.voidcopyAndDeleteDraftWorkflows(ApplicationUser user, Set<JiraWorkflow> workflows) Provided a set of workflows, this method will check, if the passed in inactive workflows have any drafts linked to them.copyWorkflow(ApplicationUser user, String clonedWorkflowName, String clonedWorkflowDescription, JiraWorkflow workflowToClone) Clones a workflow by creating a deep copy of the workflow provided.copyWorkflow(String username, String clonedWorkflowName, String clonedWorkflowDescription, JiraWorkflow workflowToClone) Clones a workflow by creating a deep copy of the workflow provided.createDraftWorkflow(ApplicationUser user, String parentWorkflowName) This will create an draft workflow of the named active workflow.createDraftWorkflow(String username, String parentWorkflowName) This will create an draft workflow of the named active workflow.org.ofbiz.core.entity.GenericValuecreateIssue(String remoteUserName, Map<String, Object> fields) Create an issue in the database.voidcreateWorkflow(ApplicationUser user, JiraWorkflow workflow) voidcreateWorkflow(String username, JiraWorkflow workflow) booleandeleteDraftWorkflow(String parentWorkflowName) Deletes all draft workflows (there should every be only one) for a given parent workflow.voiddeleteWorkflow(JiraWorkflow workflow) voidcom.opensymphony.workflow.loader.ActionDescriptorgetActionDescriptor(Issue issue, int actionId) Given an issue and the identifier if a workflow action, returns the ActionDescriptor associated.com.opensymphony.workflow.loader.ActionDescriptorgetActionDescriptor(WorkflowProgressAware workflowProgressAware) Retrieve all currently active workflows.protected com.opensymphony.workflow.config.ConfigurationgetDraftWorkflow(String parentWorkflowName) Retrieve a single draft workflow by name.getInitialStatusIdForIssue(Issue issue) Returns the initial status for the workflow the given issue belongs to.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.getNextStatusIdForAction(Issue issue, JiraWorkflow workflow, com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor) Map<com.opensymphony.workflow.loader.ActionDescriptor,Collection<com.opensymphony.workflow.loader.FunctionDescriptor>> getPostFunctionsForWorkflow(JiraWorkflow workflow) Retrieve a map: actions -> post functions for a workflow.Gets the first stepId for the given action and workflow name.com.opensymphony.workflow.spi.WorkflowStoregetStore()This is used for unit testing so we can return our own 'mock store' instead of the static StoreFactory.getPersistence(ctx);getWorkflow(Issue issue) Retrieve the workflow for a given issue.getWorkflow(Long projectId, String issueTypeId) Retrieve the workflow for a given project - issue type pair.getWorkflow(String name) Retrieve a single workflow by name.getWorkflow(org.ofbiz.core.entity.GenericValue issue) Retrieve the workflow for a given issue.getWorkflowClone(String name) This method returns a JiraWorkflow, that contains aWorkflowDescriptorthat is mutable.getWorkflowFromScheme(WorkflowScheme scheme, String issueTypeId) Return the workflow in a particular scheme for a given issue type.getWorkflowFromScheme(org.ofbiz.core.entity.GenericValue scheme, String issueTypeId) Return the workflow in a particular scheme for a given issue type.protected StringgetWorkflowName(Long projectId, String issueType) This method returns the (unique) name of the workflow which should be used for the provided projectId and issueTypeRetrieve all of the workflows in the systemprotected WorkflowSchemeManagergetWorkflowsFromScheme(Scheme workflowScheme) Returns all workflows for a given scheme.getWorkflowsFromScheme(org.ofbiz.core.entity.GenericValue scheme) Returns all workflows for a given scheme.Retrieve all of the workflows in the system including drafts.booleanisActive(JiraWorkflow workflow) Determine whether or not a given workflow is active in the system.booleanisEditable(Issue issue) booleanisEditable(Issue issue, String nextStatusId) Checks if the issue will be editable in workflow step with given id.booleanisSystemWorkflow(JiraWorkflow workflow) Determine whether or not a given workflow is a system workflow.com.opensymphony.workflow.WorkflowmakeWorkflow(ApplicationUser user) PreparesWorkflowobject with given user as callercom.opensymphony.workflow.WorkflowmakeWorkflow(String userName) PreparesWorkflowobject with given username as callercom.opensymphony.workflow.WorkflowmakeWorkflowWithUserKey(String userKey) com.opensymphony.workflow.WorkflowmakeWorkflowWithUserName(String userName) voidmigrateIssueToWorkflow(MutableIssue issue, JiraWorkflow newWorkflow, Status status) Migrates given issue to new workflow and sets new status on it.voidmigrateIssueToWorkflow(org.ofbiz.core.entity.GenericValue issue, JiraWorkflow newWorkflow, org.ofbiz.core.entity.GenericValue newStatus) Migrates given issue to new workflow and sets new status on it.booleanmigrateIssueToWorkflowNoReindex(org.ofbiz.core.entity.GenericValue issue, JiraWorkflow newWorkflow, org.ofbiz.core.entity.GenericValue newStatus) Migrates given issue to new workflow and sets new status on it.voidoverwriteActiveWorkflow(ApplicationUser user, String workflowName) Saves the draft workflow into the active workflow.voidoverwriteActiveWorkflow(String username, String workflowName) Saves the draft workflow into the active workflow.voidremoveWorkflowEntries(org.ofbiz.core.entity.GenericValue issue) voidreplaceConditionInTransition(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.voidsaveWorkflowWithoutAudit(JiraWorkflow workflow) This method will save the workflow and it will not affect the updatedDate and updatedAuthorName meta attributes of the workflow.protected booleanupdateIssueStatusAndUpdatedDate(org.ofbiz.core.entity.GenericValue issue, org.ofbiz.core.entity.GenericValue newStatus) voidupdateWorkflow(ApplicationUser user, JiraWorkflow workflow) Saves the given JiraWorkflow, which may be either a "live" or "draft" version.voidupdateWorkflow(String username, JiraWorkflow workflow) Saves the given JiraWorkflow, which may be either a "live" or "draft" version.voidupdateWorkflowNameAndDescription(ApplicationUser user, JiraWorkflow currentWorkflow, String newName, String newDescription) Used to change the name and description of an existing worfklow with the given name.voidupdateWorkflowNameAndDescription(String username, JiraWorkflow currentWorkflow, String newName, String newDescription) Used to change the name and description of an existing worfklow with the given name.booleanworkflowExists(String name)
-
Constructor Details
-
OSWorkflowManager
public OSWorkflowManager(com.opensymphony.workflow.config.Configuration configuration, DraftWorkflowStore draftWorkflowStore, com.atlassian.event.api.EventPublisher eventPublisher, WorkflowsRepository workflowsRepository, WorkflowCopyNameFactory workflowCopyNameFactory, JiraAuthenticationContext context, IssueTextFieldCharacterLengthValidator textFieldCharacterLengthValidator)
-
-
Method Details
-
getWorkflows
Retrieve all of the workflows in the system- Specified by:
getWorkflowsin interfaceWorkflowManager- Returns:
- A collection of JiraWorkflow objects.
-
getWorkflowsIncludingDrafts
Description copied from interface:WorkflowManagerRetrieve all of the workflows in the system including drafts. We return a list as we want to keep workflows and associated drafts are adjacent.- Specified by:
getWorkflowsIncludingDraftsin interfaceWorkflowManager- Returns:
- A List of
JiraWorkflowobjects.
-
getWorkflowName
This method returns the (unique) name of the workflow which should be used for the provided projectId and issueType- Returns:
- the name of the workflow that should be used for the issue
-
getActiveWorkflows
Description copied from interface:WorkflowManagerRetrieve all currently active workflows.- Specified by:
getActiveWorkflowsin interfaceWorkflowManager- Returns:
- Collection of JiraWorkflow objects.
- Throws:
WorkflowException- RuntimeException wrapper for any errors.
-
isActive
Description copied from interface:WorkflowManagerDetermine whether or not a given workflow is active in the system.Active workflows are those currently assigned to schemes and associated with projects - they cannot be edited but can be used.
- Specified by:
isActivein interfaceWorkflowManager- Parameters:
workflow- the JiraWorkflow to check- Returns:
- true if the given workflow is active
- Throws:
WorkflowException- RuntimeException wrapper for any errors.
-
isSystemWorkflow
Description copied from interface:WorkflowManagerDetermine whether or not a given workflow is a system workflow.Check for a system or XML based workflow - can not be edited.
- Specified by:
isSystemWorkflowin interfaceWorkflowManager- Parameters:
workflow- the JiraWorkflow to check- Returns:
- true if the given workflow is a system workflow
-
getWorkflow
Description copied from interface:WorkflowManagerRetrieve a single workflow by name. The returnedJiraWorkflowcontains a descriptor that by default isn't mutable.If you need to edit a workflow, please see
WorkflowManager.getWorkflowClone(String).- Specified by:
getWorkflowin interfaceWorkflowManager- Parameters:
name- The workflow name- Returns:
- A
JiraWorkflowthat wraps an Immutable WorkflowDescriptor or null - See Also:
-
getWorkflowClone
Description copied from interface:WorkflowManagerThis method returns a JiraWorkflow, that contains aWorkflowDescriptorthat is mutable. This method should be called, if you require to edit the workflow.If you only need to view a workflow, please use
WorkflowManager.getWorkflow(String)as it will provide better performance. Cloning a workflow is expensive, as it requires de-constructing and re-constructing the underlyingWorkflowDescriptorfrom XML.- Specified by:
getWorkflowClonein interfaceWorkflowManager- Parameters:
name- The workflow name- Returns:
- A
JiraWorkflowor null if it doesn't exist. - See Also:
-
getDraftWorkflow
Description copied from interface:WorkflowManagerRetrieve a single draft workflow by name. If there is not an draft workflow associated with the name this will return null.- Specified by:
getDraftWorkflowin interfaceWorkflowManager- Parameters:
parentWorkflowName- is the name of the Saved workflow which identifies then paritally edited draft workflow to retrieve.- Returns:
- a JiraWorkflow that represents an draft edited workflow.
- Throws:
IllegalArgumentException- if no parentWorkflow with the name provided can be found.
-
createDraftWorkflow
Description copied from interface:WorkflowManagerThis will create an draft workflow of the named active workflow. This draft workflow can be used to edit active workflows without overwriting the active workflow immediately.
This method will not allow you to create an draft workflow if the parent workflow is not active, the method will throw anIllegalStateExceptionin this case.- Specified by:
createDraftWorkflowin interfaceWorkflowManager- Parameters:
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 anIllegalArgumentExceptionwill be thrownparentWorkflowName- identifies the parent workflow that should be used as the template for creating the draft workflow.- Returns:
- An instance of
JiraWorkflowthat represents a copy of the parent that can be edited without overwriting the active workflow immediately.
-
createDraftWorkflow
Description copied from interface:WorkflowManagerThis will create an draft workflow of the named active workflow. This draft workflow can be used to edit active workflows without overwriting the active workflow immediately.
This method will not allow you to create an draft workflow if the parent workflow is not active, the method will throw anIllegalStateExceptionin this case.- Specified by:
createDraftWorkflowin interfaceWorkflowManager- Parameters:
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 anIllegalArgumentExceptionwill be thrownparentWorkflowName- identifies the parent workflow that should be used as the template for creating the draft workflow.- Returns:
- An instance of
JiraWorkflowthat represents a copy of the parent that can be edited without overwriting the active workflow immediately.
-
deleteDraftWorkflow
Description copied from interface:WorkflowManagerDeletes all draft workflows (there should every be only one) for a given parent workflow.- Specified by:
deleteDraftWorkflowin interfaceWorkflowManager- Parameters:
parentWorkflowName- The parentworkflow for which the draft workflow needs to be deleted.- Returns:
- true if a draft workflow as deleted, false otherwise.
- Throws:
IllegalArgumentException- if the parentWorkflowName is null
-
workflowExists
- Specified by:
workflowExistsin interfaceWorkflowManager- Throws:
WorkflowException
-
getWorkflow
Description copied from interface:WorkflowManagerRetrieve the workflow for a given issue.- Specified by:
getWorkflowin interfaceWorkflowManager- Parameters:
issue- the Issue- Returns:
- the workflow for the given issue.
- Throws:
WorkflowException- RuntimeException wrapper for any errors.
-
getWorkflow
Description copied from interface:WorkflowManagerRetrieve the workflow for a given project - issue type pair.- Specified by:
getWorkflowin interfaceWorkflowManager- Parameters:
projectId- the ProjectissueTypeId- the IssueType ID- Returns:
- the workflow for the given project - issue type pair.
- Throws:
WorkflowException- RuntimeException wrapper for any errors.
-
getWorkflowFromScheme
public JiraWorkflow getWorkflowFromScheme(org.ofbiz.core.entity.GenericValue scheme, String issueTypeId) Description copied from interface:WorkflowManagerReturn the workflow in a particular scheme for a given issue type.- Specified by:
getWorkflowFromSchemein interfaceWorkflowManager- Parameters:
scheme- the SchemeissueTypeId- the IssueType ID- Returns:
- the workflow for the issue type in the scheme.
-
getWorkflowFromScheme
Description copied from interface:WorkflowManagerReturn the workflow in a particular scheme for a given issue type.- Specified by:
getWorkflowFromSchemein interfaceWorkflowManager- Parameters:
scheme- the SchemeissueTypeId- the IssueType ID- Returns:
- the workflow for the issue type in the scheme.
-
getWorkflowsFromScheme
public Collection<JiraWorkflow> getWorkflowsFromScheme(org.ofbiz.core.entity.GenericValue scheme) throws WorkflowException Description copied from interface:WorkflowManagerReturns all workflows for a given scheme.- Specified by:
getWorkflowsFromSchemein interfaceWorkflowManager- Parameters:
scheme- the Workflow Scheme.- Returns:
- Collection of workflow schemes, empty collection if none exists.
- Throws:
WorkflowException- RuntimeException wrapper for any errors.
-
getWorkflowsFromScheme
public Iterable<JiraWorkflow> getWorkflowsFromScheme(Scheme workflowScheme) throws WorkflowException Description copied from interface:WorkflowManagerReturns all workflows for a given scheme.- Specified by:
getWorkflowsFromSchemein interfaceWorkflowManager- Parameters:
workflowScheme- the Workflow Scheme.- Returns:
- Collection of workflow schemes, empty collection if none exists.
- Throws:
WorkflowException- RuntimeException wrapper for any errors.
-
copyAndDeleteDraftWorkflows
Description copied from interface:WorkflowManagerProvided a set of workflows, this method will check, if the passed in inactive workflows have any drafts linked to them. If they do, it will copy the draft into a new inactive workflow, and then delete the draft.- Specified by:
copyAndDeleteDraftWorkflowsin interfaceWorkflowManager- Parameters:
user- The user performing the operationworkflows- A set of parentJiraWorkflows
-
copyAndDeleteDraftsForInactiveWorkflowsIn
public void copyAndDeleteDraftsForInactiveWorkflowsIn(ApplicationUser user, Iterable<JiraWorkflow> workflows) Description copied from interface:WorkflowManagerProvided a set of workflows, this method will check, if the passed in inactive workflows have any drafts linked to them. If they do, it will copy the draft into a new inactive workflow, and then delete the draft.This method is only meant to be used internally in JIRA. External developers should not call this method directly.
- Specified by:
copyAndDeleteDraftsForInactiveWorkflowsInin interfaceWorkflowManager- Parameters:
user- The user performing the operationworkflows- A set of parentJiraWorkflows
-
getNextStatusIdForAction
Description copied from interface:WorkflowManagerGiven an issue and the identifier of a workflow action, returns the next status id for the issue if the action gets executed.- Specified by:
getNextStatusIdForActionin interfaceWorkflowManager- Parameters:
issue- The issueactionId- The identifier of a workflow action- Returns:
- The status id corresponding to the next status of the issue if the action got executed
-
getNextStatusIdForAction
@Nonnull public String getNextStatusIdForAction(@Nonnull Issue issue, @Nonnull JiraWorkflow workflow, @Nonnull com.opensymphony.workflow.loader.ActionDescriptor actionDescriptor) -
getInitialStatusIdForIssue
Description copied from interface:WorkflowManagerReturns the initial status for the workflow the given issue belongs to.- Specified by:
getInitialStatusIdForIssuein interfaceWorkflowManager- Parameters:
issue- the issue in workflow for which the initial status should be returned- Returns:
- initial status id in the workflow
-
getActionDescriptor
@Nonnull public com.opensymphony.workflow.loader.ActionDescriptor getActionDescriptor(@Nonnull Issue issue, int actionId) Description copied from interface:WorkflowManagerGiven an issue and the identifier if a workflow action, returns the ActionDescriptor associated.- Specified by:
getActionDescriptorin interfaceWorkflowManager- Parameters:
issue- The issue.actionId- The identifier of a workflow action.- Returns:
- The ActionDescriptor corresponding to the workflow action id for the given issue.
-
createWorkflow
- Specified by:
createWorkflowin interfaceWorkflowManager- Throws:
WorkflowException
-
createWorkflow
- Specified by:
createWorkflowin interfaceWorkflowManager- Throws:
WorkflowException
-
saveWorkflowWithoutAudit
Description copied from interface:WorkflowManagerThis method will save the workflow and it will not affect the updatedDate and updatedAuthorName meta attributes of the workflow. This should only ever be invoked by system operations such as upgrade tasks. All other saves should use the methodWorkflowManager.updateWorkflow(String, JiraWorkflow)- Specified by:
saveWorkflowWithoutAuditin interfaceWorkflowManager- Parameters:
workflow- the workflow to save.- Throws:
WorkflowException- RuntimeException wrapper for any errors.
-
getWorkflowSchemeManager
-
deleteWorkflow
- Specified by:
deleteWorkflowin interfaceWorkflowManager- Throws:
WorkflowException
-
getWorkflow
Description copied from interface:WorkflowManagerRetrieve the workflow for a given issue.- Specified by:
getWorkflowin interfaceWorkflowManager- Parameters:
issue- the Issue- Returns:
- the workflow for the given issue.
- Throws:
WorkflowException- RuntimeException wrapper for any errors.
-
migrateIssueToWorkflow
public void migrateIssueToWorkflow(org.ofbiz.core.entity.GenericValue issue, JiraWorkflow newWorkflow, org.ofbiz.core.entity.GenericValue newStatus) throws WorkflowException Description copied from interface:WorkflowManagerMigrates given issue to new workflow and sets new status on it.- Specified by:
migrateIssueToWorkflowin interfaceWorkflowManager- Parameters:
issue- issue to migratenewWorkflow- new workflownewStatus- new status- Throws:
WorkflowException- if migration fails
-
migrateIssueToWorkflowNoReindex
public boolean migrateIssueToWorkflowNoReindex(org.ofbiz.core.entity.GenericValue issue, JiraWorkflow newWorkflow, org.ofbiz.core.entity.GenericValue newStatus) throws WorkflowException Description copied from interface:WorkflowManagerMigrates given issue to new workflow and sets new status on it. It returns true iff the issue that was migrated needs a reindex. The passed issue is not reindexed even if necessary.- Specified by:
migrateIssueToWorkflowNoReindexin interfaceWorkflowManager- Parameters:
issue- issue to migratenewWorkflow- new workflownewStatus- new status- Returns:
- true if the issue
- Throws:
WorkflowException- if migration fails
-
overwriteActiveWorkflow
Description copied from interface:WorkflowManagerSaves the draft workflow into the active workflow.- Specified by:
overwriteActiveWorkflowin interfaceWorkflowManager- Parameters:
username- User will be added to the workflows Audit trailworkflowName- The workflow to be overwritten
-
overwriteActiveWorkflow
Description copied from interface:WorkflowManagerSaves the draft workflow into the active workflow.- Specified by:
overwriteActiveWorkflowin interfaceWorkflowManager- Parameters:
user- User will be added to the workflows Audit trailworkflowName- The workflow to be overwritten
-
updateIssueStatusAndUpdatedDate
protected boolean updateIssueStatusAndUpdatedDate(org.ofbiz.core.entity.GenericValue issue, org.ofbiz.core.entity.GenericValue newStatus) -
updateWorkflow
Description copied from interface:WorkflowManagerSaves the given JiraWorkflow, which may be either a "live" or "draft" version. This method does not save the changes to the active workflow. Instead, this is meant to be used to make persistent changes to your working edit. Once all changes have been made you can over write the active workflow by callingWorkflowManager.overwriteActiveWorkflow(String, String)- Specified by:
updateWorkflowin interfaceWorkflowManager- Parameters:
username- User making the request.workflow- The JiraWorkflow to save.
-
updateWorkflow
Description copied from interface:WorkflowManagerSaves the given JiraWorkflow, which may be either a "live" or "draft" version. This method does not save the changes to the active workflow. Instead, this is meant to be used to make persistent changes to your working edit. Once all changes have been made you can over write the active workflow by callingWorkflowManager.overwriteActiveWorkflow(ApplicationUser, String)- Specified by:
updateWorkflowin interfaceWorkflowManager- Parameters:
user- User making the request.workflow- The JiraWorkflow to save.
-
copyWorkflow
public JiraWorkflow copyWorkflow(String username, String clonedWorkflowName, String clonedWorkflowDescription, JiraWorkflow workflowToClone) Description copied from interface:WorkflowManagerClones a workflow by creating a deep copy of the workflow provided.- Specified by:
copyWorkflowin interfaceWorkflowManager- Parameters:
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.- Returns:
- A cloned copy of the original workflow.
-
copyWorkflow
public JiraWorkflow copyWorkflow(ApplicationUser user, String clonedWorkflowName, String clonedWorkflowDescription, JiraWorkflow workflowToClone) Description copied from interface:WorkflowManagerClones a workflow by creating a deep copy of the workflow provided.- Specified by:
copyWorkflowin interfaceWorkflowManager- Parameters:
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.- Returns:
- A cloned copy of the original workflow.
-
updateWorkflowNameAndDescription
public void updateWorkflowNameAndDescription(String username, JiraWorkflow currentWorkflow, String newName, String newDescription) Description copied from interface:WorkflowManagerUsed to change the name and description of an existing worfklow with the given name.- Specified by:
updateWorkflowNameAndDescriptionin interfaceWorkflowManager- Parameters:
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 workflow
-
updateWorkflowNameAndDescription
public void updateWorkflowNameAndDescription(ApplicationUser user, JiraWorkflow currentWorkflow, String newName, String newDescription) Description copied from interface:WorkflowManagerUsed to change the name and description of an existing worfklow with the given name.- Specified by:
updateWorkflowNameAndDescriptionin interfaceWorkflowManager- Parameters:
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 workflow
-
getDefaultWorkflow
- Specified by:
getDefaultWorkflowin interfaceWorkflowManager- Throws:
WorkflowException
-
createIssue
public org.ofbiz.core.entity.GenericValue createIssue(String remoteUserName, Map<String, Object> fields) throws WorkflowExceptionDescription copied from interface:WorkflowManagerCreate an issue in the database.- Specified by:
createIssuein interfaceWorkflowManager- Parameters:
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 containsMutableIssueobject (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.- Returns:
- The created issue GenericValue
- Throws:
WorkflowException- If any errors occur while trying to create the issue.
-
removeWorkflowEntries
public void removeWorkflowEntries(org.ofbiz.core.entity.GenericValue issue) - Specified by:
removeWorkflowEntriesin interfaceWorkflowManager
-
doWorkflowAction
- Specified by:
doWorkflowActionin interfaceWorkflowManager
-
getStore
public com.opensymphony.workflow.spi.WorkflowStore getStore() throws com.opensymphony.workflow.StoreExceptionThis is used for unit testing so we can return our own 'mock store' instead of the static StoreFactory.getPersistence(ctx);Also used in the migrateIssueToWorkflow method.
- Specified by:
getStorein interfaceWorkflowManager- Throws:
com.opensymphony.workflow.StoreException
-
getActionDescriptor
public com.opensymphony.workflow.loader.ActionDescriptor getActionDescriptor(WorkflowProgressAware workflowProgressAware) throws Exception - Specified by:
getActionDescriptorin interfaceWorkflowManager- Throws:
Exception
-
migrateIssueToWorkflow
public void migrateIssueToWorkflow(MutableIssue issue, JiraWorkflow newWorkflow, Status status) throws WorkflowException Migrates given issue to new workflow and sets new status on it.- Specified by:
migrateIssueToWorkflowin interfaceWorkflowManager- Parameters:
issue- issue to migratenewWorkflow- new workflowstatus- new status- Throws:
WorkflowException- if migration fails
-
makeWorkflow
Description copied from interface:WorkflowManagerPreparesWorkflowobject with given username as caller- Specified by:
makeWorkflowin interfaceWorkflowManager- Parameters:
userName- caller username- Returns:
- created
Workflow
-
makeWorkflowWithUserName
- Specified by:
makeWorkflowWithUserNamein interfaceWorkflowManager
-
makeWorkflowWithUserKey
- Specified by:
makeWorkflowWithUserKeyin interfaceWorkflowManager
-
makeWorkflow
Description copied from interface:WorkflowManagerPreparesWorkflowobject with given user as caller- Specified by:
makeWorkflowin interfaceWorkflowManager- Parameters:
user- caller- Returns:
- created
Workflow
-
isEditable
- Specified by:
isEditablein interfaceWorkflowManager
-
isEditable
Description copied from interface:WorkflowManagerChecks if the issue will be editable in workflow step with given id.- Specified by:
isEditablein interfaceWorkflowManager- Parameters:
issue- the issue which is affected by the workflow actionnextStatusId- the workflow status that the issue will be in after transition- Returns:
- a boolean value which indicates if the issue will be editable in step with given id
-
getConfiguration
protected com.opensymphony.workflow.config.Configuration getConfiguration() -
getPostFunctionsForWorkflow
public Map<com.opensymphony.workflow.loader.ActionDescriptor,Collection<com.opensymphony.workflow.loader.FunctionDescriptor>> getPostFunctionsForWorkflow(JiraWorkflow workflow) Description copied from interface:WorkflowManagerRetrieve a map: actions -> post functions for a workflow.- Specified by:
getPostFunctionsForWorkflowin interfaceWorkflowManager- Parameters:
workflow- The Workflow- Returns:
- Map of actions-> post functions
-
getStepId
Description copied from interface:WorkflowManagerGets the first stepId for the given action and workflow name.- Specified by:
getStepIdin interfaceWorkflowManager- Parameters:
actionDescriptorId- id of the ActionDescriptorworkflowName- name of the JiraWorkflow- Returns:
- the first stepId for the given action and workflow name.
-
replaceConditionInTransition
public void replaceConditionInTransition(com.opensymphony.workflow.loader.ActionDescriptor transition, Map<String, String> matchMap, Map<String, String> newMap) Description copied from interface:WorkflowManagerChanges the parameter map of all conditions that have the parameter map matching matchMap by adding all properties from newMap.- Specified by:
replaceConditionInTransitionin interfaceWorkflowManager- Parameters:
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 map
-