8 Replies Latest reply on Oct 22, 2013 4:17 AM by Mauricio Salatino

    Integrating TaskService with jbpm-console

    bpmn2user Expert

      I am wondering why the demo human taskservice is not integrated with jbpm-console for the ease of deployment (e.g., startup servlet) instead of running it as a separate ant task?

        • 1. Integrating TaskService with jbpm-console
          bpmn2user Expert

          I have integrated this human task as part of jbpm-console mainly for the following reasons

           

          • I do not need to maintain another job to run human task and the installation becomes simply dropping the war files in Tomcat.
          • I can use Tomcat logs to see if there is any problem in calling Humantasks from Tomcat

           

          Anyway, here are the details if any one wants to  integate with Tomcat6.

           

          Modify web.xml in jbpm-console's war file to include a human task startup servlet.

          e.g.,

          <servlet>

                  <servlet-name>HumanTaskStartupServlet</servlet-name>

                  <servlet-class>com.sample.HumanTaskStartupServlet</servlet-class>

                   <load-on-startup>2</load-on-startup>

              </servlet>

           

              <servlet-mapping>

                  <servlet-name>HumanTaskStartupServlet</servlet-name>

                   <url-pattern>/HumanTaskStartupServlet/*</url-pattern>

              </servlet-mapping>

           

           

          Copy the humantask compiled class to WEB-INF/classes diectory of jbpm-console

          • 2. Re: Integrating TaskService with jbpm-console
            bpmn2user Expert

            Here are  the sample human task servlet and web.xml files used in Tomcat

            • 3. Integrating TaskService with jbpm-console
              Mauricio Salatino Master

              Great, sounds good for testing purposes but I'm not sure that is the best for productions applications. Imagine that if you put multiple applications on the same tomcat instance and one application consume all the memory, your jBPM console will stop working as well as all your task clients, because the task server is running inside tomcat.

              This idea also breaks the scalability that gives you the Task Server running decoupled from tomcat in a different JVM instance.

              But if it works for you congrats!

              • 4. Re: Integrating TaskService with jbpm-console
                bpmn2user Expert

                That is a good point. I am not sure how much  resource intensive this human task service is?

                 

                Well! We are already running two war files in the same JVM instance (jbpm-console and gwt-console-derver). We might as well have them installed in two seperate JVM instances. I am looking at the deployment option, i.e  using a war file instead of running a standalone job with an ant task.

                • 5. Integrating TaskService with jbpm-console
                  Kris Verlaenen Master

                  Nice !

                   

                  I had already identified this as a possible improvement: https://issues.jboss.org/browse/JBPM-3013

                  This will help me speed up the fix

                   

                  Mauricio is correct in saying that this is just one possibility and that this does not necessarily is the ideal solution for everyone, but the installer simply creates a demo setup, in which case I think it makes sense, as it probably is a little easier for people to deploy a war to get the task service running rather then executing a separate Java program.

                   

                  Kris

                  • 6. Re: Integrating TaskService with jbpm-console
                    Shobhit Tyagi Master

                    Hi Bpmn2user,

                     

                    It has been quite some time since you posted this.

                    I tried using the servlet you attached above to get rid of human task service related stuff. It could not connect to the task client. Below is the trace. COuld you please take a look at it and lemme know what I might have done wrong.

                     

                    HTTP 500:

                    HTTP Status 500 - java.lang.IllegalArgumentException: Could not connect task client


                    type Exception report

                    message java.lang.IllegalArgumentException: Could not connect task client

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

                    exception

                    org.jboss.resteasy.spi.UnhandledException: java.lang.IllegalArgumentException: Could not connect task client
                         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)
                    

                     

                    root cause

                    java.lang.IllegalArgumentException: Could not connect task client
                         org.jbpm.integration.console.TaskManagement.connect(TaskManagement.java:66)
                         org.jbpm.integration.console.TaskManagement.getAssignedTasks(TaskManagement.java:179)
                         org.jboss.bpm.console.server.TaskListFacade.getTasksForIdRef(TaskListFacade.java:99)
                         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                         sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                         sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                         java.lang.reflect.Method.invoke(Unknown Source)
                         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)
                    

                     

                    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.36 logs.

                    • 7. Re: Integrating TaskService with jbpm-console
                      Gaurav Rathi Newbie

                      Hello

                      Is this issue resolved ?

                      I am also getting the same error...

                      • 8. Re: Integrating TaskService with jbpm-console
                        Mauricio Salatino Master

                        This post is from a year ago, and we have a new tooling now, did you check that?

                        Cheers