5 Replies Latest reply on Apr 23, 2014 10:22 AM by arif.mohammed

    Claiming and Completing User Task is slow in jBPM (Compared to Activiti)

    rsmagdum

      Hi All,
      We are evaluating jBPM and Activiti engines.

      I have attached two BPMNs (user_task_02, single_user_task) that we have used to compare user task's performance in both engines.

      In jBPM, we have started and completed user task by following way -

           runtime.getTaskService().start(taskSummaryList.get(i).getId(), "krisv");

           runtime.getTaskService().complete(taskSummaryList.get(i).getId(), "krisv", null);

       

      Is there any way to increase jBPM's performance?
      Is there any possibility that jBPM's user task will perform fast after some code changes? (should file JIRA issue?)

       

      For another BPMN (performance_01) , which has some multi instance, sub processes, service tasks, parallel gateway etc. jBPM is working better than activiti.

      swiderski.maciej  salaboy21

      Thanks,
      Rahul

        • 1. Re: Claiming and Completing User Task is slow in jBPM (Compared to Activiti)
          salaboy21

          Hi Rahul,

          Can you share some numbers? You mention that jBPM is slower but how much slower?

          You need to take into account that the jBPM Human Task Service do a more complete lifecycle management than other engines and for that reason the performance can be a little bit less compared with different approaches. The jBPM Human Task service is following the WS-HT specification.

          Notice also that if you don't need to do all that lifecycle management you can implement your own Human Task Service, but we have noticed that most of the time having the full task lifecycle is really useful for real life scenarios.

           

          Regards

          • 2. Re: Re: Claiming and Completing User Task is slow in jBPM (Compared to Activiti)
            rsmagdum

            Hi Mauricio,
            Thanks for quick reply.
            We have designed same BPMNs for both engines.
            I have attached outputs for both.
            Though names are different, BPMNs have same functionality in them.
            Activiti BPMN Name and its corresponding jBPM BPMN Name details-

            Performance                        -> Performance_01

            OurUserTaskDia                  -> user_task_02

            SimpleUserTaskProcess      -> single_user_task


            And as you said "you can implement your own Human Task Service". Can you provide me any example for this?


            Thanks,

            Rahul

            • 3. Re: Re: Claiming and Completing User Task is slow in jBPM (Compared to Activiti)
              salaboy21

              Take a look at this class: https://github.com/droolsjbpm/jbpm/blob/master/jbpm-human-task/jbpm-human-task-workitems/src/main/java/org/jbpm/services/task/wih/LocalHTWorkItemHandler.java#L61

               

              Notice that is the one in charge of creating the task from the process, which means that you can create your own task service and a different implementation for this class.

              You will need to create your service based on your needs, so for example if you want it to be extremely performant you can create the service with a fast storage like for example infinispan which is an in memory solution, to avoid all the performance impact of using a Database.

               

              That will definitely improve the speed for your use case, but the question is .. do you really need to be faster by 100 ms?

               

              Looking at the reports I wasn't able to quickly spot where the differences are, because of the different names. Can you please clarify your results trying to unifying the names?

               

              Regards

              • 4. Re: Claiming and Completing User Task is slow in jBPM (Compared to Activiti)
                swiderski.maciej

                one additional note on top of what Mauricio has already said, mind that these are user tasks which are executed by humans and thus require more advanced life cycle to provide more flexible management and thus performance might suffer because of that. I wouldn't spent so much time tuning performance of user task so much (especially these parts that are related to life cycle such as claim, start, etc) as long as they are executing less than a half a second or so. The important methods are these that affect process instance such as complete, skip, exit.

                 

                What would be good as well to know is how do you actually measure the performance, is it direct calls to API, what data base you use? Might be worth to look at db side as well to check if the tables can be tuned with indexes and so on.

                From my point of view the most important aspect when looking at performance is the execution of the engine itself which is the automation. user tasks are for human actors and by that might be heavier from execution point of view as they carry additional information - such as user assignment, variables (which might include transformations) etc.

                 

                HTH

                • 5. Re: Claiming and Completing User Task is slow in jBPM (Compared to Activiti)
                  arif.mohammed

                  Hi Maciej I have a requirement where 2 operations say claim and start need tobe performed in a single transaction because I know in my processes once a task has been assigned to a group any user should be able to pick it and start working on that. doing 2 operations in a single transaction was not possible in jbpm5 and doing it in two separate transactions is little bit slow.