2 Replies Latest reply on Feb 28, 2007 9:29 AM by raffaele.camanzo

    Can I really end a conversation programmatically?

    raffaele.camanzo

      Hi All,

      I'm facing a problem trying to end a conversation programmatically.

      The scenario:
      We have an application (for a full description refer to my previous post: "Problems with application-like behaviour") with a menu and a tabbed view of the services offered to the users; each tab is a conversation with a given id in order to provide to the user the ability to switch between the opened tabs. A user should be able to ask for a service, make the work and then close the tab and then, after a while, ask again for the same service. When the user asks for the tab to be closed the application should clean up all the data related to; this means that we have to remove the tabs control data and the tab content-specific data (the conversation one).
      The tab remotion request is handled in a generic way by a session scoped stateful bean (which handles the application behaviour), it removes the control data and then calls the Manager in order to remove the conversation of the current tab and switch to the conversation of the one focused.

      The problem:
      In order to clean the conversation data the action related to the tab remotion makes these Seam API calls:

      Manager.instance().endConversation(false);
      Manager.instance().switchConversation(currentTab.getConversationId());
      


      I think that this should work because the current conversation when I invoke the Manager is the one I want to remove and I hold the data of the one I want to activate.

      The effect:
      Unfortunately when the user selects the link related to the conversation I tried to remove, Seam, instead of create a brand new conversation with the given identifier, resumes the old conversation and shows the tab exactly like when I perform a tab switch.

      I hope that the description is clear and I hope that someone can help me.

      Thanks in advice.
      Regards,
      Raffaele Camanzo