private RestrictionDescriptor getOrCreateRestriction(ActionDescriptor transition) { RestrictionDescriptor restriction = transition.getRestriction(); if (restriction == null) { restriction = new RestrictionDescriptor(); transition.setRestriction(restriction); } return restriction; }
public boolean isTransitionWithoutStepChange(ActionDescriptor transition) { return transition.getUnconditionalResult().getStep() == JiraWorkflow.ACTION_ORIGIN_STEP_ID; }
@Override public RestrictionDescriptor apply(final ActionDescriptor input) { return input.getRestriction(); } }).getOrNull();
public List getTransitionSteps() { List transitions = getWorkflow().getDescriptor().getSteps(); if(getTransition().getUnconditionalResult().getStep() == JiraWorkflow.ACTION_ORIGIN_STEP_ID) { StepDescriptor dummyStep = new DescriptorFactory().createStepDescriptor(); dummyStep.setId(JiraWorkflow.ACTION_ORIGIN_STEP_ID); dummyStep.setName(getText("admin.workflowtransitions.same.destination.step")); transitions.add(dummyStep); } return transitions; }
private static StepDescriptor getInitialStepDescriptor(JiraWorkflow workflow) { List initialActions = workflow.getDescriptor().getInitialActions(); ActionDescriptor initialAction = (ActionDescriptor) initialActions.get(0); int initialStep = initialAction.getUnconditionalResult().getStep(); return workflow.getDescriptor().getStep(initialStep); }
@Override public Long apply(final ActionDescriptor actionDescriptor) { return (long) actionDescriptor.getId(); } });
protected boolean isModulePresent(Class implementationClass) { // Check if the module is present in either the unconiditional result post functions or in global post-functions // (as they are always executed). return isModulePresent(getTransition().getUnconditionalResult().getPostFunctions(), implementationClass) || isModulePresent(getTransition().getPostFunctions(), implementationClass); }
public String getTransitionName() { return transition.getName(); }
@Override public Integer apply(final ActionDescriptor input) { final ResultDescriptor result = input.getUnconditionalResult(); return result != null && result.getPostFunctions() != null ? result.getPostFunctions().size() : 0 ; } });
@Override public Map<String, String> get() { return descriptor.getMetaAttributes(); }
@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); }
@Override public Map<String, String> get() { return descriptor.getMetaAttributes(); }
public void initDone() throws FactoryException { // let the XML workflow factory setup from workflows.xml first super.initDone(); //the workflowDescriptorStore is used to load everything else. }
@Override public void set(final Map<String, String> properties) { descriptor.setMetaAttributes(properties); } });
@Override public void set(final Map<String, String> properties) { descriptor.setMetaAttributes(properties); } });
public Collection getTransitions() { // The actions list should contain all the common and ordinary actions. // (And no global actions, which cannot be deleted from here). return step.getActions(); }
public ConditionsDescriptor getGlobalConditions() { return delegate.getGlobalConditions(); }
public SplitDescriptor getSplit(final int id) { return delegate.getSplit(id); }
private StepDescriptor getInitialStepDescriptor(JiraWorkflow workflow) { List initialActions = workflow.getDescriptor().getInitialActions(); ActionDescriptor initialAction = (ActionDescriptor) initialActions.get(0); int initialStep = initialAction.getUnconditionalResult().getStep(); return workflow.getDescriptor().getStep(initialStep); }
public int hashCode() { return (actionDescriptor != null ? actionDescriptor.getId() : 0); } }