Announcement Announcement Module
Collapse
No announcement yet.
Limit Execution and detect last active snapshot Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Limit Execution and detect last active snapshot

    Hello, i'm pretty new to spring framework so please do not judge me for the following question:




    i have an application called myapp i open it in a browsertab. it's url e.g http://localhost:8080/myapp?execution=e1s1

    then i click next and it changes to http://localhost:8080/myapp?execution=e1s2

    fine.. so i have the execution 1 snapshot 2. great!

    if i open a new tab calling the url http://localhost:8080/myapp again it gets a new execution. so the url looks like ?e2s1.

    my question is now, can i limit the numbers of executions to 1 for every session calling the last active snapshot when calling the link http://localhost:8080/myapp.

    here a picture describing the situation:

    Attachment

    i tried it with
    Code:
    <webflow:flow-execution-repository max-executions="1" max-execution-snapshots="30" />
    but this just limits the number, so on every restart the old execution is killed and a new one is started.

    is this possible?

    i started to override the handle method of CustomFlowHandlerAdapter
    Code:
    @Override
    	public ModelAndView handle(HttpServletRequest request,
    			HttpServletResponse response, Object handler) throws Exception {
    
    		String execution_key = "1";
    		String execution_step = ???; :confused:
    		String generated_execution = "e"+execution_key+"s"+execution_step;
    		
    		CutomHttpRequestWrapper customRequest = new CutomHttpRequestWrapper(request,generated_execution);
    		
    		return super.handle(customRequest, response, handler);
    	}
    the String execution_step should be then the latest, (if it exists) snapshotid of the (if it exists) first execution.

    is there a way to detect the last id or is this kind of idea weak.




    thanks to all of you for reading this!

    i hope somebody can help me or give me an advice for a propper solution!

    your confused kimschl
    Attached Files

  • #2
    does nobody had the same problem ever before?
    is there a way to get expected result?

    Comment


    • #3
      i solved the problem.

      i saved the current/last active executionkey in the session. so on every step/start it checked if it's the active executionid.
      then i detected the last active snapshotid from conversation with reflection.
      if there was no executionkey or the execution was ended a new one is started.

      if somebody has this problem in future, write me.

      kimschl

      Comment

      Working...
      X