1 2 3 Previous Next 30 Replies Latest reply on Jun 2, 2006 11:55 AM by jajansen

    Some thoughts about the conversations

    armita

      1- Suppose I have an application with some modules wich anyone could be accessed via a sidebar menu all across the application. Know suppose user changed his mind in the middle of say a third level nested conversation, and changes the module.
      Consider I may have been opened any number of conversations in the old module and the time user changes it, I want to close all of them and start with a fresh ConversationContext.
      I thinks it would be nice to have something like @EndAll to destroy all the comversations. And it may happen that I want to preserve some level of conversation stack ( subModules ? ) then I wish to have something like @EndAll(preserve=1) which will destroy all the nested conversations but the last one.

        • 1. Re: Some thoughts about the conversations
          gavin.king

          I don't think we need an annotation for that. But we could provide an API. Add a JIRA request, if you like.

          • 2. Re: Some thoughts about the conversations
            christian.bauer

            I second this feature request. Another way to solve it are nested pageflows for nested conversations. The outermost pageflow would be the "modules" and the transitions between them.

            • 3. Re: Some thoughts about the conversations
              emsa

              Ever considered adding named-conversations to seam [@Begin(name="adduser")]? This way it would be possible to control serveral parallell conversation easily at the same time. This could be usefull for ex. when you have several independent zones on the same page.

              • 4. Re: Some thoughts about the conversations
                armita

                I have thought of named conversations but could not reach any clear idea, still I think it could be a good idea.

                Here is another usecase: I am selecting an object and user reaches to a view page with CRUD buttons. Here is two choice for implementing the CRUD :
                1- to have a hidden input in the view page to let the Seam refetch the object from database when request submitted. Load on database.

                2- Make the CRUD handler SB conversational and let the bean live in the conversation, so any further operations uses the in conversation bean. But here we got a problem, how to end the conversation? The only solution at the moment is to put a "back" button to call the @End method of the SB. But this way the user will suffer a lot of useless clicks.
                So we need a way to orphanate the conversation and let him time out. But unfurtunately after begining the converesation, every requests touches it and it stays alive.

                • 5. Re: Some thoughts about the conversations
                  gavin.king

                  No, there are instructions in the Seam docs for how to leave a conversation scope.

                  • 6. Re: Some thoughts about the conversations
                    emsa

                    One problem with parallell/named conversations would be to handle bijections (etc) if the same component lives in parallell conversations. Solvable but its more to it than just adding name to @Begin and @End.

                    • 7. Re: Some thoughts about the conversations
                      gavin.king

                      I think what you guys may be grasping for is a concept of "conversation group", perhaps analogous to ThreadGroup.

                      Do you think?

                      • 8. Re: Some thoughts about the conversations
                        armita

                         

                        "gavin.king@jboss.com" wrote:
                        No, there are instructions in the Seam docs for how to leave a conversation scope.


                        I could not find it, I don't think you mean calling the leave() method, do you?

                        • 9. Re: Some thoughts about the conversations
                          gavin.king

                          http://docs.jboss.com/seam/reference/en/html/conversations.html#d0e2284

                          <h:commandLink action="main" value="Exit">
                           <f:param name="conversationId" value="new"/>
                          </h:commandLink>


                          Or, simply:

                          <h:outputLink value="main.jsf">
                           <h:outputText value="Continue"/>
                          </h:outputLink>



                          • 10. Re: Some thoughts about the conversations
                            emsa

                            One thing I'd like to do to is to have a menu of actions. Each action will start a Wizard but the menu is still present even if a Wizard for one of the actions is started. Now, if the user clicks on another action, while still beeing in the middle of the first Wizard one I'd like to start a Conversation for action 2, without killing of the first one.

                            This could be solved with named Conversations and annotations like:

                            @Begin(join=true, name="wiz_one"}
                            public String startWizardOne() { }
                            
                            @Begin(join=true, name="wiz_two"}
                            public String startWizardTwo() { }
                            


                            If this works it would also be possible to have the two Wizard shown in the same page, but with parallell and independant conversations.

                            If this is combined with hierarchical Conversation I guess that you can regard one set of named conversation as a ConversationGroup.


                            • 11. Re: Some thoughts about the conversations
                              armita

                              It is not what I need.
                              Let me explain in this way,
                              have tried booking example and created two converesation. I was working with one of them and leaved the other untouched, but as long as I am working with the active one, the inactive one stayed there and didn't died.
                              suppose I am in a view page of entity with "view" "delete" "update" buttons and already started the conversation. I am looking for a way to close this conversation however user leaves the section.

                              • 12. Re: Some thoughts about the conversations
                                gavin.king

                                You want to have two conversations in the same page?

                                Yew, we can't do that yet ;-)

                                And I don't expect to implement it anytime soon, sorry...

                                • 13. Re: Some thoughts about the conversations
                                  gavin.king

                                   

                                  "armita" wrote:
                                  It is not what I need.
                                  Let me explain in this way,
                                  have tried booking example and created two converesation. I was working with one of them and leaved the other untouched, but as long as I am working with the active one, the inactive one stayed there and didn't died.
                                  suppose I am in a view page of entity with "view" "delete" "update" buttons and already started the conversation. I am looking for a way to close this conversation however user leaves the section.


                                  If you make them all nested conversations of a single outer conversation, then ending the outer conversation destroys all it's children. Not sure if that helps.

                                  • 14. Re: Some thoughts about the conversations

                                    Hi,

                                    I have a question concerning "recursive" converstation/operations.
                                    Let's say that I have documents that refer to other documents.

                                    Now, I have a stateful bean that contains a searchDocuments method, a list of documents (the result of the seach) and a search parameter (a string that identifies document(s)).

                                    I also have a stateless bean to select document. It just inject the the selected document to the stateful bean that view the doc.

                                    There is another staleful bean to view a document (there is other business logic involved when displaying a document).

                                    I would also like to use the breadcrump functionality from jboss seam.

                                    Here is what happens:

                                    1) on the first searchDocuments I start a conversation with @begin(true)

                                    2) resulting documents are displayed. The breadcrump is displayed. The user can now select one document.

                                    3) when the user selects a document, a nested conversation is started on the selectDocument method (from the stateless bean).

                                    4) Once the document is selected the user is presented with criteria that, once clicked, will forward him to 2). For this another method with @begin(nested = true) is used. However, the same stateful bean perfoms the operation.

                                    The breadcrump is well displayed. However, if you click on the first occurrence of the breadcrump, the staful bean perfoms the operation with the arguments of the last operation resulting in completely wrong results.

                                    Is there a way of performing "recursive" operation using nested converstation?

                                    Thanks for you help,

                                    1 2 3 Previous Next