Results 1 to 5 of 5

Thread: going back a state

  1. #1
    Join Date
    Jan 2007
    Posts
    155

    Default going back a state

    Hi, I have the following flow:

    State 1--->State 2
    | |
    ----<--------
    (back)

    But when i take the back transition i have an error.

    The question is :
    Can i make my flows go backward or always forward?
    The back event is trigger by
    <a href = "flowController.html?_flowExecutionKey = ${flowExecutionKey}&_eventId=backr">Back</a>

    What is the problem?

    Thanks!!

    Code:
    <start-state idref="listarUnidades" />
    
      <view-state id="listarUnidades" view="seleccionarUnidad">
    	    <render-actions>
    				<bean-action bean="unidadFacade" method="findUnidadesAdministrativas">
    					<method-result name="unidades"/>
    				</bean-action>
    		    </render-actions>
    			<transition on="select" to="listarExpedientes">
    				<set attribute="idUnidad" scope="flow" value="${requestParameters.idUnidad}"/>
    			</transition>
    		</view-state>
    		
    		<view-state id="listarExpedientes" view="listarExpedientes">
    			<render-actions>
    				<bean-action bean="expedienteFacade" method="findExpedientesByUnidad">
    					<method-arguments>
    						<argument expression = "${flowScope.idUnidad}" parameter-type="long"/>
    					</method-arguments>
    					<method-result name="expedientes"/>
    				</bean-action>
    			</render-actions>
    			<transition on="select" to="verExpediente"/>
    			<transition on="back" to="listarUnidades"/>
    		</view-state>
    And get the error when taking the back transition:
    Code:
    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.executor.support.FlowExecutorArgumentExtractionException: Unable to extract the flow definition id parameter: make sure the client provides the '_flowId' parameter as input or set the 'defaultFlowId' property; the parameters provided in this request are: map['_flowExecutionKey ' -> ' _cC3592784-3986-BA51-1DAE-21C871F31FEF_kE192128A-9D46-E2C6-1B86-07EB72B912A1', '_eventId' -> 'volver']
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:411)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:354)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    
    causa raíz
    
    org.springframework.webflow.executor.support.FlowExecutorArgumentExtractionException: Unable to extract the flow definition id parameter: make sure the client provides the '_flowId' parameter as input or set the 'defaultFlowId' property; the parameters provided in this request are: map['_flowExecutionKey ' -> ' _cC3592784-3986-BA51-1DAE-21C871F31FEF_kE192128A-9D46-E2C6-1B86-07EB72B912A1', '_eventId' -> 'volver']
    	org.springframework.webflow.executor.support.RequestParameterFlowExecutorArgumentHandler.extractFlowId(RequestParameterFlowExecutorArgumentHandler.java:81)
    	org.springframework.webflow.executor.support.FlowRequestHandler.handleFlowRequest(FlowRequestHandler.java:130)
    	org.springframework.webflow.executor.mvc.FlowController.handleRequestInternal(FlowController.java:172)
    	org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
    	org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:819)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:754)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:399)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:354)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  2. #2
    Join Date
    Jan 2007
    Posts
    155

    Default

    I make it work adding the _flowId parameter in the link
    <a href = "flowController.html?_flowExecutionKey = ${flowExecutionKey}&_eventId=back"&_flowId=selecci onarUnidad-flow>Back</a>

    But i don't understand it is necessary here and why it is not necessary if the transition is to a forward state.

    By!

  3. #3
    Join Date
    Jan 2007
    Posts
    155

    Thumbs down _flowId again

    Hi, i come with the problem again:
    When the transition is to ingresar, it works ok, but from then ,
    it has the same error asking for the _flowId.

    What is the problem? The flow is the same, i'm not leaving it.
    Do i miss something???

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <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-1.0.xsd">
    
    	<start-state idref="listarUnidades" />
    
    	<view-state id="listarUnidades" view="listarUnidades">
    		<render-actions>
    			<bean-action bean = "unidadFacade" method = "findUnidadesAdministrativas">
    				<method-result name = "unidades"/>
    			</bean-action>
    		</render-actions>
    		<transition on = "select" to = "ingreso">
    			<set attribute = "idUnidad" scope = "flow" value = "${requestParameters.idUnidad}"/>
    		</transition>
    	</view-state>
    			
    	<view-state id="ingreso" view="ingreso">
    	 	<transition on = "entrada"  to = "listarExpedientesEnUnidad" />
    		<transition on = "recibir"  to = "listarExpedientesARecibir" />
    		<transition on = "cancelar" to = "listarExpedientesACancelar" />
    	</view-state>
    	
    	<subflow-state id = "listarExpedientesEnUnidad" flow = "listarExpedientesEnUnidad-flow">
    		<attribute-mapper>
    			<input-mapper>
    				<mapping source = "${requestParameters.idUnidad}" target = "idUnidad" from = "string" to = "long"/> 
    			</input-mapper>
    		</attribute-mapper>
    		<transition on = "finish" to = "ingreso"/>
    	</subflow-state>
    		
    </flow>

  4. #4
    Join Date
    Jan 2007
    Posts
    155

    Default _flowId solved, white space

    The problem was the jps link:

    <a href = "flowController.html?_flowExecutionKey = ${flowExecutionKey}&_eventId = volver">Unidades administrativas</a>

    the correct form is without the spaces:

    <a href = "flowController.html?_flowExecutionKey=${flowExecu tionKey}&_eventId=volver">Unidades administrativas</a>

  5. #5
    Join Date
    Jul 2007
    Location
    Mauritius
    Posts
    128

    Default listener

    Hello there,

    even though what you are doing is good. I suggest you find a way to store get the previousStateId, by storing it in the flowscope. You can use the listeners to that. If you get bigger flows I think this would be better. I would appreciate an opinion from the senior members on this if possible.

    regards
    Kris

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •