Hi everybody,
I am trying to use a WebFlow inside a Roo project.
I ran the command
and then I wrote the flowCode:web flow -flowName flow
The problem is that I cannot persist the entity on the end-state. I get an exception.Code:<flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> <!-- <persistence-context /> --> <on-start> <evaluate expression="new org.freepoll.web.flows.questions.create.QuestionFlowManager()" result="flowScope.flowManager" /> <evaluate expression="flowManager.buildQuestion()" result="flowScope.question" /> </on-start> <!-- create the question --> <view-state id="create-question" view="create/create-question" model="question"> <transition to="create-option" on="createoption"></transition> <transition to="cancelled" on="cancel"></transition> <transition to="confirmed" on="confirm" /> </view-state> <!-- create an option --> <view-state id="create-option" view="create/create-option" model="option"> <on-entry> <evaluate expression="flowManager.buildOption(question)" result="viewScope.option" /> </on-entry> <transition to="cancelled" on="cancel"></transition> <transition to="create-question" on="optioncancel"></transition> <transition to="create-question" on="optionconfirm"> <evaluate expression="question.addOption(option)"></evaluate> </transition> <transition to="confirmed" on="confirm"> <evaluate expression="flowManager.addOption(question, option)"></evaluate> </transition> </view-state> <!-- exit without saving --> <end-state id="cancelled" view="create/cancelled" /> <!-- save, exit and return the id of the newly created question --> <end-state id="confirmed" view="create/confirmed"> <on-entry> <evaluate expression="question.persist()"></evaluate> </on-entry> </end-state> </flow>
Do I have to do something different to save entities from a webflow?
Thanks,
Stefano


Reply With Quote