6 Replies Latest reply on Oct 20, 2010 5:50 AM by varun shaji

    Seam3 and JBPM intergration wishlist

    varun shaji Newbie

      The Seam 2 and JBPM based pageflow was one of the best features in Seam 2..And the only other competitor to this was Spring Webflow


      I would suggest if Seam3 is to intergrate with JBPM it should uphold the existing pageflow..That way seam provides a way to orchestrate views in the view layer.


      Already a non-xml based annotation based navigation in Seam3 is on discussion -Link  But that only makes it a stateless navigation.. and an intergration with Drools or JBPM only applies to the business side wiring..
      In cases where layering is thr it would be better to have a light weight stateful pageflow component like jbpm-jpdl in the view Layer.


      And in Seam 2 intergrationg to jbpm-jpdl existed in the Seam-navigation handler.. Here in Seam 3  as of now i couldnt find any SeamViewHandler..Or navigation implementation..So in the modular approach where will the JBPM based pageflow come to exist..Would it be in JBPM module or in Seam faces module?


      It would be better to have it in JBPM module...So that If someday a drools based navigation in view layer is possible that could also be incorporated in drools module without crowding the faces module..


      Thr was also an approach i come to know for stateful navigation where facescontext was passed in to the BPM process engine like drools. It seems good. But the point is how can a non-programmer be able to modify the flows and rewire it. I think in the above approach it would be much harder especially if the user is not aware to use the API to handle the navigation..but with the jbpm-jpdl approach i think even a non programmer could modify the flow using tools in eclipse..


        • 1. Re: Seam3 and JBPM intergration wishlist
          Pete Muir Master

          Yes, we are planning to support pageflow via both jBPM 3 and Drools 5 in Seam 3.

          • 2. Re: Seam3 and JBPM intergration wishlist
            varun shaji Newbie

            JBPM 3.2.2 which is the jbpm used in Seam 2.2.1 lacks major support for JUEL..The support for scripting is limited. But found JBPM 4 supports JUEL completely and also supports - My Link


            It would be better to have an intergration with JBPM4 rather than JBPM3 taking to consideration the new features it would bring in pageflow.

            • 3. Re: Seam3 and JBPM intergration wishlist
              varun shaji Newbie

              varun ss wrote on Jul 29, 2010 23:43:


              JBPM 3.2.2 which is the jbpm used in Seam 2.2.1 lacks major support for JUEL..The support for scripting is limited. But found JBPM 4 supports JUEL completely and also supports - My Link

              It would be better to have an intergration with JBPM4 rather than JBPM3 taking to consideration the new features it would bring in pageflow.


              JBPM 4 is based on BPMN so it would be a complete revamp..but is it possible to bring in a  JUEL intergration through pageflow and JBPM3 ..i feel that would be a necessity as the existing el support is very limited..

              • 4. Re: Seam3 and JBPM intergration wishlist
                varun shaji Newbie
                Pageflow should be positioned as an alternative to spring webflow according to my viewpoint. But currently a number of deficiencies exist in pageflow which restrict smooth transition from webflow to pageflow.

                I have an use case like

                Environment :
                I am not using process-flow(work-flow). Just using pageflow with conversation scope.

                Case :

                "<page name="search" view-id="/AI/search.xhtml" redirect="true">
                        <transition name="avail" to="availability">
                                <action expression="#{bookingFlowHandler.search}"/>
                                <action expression="#{bookingFlowHandler.initFlightListWidget}"/>
                        </transition>
                </page>

                       
                <page name="availability" view-id="/AI/availability.xhtml" redirect="true">
                        <transition name="book" to="passengerdetail">
                                <action expression="#{bookingFlowHandler.selectFlight}"/>                
                                <action  expression="#{bookingFlowHandler.initpassengerDetailWidget}"/>
                        </transition>
                </page>


                <page name="passengerdetail" view-id="/AI/summary.xhtml" redirect="true">
                        <transition name="summay" to="summary">
                                <action expression="#{bookingFlowHandler.updatePassenger}"/>                     
                                <action  expression="#{bookingFlowHandler.iniSummaryWidget}"/>
                        </transition>
                </page>"







                Here i am using fictional reservation system. I search for flights. And from the list i select a flight. Enter passenger detail. And go to the summary page.
                All service calls are bolder.

                So during a transition i call the service and submit data if required. And from the service i get the response data. This  response data i need to set to some screen model -''widget" to display in screen. So majority transition will have a pattern like some servce calls and some model updates. Currenlty thr is no way i can transfer the data returned form the service to the model through pageflow. I need to do in code.

                This decrease the flexibility in wiring the flow. As the service and the models are tight coupled through java code. I need to have a declarative way of doing this

                In spring webflow we have a feature like ::



                "<view-state id="search">
                    <transition on="avail" to="availability">
                        <evaluate expression="#{bookingFlowHandler.search}"  result="flowScope.flightList"/>
                          <evaluate expression="#{bookingFlowHandler.initFlightListWidget(flightList)}"/>
                    </transition>
                </view-state>"



                Here we have an <evaluate expression  similiar to <action expression but with added support for storing the return result from the call into a scope.

                Similarly it provides more flexibility to pageflow if it could include something like above ::



                "<page name="search" view-id="/AI/search.xhtml" redirect="true">
                        <transition name="avail" to="availability">
                                <action expression="#{bookingFlowHandler.search}"  store="flightList"/>
                                <action expression="#{bookingFlowHandler.initFlightListWidget(flightList)}"/>
                        </transition>
                </page>"




                where flightlist could be looked up in the CDI and Seam context. And if not found put into the default conversation scope with key 'flightList'. This could facilitate loose coupling of the service and the model and thus enhance wiring!!
                • 5. Re: Seam3 and JBPM intergration wishlist
                  varun shaji Newbie

                  Well upon the advice from Timohr i mixed up the xsd's of jpdl and pageflow. I included the node and decision from jpdl that are more powerful than pageflow.. So now i have a working pageflow which can replace the springwebflow..


                  And for transfering the data b/w the nodes i used the contexts.Th contexts from Seam and JBPM were used.Programaticaly added the values to contexts.. Still I feel its better to have a declarative way to do this. i feel the pageflow has been severly restricted as of Seam 2.2.1. In Seam 3 i expect more power..like more features of jpdl could be included in the pageflow xsd..Like the node, the decision could be the one from jpdl rather than the pageflow decision since one can have multpile branches out from decision rather than only 2 possibilities.


                  Include the JSF events/contexts into the JPDL. That way i could use JPDL to wire AJAX which is not implemented in any of the existing frameworks..Which will be a great boost..As new gen application has this problem of hardwired AJAX calls. So a ActionEvent or a ValueChange event could act as a signal/event inside the JBPM. currently only web page wiring is possible..this way i can wire ajax..which will be tremendously useful for JSF applications using Richfaces/icefaces and even Flex applications.




                   

                  • 6. Re: Seam3 and JBPM intergration wishlist
                    varun shaji Newbie

                    The current Pageflow has a drawback.. i saw its source also mentioned it. Before any page is to be served it checks whether the viewId of the current request is same as the pageflow state. THus it puts a limitation for the pageflow to do redirection to external websites and return and join the pageflow back. SInce the return request are GET request.


                    I tried a hack like commented the check But i feel its insecure. Would thr be a solution to this in new Pageflow. The old pageflow only had transitions from postback as it was invoked only from the application phase.
                    But it would  be better to get it invoked from a GET request with the outcome as a parameter for the GET.This ia a requirement as JSF supports GET now!!
                    So the pageflow in this case can be invoked from the renderphase..