private ImmutableList<ChangedValue> computeChangedValues(final JiraWorkflow originalWorkflow, final JiraWorkflow currentWorkflow) { final ChangedValuesBuilder changedValues = new ChangedValuesBuilder(); changedValues.addIfDifferent("common.words.name", originalWorkflow == null ? null : originalWorkflow.getDisplayName(), currentWorkflow.getDisplayName()) .addIfDifferent("common.words.description", originalWorkflow == null ? null : originalWorkflow.getDescription(), currentWorkflow.getDescription()); return changedValues.build(); } }
public String doDefault() throws Exception { newWorkflowName = workflowCopyNameFactory.createFrom(getWorkflow().getName(), getLocale()); if (TextUtils.stringSet(getWorkflow().getDescription())) { setDescription(getWorkflow().getDescription()); } return super.doDefault(); }
public String doDefault() throws Exception { if (workflow.isEditable()) { newWorkflowName = workflow.getName(); description = workflow.getDescription(); return INPUT; } else { addErrorMessage(getText("admin.errors.workflow.cannot.be.edited.as.it.is.not.editable")); } return ERROR; }
@Override public void copyAndDeleteDraftsForInactiveWorkflowsIn(ApplicationUser user, Iterable<JiraWorkflow> workflows) { if (workflows == null || isEmpty(workflows)) { return; } for (final JiraWorkflow workflow : workflows) { final String parentWorkflowName = workflow.getName(); final JiraWorkflow draftWorkflow = getDraftWorkflow(parentWorkflowName); //We should only create a copy and delete the draft, if the parentworkflow //is not active, and the draft actually exists. For a workflow that's still //active, we want to keep the draft around. if (!workflow.isActive() && draftWorkflow != null) { String username = user == null ? null : user.getName(); StringBuilder builder = new StringBuilder(); final String parentDescription = stripToNull(draftWorkflow.getDescription()); if (parentDescription != null) { builder.append(parentDescription).append(" "); } builder.append(getI18nBean(user).getText("admin.workflows.manager.draft.auto.generated", parentWorkflowName)); copyWorkflow(username, getClonedWorkflowName(parentWorkflowName, user), builder.toString(), draftWorkflow); deleteDraftWorkflow(parentWorkflowName); } } }
private WorkflowBean jiraWorkflowToWorkflowBean(JiraWorkflow jiraWorkflow) { String name = jiraWorkflow.getName(); String description = jiraWorkflow.getDescription(); int steps = jiraWorkflow.getDescriptor().getSteps().size(); boolean isDefault = jiraWorkflow.isDefault(); String updateDate = jiraWorkflow.getUpdatedDate() != null ? dateTimeFormatter.forLoggedInUser().format(jiraWorkflow.getUpdatedDate()) : null; ApplicationUser updateAuthor = jiraWorkflow.getUpdateAuthor(); String updateAuthorName = userManager.isUserExisting(updateAuthor)?updateAuthor.getDisplayName():null; return new WorkflowBean(name, description, updateDate, updateAuthorName, steps, isDefault); } }
if (newDescription != null && !newDescription.equals(workflow.getDescription()))