Situation : I am developing a spring mvc web flow app , in that i have two tables customer
and customerAdress
and two corresponding models : customerModel
and customerAdressModel
, now following is my flow.xml :
<var name="customer" class="com.model.Customer"/>
<var name="customerAdress" class="com.model.CustomerAdress"/>
<var name="id">
<view-state id="customer" view="customerView.jsp" model="customer">
<transition on="next" to="customerAdress"/>
</view-state>
<view-state id="customerAdress" view="customerAdressView.jsp" model="customerAdress">
<transition on="next" to="insertCustomer"/>
</view-state>
<action-state id="insertCustomer">
<evaluate expression="Buisness.insertCustomer(customer)"/>
<evaluate expression="Buisness.fetchCustomerId(customer)" result="id"/>
<evaluate expression="Buisness.insertCustomerAdress(id,cutomerAdress)"/>
</action-state>
Now insertCustomer
inserts customer , fetchCustomerId
fetches customer's id and insertCusotomerAdress
inserts adresses of customer by id
Problem : My problem is this code is not working , specifically insertCustomerAdress
is not working , i think i have done some mistake in decalring id
or assigning buisness service's value to id
, can somebody please tell me proper syntax ?
By default action state executes only first action. To execute a chain of actions use Named actions.