public Collection<JiraWorkflow> getWorkflowsFromScheme(GenericValue scheme) throws WorkflowException { if (scheme != null) { // now, check if we have a workflow configured for this issue type try { Collection<GenericValue> schemeEntities = getWorkflowSchemeManager().getEntities(scheme); if (schemeEntities != null) { List<JiraWorkflow> result = new ArrayList<JiraWorkflow>(schemeEntities.size()); for (GenericValue schemeEntity : schemeEntities) { result.add(getWorkflow(schemeEntity.getString("workflow"))); } return result; } } catch (GenericEntityException e) { throw new WorkflowException(e); } } // Always return the default if nothing else is found return CollectionBuilder.newBuilder(getWorkflow(JiraWorkflow.DEFAULT_WORKFLOW_NAME)).asMutableList(); }
schemeEntites = ComponentAccessor.getComponentOfType(WorkflowSchemeManager.class).getEntities(schemeGV);
for (GenericValue workflowScheme : workflowSchemes) Collection<GenericValue> entities = workflowSchemeManager.getEntities(workflowScheme); for (GenericValue entity : entities)