10 Replies Latest reply on Apr 15, 2015 10:54 AM by barnaby33

    jBPM6: Deploy custom work item handlers OTB

    lauradp

      Hello everybody,

      I'd like to know if I can deploy custom work item handlers without changing any of the jbpm wars nor re-running jbpm installation.

      My goal is to run processes containing custom services from jbpm-console.

       

      Thanks

      Laura

        • 1. Re: jBPM6: Deploy custom work item handlers OTB
          swiderski.maciej

          not in 6.0.x due to limitation in handling properly classloaders, it will be possible in 6.1.0 with two options:

          • deployment descriptors
          • kmodule.xml

          in one of these files you'll be able to define work item handlers and then the handlers (as implementation) would need to be added as dependency to your project.

           

          HTH

          1 of 1 people found this helpful
          • 2. Re: jBPM6: Deploy custom work item handlers OTB
            lauradp

            Thanks for your answer Maciej!

            I tried to add a jar containing my workItems as a global jboss module (http://www.mastertheboss.com/jboss-as-7/how-to-install-a-module-on-jboss-as-7),

             

            <subsystem xmlns="urn:jboss:domain:ee:1.0" >           

               <global-modules>

              <module name="my.module.name" slot="main" />           

               </global-modules>

              </subsystem>

             

             

            but I get the same error

             

            should I add this module to jbpm dependencies, and, If so, how should I edit build.xml file?

            • 3. Re: jBPM6: Deploy custom work item handlers OTB
              swiderski.maciej

              I assume you only paced the jar on classpath (global modules should be added to all deployments) but there is no configuration that tells jbpm about your handler. So you need to add configuration in the conf file that is stored in WEB-INF/classes/META-INF.

               

              Alternatively you can place these drools.session.conf and CustomWorkItemHandlers.conf (copy them from web app) in your home directory as these files should be read from there too if you don't want to edit files in web appl.

               

              HTH

              • 4. Re: jBPM6: Deploy custom work item handlers OTB
                lauradp

                Hi Maciej,

                thanks for your answer.

                I placed my_module.jar and module.xml in

                %JBOSS_HOME%/modules/my_module_path/main

                end I declared it in standalone.xml:

                <subsystem xmlns="urn:jboss:domain:ee:1.0" >          

                      <global-modules>

                          <module name="my.module.name" slot="main" />          

                     </global-modules>

                </subsystem>

                 

                What do you mean when you say: "So you need to add configuration in the conf file that is stored in WEB-INF/classes/META-INF."?

                What do you mean  with m"my home directory" and if I place there drools.session.conf and CustomWorkItemHandlers.conf can I run my processes from jbpm-console.

                 

                Laura

                • 5. Re: jBPM6: Deploy custom work item handlers OTB
                  swiderski.maciej

                  look here where you can find example of conf files that are responsible for registration of work item handlers. So you go to jbpm-console.war/WEB-INF/classes/META-INF and add entry for you handler into CustomWorkItemHandlers.conf or copy these files into your user home directory and then modify. Anyway you need to modify CustomWorkItemHandler.conf file. Easiest is to modify that one stored in WEB-INF/classes/META-INF

                   

                  HTH

                  • 6. Re: jBPM6: Deploy custom work item handlers OTB
                    lauradp

                    Maciej,

                    you mean that If I create a new version of the module containing one more workitemHandler for a new service I need to add a new entry in the CustomWorkItemHandler.conf placed inside jbpm-console.war.

                     

                     

                    What about creating a MyCustomWorkItemHandler.conf in my module's jar. Is there any way for referencing it only once in jbpm-console.war's configuration?

                     

                     

                    Laura

                     

                     

                    UPDATE

                    I modified myHandlersModule.jar putting a META-INF folder containing MyCustomWorkItemHandlers.conf with custom my handlers declarations, then I tested this configuration:

                     

                     

                    1) In jbpm-console.war bpm-console.war/WEB-INF/classes/META-INF/drools.session:

                    drools.workItemHandlers = MyCustomWorkItemHandlers.conf

                    while starting demo I get the errors reported in deploy-err.log attachment, when running my process I get the error listed in error2.log attachment.

                    • 7. Re: jBPM6: Deploy custom work item handlers OTB
                      lauradp

                      Hi Maciej,

                      can you confirm that custom workItem can be deploed in jBpm 6.1?

                      How does it work?

                       

                      Laura

                      • 8. Re: jBPM6: Deploy custom work item handlers OTB
                        sanjay05222

                        Hi Maciej ,

                         

                        I have tried custom work item by following below mention steps and it works fine but I would like to have more details of how to configure using the kmodule.xml/deployment descriptors.

                         

                        Steps Followed : Which Works.

                        1. Extended the class from the WebSericeWorkItemHandler or similar interace provided in the Jbpm

                        2. Packed the class in jar.

                        3. Dropped in the web-inf\lib folder

                        4. Configured in the CustomWorkItemHandlers.conf

                        5. Add the info in the xxx.wid file inside the jbpm myproject.

                        6. Redeploy the war and Execute the BPM Process. 


                        Please provide if you can step by step for your second solution where we don't have to hack the jbpm-console.war  and able to do it by just within the jbpm project we create and deploy it directly . I think that is the key point for this to be more successful.

                         

                        Pardon me Laura just incase I am hijacking your question.

                         

                         

                        Thanks

                        Sanjay Gautam

                        • 9. Re: jBPM6: Deploy custom work item handlers OTB
                          brepine

                          Hello,

                           

                          I'm working on the same.

                          Has anyone found a solution to this?

                          Modifying the jpbm-console.war is less than ideal.


                          Thanks,

                          Burt Repine

                          • 10. Re: jBPM6: Deploy custom work item handlers OTB
                            barnaby33

                            How about creating a custom work item handler and registering it once, where it goes into JNDI and gets out the actual handler as an EJB, or Spring Bean. That way you could actually use DI to configure the handler to do things like query and update databases.

                             

                            I'm new to jBPM and using 6.2, but the processes involved in custom work item handlers seem pretty barbaric.