Announcement Announcement Module
Collapse
No announcement yet.
simple confirmation page before save Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • simple confirmation page before save

    Hi All,

    I have a simple flow to render just wondering what is the correct approach.
    I have a customer form to update. When i click save (before the actual save process) I need to ask the user input for confirmation with list of things that will be affected by this changes on page. This page has a form with YES or NO and changes displayed in text.

    I am thinking i should be using subflow for this.

    couple of things

    1)Is sub flow the approach as it seems a bit complicated for simple YES /NO form submit

    2)If subflow is the approach how to pass the customer reference to the subflow and pass the error back so that it will be displayed in the view in main flow

    I have managed to get the subflow to be called from the mainflow.
    But i am unable to have the customer reference in the subflow
    and i am getting the error
    Code:
    org.springframework.webflow.engine.NoMatchingTransitionException: No transition was matched on the event(s) signaled by the [1] action(s) that executed in this action state 'saveEdit' of flow 'editProfileComplete'; transitions must be defined to handle action result outcomes -- possible flow configuration error? Note: the eventIds signaled were: 'array<String>['no']', while the supported set of transitional criteria for this action state is 'array<TransitionCriteria>[success, error]'
    	at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:132)
    	at org.springframework.webflow.engine.State.enter(State.java:194)
    Below i have copied the bits in my flow xml file

    Code:
    <view-state id="profileCard" view="editProfileCard" model="customer">
    		<transition on="saveProfileCard" to="saveProfileCardConfirmSubflow" validate="true">
    			<evaluate expression="customer.customizeUiValuesForDB()"/>
    			<evaluate expression="customerAction.checkEmail(customer, messageContext)" />
    		</transition>
    		<transition on="saveProfileCardOnTab" to="saveProfileCardConfirmOnTabSubflow" validate="true">
    			<evaluate expression="customer.customizeUiValuesForDB()"/>
    			<evaluate expression="customerAction.checkEmail(customer, messageContext)" />
    		</transition>
    		<transition on="cancel" to="cancel" validate="false"/>
    		<transition on="profileSecurity" to="profileSecurity" validate="false"/>
    </view-state>
    <subflow-state id="saveProfileCardConfirmSubflow" subflow="editProfileComplete">
    		<input name="customer" value="flowScope.customer"/>
    		<transition on="editComplete" to="close"/>
        	<transition on="editError" to="profileCard"/>
        	<transition on="editCancel" to="profileCard"/>
    </subflow-state>
    	
    <subflow-state id="saveProfileCardConfirmOnTabSubflow" subflow="editProfileComplete">
        	<transition on="editComplete" to="profileSecurity"/>
        	<transition on="editError" to="profileCard"/>
        	<transition on="editCancel" to="profileCard"/>
    </subflow-state>
    and the sub flow i have
    Code:
    <view-state id="editProfileComplete" view="editProfileCompleted">
    		<transition on="saveProfileCardConfirm" to="saveEdit"></transition>
        	<transition on="saveProfileCardConfirmCancel" to="editCancel"/>
    	</view-state>
    	    
        <action-state id="saveEdit">
        	<evaluate expression="customerAction.editProfile(flowScope.customer,messageContext)"/>
        	<transition on="success" to="editComplete"/>
        	<transition on="error" to="editError"/>
        </action-state>
        
        <end-state id="editComplete" />
        
        <end-state id="editError" />
        
        <end-state id="editCancel" />
    Thanks
    Thomas

  • #2
    Hi All

    I was over complicating by using a sub flow where i could have achieved the same within the current flow..

    I just had to pass to another view state instead of a sub flow

    Code:
    <view-state id="profileCard" view="editProfileCard" model="customer">
    		<transition on="saveProfileCard" to="editProfileComplete" validate="true">
    			<evaluate expression="customer.customizeUiValuesForDB()"/>
    			<evaluate expression="customerAction.checkEmail(customer, messageContext)" />
    		</transition>
    		<transition on="saveProfileCardOnTab" to="editProfileCompleteTab" validate="true">
    			<evaluate expression="customer.customizeUiValuesForDB()"/>
    			<evaluate expression="customerAction.checkEmail(customer, messageContext)" />
    		</transition>
    		<transition on="cancel" to="cancel" validate="false"/>
    		<transition on="profileSecurity" to="profileSecurity" validate="false"/>
    	</view-state>
    	
    	
    	<view-state id="editProfileComplete" view="editProfileCompleted">
    		<transition on="saveProfileCardConfirm" to="saveEdit"></transition>
        	<transition on="saveProfileCardConfirmCancel" to="profileCard"/>
    	</view-state>
        <action-state id="saveEdit">
        	<evaluate expression="customerAction.editProfile(flowScope.customer,messageContext)"/>
        	<transition on="yes" to="close"/>
        	<transition on="no" to="profileCard"/>
        </action-state>
        
        <view-state id="editProfileCompleteTab" view="editProfileCompleted">
    		<transition on="saveProfileCardConfirm" to="saveEditTab"></transition>
        	<transition on="saveProfileCardConfirmCancel" to="profileCard"/>
    	</view-state>
        <action-state id="saveEditTab">
        	<evaluate expression="customerAction.editProfile(flowScope.customer,messageContext)"/>
        	<transition on="yes" to="profileSecurity"/>
        	<transition on="no" to="profileCard"/>
        </action-state>
    	
    	<view-state id="profileSecurity" view="editProfileSecurity" model="manageSecurity">
    		<transition on="saveProfileSecurity" to="close" validate="true">
    	        <evaluate expression="customerAction.updatePassword(manageSecurity,messageContext)"/>
    		</transition>
    		<transition on="saveProfileSecurityOnTab" to="profileCard" validate="true">
    	        <evaluate expression="customerAction.updatePassword(manageSecurity,messageContext)"/>
    		</transition>
    		<transition on="cancel" to="cancel" validate="false"/>
    		<transition on="profileCard" to="profileCard" validate="false"/>
    	</view-state>
    
    
    	<end-state id="cancel" view="redirect:/home.do"/>
    	<end-state id="close" view="redirect:/home.do"/>

    one thing that might help me is as u can see transition saveProfileCard and saveProfileCardTab is doing exactly the same thing the only difference being on "yes" on action state they render different view . Is there a better approach to handle that in the flow.

    Thanks
    Thomas

    Comment

    Working...
    X