8 Replies Latest reply on Jun 25, 2009 2:39 PM by Heiko Braun

    BPM console demo published

    Heiko Braun Master
        • 1. Re: BPM console demo published
          Ronald van Kuijk Master

          Looks great. Could you give some pointers on how pluggable the forms solution is and provide some basic directions like:
          - how/where do I reference the form
          - how/where do I configure a url to the form (assuming it is an external url)
          - how/where should I post the form result back
          - variables
          - transition to take

          I have a (possible) customer that is interested in a different forms standard. So I'd like to give this a go.

          • 2. Re: BPM console demo published
            Heiko Braun Master

            The current form dispatcher plugin is a good starting point:

            http://anonsvn.jboss.org/repos/jbpm/jbpm4/trunk/modules/integration/form-plugin/

            Especially the actual plugin implementation:

            http://anonsvn.jboss.org/repos/jbpm/jbpm4/trunk/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskDispatcherPluginImpl.java

            It implements the TaskDispatcher interface:

            http://anonsvn.jboss.org/repos/jbpm/projects/gwt-console/trunk/server/server-integration/src/main/java/org/jboss/bpm/console/server/plugin/TaskDispatcherPlugin.java

            It's packaged using a service declaration so the console can load it:
            http://anonsvn.jboss.org/repos/jbpm/jbpm4/trunk/modules/integration/form-plugin/src/main/resources/META-INF/services/

            Steps to create a TaskDispatcher


            Implement the interface
            package a jar, including the service declaration
            replace the current form-plugin.jar with your own so the PluginMgr doesn't see two of them.

            • 3. Re: BPM console demo published
              Heiko Braun Master

              A few words on the plugin interface:


              public interface TaskDispatcherPlugin
              {
               URL getDispatchUrl(long taskId); (1)
              
               DataHandler provideTaskUI(long taskId); (2)
              
               void processCompletion(long taskId, String outcome, InputStream payload); (3)
              }
              
              




              the dispatch URL is requested by the console task lists in order to correctly reference the dispatcher. In the example it simply points back to the gwt-console-server. this is the minimum you'd need to implemented.
              provideTaskUI() will be called from the console server as well. but if the reference URL points somewhere else, then can leave it out (blank impl.)
              processCompletion() is actually outdated. not sure if it will stay. currently the console server directly processes task completion using the TaskService interface.


              It's work in progress. So things may change. But feedback, especially from a separate dispatcher implementation would be highly appreciated.


              • 4. Re: BPM console demo published
                Bernd Ruecker Master

                Hi Heiko,

                to have this kind of interface could be a good imporvement. I will look into a Portlet GUI in the near future, then I will have a deeper look at it (but I don't expect it before juli, means after GA).

                Cheers
                Bernd

                • 5. Re: BPM console demo published
                  Ronald van Kuijk Master

                  Thanks Heiko, I'm not into the 4.0 codebase yet, so thanks for pointing me in the right direction.

                  I'll let you know my initial results tomorrow

                  • 6. Re: BPM console demo published
                    Ronald van Kuijk Master

                    A few remarks
                    - I see the protocol is fixed (http) Shouldn't this be either configurable or automagically filled with the right value (e.g. https)
                    - A quick scan seems to show this implementation is susceptible for parameter substitution (the taskid) since jBPM does (afaik) not have authorization yet on the taskservice.

                    And a few questions:
                    Is there an FTL example available. (also posted in another forum topic) The reason I ask this is that I kind of miss how the result is posted back. Or is the value of the formDirective.setAction the postback URL?

                    Is the form displayed in an IFrame, so completely independent of the enveloping techology (GWT in this case) (also related to the missing example, otherwise I would be able to have seen this)

                    This solution seems targeted at forms that fully embed everything and do not require a 'form engine'. For my solution I need to initialize a formengine and pass the formdefinition to it. But since this formsengine is serverside, It is kind of hard (securitywise and configurationwise) to pass this formdefinition via http. Also the real post-back is done on the server, so doing that via http poses the same problems. (loose coupling is not always great). I'm still figuring out how to 'solve' this, but the 'processCompletion' method would be an option. Maybe the external formssolution already signalled the task/process and just uses this method to have the rest of the ui 'continue'

                    Another 'problem' is that 'my' formsolution cannot be put in a jar but requires a webapp. So maybe the 'pluggability' mechanism of the formssolution should change.

                    In short, I currently do not see an easy way to plug in my forms mechanism, I'll do some more brainstorming and let you know.

                    • 7. Re: BPM console demo published
                      Emanuele Fabbri Newbie

                      Hi! I've installed the new jBpm CR1 release and I tried to run the taskform example as seen on the http://vimeo.com/4643652 but in my machine the example return the exeption:


                      HTTP Status 500 -

                      type Exception report

                      message

                      description The server encountered an internal error () that prevented it from fulfilling this request.

                      exception

                      org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: No UI associated with task ID 14
                      org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)
                      org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)
                      org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)
                      org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)
                      org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
                      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
                      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
                      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                      org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
                      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

                      root cause

                      java.lang.RuntimeException: No UI associated with task ID 14
                      org.jboss.bpm.console.server.TaskMgmtFacade.renderUI(TaskMgmtFacade.java:156)
                      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      java.lang.reflect.Method.invoke(Method.java:597)
                      org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
                      org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
                      org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
                      org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
                      org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
                      org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
                      org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
                      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
                      org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
                      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                      org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
                      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

                      note The full stack trace of the root cause is available in the JBoss Web/2.1.3.GA logs.


                      What does I'm doing wrong?

                      Thanks.

                      Emanuele

                      • 8. Re: BPM console demo published
                        Heiko Braun Master

                        @efabbri

                        The task w. ID 14 requires a freemarker template. It follows the naming convention <task_name>.ftl. It should be deployed along with the process.
                        In jbpm this happens when you package a .bar archive (zip file) which includes the template and deploy (copy to server/default/deploy) it to jboss.
                        But since jbpm didn't decide a single deployment pattern, you might eventually have used one of the other forms of deployment, i.e. the ant task. Unfortunately the solutions divert maturity and completeness. But I know that the deployer can handle it.