getConnectedUser()).setTitle(_title)
.setInsertAfter(bascene);
- _bastep = getProjectElementService().getFirstStep(bascene)
+
+ long selectedScenarioId = Long.valueOf(parse[0]);
+ Scenario selectedScenario = scene[0];
+ for(Scenario scenario : scene) {
+ if(scenario.getIndex() == selectedScenarioId) {
+ selectedScenario = scenario;
+ }
+ }
+ _bastep = getProjectElementService().getFirstStep(selectedScenario)
.getNumber();
if (this.sharesStep()) {
- step = getProjectElementService().getSteps(bascene);
+ step = getProjectElementService().getSteps(selectedScenario);
sprop.setBaseStep(step[number - _bastep]);
}
- bascene = getScenarioService().addScenario(study, sprop);
+ Scenario createdScenario = getScenarioService().addScenario(study, sprop);
// transax.commit();
// Update of the display
}
}
}
- _mystudy.setSelection(bascene.getIndex() + "." + number);
+ _mystudy.setSelection(createdScenario.getIndex() + "." + number);
getSession().remove("menu.scenario");
return SUCCESS;
} catch (RuntimeException saverror) {