@Override public RestrictionDescriptor apply(final ActionDescriptor input) { return input.getRestriction(); } }).getOrNull();
private Map<String, Map<String, String>> updateConditionsCustomFieldIds(ActionDescriptor action, Map<String, String> oldToNewIdMapping) { Map<String,Map<String, String>> result = new HashMap<String, Map<String, String>>(); if(null != action.getRestriction()) { ConditionsDescriptor rootConditions = action.getRestriction().getConditionsDescriptor(); if(null != rootConditions) { updateConditionsCustomFieldIds(rootConditions, oldToNewIdMapping, result); } } return result; }
private Map<String,Set<String>> removeConditionsWithClassnames(ActionDescriptor action, Set<String> classesToRemove) { Map<String,Set<String>> result = new HashMap<String, Set<String>>(); if(null != action.getRestriction()) { ConditionsDescriptor rootConditions = action.getRestriction().getConditionsDescriptor(); if(null != rootConditions) { removeConditionWithClassnames(rootConditions,classesToRemove,result); } } return result; }
protected boolean upgradeWorkflow(JiraWorkflow workflow, boolean isSystemWorkflow) { boolean updated = false; for (Iterator actions = workflow.getAllActions().iterator(); actions.hasNext();) { ActionDescriptor action = (ActionDescriptor) actions.next(); RestrictionDescriptor restrictionDescriptor = action.getRestriction(); if (restrictionDescriptor != null && restrictionDescriptor.getConditionsDescriptor() != null) { updated = upgradeConditions(action.getRestriction().getConditionsDescriptor(), action, workflow, isSystemWorkflow) || updated; } } return updated; }
private RestrictionDescriptor getOrCreateRestriction(ActionDescriptor transition) { RestrictionDescriptor restriction = transition.getRestriction(); if (restriction == null) { restriction = new RestrictionDescriptor(); transition.setRestriction(restriction); } return restriction; }
@Override public void replaceConditionInTransition(ActionDescriptor transition, Map<String, String> matchMap, Map<String, String> newMap) { ConditionsDescriptor conditionsDescriptor = transition.getRestriction().getConditionsDescriptor(); if (conditionsDescriptor == null) { return; } replaceConditionInConditionsDescriptor(conditionsDescriptor, matchMap, newMap); }
private Set<String> getExtensionClassnames(JiraWorkflow workflow) { Set<String> uniqueClassnames = new HashSet<String>(); Collection<ActionDescriptor> allActions = workflow.getAllActions(); for (ActionDescriptor action : allActions) { uniqueClassnames.addAll(workflowScreensHelper.getClassnamesForScreenFromAction(action)); uniqueClassnames.addAll(getFunctionClassnames(action)); uniqueClassnames.addAll(getValidatorClassnames(action)); if(null != action.getRestriction()) { uniqueClassnames.addAll(getConditionClassnames(action.getRestriction().getConditionsDescriptor())); } } return uniqueClassnames; }
protected void checkDescriptor() { final RestrictionDescriptor restriction = getTransition().getRestriction(); if (restriction == null) { addErrorMessage(getText("admin.errors.workflows.cannot.delete.condition")); } }
public void changeLogicOperator(ActionDescriptor transition, String count) { RestrictionDescriptor restriction = transition.getRestriction(); if (restriction != null) { ConditionsDescriptor conditionsDescriptor = getParentConditionsDescriptor(restriction, count); if (OPERATOR_AND.equals(conditionsDescriptor.getType())) { conditionsDescriptor.setType(OPERATOR_OR); } else { conditionsDescriptor.setType(OPERATOR_AND); } } } }
private ConditionsDescriptor getConditionsDescriptor() { RestrictionDescriptor restriction = getTransition().getRestriction(); if (restriction != null) { WorkflowEditorTransitionConditionUtil wetcu = new WorkflowEditorTransitionConditionUtil(); return wetcu.getParentConditionsDescriptor(restriction, getCount()); } else { return null; } }
@Override public MultiMap getAssociatedWorkflows(ProjectRole projectRole, ErrorCollection errorCollection) { Collection<JiraWorkflow> workflows = workflowManager.getWorkflows(); MultiMap associatedWorkflows = new MultiHashMap(workflows.size()); for (JiraWorkflow jiraWorkflow : workflows) { Collection<ActionDescriptor> actions = jiraWorkflow.getAllActions(); for (ActionDescriptor actionDescriptor : actions) { RestrictionDescriptor restriction = actionDescriptor.getRestriction(); if (restriction != null) { ConditionsDescriptor conditionsDescriptor = restriction.getConditionsDescriptor(); if (conditionsDescriptorContainsProjectRoleCondition(conditionsDescriptor, projectRole.getId())) { associatedWorkflows.put(jiraWorkflow, actionDescriptor); // workflow matches, don't need to check the conditions on any more actions } } } } return associatedWorkflows; }
public void deleteCondition(ActionDescriptor transition, String count) RestrictionDescriptor restriction = transition.getRestriction(); if (restriction != null)
protected void setupWorkflowDescriptor() RestrictionDescriptor restriction = getTransition().getRestriction(); if (restriction != null)