12 Replies Latest reply on Jan 17, 2006 3:54 PM by Matthew Edwards

    jBPM and Pageflow

    Matthew Edwards Newbie

      I am having some difficulty grasping how to use jBPM and Pageflow with Seam. Could someone help me understand the answers to some of my questions?

      (1) Can you use jBPM (without pageflow) to navigate a user from page to page?

      (2) Can you use jBPM and pageflow at the same time? (I don't mean in the same project, but rather in the same conversation or something like that.)

      (3) How does the start state in a pageflow scenario get initiated?

      (4) Is the possible simple scenario possible, how?

      * user requests index page of website
      * index page forewards the user to the equivilent main.seam page with a login form
      * user inputs information and submits login form by calling only the 'login' action
      * the login action is detected by jBPM or jDPL pageflow and executes the #login.login action
      * a result of 'true' is returned to the jBPM or jDPL pageflow
      * the process uses the 'true' transition to foreward the user to another page

      (5) In the previous scenario, how would the jBPM/... process be initiated?

      (6) Is it possible to replace simple JSF navigation with pageflows?


      I think some of my confusion is coming from not understanding the background process that is going on. I read the Seam docs and have studied the examples, but am still confused.

      (7) Could anyone tell me the story of a Seam-jBPM request? eg. The user requests a page, Seam checks for a previous conversation, Seam ...

      I sincerely apprieciate any help. Thankyou.

        • 1. Re: jBPM and Pageflow
          Gavin King Master

          (1) I dont understand. jBPM business process management and jBPM pageflow are very different things

          (2) Yes, sure.

          (3) @Begin(pageflow="pageflowDefinitionName")

          (4) jBPM pageflow is only sensible and useful for *conversations*. Don't use it for navigation between conversations, or for ad hoc navigation.

          (5) It is always initiated by an @Begin.

          (6) Yes, but only in a conversation.

          (7) There is no difference in the JSF lifecycle. Seam is just replacing the default JSF NavigationHandler with a custom one that delegates to jBPM if and only if a jBPM pageflow is in progress.

          • 2. Re: jBPM and Pageflow
            Matthew Edwards Newbie

            (1) I mean, does jBPM business process management allow for navigation between pages?

            (2) If you use jBPM business problems for logic, do you use pageflow for navigation? Or just use business process management for both? Can they go into the same BPM definition?

            (3) What I mean for this one is, what is the best way to initiate a call to @Begin(...). What I got working was: page-1 calls the Seam component through an action, the component returns a string used in JSF navigation, we go to page-2. Then page-2 uses the jBPM pageflow transition names to proceed, ect. until the pageflow is finished, at which time the conversation and pageflow is destroyed.

            How else would you instantiate @Begin?

            (7) If a pageflow is initiated and the next transition would be an action named "go" and there is a JSF navigation definition that would also respond to "go", which would have precedence? or does Seam disable one to use the other?

            Thanks Gavin.

            • 3. Re: jBPM and Pageflow
              Gavin King Master

              (1) no, these are very, very orthogonal concerns. One is about managing interaction between the app and a user. The other is about managing many interactions that occur between many users. Totally different level of granularity. conversation==task. business process=sum of many tasks.

              (2) page flow == navigation. no, they cannot live in the same process definition. A task encapsulates an entire pageflow.

              (3) Yes, some page needs to invoke an action which initiates the pageflow/conversation.

              (7) In the current implementation, if a pageflow is in process, it *always* completely overrides any defined JSF navigation rules. You cannot mix-n-match. But, I just realized that this is probably too restrictive. I guess I need to change something here.

              • 4. Re: jBPM and Pageflow
                Gavin King Master

                 

                "gavin.king@jboss.com" wrote:
                (7) In the current implementation, if a pageflow is in process, it *always* completely overrides any defined JSF navigation rules. You cannot mix-n-match. But, I just realized that this is probably too restrictive. I guess I need to change something here.


                Well. Maybe, maybe not. Have to think about it in the morning when I am sober :)

                • 5. Re: jBPM and Pageflow
                  Matthew Edwards Newbie

                  Where I am at now:

                  I have defined an action: #{login.start}
                  It begins a conversation, defines a pageflow and returns a string.

                  What happens as a result of the string returned? Is the page flow looking for a transition rule? Or is JSF looking for a view-id to recon? Then the page that is finally returned to the user ends up as the first page looking for a transition in a pageflow definition? (That make sense--JSF page action calls method; method begins pageflow; result from method is solved by JSF navigation; page returned; then control is handed over to pageflow.)

                  Or do I not need to return anything at all? Does the pageflow process take over until the conversation is done?

                  • 6. Re: jBPM and Pageflow
                    Matthew Edwards Newbie

                    You said:

                    a task encapsulates an entire pageflow
                    Does that mean that a pageflow can be initiated by a task, and then wait for control to return? (I am going to get this pageflow stuff handled before I move on to the business stuff. I couldn't find any pageflow documentation around the jBPM part of the JBoss website--is there any?) (When you going to write a book Gavin? I'll buy it. :-)

                    • 7. Re: jBPM and Pageflow
                      Gavin King Master

                      The string returned from the action will be the name of a transition of the jPDL <start-state>. The next page will be the page that is the target of that transition.

                      By the way, it is *extremely* wierd to start a conversation from login!

                      • 8. Re: jBPM and Pageflow
                        Gavin King Master

                         

                        "matthew.edwards@byu.edu" wrote:
                        You said:
                        a task encapsulates an entire pageflow
                        Does that mean that a pageflow can be initiated by a task, and then wait for control to return?


                        Conceptually correct, yes.

                        @BeginTask(pageflow="foo")

                        "matthew.edwards@byu.edu" wrote:
                        (I am going to get this pageflow stuff handled before I move on to the business stuff.


                        So don't worry about business process for now. These things are orthogonal. You can use them together, or independently.

                        "matthew.edwards@byu.edu" wrote:
                        I couldn't find any pageflow documentation around the jBPM part of the JBoss website--is there any?) (When you going to write a book Gavin? I'll buy it. :-)


                        No, the pageflow stuff is one class in Seam CVS. We're about to start work on a book ;)


                        • 9. Re: jBPM and Pageflow
                          Martin Henderson Newbie

                          just my +1 on this thread... I think it would be great to have an example of exactly how jbpm can be used to manage navigations and navigation rules between pages.... the doco seems a bit light on this :-)

                          Marty

                          • 10. Re: jBPM and Pageflow
                            Gavin King Master

                            Have you looked at the numberguess and dvd examples in CVS?

                            • 11. Re: jBPM and Pageflow
                              Thomas Heute Master

                              There are several examples in the CVS, look at "numberguess" for instance.

                              • 12. Re: jBPM and Pageflow
                                Matthew Edwards Newbie

                                Gavin, thanks for your help last night. Some of your answers in this post really opened up jBPM for me. (Did I say that I promise not to use pageflow/conversations for the login process? just as an example to talk about because almost all your Seam/examples have a login process.)