/** @param relative The story, before which the new story should be placed. Optional. */ public Requirement createNewRequirement(Requirement relative, boolean before, boolean split) { Requirement item = new Requirement(this); if (split) { String theme = relative.getLabel(); List<String> themes = relative.getThemes(); if (!themes.contains(theme)) themes.add(theme); relative.setThemes(themes); relative.setDirty(true); item.setEpic(relative); item.setThemes(themes); item.setDescription(relative.getDescription()); item.setTestDescription(relative.getTestDescription()); item.setQualitys(relative.getQualitys()); } if (relative == null) { updateRequirementsOrder(); } else { List<Requirement> requirements = getProductBacklogRequirements(); requirements.remove(item); Collections.sort(requirements, getRequirementsOrderComparator()); int idx = requirements.indexOf(relative); if (!before) idx++; requirements.add(idx, item); updateRequirementsOrder(requirements); } getDao().createRequirement(item); return item; }
@Override protected void onExecute() { DateAndTime time = DateAndTime.now(); for (int i = 0; i < COUNT; i++) { final Requirement req = new Requirement(getCurrentProject()); req.setLabel("Generated Story " + time + " - #" + i); req.setDescription(longText()); req.setTestDescription(longText()); dao.createRequirement(req); } }