2 Replies Latest reply on Aug 7, 2018 12:39 PM by Cory Dahlstrom

    Contents of a Conversation...

    Cory Dahlstrom Novice

      After we execute a conversation.begin() the user can navigate through a series of screens that are backed by @ConversationScoped beans. 

       

      Is there a way to list the @ConversationScoped beans for a particular cid?

       

      Thanks!

       

      Cory.

        • 1. Re: Contents of a Conversation...
          Martin Kouba Master

          Hi Cory,

          I don't think there is an easy way to list the contents of a particular conversation. If you're inside an HTTP request where a concrete conversation id was specified (cid param), you can obtain the conversation context via BeanManager#getContext(Class<? extends Annotation>) and look for existing bean instances using Context#get(Contextual<T>). Of course, you'll need to collect all ConversationScoped beans first. In theory, you could also inspect the HttpSession attributes directly. Conversation scoped bean instance attributes are prefixed with WELD_C.X where X is the conversation id. But note that this is no API and thus can change at any time.