3 Replies Latest reply on Mar 27, 2014 4:11 AM by Maciej Swiderski

    Deploying workitem handlers inside the kjar

    Fin Steenbjerg Newbie

      I have just started using JBPM (6.0.1.Final) and I have a problem with understanding how to make it all fit together.


      My use case is, that I have a number of processes that I want to deploy/maintain independently. Each processes is going to invoke a number of backend service (REST based). The result of some of the service invocations needs to be computed before it can be used by other tasks inside the process.


      My idea is to deploy the processes as kjar files containing some workitemhandlers directly into the workbench. The problem is to get the workitemhandlers deployed inside the kjar (tried CDI producers, drools.rulebase.conf and adding it to the kmodule.xml). If I place the workitemhandler class inside a separate jar and place this jar inside the webinf/lib of the jbpm-console.war file, everything works (registrating the workitemhandler via CDI). The reason for having the workitemhandles deployed inside the kjar is that I need to be able to update the individual processes separately (without impacting other processes). Secondly, adding jars to webinf/lib does not fit very well into our deployment model.


      Therefore - Is there anyway to get workitemhandlers deployed together with the kjar? or should I do something completely different? Please comment.

        • 1. Re: Deploying workitem handlers inside the kjar
          Maciej Swiderski Master

          in 6.0.1 there was an issue with use of proper classloader when registering handlers via kmodule.xml and it required MVEL base syntax e.g. to create handler of class org.jbpm.handler.CustomHandler you would need to use new org.jbpm.handler.CustomHandler().


          That was already fixed in master and will be available in 6.1.0 (both classloader issues and limitation to use MVEL syntax). So for now the only way is to use actually cdi producers for work item registration. Note that you can filter based on identifier given to the methods like getWorkItemHandlers to be able to provide handlers for given deployments. Identifier is the id of deployment unit.



          • 2. Re: Deploying workitem handlers inside the kjar
            Fin Steenbjerg Newbie

            Thanks for your quick reply.


            As I understand your answer, you are telling me that I can't get a custom handler to work when it is deployed inside the kjar (due to the issue you mention). Was this issue introduced with 6.0.1 - does it work with 6.0.0 or should I wait for 6.1.0? Do you have an release date for 6.1.0? What do you recommend 6.0.0 or 6.1.0?

            • 3. Re: Deploying workitem handlers inside the kjar
              Maciej Swiderski Master

              the issue was in both 6.0.0 and 6.0.1 so you'll need to wait for another release. 6.1.0 should be out in June but in like 2 weeks there will be beta released so you can pick that up and try to see if all is working as expected. As there will be still time to fix outstanding issues before final goes out.