13 Replies Latest reply on Jul 1, 2014 10:30 AM by lauradp

    Workitem implementation jar in jBPM6

    ocramot

      Hi,

       

      we implemented some custom workitem, and in the previous version (5.4), in order to make them work, we put our jar containing the workitem handlers classes and their dependecies into the WEB-INF/lib of the jbpm-gwt-console-server.war file. Also, we had to modify the jbpm-installer/jboss-as-7.1.1.Final/standalone/configuration/session.template to add our custom handler to workItemHandlers field.

       

      Is this procedure the same in the new version? Or is there in jBPM 6 a simpler/different way to do this? I mean, putting the workitems in some folder outside the war, or through some interface in the console.

       

      Thanks in advance.

       

      Cheers

        • 1. Re: Workitem implementation jar in jBPM6
          salaboy21

          Hi in jbpm6 you have two options

          1) the one that you mention.. you will need to add the jar that contains the workitemhandler in the WEB-INF/lib dir of the application

           

          or

           

          2) you can upload the jar using the maven repo explorer and then add the new uploaded artifact as a dependency of your Kproject..

           

          I would recommend the first option, because usually creating and deploying a new version of workitemhandlers is a technical task and you don't want to add that to the same dependency cycle as your other business assets.

          1 of 1 people found this helpful
          • 2. Re: Workitem implementation jar in jBPM6
            ocramot

            Thanks for your quick reply!

            Correct me if I'm wrong, but the first option, which we have been using until now, requires the restart of the jboss server everytime a new jar is uploaded (which is by the way causing some other issues in JBPM 5.4, as I asked in another question here )

            We'll try the second options too, and see if it can resolve our problems. Thanks again.

            • 3. Re: Workitem implementation jar in jBPM6
              lauradp

              Hi,

              I was trying to follow the second option.

              I uploaded my jar and I added it to my project dependencies, but on deploying it I get teh following error:

              Unable to complete your request. The following exception occurred: java.lang.ClassNotFoundException:org.jbpm.process.workitem.AbstractWorkItemHandler.

              Can anyone help me?

               

              Laura

              • 4. Re: Workitem implementation jar in jBPM6
                salaboy21

                Hi Laura, sorry for the late reply.

                Are you still getting this issue? Which exact version are you using?

                • 5. Re: Workitem implementation jar in jBPM6
                  lauradp

                  Hi Mauricio,

                  I gave up and I added my jar in jbpm-console.war

                  Thanks for your answer!

                   

                  Laura

                  • 6. Re: Workitem implementation jar in jBPM6
                    salaboy21

                    To be honest, that's the safest way to go. By that you make sure that nobody adds a new version that can cause unexpected  issues (class clashings) during runtime. At the end of the day, adding a new system to system conector is a technical task, and they are supposed to not to change as often as the business processes itself.

                     

                    Regards

                    • 7. Re: Workitem implementation jar in jBPM6
                      lauradp

                      Hi Mauricio,

                      I'm facing a strange issue.

                       

                      Adding jar into jbpm-console.war works for processes imported by bpmn file, but when I add a custom service from the palette (after having defined it in workItemdefinitions and CustomWorkitemHandlers.conf) I get this error: Process 'test' [****]: Task node 'LauraTask ' [3] has no work name.

                       

                      Can you help me solving this issue?

                      • 8. Re: Workitem implementation jar in jBPM6
                        salaboy21

                        Hi Laura,

                        That's because one of your tasks in the designer doesn't have a proper Task Name property set.

                        • 9. Re: Workitem implementation jar in jBPM6
                          lauradp

                          Hi Mauricio,

                          thanks for your answer!

                           

                          Where should I configure Task Name Property?

                           

                          This is my wid:

                           

                            [

                              "name" : "LogTask",

                              "parameters" : [

                            "input_uri" : new StringDataType(),

                            "request_origin" : new StringDataType(),

                            "messageId" : new StringDataType(),

                            "TaskPriority" : new IntegerDataType()

                              ],

                             "results" : [

                                  "LogTaskExitValue" : new IntegerDataType()

                              ],

                             "displayName" : "LogTask",

                              "icon" : "defaultservicenodeicon.png"

                            ]

                           

                           

                           

                          Laura

                          • 10. Re: Workitem implementation jar in jBPM6
                            salaboy21

                            That's inside the process designer.. you need to click on your User Task node called:"LauraTask" and see the Properties there.. look for the one called Task Name.

                            • 11. Re: Workitem implementation jar in jBPM6
                              salaboy21

                              The screenshot that you attached here doesn't show any LauraTask node .. please review that error belongs to that process.

                              • 12. Re: Workitem implementation jar in jBPM6
                                lauradp

                                I have this problem for all my custom services.

                                • 13. Re: Workitem implementation jar in jBPM6
                                  lauradp

                                  I succeeded in having my services working. I followed the folliwing steps:

                                  1) create an empty process in the same package of workitemHandlers;

                                  2) add a custom task by selecting it form the palette, assign a nema to the task;

                                  3) save and exit;

                                  4) Set TaskName property;

                                  5) save and exit;

                                  6) complete the process