* @see org.andromda.samples.animalquiz.guess.GuessController#nextDecisionItemAvailable(org.apache.struts.action.ActionMapping, org.andromda.samples.animalquiz.guess.NextDecisionItemAvailableForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
public final java.lang.String nextDecisionItemAvailable(ActionMapping mapping, org.andromda.samples.animalquiz.guess.NextDecisionItemAvailableForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
{
final GuessSessionState sessionState = this.getGuessSessionState(request);
VODecisionItem item = sessionState.getLastDecisionItem();
final Long idNextItem = "yes".equals(sessionState.getLastAnswerFromUser()) ?
item.getIdYesItem() : item.getIdNoItem();
if (idNextItem != null)
{
item = this.getDecisionService().getNextQuestion(idNextItem);
form.setQuestion(item.getPrompt());
// Keep the decision item in the session so that
// the next step can process it.
sessionState.setLastDecisionItem(item);
return "yes";