3 Replies Latest reply on Aug 23, 2014 2:54 PM by gsi

    Problems with custom work item handlers

    gsi

      Service tasks in general do not work for me on kie workbench. I have tried to follow the documentation but to no success. All tasks under Service Tasks in Kie workbench do not work and a similar issue is experienced with my custom work item handlers.

       

      I can go as far as including service tasks and custom tasks in a business process and deploying the project. The problem starts when I try to start a process instance, I get this error:

       

      Process Instances failed to start: [TestProject.test:3 - Log:3] -- Could not find work item handler for Log

       


      The server log snippet is as follows:


      ========================================================================================================================================================

       

      [org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit] (default task-93) Successfully deleted file : .../jbpm-installer/wildfly-8.1.0.Final/standalone/tmp/vfs/temp/tempc014fddbc9e42a15/jbpm-console.war-3107a71416517166/org.kie.workbench.KIEWebapp/stencilsets/bpmn2.0jbpm/view/activity/workitems/Log.svg

      2014-08-21 23:15:16,227 WARN  [org.jboss.solder.exception.control.log] (default task-122) No handlers found for exception java.lang.IllegalArgumentException: java.io.FileNotFoundException:.../jbpm-installer/wildfly-8.1.0.Final/standalone/tmp/vfs/temp/tempc014fddbc9e42a15/jbpm-console.war-3107a71416517166/org.kie.workbench.KIEWebapp/stencilsets/bpmn2.0jbpm/view/activity/workitems/Email.svg (No such file or directory)

      2014-08-21 23:15:16,237 ERROR [io.undertow.request] (default task-122) UT005023: Exception handling request to /jbpm-console/stencilset//org.kie.workbench.KIEWebapp/stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json/view/activity/workitems/Email.svg: java.lang.IllegalArgumentException: java.io.FileNotFoundException: .../jbpm-installer/wildfly-8.1.0.Final/standalone/tmp/vfs/temp/tempc014fddbc9e42a15/jbpm-console.war-3107a71416517166/org.kie.workbench.KIEWebapp/stencilsets/bpmn2.0jbpm/view/activity/workitems/Email.svg (No such file or directory)

        at org.jbpm.designer.web.stencilset.impl.LocalStencilSetImpl.getResourceContents(LocalStencilSetImpl.java:46) [jbpm-designer-backend-6.1.0.Final.jar:6.1.0.Final]

        at org.jbpm.designer.web.stencilset.impl.StencilSetServiceServlet.doGet(StencilSetServiceServlet.java:119) [jbpm-designer-backend-6.1.0.Final.jar:6.1.0.Final]

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

       

      =====================================================================================================================================================

      I started with version 6.0.1 and later Version 6.1 and I still experience the same problem. I suspect I am missing something.

       

      These are the steps that I follow when using my own work item handlers:

      1. I put the jar with my custom work item handlers inside the dependency/ folder found inside the jbpm-installation directory

      2. Edit the conf/META-INF/CustomWorkItemHandlers.conf and include my own as follows:

          "MyWorkItemHandler" : org.myorganisation.handlers.MyWorkItemHandler()

      3. Execute ant install.dependencies

      4. Execute ant install.demo

      5. Execute ant start.demo

      6. In my Kie workbench project's work item definitions I include an entry as follows;

       

      [

          "name" : "MyWorkItemHandler",

          "displayName" : "My Work Item Handler",

          "icon" : "defaultservicenodeicon.png"

        ]

       

      "My Work Item Handler" task becomes available under service tasks and I can include it in a business process. Starting a new process instance gives the Could not find work item handler error.

       

      What am I missing?

       

      I am using Java 1.7.0_67 and Ant 1.9.3 on Ubuntu 14.04.

       

      G

        • 1. Re: Problems with custom work item handlers
          salaboy21

          Hi George,

          I think that the only thing that you are missing is :



          "1. I put the jar with my custom work item handlers inside the dependency/ folder found inside the jbpm-installation directory"


          It should be inside the web application/WEB-INF/lib directory. As explained here:


          http://salaboy.com/2013/10/22/kie-wb-jbpm-console-ng-configurations/


          Look also for your second point that you need to edit that file but inside the web app..


          HTH

          • 2. Re: Problems with custom work item handlers
            gsi

            Hi Mauricio,

             

            Thanks. Copying the files manually works. It is strange though as the procedure explained above also does copy the files to correct directories in the jbpm-console.war.

             

            I also think there is a bug though as sometimes even the default service tasks (Log,Email, Web Service ...) throw the same error while I expect them to work out of the box. I will investigate the bug  and report it if found.

             

            Thanks once again.

             

            G

            • 3. Re: Problems with custom work item handlers
              gsi

              It works perfectly now. The root cause was that the web app was failing to resolve a class that implements one of my custom work item handlers.