spring-projects / spring-webflow

Spring Web Flow
https://spring.io/projects/spring-webflow
Apache License 2.0
329 stars 233 forks source link

Creating a ConversationListener interface so conversation begin and end can be monitored [SWF-154] #130

Open spring-operator opened 18 years ago

spring-operator commented 18 years ago

Martin van Dijken opened SWF-154 and commented

We'd like to have a way of attaching a ConversationListener to our web flow configuration. The problem we'd like to fix is that when a user logs on in our system, the user record in the database is functionally locked. We have no means by which we can unlock the user when he is done.

I've been mulling this over with a colleague a little and we're halfway on a solution but are running into some problems:

The obvious way of solving this would be to use a J2EE SessionListener. Unfortunately our debugging has shown that we can't access any webflow objects from the HttpSession object nor directly from the ServletContext. What we can get to is a Spring WebApplicationContext object. From that we can get to the flowExecutor and many other objects, but we can't yet figure out how to get to the conversation this session resolves to. Any thoughts?

The second problem is how to architect this. I'll dive into this a little deeper and throw up some suggestions. It should at least look like the way the flowExecutionListeners work.


Affects: 1.0.4

Issue Links:

1 votes, 3 watchers

spring-operator commented 18 years ago

david varnes commented

I believe that this enhancement is related to an earlier request #1009. I submitted that one before the new Conversation sub-system was factored out in the API. But the gist is to expose the lifecycle operations of the flowExecutor to an appropriate Listener.

In that Jira is a link to a discussion about this that we had in the forum

spring-operator commented 18 years ago

Erwin Vervaet commented

The SessionBindingConversationManager used by RC4 (and 1.0) puts a ConversationContainer object in the HttpSession. That ConversationContainer contains 'ContainedConversation' objects. So you should be able to get at those from if you've got access to the HttpSession.

Secondly, you can ofcourse also implement a custom ConversationManager. This is pretty easy (only 3 methods) and would allow you to basically do whatever is needed, e.g. have listener support.

You can plugin the custom ConversationManager at the level of the FlowExecutorFactoryBean.

spring-operator commented 13 years ago

Martin van Dijken commented

Keith, I'm not currently using Web Flow in any active projects and don't know if I will in the near future. Is there a point in keeping this issue open?