-
1. Re: Best practices for conversational model
jacob.orshalick Jun 18, 2008 4:11 PM (in response to endyamon)This will be based on your application. You have to look at the way your application is designed and ensure that it makes sense to join the conversation. Is the state the same but a context variable just changes? Or is the context completely different? If the context is completely different, you should not join the conversation, just let the previous conversation become background. The conversation timeout will take care of cleaning up the discarded state of the background conversation.
Hope it helps.
-
2. Re: Best practices for conversational model
joaobmonteiro Jun 18, 2008 4:15 PM (in response to endyamon)Hi Roberson,
The problem is that even with conversation model, we can't determine if the user is already there. When I need to start a conversation I always use join true. However, this approach could keep undesired itens in memory such as resources used in previous conversation. Well, I usually end conversations in menu links, so when user gives up and start another iteraction, I will create a new conversation.
I don't know if it is the best or a good practices but in my case it does the trick.
-
3. Re: Best practices for conversational model
endyamon Jun 18, 2008 4:31 PM (in response to endyamon)Jacob,
yeah! many times doesn't make sense to join, but i can't control the users action sometimes to finish properly one conversation and begin a new one.
Joao,
thanks man i will try it. Just tell me, do you finish and start an explicit conversation in the same link or use pages.xml or @Begin in different steps.Roberson
-
4. Re: Best practices for conversational model
joaobmonteiro Jun 18, 2008 5:31 PM (in response to endyamon)Hi Roberson,
There is at least two approaches:
1. First, ignore entire current conversation and start a new one:<h:commandLink action="#{some action}" value="some action">
<s:conversationPropagation type="none"/>
</h:commandLink>2. Finish current conversation after render response.
<h:commandLink action="#{some action}" value="some action">
<s:conversationPropagation type="end"/>
</h:commandLink>In first case, there will be a new and fresh conversation for 'some action', immediatly. The previous conversation will suffer timeout
In second case, only when request is processed and response rendered the previous conversation will end.
For choosing the approach, consider what Jacob said. I usually use the first case.
-
5. Re: Best practices for conversational model
endyamon Jun 18, 2008 6:21 PM (in response to endyamon)Hi Joao,
i changed as you recommended in your first reply, ending conversation in my menu links and it worked.
Anyway i'm considering using this first approach you said.
Thanks man.
-
6. Re: Best practices for conversational model
joaobmonteiro Jun 18, 2008 9:32 PM (in response to endyamon)Nice!
Another thing, you can use the debug page to inspect and monitor active conversations so you can better understand how your system behave in case of creating new conversations or ending the previous one, elements in memory and so on.
Seeya!
-
7. Re: Best practices for conversational model
endyamon Jun 18, 2008 9:40 PM (in response to endyamon)Cool!
I will take a look in seam's reference to learn more about debug page. Anyway i know that i don't have to worry about conversations anymore.
Thank you!
Roberson