10 Replies Latest reply on Oct 2, 2006 2:26 AM by stealth_nsk

    Dynamic Pageflow with Seam

    go_rags

      I am trying to put a prototype to give our users/admistrators complete control over the navigation of the pages in our application. Our initial architecture called for a uber-controller (with a custom PDL) that will do the navigation control, but since seam supports jPDL we want to use it.

      I am having little success in dynamically loading the Pageflow defenitions. I am currently using a APPLICATION scope component to retrive the jbpm context and set its pageflow.


      @Name("navcontroller")
      @Scope(ScopeType.APPLICATION)
      public class NavigationSelector {

      @In(create=true, value="org.jboss.seam.core.jbpm")
      private Jbpm jbpm;

      :::::::

      public String applyNavigation() {

      jbpm.setPageflowDefinitions(new String[]{currentChoice});
      return null;

      }


      }

      Then i redirect it to a page which would create my pageflow component and take control from there.

      Is it possible to this in seam, if yes, where am I going worng?

      Thanks in advance,
      Raghu.

        • 1. Re: Dynamic Pageflow with Seam
          gavin.king

          It is not currently possible to load a new pageflow at runtime. However, it would be easy enough to implement. Add a feature request to Seam JIRA.

          • 2. Re: Dynamic Pageflow with Seam
            ranik

            Looks like a simple fix, would you be interested in taking a fix for this?
            If so, please let me know the preferred option for exposing this via API and how to submit the fix.

            1. replace a specific pageflow by providing a new method - 'public void installPageFlowDefinition(String pathPageFlow)' - this can be used to add new pageflows as well as update existing ones.
            2. provide a new method - 'public void refreshPageFlowDefinitions()' which would do the equivalent of the current 'installPageflowDefinitions()'
            3. Suggestions? - my vote is for #1.

            Note: setPageFlowDefinitions didn't work it just sets the list of pageflow definitions, the code to actually load them and cache in an internal map runs during initialization only.

            thanks,
            Rani.

            • 3. Re: Dynamic Pageflow with Seam
              gavin.king

              (1) is about right, but I think its more flexible to let the pageflow be passed as a String.

              • 4. Re: Dynamic Pageflow with Seam
                gavin.king

                Note that the JIRA issue is here:

                http://jira.jboss.com/jira/browse/JBSEAM-176

                • 5. Re: Dynamic Pageflow with Seam
                  ranik

                  I had attached a simple change to enable addition of dynamic pageflow to the jira issue yesterday. Is there already a unit test class for JBpm which I missed?

                  • 6. Re: Dynamic Pageflow with Seam
                    stealth_nsk

                    As I can see, this feature is already resolved. Could you please document how we could control handlers/viewers for dynamically loaded pageflows?

                    Could we use some kind of manager bean to provide information to and handle tasks from dynamic pageflows?

                    P.S. It would be a very powerful feature as it would allow user scripting in the way similar to Alfresco 1.4 jBPM implementation.

                    • 7. Re: Dynamic Pageflow with Seam
                      gavin.king

                      Jbpm.instance().deployPageflowDefinition( Jbpm.instance().getPageflowDefinitionFromXxxxx("aResourceOrXmlDocument") );

                      • 8. Re: Dynamic Pageflow with Seam
                        stealth_nsk

                        Thank you for the information. However, one question still remain:

                        Is there any possibilities to set up handlers and data sources for those dynamic processes? I can describe my needs in more details:
                        I want users to be able to enter workflows in web application at runtime, using Rhino javascript scripts to process business processes from state to state.

                        • 9. Re: Dynamic Pageflow with Seam
                          gavin.king

                          What is a "handler"?

                          What is a "datasource"?

                          • 10. Re: Dynamic Pageflow with Seam
                            stealth_nsk

                             

                            "gavin.king@jboss.com" wrote:
                            What is a "handler"?

                            What is a "datasource"?


                            Sorry for the mees in terms. I meant variables and scripts to make workflow work. In general, it's ok. I think I could deal with jPDL BeanShell scripts, however it would be better to have the ability of using external script library.