2 Replies Latest reply on Aug 12, 2014 3:23 PM by rob3c

    Registering WorkItemHandler in kie-workbench

    sapsiero

      Hi,

       

      I would like to add my own custom process element to the kie workbench. What I understood:

       

      1. You can specify your own process elements in the workbench using the work item handler definition.

      2. You can upload the corresponding workitemhandler implementation as a jar file to the kie-workbench project.

       

      But how is it possible to register the WorkItemHandler implementation to the process element? Is it possible to modify the existing CustomWorkItemHandlers.conf? Where would I find it in the kie-workbench? Or is it possible to add a second, third, ... CustomWorkItemHandlers.conf to the workbench by just uploading it?

       

      Thanks and regards

       

      Tim

        • 1. Re: Registering WorkItemHandler in kie-workbench
          sapsiero

          I found some explanations in other threads. To me it looks like you have to unpack the jbpm-console.war on the server.

           

          Then you can easily adapt the configuration files to your needs.

           

          See https://community.jboss.org/message/807163#807163 and https://community.jboss.org/message/859700#859700.

          • 2. Re: Registering WorkItemHandler in kie-workbench
            rob3c

            That's right. Until they fix custom work item handler deployment via project kmodule dependencies, putting them on the classpath via dropping a jar in jbpm-console.war/WEB-INF/lib is the only way.

             

            If you want your custom work items to be a little more self-contained, you don't have to register the work item definition <-> handler mappings separately outside your jar in the jbpm-console/WEB-INF/classes/META-INF/CustomWorkItemHandlers.conf file. Instead, you can implement the WorkItemHandlerProducer interface and expose it to CDI as an alternative in your jar's META-INF/beans.xml file. Then, your producer's getWorkItemHandlers() method will be called for each deployment where you can register the handlers as well as perform any other initialization you care to.

             

            Regards,

            Robert