8

Recently, I looked at spring 2.3 webflow booking-faces demo, I found it strange that a different flow execution key is assigned every time I click to "browse" hotel detail.

When I search the hotels and page to the 5th page of the search result, I get an URL with execution=e1s2. Then I click to browse a hotel detail, I get an URL with execution=e1s3. But when I click the "back to search" button, I found the page is directed to the first page of the search list with an execution=e1s4 URL, and the paging state is missed. However, browsing step is defined in the same flow definition with hotel search act and paging var is defined within flow scope.

My question is whether a new execution key parameter means a new flow execution? What's the semantics? If so, How can I configure to stick into an identical flow execution when I click "back to search" button.

Thanks

Shafin Mahmud
  • 3,831
  • 1
  • 23
  • 35
spaadecon
  • 81
  • 1
  • 3
  • I got the answer. webflow execution key is consisted of two parts: flow instance id and state id. For example, in url with "execution=e1s2", "e1" indicates flow instance execution, and "s1" indicates the state. So In the above questions, all urls means the same flow instance but different flow-stats. As for the phenomena about "back to search" resetting paging state , it's because of Primefaces lazyloading table. – spaadecon Dec 26 '11 at 17:01

1 Answers1

18

To be precise: the flow execution key (eg. "e1s2") indeed consists of two parts:

  • "e1": This part identifies the flow execution. Each time you start a new flow, a new flow execution is created. A flow execution essentially holds all state associated with the executing flow (i.e. the conversation you're having with the web application). When a flow hits an end-state, the flow execution (and all associated snapshots) will be destroyed.
  • "s2": This part identifies a snapshot within the flow execution. Webflow uses so-called continuation snapshots to be able to support the browser back and refresh buttons. On every request into a flow execution, webflow creates a new snapshot that allows you to continue from that point onward if needed, for instance when you use the browser back button.

See also: https://docs.spring.io/spring-webflow/docs/current/api/org/springframework/webflow/execution/repository/support/CompositeFlowExecutionKey.html

Keep in mind that the flow execution key is not intended to be human readable or be interpreted by other software. This is essentially an internal webflow artifact.

dbreaux
  • 4,982
  • 1
  • 25
  • 64
klr8
  • 655
  • 1
  • 6
  • 12