Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.4
-
None
-
None
Description
The goal here is to detect that the conversation is invalid (by expiration/back button/whatever) and gracefully handle the event. Either by filter or by a phaselistener.
The problem is that ConversationManager.getCurrentConversationContextId() always creates a new conversation context id (by calling getOrCreateConversationContextId()) if the conversation context id is invalid, so we can't use it.
We could call ConversationManager.getConversationContext(Long conversationContextId) to check for null, but since ConversationManager.findConversationContextId() is private, we can't call it.
So I propose two alternatives:
1) Create a new ConversationManager.getCurrentConversationContextId(boolean createNew) that only creates a new conversation context if required. ConversationManager.getCurrentConversationContexIdt() should call ConversationManager.getCurrentConversationContextId(true);
2) Make ConversationManager.findConversationContextId() public so we could use ConversationManager.getConversationContext(Long conversationContextId).